InpSheetMapper.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.xinxin.topro.inpnurseservice.mysqlmapper.InpSheetMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSheet" >
  5. <id column="IST_ID" property="istId" jdbcType="INTEGER" />
  6. <result column="recordor" property="recordor" jdbcType="VARCHAR" />
  7. <result column="PatientNo" property="patientno" jdbcType="VARCHAR" />
  8. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  9. <result column="DD_DepDm" property="ddDepdm" jdbcType="VARCHAR" />
  10. <result column="DW_WardDm" property="dwWarddm" jdbcType="VARCHAR" />
  11. <result column="DB_BedNo" property="dbBedno" jdbcType="VARCHAR" />
  12. <result column="IST_Measure_Time" property="istMeasureTime" jdbcType="TIMESTAMP" />
  13. <result column="IST_Recordor" property="istRecordor" jdbcType="VARCHAR" />
  14. <result column="IST_Record_Time" property="istRecordTime" jdbcType="TIMESTAMP" />
  15. <result column="IST_Type" property="istType" jdbcType="INTEGER" />
  16. <result column="IST_Operation_Time" property="istOperationTime" jdbcType="TIMESTAMP" />
  17. <result column="IST_Operator" property="istOperator" jdbcType="VARCHAR" />
  18. <result column="IST_IsDel" property="istIsdel" jdbcType="INTEGER" />
  19. <result column="IST_Remark" property="istRemark" jdbcType="VARCHAR" />
  20. <result column="IST_FormerID" property="istFormerid" jdbcType="INTEGER" />
  21. <result column="IST_IsPrint" property="istIsprint" jdbcType="INTEGER" />
  22. <result column="IST_Printer" property="istPrinter" jdbcType="VARCHAR" />
  23. </resultMap>
  24. <resultMap id="BaseDetailResultMap" type="com.xinxin.topro.inpnurseservice.vo.InpSheetVO" extends="BaseResultMap">
  25. <result column="recordor" property="recordor" jdbcType="VARCHAR" />
  26. <collection property="detailList" ofType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSheetDetail">
  27. <result column="ISD_ID" property="isdId" jdbcType="INTEGER" />
  28. <result column="ISD_Code" property="isdCode" jdbcType="VARCHAR" />
  29. <result column="ISD_Name" property="isdName" jdbcType="VARCHAR" />
  30. <result column="ISD_Value" property="isdValue" jdbcType="VARCHAR" />
  31. <result column="ISD_Remark" property="isdRemark" jdbcType="VARCHAR" />
  32. <result column="ISD_Recordor" property="isdRecordor" jdbcType="VARCHAR" />
  33. <result column="ISD_Record_Time" property="isdRecordTime" jdbcType="TIMESTAMP" />
  34. <result column="ISD_Operation_Time" property="isdOperationTime" jdbcType="TIMESTAMP" />
  35. <result column="ISD_Operator" property="isdOperator" jdbcType="VARCHAR" />
  36. <result column="ISD_IsDel" property="isdIsdel" jdbcType="INTEGER" />
  37. </collection>
  38. </resultMap>
  39. <sql id="Base_Column_List" >
  40. IST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IST_Measure_Time, IST_Recordor,
  41. IST_Record_Time, IST_Type, IST_Operation_Time, IST_Operator, IST_IsDel, IST_Remark,
  42. IST_FormerID, IST_IsPrint, IST_Printer
  43. </sql>
  44. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  45. select
  46. <include refid="Base_Column_List" />
  47. from inp_sheet
  48. where IST_ID = #{istId,jdbcType=INTEGER}
  49. and IST_IsDel = 0
  50. </select>
  51. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  52. delete from inp_sheet
  53. where IST_ID = #{istId,jdbcType=INTEGER}
  54. </delete>
  55. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSheet" >
  56. insert into inp_sheet (IST_ID, PatientNo, HI_ID,
  57. DD_DepDm, DW_WardDm, DB_BedNo,
  58. IST_Measure_Time, IST_Recordor, IST_Record_Time,
  59. IST_Type, IST_Operation_Time, IST_Operator,
  60. IST_IsDel, IST_Remark, IST_FormerID,
  61. IST_IsPrint, IST_Printer)
  62. values (#{istId,jdbcType=INTEGER}, #{patientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER},
  63. #{ddDepdm,jdbcType=VARCHAR}, #{dwWarddm,jdbcType=VARCHAR}, #{dbBedno,jdbcType=VARCHAR},
  64. #{istMeasureTime,jdbcType=TIMESTAMP}, #{istRecordor,jdbcType=VARCHAR}, #{istRecordTime,jdbcType=TIMESTAMP},
  65. #{istType,jdbcType=INTEGER}, #{istOperationTime,jdbcType=TIMESTAMP}, #{istOperator,jdbcType=VARCHAR},
  66. #{istIsdel,jdbcType=INTEGER}, #{istRemark,jdbcType=VARCHAR}, #{istFormerid,jdbcType=INTEGER},
  67. #{istIsprint,jdbcType=INTEGER}, #{istPrinter,jdbcType=VARCHAR})
  68. </insert>
  69. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSheet" useGeneratedKeys="true" keyProperty="istId" keyColumn="IST_ID">
  70. insert into inp_sheet
  71. <trim prefix="(" suffix=")" suffixOverrides="," >
  72. <if test="patientno != null" >
  73. PatientNo,
  74. </if>
  75. <if test="hiId != null" >
  76. HI_ID,
  77. </if>
  78. <if test="ddDepdm != null" >
  79. DD_DepDm,
  80. </if>
  81. <if test="dwWarddm != null" >
  82. DW_WardDm,
  83. </if>
  84. <if test="dbBedno != null" >
  85. DB_BedNo,
  86. </if>
  87. <if test="istMeasureTime != null" >
  88. IST_Measure_Time,
  89. </if>
  90. <if test="istRecordor != null" >
  91. IST_Recordor,
  92. </if>
  93. <if test="istRecordTime != null" >
  94. IST_Record_Time,
  95. </if>
  96. <if test="istType != null" >
  97. IST_Type,
  98. </if>
  99. <if test="istOperationTime != null" >
  100. IST_Operation_Time,
  101. </if>
  102. <if test="istOperator != null" >
  103. IST_Operator,
  104. </if>
  105. <if test="istIsdel != null" >
  106. IST_IsDel,
  107. </if>
  108. <if test="istRemark != null" >
  109. IST_Remark,
  110. </if>
  111. <if test="istFormerid != null" >
  112. IST_FormerID,
  113. </if>
  114. <if test="istIsprint != null" >
  115. IST_IsPrint,
  116. </if>
  117. <if test="istPrinter != null" >
  118. IST_Printer,
  119. </if>
  120. </trim>
  121. <trim prefix="values (" suffix=")" suffixOverrides="," >
  122. <if test="patientno != null" >
  123. #{patientno,jdbcType=VARCHAR},
  124. </if>
  125. <if test="hiId != null" >
  126. #{hiId,jdbcType=INTEGER},
  127. </if>
  128. <if test="ddDepdm != null" >
  129. #{ddDepdm,jdbcType=VARCHAR},
  130. </if>
  131. <if test="dwWarddm != null" >
  132. #{dwWarddm,jdbcType=VARCHAR},
  133. </if>
  134. <if test="dbBedno != null" >
  135. #{dbBedno,jdbcType=VARCHAR},
  136. </if>
  137. <if test="istMeasureTime != null" >
  138. #{istMeasureTime,jdbcType=TIMESTAMP},
  139. </if>
  140. <if test="istRecordor != null" >
  141. #{istRecordor,jdbcType=VARCHAR},
  142. </if>
  143. <if test="istRecordTime != null" >
  144. #{istRecordTime,jdbcType=TIMESTAMP},
  145. </if>
  146. <if test="istType != null" >
  147. #{istType,jdbcType=INTEGER},
  148. </if>
  149. <if test="istOperationTime != null" >
  150. #{istOperationTime,jdbcType=TIMESTAMP},
  151. </if>
  152. <if test="istOperator != null" >
  153. #{istOperator,jdbcType=VARCHAR},
  154. </if>
  155. <if test="istIsdel != null" >
  156. #{istIsdel,jdbcType=INTEGER},
  157. </if>
  158. <if test="istRemark != null" >
  159. #{istRemark,jdbcType=VARCHAR},
  160. </if>
  161. <if test="istFormerid != null" >
  162. #{istFormerid,jdbcType=INTEGER},
  163. </if>
  164. <if test="istIsprint != null" >
  165. #{istIsprint,jdbcType=INTEGER},
  166. </if>
  167. <if test="istPrinter != null" >
  168. #{istPrinter,jdbcType=VARCHAR},
  169. </if>
  170. </trim>
  171. </insert>
  172. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSheet" >
  173. update inp_sheet
  174. <set >
  175. <if test="patientno != null" >
  176. PatientNo = #{patientno,jdbcType=VARCHAR},
  177. </if>
  178. <if test="hiId != null" >
  179. HI_ID = #{hiId,jdbcType=INTEGER},
  180. </if>
  181. <if test="ddDepdm != null" >
  182. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  183. </if>
  184. <if test="dwWarddm != null" >
  185. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  186. </if>
  187. <if test="dbBedno != null" >
  188. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  189. </if>
  190. <if test="istMeasureTime != null" >
  191. IST_Measure_Time = #{istMeasureTime,jdbcType=TIMESTAMP},
  192. </if>
  193. <if test="istRecordor != null" >
  194. IST_Recordor = #{istRecordor,jdbcType=VARCHAR},
  195. </if>
  196. <if test="istRecordTime != null" >
  197. IST_Record_Time = #{istRecordTime,jdbcType=TIMESTAMP},
  198. </if>
  199. <if test="istType != null" >
  200. IST_Type = #{istType,jdbcType=INTEGER},
  201. </if>
  202. <if test="istOperationTime != null" >
  203. IST_Operation_Time = #{istOperationTime,jdbcType=TIMESTAMP},
  204. </if>
  205. <if test="istOperator != null" >
  206. IST_Operator = #{istOperator,jdbcType=VARCHAR},
  207. </if>
  208. <if test="istIsdel != null" >
  209. IST_IsDel = #{istIsdel,jdbcType=INTEGER},
  210. </if>
  211. <if test="istRemark != null" >
  212. IST_Remark = #{istRemark,jdbcType=VARCHAR},
  213. </if>
  214. <if test="istFormerid != null" >
  215. IST_FormerID = #{istFormerid,jdbcType=INTEGER},
  216. </if>
  217. <if test="istIsprint != null" >
  218. IST_IsPrint = #{istIsprint,jdbcType=INTEGER},
  219. </if>
  220. <if test="istPrinter != null" >
  221. IST_Printer = #{istPrinter,jdbcType=VARCHAR},
  222. </if>
  223. </set>
  224. where IST_ID = #{istId,jdbcType=INTEGER}
  225. </update>
  226. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSheet" >
  227. update inp_sheet
  228. set PatientNo = #{patientno,jdbcType=VARCHAR},
  229. HI_ID = #{hiId,jdbcType=INTEGER},
  230. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  231. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  232. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  233. IST_Measure_Time = #{istMeasureTime,jdbcType=TIMESTAMP},
  234. IST_Recordor = #{istRecordor,jdbcType=VARCHAR},
  235. IST_Record_Time = #{istRecordTime,jdbcType=TIMESTAMP},
  236. IST_Type = #{istType,jdbcType=INTEGER},
  237. IST_Operation_Time = #{istOperationTime,jdbcType=TIMESTAMP},
  238. IST_Operator = #{istOperator,jdbcType=VARCHAR},
  239. IST_IsDel = #{istIsdel,jdbcType=INTEGER},
  240. IST_Remark = #{istRemark,jdbcType=VARCHAR},
  241. IST_FormerID = #{istFormerid,jdbcType=INTEGER},
  242. IST_IsPrint = #{istIsprint,jdbcType=INTEGER},
  243. IST_Printer = #{istPrinter,jdbcType=VARCHAR}
  244. where IST_ID = #{istId,jdbcType=INTEGER}
  245. </update>
  246. <select id="selectByPatientTimeType" resultMap="BaseDetailResultMap">
  247. select
  248. iss.IST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IST_Measure_Time, IST_Recordor,
  249. IST_Record_Time, IST_Type, IST_Operation_Time, IST_Operator, IST_IsDel, IST_Remark,
  250. IST_FormerID, IST_IsPrint, IST_Printer,ISD_ID, ISD_Code, ISD_Name, ISD_Value,ISD_Remark, ISD_Recordor, ISD_Record_Time, ISD_Operation_Time,
  251. ISD_Operator, ISD_IsDel,
  252. (select su.UI_Name from sys_userinfo su where su.UI_Code = iss.IST_Recordor and su.HI_ID = iss.HI_ID limit 1) recordor
  253. from inp_sheet iss left join inp_sheet_detail isd on iss.IST_ID = isd.IST_ID and isd.ISD_IsDel = 0
  254. where
  255. iss.PatientNo = #{patientno,jdbcType=VARCHAR}
  256. and iss.HI_ID = #{hiId,jdbcType=INTEGER}
  257. <if test="dwWarddm != null">
  258. and iss.DW_WardDm = #{dwWarddm,jdbcType=VARCHAR}
  259. </if>
  260. and iss.IST_Type = #{istType,jdbcType=INTEGER}
  261. <if test="startTime != null">
  262. and iss.IST_Measure_Time >= #{startTime,jdbcType=TIMESTAMP}
  263. </if>
  264. <if test="endTime != null">
  265. and #{endTime,jdbcType=TIMESTAMP} >= iss.IST_Measure_Time
  266. </if>
  267. <if test="measureTime != null">
  268. and iss.IST_Measure_Time = #{measureTime,jdbcType=TIMESTAMP}
  269. </if>
  270. and iss.IST_IsDel = 0
  271. order by iss.IST_Measure_Time desc
  272. </select>
  273. <update id="delByIds">
  274. update inp_sheet
  275. set
  276. IST_Operation_Time = #{istOperationTime,jdbcType=TIMESTAMP},
  277. IST_Operator = #{istOperator,jdbcType=VARCHAR},
  278. IST_IsDel = -1
  279. where IST_ID in
  280. <foreach collection="list" open="(" close=")" separator="," item="item">
  281. #{item,jdbcType=INTEGER}
  282. </foreach>
  283. </update>
  284. <select id="selectRelationByPatientListTimeType" resultMap="BaseDetailResultMap">
  285. select
  286. iss.IST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IST_Measure_Time, IST_Recordor,
  287. IST_Record_Time, IST_Type, IST_Operation_Time, IST_Operator, IST_IsDel, IST_Remark,
  288. IST_FormerID, IST_IsPrint, IST_Printer,ISD_ID, ISD_Code, ISD_Name, ISD_Value,ISD_Remark, ISD_Recordor, ISD_Record_Time, ISD_Operation_Time,
  289. ISD_Operator, ISD_IsDel,
  290. (select su.UI_Name from sys_userinfo su where su.UI_Code = iss.IST_Recordor and su.HI_ID = iss.HI_ID limit 1) recordor
  291. from inp_sheet iss left join inp_sheet_detail isd on iss.IST_ID = isd.IST_ID and isd.ISD_IsDel = 0
  292. where iss.IST_IsDel = 0
  293. and iss.PatientNo in
  294. <foreach collection="list" open="(" close=")" separator="," item="item">
  295. #{item,jdbcType=VARCHAR}
  296. </foreach>
  297. and iss.HI_ID = #{hiId,jdbcType=INTEGER}
  298. and iss.IST_Type = #{istType,jdbcType=INTEGER}
  299. and iss.IST_Measure_Time = #{measureTime,jdbcType=TIMESTAMP}
  300. </select>
  301. <select id="selectRelationByWardTimeType" resultMap="BaseDetailResultMap">
  302. select
  303. iss.IST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IST_Measure_Time, IST_Recordor,
  304. IST_Record_Time, IST_Type, IST_Operation_Time, IST_Operator, IST_IsDel, IST_Remark,
  305. IST_FormerID, IST_IsPrint, IST_Printer,ISD_ID, ISD_Code, ISD_Name, ISD_Value,ISD_Remark, ISD_Recordor, ISD_Record_Time, ISD_Operation_Time,
  306. ISD_Operator, ISD_IsDel,
  307. (select su.UI_Name from sys_userinfo su where su.UI_Code = iss.IST_Recordor and su.HI_ID = iss.HI_ID limit 1) recordor
  308. from inp_sheet iss left join inp_sheet_detail isd on iss.IST_ID = isd.IST_ID and isd.ISD_IsDel = 0
  309. where iss.IST_IsDel = 0
  310. and iss.DW_WardDm = #{wardDm,jdbcType=VARCHAR}
  311. and iss.HI_ID = #{hiId,jdbcType=INTEGER}
  312. and iss.IST_Type = #{istType,jdbcType=INTEGER}
  313. and iss.IST_Measure_Time = #{measureTime,jdbcType=TIMESTAMP}
  314. </select>
  315. <select id="selectByPatientListTimeType" resultMap="BaseResultMap">
  316. select <include refid="Base_Column_List"/>
  317. from inp_sheet
  318. where IST_IsDel = 0
  319. and PatientNo in
  320. <foreach collection="list" open="(" close=")" separator="," item="item">
  321. #{item,jdbcType=VARCHAR}
  322. </foreach>
  323. and HI_ID = #{hiId,jdbcType=INTEGER}
  324. and IST_Type = #{istType,jdbcType=INTEGER}
  325. and IST_Measure_Time = #{measureTime,jdbcType=TIMESTAMP}
  326. </select>
  327. <select id="selectBySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSheet" resultMap="BaseResultMap">
  328. SELECT
  329. <include refid="Base_Column_List"/>
  330. FROM inp_sheet
  331. WHERE IST_IsDel = 0
  332. <if test="patientno != null" >
  333. AND PatientNo = #{patientno,jdbcType=VARCHAR}
  334. </if>
  335. <if test="hiId != null" >
  336. AND HI_ID = #{hiId,jdbcType=INTEGER}
  337. </if>
  338. <if test="dwWarddm != null" >
  339. AND DW_WardDm = #{dwWarddm,jdbcType=VARCHAR}
  340. </if>
  341. <if test="istMeasureTime != null" >
  342. AND IST_Measure_Time = #{istMeasureTime,jdbcType=TIMESTAMP}
  343. </if>
  344. <if test="istType != null" >
  345. AND IST_Type = #{istType,jdbcType=INTEGER}
  346. </if>
  347. <if test="typeList != null" >
  348. AND IST_Type in
  349. <foreach collection="typeList" open="(" close=")" separator="," item="item">
  350. #{item,jdbcType=INTEGER}
  351. </foreach>
  352. </if>
  353. ORDER BY IST_Measure_Time DESC
  354. </select>
  355. <select id="selectByPatient" resultMap="BaseResultMap">
  356. SELECT
  357. iss.*,
  358. (select su.UI_Name from sys_userinfo su where su.UI_Code = iss.IST_Recordor and su.HI_ID = iss.HI_ID limit 1) recordor
  359. FROM inp_sheet iss
  360. where
  361. PatientNo = #{patientNo,jdbcType=VARCHAR}
  362. AND HI_ID = #{hiId,jdbcType=INTEGER}
  363. <if test="dwWardDm != null">
  364. AND DW_WardDm = #{dwWardDm,jdbcType=VARCHAR}
  365. </if>
  366. AND IST_Type = #{type,jdbcType=INTEGER}
  367. <if test="startTime != null">
  368. AND IST_Measure_Time <![CDATA[>=]]> #{startTime}
  369. </if>
  370. <if test="endTime != null">
  371. AND IST_Measure_Time <![CDATA[<=]]>#{endTime}
  372. </if>
  373. AND IST_IsDel = 0
  374. ORDER BY IST_Measure_Time DESC
  375. </select>
  376. <insert id="batchInsert" useGeneratedKeys="true" keyColumn="IST_ID" keyProperty="istId">
  377. insert into inp_sheet (PatientNo, HI_ID,
  378. DD_DepDm, DW_WardDm, DB_BedNo,
  379. IST_Measure_Time, IST_Recordor, IST_Record_Time,
  380. IST_Type, IST_Operation_Time, IST_Operator,
  381. IST_IsDel, IST_Remark, IST_FormerID,
  382. IST_IsPrint, IST_Printer)
  383. values
  384. <foreach collection="list" separator="," item="item">
  385. (#{item.patientno,jdbcType=VARCHAR}, #{item.hiId,jdbcType=INTEGER},
  386. #{item.ddDepdm,jdbcType=VARCHAR}, #{item.dwWarddm,jdbcType=VARCHAR}, #{item.dbBedno,jdbcType=VARCHAR},
  387. #{item.istMeasureTime,jdbcType=TIMESTAMP}, #{item.istRecordor,jdbcType=VARCHAR}, #{item.istRecordTime,jdbcType=TIMESTAMP},
  388. #{item.istType,jdbcType=INTEGER}, #{item.istOperationTime,jdbcType=TIMESTAMP}, #{item.istOperator,jdbcType=VARCHAR},
  389. 0, #{item.istRemark,jdbcType=VARCHAR}, #{item.istFormerid,jdbcType=INTEGER},
  390. #{item.istIsprint,jdbcType=INTEGER}, #{item.istPrinter,jdbcType=VARCHAR})
  391. </foreach>
  392. </insert>
  393. <update id="deleteByIstId">
  394. UPDATE inp_sheet
  395. SET
  396. IST_Operation_Time = #{istOperationTime,jdbcType=TIMESTAMP},
  397. IST_Operator = #{istOperator,jdbcType=VARCHAR},
  398. IST_IsDel = -1
  399. where IST_ID = #{istId,jdbcType=INTEGER}
  400. </update>
  401. <update id="delByTypeAndPatient">
  402. UPDATE inp_sheet
  403. SET
  404. IST_Operation_Time = #{istOperationTime,jdbcType=TIMESTAMP},
  405. IST_Operator = #{istOperator,jdbcType=VARCHAR},
  406. IST_IsDel = -1
  407. WHERE PatientNo = #{patientNo,jdbcType=VARCHAR}
  408. AND IST_Type = #{type,jdbcType=INTEGER}
  409. </update>
  410. <select id="selectByPatientTimeTypes" resultMap="BaseDetailResultMap">
  411. select
  412. iss.IST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IST_Measure_Time, IST_Recordor,
  413. IST_Record_Time, IST_Type, IST_Operation_Time, IST_Operator, IST_IsDel, IST_Remark,
  414. IST_FormerID, IST_IsPrint, IST_Printer,ISD_ID, ISD_Code, ISD_Name, ISD_Value,ISD_Remark, ISD_Recordor, ISD_Record_Time, ISD_Operation_Time,
  415. ISD_Operator, ISD_IsDel,
  416. (select su.UI_Name from sys_userinfo su where su.UI_Code = iss.IST_Recordor and su.HI_ID = iss.HI_ID limit 1) recordor
  417. from inp_sheet iss inner join inp_sheet_detail isd on iss.IST_ID = isd.IST_ID and isd.ISD_IsDel = 0
  418. where
  419. iss.PatientNo = #{patientno,jdbcType=VARCHAR}
  420. and iss.HI_ID = #{hiId,jdbcType=INTEGER}
  421. and iss.IST_Type in
  422. <foreach collection="list" open="(" close=")" separator="," item="item">
  423. #{item,jdbcType=INTEGER}
  424. </foreach>
  425. <if test="startTime != null">
  426. and iss.IST_Measure_Time >= #{startTime,jdbcType=TIMESTAMP}
  427. </if>
  428. <if test="endTime != null">
  429. and #{endTime,jdbcType=TIMESTAMP} >= iss.IST_Measure_Time
  430. </if>
  431. and iss.IST_IsDel = 0
  432. order by iss.IST_Measure_Time desc
  433. </select>
  434. <select id="selectByTimeType" resultMap="BaseResultMap">
  435. SELECT
  436. <include refid="Base_Column_List"/>
  437. FROM inp_sheet
  438. where
  439. PatientNo = #{patientNo,jdbcType=VARCHAR}
  440. AND HI_ID = #{hiId,jdbcType=INTEGER}
  441. <if test="dwWardDm != null">
  442. AND DW_WardDm = #{dwWardDm,jdbcType=VARCHAR}
  443. </if>
  444. AND IST_Type = #{type,jdbcType=INTEGER}
  445. AND IST_Measure_Time = #{istMeasureTime,jdbcType=TIMESTAMP}
  446. AND IST_IsDel = 0
  447. LIMIT 1
  448. </select>
  449. <select id="selectByPatientNoAndCode" resultType="java.lang.String">
  450. SELECT DISTINCT isd.ISD_Value FROM inp_sheet ist
  451. INNER JOIN inp_sheet_detail isd ON ist.IST_ID = isd.IST_ID
  452. WHERE
  453. ist.PatientNo = #{patientNo,jdbcType=VARCHAR}
  454. AND ist.HI_ID = #{hiId,jdbcType=INTEGER}
  455. AND ist.IST_Type = #{type,jdbcType=INTEGER}
  456. AND isd.ISD_Code = #{isdCode,jdbcType=VARCHAR}
  457. AND ist.IST_IsDel = 0
  458. AND isd.ISD_IsDel = 0
  459. ORDER BY ist.IST_Measure_Time
  460. </select>
  461. <select id="selectRelationByWardPatientType" resultMap="BaseDetailResultMap">
  462. select
  463. iss.IST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IST_Measure_Time, IST_Recordor,
  464. IST_Record_Time, IST_Type, IST_Operation_Time, IST_Operator, IST_IsDel, IST_Remark,
  465. IST_FormerID, IST_IsPrint, IST_Printer,ISD_ID, ISD_Code, ISD_Name, ISD_Value,ISD_Remark, ISD_Recordor, ISD_Record_Time, ISD_Operation_Time,
  466. ISD_Operator, ISD_IsDel,
  467. (select su.UI_Name from sys_userinfo su where su.UI_Code = iss.IST_Recordor and su.HI_ID = iss.HI_ID limit 1) recordor
  468. from inp_sheet iss left join inp_sheet_detail isd on iss.IST_ID = isd.IST_ID and isd.ISD_IsDel = 0
  469. where iss.IST_IsDel = 0
  470. <if test="wardDm != null">
  471. and iss.DW_WardDm = #{wardDm,jdbcType=VARCHAR}
  472. </if>
  473. and iss.PatientNo = #{patientNo,jdbcType=VARCHAR}
  474. and iss.HI_ID = #{hiId,jdbcType=INTEGER}
  475. and iss.IST_Type = #{istType,jdbcType=INTEGER}
  476. </select>
  477. <select id="selectRelationById" resultMap="BaseDetailResultMap">
  478. select
  479. iss.IST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IST_Measure_Time, IST_Recordor,
  480. IST_Record_Time, IST_Type, IST_Operation_Time, IST_Operator, IST_IsDel, IST_Remark,
  481. IST_FormerID, IST_IsPrint, IST_Printer,ISD_ID, ISD_Code, ISD_Name, ISD_Value,ISD_Remark, ISD_Recordor, ISD_Record_Time, ISD_Operation_Time,
  482. ISD_Operator, ISD_IsDel,
  483. (select su.UI_Name from sys_userinfo su where su.UI_Code = iss.IST_Recordor and su.HI_ID = iss.HI_ID limit 1) recordor
  484. from inp_sheet iss left join inp_sheet_detail isd on iss.IST_ID = isd.IST_ID and isd.ISD_IsDel = 0
  485. where iss.IST_ID = #{istId,jdbcType=INTEGER}
  486. </select>
  487. <select id="selectRelationByTypeRemark" resultMap="BaseDetailResultMap">
  488. select
  489. iss.IST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IST_Measure_Time, IST_Recordor,
  490. IST_Record_Time, IST_Type, IST_Operation_Time, IST_Operator, IST_IsDel, IST_Remark,
  491. IST_FormerID, IST_IsPrint, IST_Printer,ISD_ID, ISD_Code, ISD_Name, ISD_Value,ISD_Remark, ISD_Recordor, ISD_Record_Time, ISD_Operation_Time,
  492. ISD_Operator, ISD_IsDel,
  493. (select su.UI_Name from sys_userinfo su where su.UI_Code = iss.IST_Recordor and su.HI_ID = iss.HI_ID limit 1) recordor
  494. from inp_sheet iss left join inp_sheet_detail isd on iss.IST_ID = isd.IST_ID and isd.ISD_IsDel = 0
  495. where iss.IST_Type = #{istType,jdbcType=INTEGER}
  496. and iss.HI_ID = #{hiId,jdbcType=INTEGER}
  497. and iss.IST_IsDel = 0
  498. and iss.IST_Remark = #{remark,jdbcType=VARCHAR}
  499. </select>
  500. <update id="updateRemarkByTypeRemark">
  501. update inp_sheet
  502. set IST_Remark = #{remark,jdbcType=VARCHAR}
  503. where IST_Type = #{istType,jdbcType=INTEGER}
  504. and HI_ID = #{hiId,jdbcType=INTEGER}
  505. and IST_IsDel = 0
  506. and IST_Remark = #{oldRemark,jdbcType=VARCHAR}
  507. and PatientNo = #{patientNo,jdbcType=VARCHAR}
  508. </update>
  509. </mapper>