InpSpecialEventMapper.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  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.InpSpecialEventMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSpecialEvent" >
  5. <id column="ISE_ID" property="iseId" jdbcType="INTEGER" />
  6. <result column="PatientNo" property="patientno" jdbcType="VARCHAR" />
  7. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  8. <result column="DD_DepDm" property="ddDepdm" jdbcType="VARCHAR" />
  9. <result column="DW_WardDm" property="dwWarddm" jdbcType="VARCHAR" />
  10. <result column="DB_BedNo" property="dbBedno" jdbcType="VARCHAR" />
  11. <result column="ISE_Measure_Time" property="iseMeasureTime" jdbcType="TIMESTAMP" />
  12. <result column="ISE_Recordor" property="iseRecordor" jdbcType="VARCHAR" />
  13. <result column="ISE_Record_Time" property="iseRecordTime" jdbcType="TIMESTAMP" />
  14. <result column="ISE_Item_Code" property="iseItemCode" jdbcType="VARCHAR" />
  15. <result column="ISE_Item_Name" property="iseItemName" jdbcType="VARCHAR" />
  16. <result column="ISE_Item_Value" property="iseItemValue" jdbcType="VARCHAR" />
  17. <result column="ISE_Remark" property="iseRemark" jdbcType="VARCHAR" />
  18. <result column="ISE_Original" property="iseOriginal" jdbcType="VARCHAR" />
  19. <result column="ISE_Original_ID" property="iseOriginalId" jdbcType="INTEGER" />
  20. <result column="ISE_IsDel" property="iseIsdel" jdbcType="INTEGER" />
  21. <result column="ISE_Operation_Time" property="iseOperationTime" jdbcType="TIMESTAMP" />
  22. <result column="ISE_Operator" property="iseOperator" jdbcType="VARCHAR" />
  23. <result column="ISE_Time_Point" property="iseTimePoint" jdbcType="VARCHAR"/>
  24. </resultMap>
  25. <resultMap id="ResultMap" type="com.xinxin.topro.inpnurseservice.response.InpSpecialEventResponse" >
  26. <result column="operateTime" property="operateTime" jdbcType="TIMESTAMP" />
  27. <result column="operateName" property="operateName" jdbcType="VARCHAR" />
  28. <result column="doctorName" property="doctorName" jdbcType="VARCHAR" />
  29. </resultMap>
  30. <sql id="Base_Column_List" >
  31. ISE_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, ISE_Measure_Time, ISE_Recordor,
  32. ISE_Record_Time, ISE_Item_Code, ISE_Item_Name, ISE_Item_Value, ISE_Remark, ISE_Original,
  33. ISE_Original_ID, ISE_IsDel, ISE_Operation_Time, ISE_Operator,ISE_Time_Point
  34. </sql>
  35. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  36. select
  37. <include refid="Base_Column_List" />
  38. from inp_special_event
  39. where ISE_IsDel = 0 and ISE_ID = #{iseId,jdbcType=INTEGER}
  40. </select>
  41. <select id="selectByIds" resultMap="BaseResultMap" parameterType="java.util.List" >
  42. select
  43. <include refid="Base_Column_List" />
  44. from inp_special_event
  45. where ISE_IsDel = 0
  46. and ISE_ID in <foreach item='item' index='index' collection='list' open='(' separator=',' close=')'> #{item} </foreach>
  47. </select>
  48. <select id="selectByPatientNos" resultMap="BaseResultMap" parameterType="java.util.List" >
  49. select
  50. <include refid="Base_Column_List" />
  51. from inp_special_event
  52. where PatientNo in <foreach item='item' index='index' collection='list' open='(' separator=',' close=')'> #{item} </foreach>
  53. and ISE_IsDel = 0
  54. </select>
  55. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  56. delete from inp_special_event
  57. where ISE_ID = #{iseId,jdbcType=INTEGER}
  58. </delete>
  59. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSpecialEvent" useGeneratedKeys="true"
  60. keyColumn="ISE_ID" keyProperty="iseId">
  61. insert into inp_special_event (ISE_ID, PatientNo, HI_ID,
  62. DD_DepDm, DW_WardDm, DB_BedNo,
  63. ISE_Measure_Time, ISE_Recordor, ISE_Record_Time,
  64. ISE_Item_Code, ISE_Item_Name, ISE_Item_Value,
  65. ISE_Remark, ISE_Original, ISE_Original_ID,
  66. ISE_IsDel, ISE_Operation_Time, ISE_Operator,ISE_Time_Point
  67. )
  68. values (#{iseId,jdbcType=INTEGER}, #{patientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER},
  69. #{ddDepdm,jdbcType=VARCHAR}, #{dwWarddm,jdbcType=VARCHAR}, #{dbBedno,jdbcType=VARCHAR},
  70. #{iseMeasureTime,jdbcType=TIMESTAMP}, #{iseRecordor,jdbcType=VARCHAR}, #{iseRecordTime,jdbcType=TIMESTAMP},
  71. #{iseItemCode,jdbcType=VARCHAR}, #{iseItemName,jdbcType=VARCHAR}, #{iseItemValue,jdbcType=VARCHAR},
  72. #{iseRemark,jdbcType=VARCHAR}, #{iseOriginal,jdbcType=VARCHAR}, #{iseOriginalId,jdbcType=INTEGER},
  73. #{iseIsdel,jdbcType=INTEGER}, #{iseOperationTime,jdbcType=TIMESTAMP}, #{iseOperator,jdbcType=VARCHAR},
  74. #{iseTimePoint,jdbcType=VARCHAR}
  75. )
  76. </insert>
  77. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSpecialEvent" >
  78. insert into inp_special_event
  79. <trim prefix="(" suffix=")" suffixOverrides="," >
  80. <if test="iseId != null" >
  81. ISE_ID,
  82. </if>
  83. <if test="patientno != null" >
  84. PatientNo,
  85. </if>
  86. <if test="hiId != null" >
  87. HI_ID,
  88. </if>
  89. <if test="ddDepdm != null" >
  90. DD_DepDm,
  91. </if>
  92. <if test="dwWarddm != null" >
  93. DW_WardDm,
  94. </if>
  95. <if test="dbBedno != null" >
  96. DB_BedNo,
  97. </if>
  98. <if test="iseMeasureTime != null" >
  99. ISE_Measure_Time,
  100. </if>
  101. <if test="iseRecordor != null" >
  102. ISE_Recordor,
  103. </if>
  104. <if test="iseRecordTime != null" >
  105. ISE_Record_Time,
  106. </if>
  107. <if test="iseItemCode != null" >
  108. ISE_Item_Code,
  109. </if>
  110. <if test="iseItemName != null" >
  111. ISE_Item_Name,
  112. </if>
  113. <if test="iseItemValue != null" >
  114. ISE_Item_Value,
  115. </if>
  116. <if test="iseRemark != null" >
  117. ISE_Remark,
  118. </if>
  119. <if test="iseOriginal != null" >
  120. ISE_Original,
  121. </if>
  122. <if test="iseOriginalId != null" >
  123. ISE_Original_ID,
  124. </if>
  125. <if test="iseIsdel != null" >
  126. ISE_IsDel,
  127. </if>
  128. <if test="iseOperationTime != null" >
  129. ISE_Operation_Time,
  130. </if>
  131. <if test="iseOperator != null" >
  132. ISE_Operator,
  133. </if>
  134. <if test="iseTimePoint != null">
  135. ISE_Time_Point,
  136. </if>
  137. </trim>
  138. <trim prefix="values (" suffix=")" suffixOverrides="," >
  139. <if test="iseId != null" >
  140. #{iseId,jdbcType=INTEGER},
  141. </if>
  142. <if test="patientno != null" >
  143. #{patientno,jdbcType=VARCHAR},
  144. </if>
  145. <if test="hiId != null" >
  146. #{hiId,jdbcType=INTEGER},
  147. </if>
  148. <if test="ddDepdm != null" >
  149. #{ddDepdm,jdbcType=VARCHAR},
  150. </if>
  151. <if test="dwWarddm != null" >
  152. #{dwWarddm,jdbcType=VARCHAR},
  153. </if>
  154. <if test="dbBedno != null" >
  155. #{dbBedno,jdbcType=VARCHAR},
  156. </if>
  157. <if test="iseMeasureTime != null" >
  158. #{iseMeasureTime,jdbcType=TIMESTAMP},
  159. </if>
  160. <if test="iseRecordor != null" >
  161. #{iseRecordor,jdbcType=VARCHAR},
  162. </if>
  163. <if test="iseRecordTime != null" >
  164. #{iseRecordTime,jdbcType=TIMESTAMP},
  165. </if>
  166. <if test="iseItemCode != null" >
  167. #{iseItemCode,jdbcType=VARCHAR},
  168. </if>
  169. <if test="iseItemName != null" >
  170. #{iseItemName,jdbcType=VARCHAR},
  171. </if>
  172. <if test="iseItemValue != null" >
  173. #{iseItemValue,jdbcType=VARCHAR},
  174. </if>
  175. <if test="iseRemark != null" >
  176. #{iseRemark,jdbcType=VARCHAR},
  177. </if>
  178. <if test="iseOriginal != null" >
  179. #{iseOriginal,jdbcType=VARCHAR},
  180. </if>
  181. <if test="iseOriginalId != null" >
  182. #{iseOriginalId,jdbcType=INTEGER},
  183. </if>
  184. <if test="iseIsdel != null" >
  185. #{iseIsdel,jdbcType=INTEGER},
  186. </if>
  187. <if test="iseOperationTime != null" >
  188. #{iseOperationTime,jdbcType=TIMESTAMP},
  189. </if>
  190. <if test="iseOperator != null" >
  191. #{iseOperator,jdbcType=VARCHAR},
  192. </if>
  193. <if test="iseTimePoint != null">
  194. #{iseTimePoint,jdbcType=VARCHAR},
  195. </if>
  196. </trim>
  197. </insert>
  198. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSpecialEvent" >
  199. update inp_special_event
  200. <set >
  201. <if test="patientno != null" >
  202. PatientNo = #{patientno,jdbcType=VARCHAR},
  203. </if>
  204. <if test="hiId != null" >
  205. HI_ID = #{hiId,jdbcType=INTEGER},
  206. </if>
  207. <if test="ddDepdm != null" >
  208. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  209. </if>
  210. <if test="dwWarddm != null" >
  211. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  212. </if>
  213. <if test="dbBedno != null" >
  214. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  215. </if>
  216. <if test="iseMeasureTime != null" >
  217. ISE_Measure_Time = #{iseMeasureTime,jdbcType=TIMESTAMP},
  218. </if>
  219. <if test="iseRecordor != null" >
  220. ISE_Recordor = #{iseRecordor,jdbcType=VARCHAR},
  221. </if>
  222. <if test="iseRecordTime != null" >
  223. ISE_Record_Time = #{iseRecordTime,jdbcType=TIMESTAMP},
  224. </if>
  225. <if test="iseItemCode != null" >
  226. ISE_Item_Code = #{iseItemCode,jdbcType=VARCHAR},
  227. </if>
  228. <if test="iseItemName != null" >
  229. ISE_Item_Name = #{iseItemName,jdbcType=VARCHAR},
  230. </if>
  231. <if test="iseItemValue != null" >
  232. ISE_Item_Value = #{iseItemValue,jdbcType=VARCHAR},
  233. </if>
  234. <if test="iseRemark != null" >
  235. ISE_Remark = #{iseRemark,jdbcType=VARCHAR},
  236. </if>
  237. <if test="iseOriginal != null" >
  238. ISE_Original = #{iseOriginal,jdbcType=VARCHAR},
  239. </if>
  240. <if test="iseOriginalId != null" >
  241. ISE_Original_ID = #{iseOriginalId,jdbcType=INTEGER},
  242. </if>
  243. <if test="iseIsdel != null" >
  244. ISE_IsDel = #{iseIsdel,jdbcType=INTEGER},
  245. </if>
  246. <if test="iseOperationTime != null" >
  247. ISE_Operation_Time = #{iseOperationTime,jdbcType=TIMESTAMP},
  248. </if>
  249. <if test="iseOperator != null" >
  250. ISE_Operator = #{iseOperator,jdbcType=VARCHAR},
  251. </if>
  252. <if test="iseTimePoint != null">
  253. ISE_Time_Point = #{iseTimePoint,jdbcType=VARCHAR},
  254. </if>
  255. </set>
  256. where ISE_ID = #{iseId,jdbcType=INTEGER}
  257. </update>
  258. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSpecialEvent" >
  259. update inp_special_event
  260. set PatientNo = #{patientno,jdbcType=VARCHAR},
  261. HI_ID = #{hiId,jdbcType=INTEGER},
  262. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  263. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  264. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  265. ISE_Measure_Time = #{iseMeasureTime,jdbcType=TIMESTAMP},
  266. ISE_Recordor = #{iseRecordor,jdbcType=VARCHAR},
  267. ISE_Record_Time = #{iseRecordTime,jdbcType=TIMESTAMP},
  268. ISE_Item_Code = #{iseItemCode,jdbcType=VARCHAR},
  269. ISE_Item_Name = #{iseItemName,jdbcType=VARCHAR},
  270. ISE_Item_Value = #{iseItemValue,jdbcType=VARCHAR},
  271. ISE_Remark = #{iseRemark,jdbcType=VARCHAR},
  272. ISE_Original = #{iseOriginal,jdbcType=VARCHAR},
  273. ISE_Original_ID = #{iseOriginalId,jdbcType=INTEGER},
  274. ISE_IsDel = #{iseIsdel,jdbcType=INTEGER},
  275. ISE_Operation_Time = #{iseOperationTime,jdbcType=TIMESTAMP},
  276. ISE_Operator = #{iseOperator,jdbcType=VARCHAR},
  277. ISE_Time_Point = #{iseTimePoint,jdbcType=VARCHAR}
  278. where ISE_ID = #{iseId,jdbcType=INTEGER}
  279. </update>
  280. <select id="selectEventByPatient" resultMap="BaseResultMap"
  281. parameterType="com.xinxin.topro.inpnurseservice.vo.InpTprEventVo">
  282. select
  283. <include refid="Base_Column_List"/>
  284. from inp_special_event
  285. where ISE_IsDel = 0 and PatientNo = #{patientNo,jdbcType=VARCHAR} and ISE_Item_Code = #{iseItemCode,jdbcType=VARCHAR}
  286. </select>
  287. <select id="selectOperationaAll" resultMap="BaseResultMap"
  288. parameterType="com.xinxin.topro.inpnurseservice.vo.InpTprEventVo">
  289. select
  290. <include refid="Base_Column_List"/>
  291. from inp_special_event
  292. where ISE_IsDel = 0
  293. <if test="patientNo != null" >
  294. and PatientNo = #{patientNo,jdbcType=VARCHAR}
  295. </if>
  296. <if test="iseItemCode != null" >
  297. and ISE_Item_Code = #{iseItemCode,jdbcType=VARCHAR}
  298. </if>
  299. <if test="beginTime != null" >
  300. and ISE_Measure_Time <![CDATA[>=]]> #{beginTime}
  301. </if>
  302. <if test="endTime != null" >
  303. and ISE_Measure_Time <![CDATA[<=]]>#{endTime}
  304. </if>
  305. ORDER BY ISE_Measure_Time DESC
  306. </select>
  307. <select id="selectEventByPatientNo" resultMap="BaseResultMap">
  308. select
  309. <include refid="Base_Column_List"/>
  310. from inp_special_event
  311. where ISE_IsDel = 0 and PatientNo = #{patientNo,jdbcType=VARCHAR}
  312. ORDER BY ISE_Measure_Time DESC
  313. </select>
  314. <select id="getOperationRatio" resultMap="BaseResultMap" >
  315. SELECT ISE_REMARK,count(*) count
  316. from inp_special_event
  317. where DW_WardDm = #{wardDm,jdbcType=VARCHAR}
  318. and ISE_Measure_Time &lt;= #{etime,jdbcType=TIMESTAMP}
  319. AND ISE_Measure_Time &gt;= #{stime,jdbcType=TIMESTAMP}
  320. AND ISE_Item_Code = 'Operation'
  321. GROUP BY ISE_REMARK
  322. </select>
  323. <select id="selectEventByTimeRange" resultMap="BaseResultMap">
  324. select
  325. <include refid="Base_Column_List"/>
  326. from inp_special_event
  327. where ISE_IsDel = 0 and PatientNo = #{patientNo,jdbcType=VARCHAR}
  328. and ISE_Measure_Time between #{beginDate,jdbcType=TIMESTAMP} and #{endDate,jdbcType=TIMESTAMP}
  329. </select>
  330. <select id="selectOperationInfo" resultMap="ResultMap">
  331. SELECT b.IMO_Open_Time operateTime, b.IMO_Order_Name operateName, d.UI_Name doctorName from inp_special_event a
  332. INNER JOIN inp_med_order b on a.ISE_Original_ID = b.IMO_ID
  333. INNER JOIN inp_patient c on b.PatientNo = c.IP_PatientNo
  334. INNER JOIN sys_userinfo d on c.IP_Attending_Doctor = d.UI_Code
  335. where a.ISE_IsDel = 0 and a.PatientNo = #{patientNo,jdbcType=VARCHAR}
  336. and a.ISE_Item_Code = 'Operation'
  337. order by b.IMO_Open_Time desc
  338. </select>
  339. <select id="selectEventByIseCode" resultMap="BaseResultMap">
  340. select *
  341. from inp_special_event
  342. where PatientNo = #{patientNo,jdbcType=VARCHAR}
  343. and HI_ID = #{hiId,jdbcType=INTEGER}
  344. and ISE_Item_Code = #{iseCode,jdbcType=VARCHAR}
  345. and ISE_Original_ID is not null
  346. and ISE_IsDel = 0
  347. </select>
  348. <select id="selectExistAdmissionEvent" resultType="java.lang.Integer">
  349. select count(1)
  350. from inp_special_event
  351. where PatientNo = #{patientNo,jdbcType=VARCHAR}
  352. and HI_ID = #{hiId,jdbcType=INTEGER}
  353. and ISE_Item_Code = #{iseCode,jdbcType=VARCHAR}
  354. and ISE_Original_ID is not null
  355. and ISE_IsDel = 0
  356. </select>
  357. <insert id="bulkInsert" useGeneratedKeys="true" keyColumn="ISE_ID" keyProperty="iseId">
  358. insert into inp_special_event (ISE_ID, PatientNo, HI_ID,
  359. DD_DepDm, DW_WardDm, DB_BedNo,
  360. ISE_Measure_Time, ISE_Recordor, ISE_Record_Time,
  361. ISE_Item_Code, ISE_Item_Name, ISE_Item_Value,
  362. ISE_Remark, ISE_Original, ISE_Original_ID,
  363. ISE_IsDel, ISE_Operation_Time, ISE_Operator,ISE_Time_Point
  364. )
  365. values <foreach collection="list" separator="," index="index" item="item">
  366. (#{item.iseId,jdbcType=INTEGER}, #{item.patientno,jdbcType=VARCHAR}, #{item.hiId,jdbcType=INTEGER},
  367. #{item.ddDepdm,jdbcType=VARCHAR}, #{item.dwWarddm,jdbcType=VARCHAR}, #{item.dbBedno,jdbcType=VARCHAR},
  368. #{item.iseMeasureTime,jdbcType=TIMESTAMP}, #{item.iseRecordor,jdbcType=VARCHAR}, #{item.iseRecordTime,jdbcType=TIMESTAMP},
  369. #{item.iseItemCode,jdbcType=VARCHAR}, #{item.iseItemName,jdbcType=VARCHAR}, #{item.iseItemValue,jdbcType=VARCHAR},
  370. #{item.iseRemark,jdbcType=VARCHAR}, #{item.iseOriginal,jdbcType=VARCHAR}, #{item.iseOriginalId,jdbcType=INTEGER},
  371. #{item.iseIsdel,jdbcType=INTEGER}, #{item.iseOperationTime,jdbcType=TIMESTAMP}, #{item.iseOperator,jdbcType=VARCHAR},
  372. #{item.iseTimePoint,jdbcType=VARCHAR}
  373. )
  374. </foreach>
  375. </insert>
  376. <update id="updateByIseOriginalId" >
  377. update inp_special_event
  378. set ISE_IsDel = -1
  379. where ISE_Original = #{iseOriginal,jdbcType=VARCHAR}
  380. and ISE_Original_ID = #{iseOriginalId,jdbcType=INTEGER}
  381. and HI_ID = #{hiId,jdbcType=INTEGER}
  382. and ISE_IsDel=0
  383. </update>
  384. <select id="selectByIseOriginalId" resultMap="BaseResultMap">
  385. select
  386. <include refid="Base_Column_List" />
  387. from inp_special_event
  388. where ISE_IsDel=0
  389. and ISE_Original = #{iseOriginal,jdbcType=VARCHAR}
  390. and ISE_Original_ID=#{iseOriginalId,jdbcType=INTEGER}
  391. and HI_ID =#{hiId,jdbcType=INTEGER}
  392. </select>
  393. <select id="selectByIseOriginalIds" resultMap="BaseResultMap"
  394. parameterType="com.xinxin.topro.inpnurseservice.vo.InpEventOriginalListVo">
  395. select
  396. <include refid="Base_Column_List" />
  397. from inp_special_event
  398. where ISE_IsDel=0
  399. and ISE_Original = #{vo.iseOriginal,jdbcType=VARCHAR}
  400. and HI_ID =#{vo.hiId,jdbcType=INTEGER}
  401. and ISE_Original_ID in
  402. <foreach collection="vo.iseOriginalId" index="index" item="item" separator="," open="(" close=")">
  403. #{item,jdbcType=INTEGER}
  404. </foreach>
  405. </select>
  406. <update id="updateByIseOriginalIds" parameterType="java.util.List">
  407. update inp_special_event
  408. set ISE_IsDel = -1
  409. where ISE_IsDel=0
  410. and ISE_Original_ID in
  411. <foreach collection="iseOriginalIds" item="item" index="index" open="(" close=")" separator=",">
  412. #{item,jdbcType=INTEGER}
  413. </foreach>
  414. </update>
  415. <select id="selectEventByTimeRangeAndCode" resultMap="BaseResultMap">
  416. select
  417. <include refid="Base_Column_List"/>
  418. from inp_special_event
  419. where ISE_IsDel = 0
  420. and ISE_Measure_Time between #{beginDate,jdbcType=TIMESTAMP} and #{endDate,jdbcType=TIMESTAMP}
  421. and ISE_Item_Code = #{iseCode,jdbcType=VARCHAR}
  422. and PatientNo in
  423. <foreach collection="patientNos" item="item" index="index" separator="," open="(" close=")">
  424. #{item,jdbcType=VARCHAR}
  425. </foreach>
  426. </select>
  427. <select id="selectFirstTimeByCodes" resultType="java.util.Date">
  428. select min(ISE_Measure_Time)
  429. from inp_special_event
  430. where ISE_IsDel = 0
  431. and PatientNo = #{patientNo,jdbcType=VARCHAR}
  432. and ISE_Item_Code in
  433. <foreach collection="codes" item="item" index="index" separator="," open="(" close=")">
  434. #{item,jdbcType=VARCHAR}
  435. </foreach>
  436. and HI_ID =#{hiId,jdbcType=INTEGER}
  437. </select>
  438. </mapper>