InpIoMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  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.InpIoMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpIo" >
  5. <id column="IIO_ID" property="iioId" 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="IIO_Measure_Time" property="iioMeasureTime" jdbcType="TIMESTAMP" />
  12. <result column="IIO_Recordor" property="iioRecordor" jdbcType="VARCHAR" />
  13. <result column="IIO_Record_Time" property="iioRecordTime" jdbcType="TIMESTAMP" />
  14. <result column="IIO_Source" property="iioSource" jdbcType="INTEGER" />
  15. <result column="IC_ID" property="icId" jdbcType="INTEGER" />
  16. <result column="DIO_ID" property="dioId" jdbcType="INTEGER" />
  17. <result column="IIO_Type" property="iioType" jdbcType="INTEGER" />
  18. <result column="IIO_Amount" property="iioAmount" jdbcType="VARCHAR" />
  19. <result column="IIO_Unit" property="iioUnit" jdbcType="VARCHAR" />
  20. <result column="IIO_Nurse_Record" property="iioNurseRecord" jdbcType="VARCHAR" />
  21. <result column="IIO_IsRecord" property="iioIsrecord" jdbcType="INTEGER" />
  22. <result column="IIO_Operation_Time" property="iioOperationTime" jdbcType="TIMESTAMP" />
  23. <result column="IIO_Operator" property="iioOperator" jdbcType="VARCHAR" />
  24. <result column="IIO_IsDel" property="iioIsdel" jdbcType="INTEGER" />
  25. <result column="IIO_FormerID" property="iioFormerid" jdbcType="INTEGER" />
  26. <result column="IIO_AdviceCode" property="iioAdviceCode" jdbcType="VARCHAR" />
  27. <result column="IIO_Advice" property="iioAdvice" jdbcType="VARCHAR" />
  28. <result column="IIO_Original" property="iioOriginal" jdbcType="VARCHAR" />
  29. <result column="IIO_Original_ID" property="iioOriginalId" jdbcType="INTEGER" />
  30. </resultMap>
  31. <sql id="Base_Column_List" >
  32. IIO_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IIO_Measure_Time, IIO_Recordor,
  33. IIO_Record_Time, IIO_Source, IC_ID, DIO_ID, IIO_Type, IIO_Amount, IIO_Unit, IIO_Nurse_Record,
  34. IIO_IsRecord, IIO_Operation_Time, IIO_Operator, IIO_IsDel, IIO_FormerID, IIO_AdviceCode, IIO_Advice,
  35. IIO_Original,IIO_Original_ID
  36. </sql>
  37. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  38. select
  39. <include refid="Base_Column_List" />
  40. from inp_io
  41. where IIO_IsDel = 0 and IIO_ID = #{iioId,jdbcType=INTEGER}
  42. </select>
  43. <select id="selectBatchList" resultMap="BaseResultMap" parameterType="List" >
  44. select
  45. <include refid="Base_Column_List" />
  46. from inp_io
  47. where IIO_IsDel = 0 and IIO_ID in
  48. <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
  49. #{item,jdbcType=INTEGER}
  50. </foreach>
  51. </select>
  52. <select id="selectSearchRecordTime" resultMap="BaseResultMap" parameterType="com.xinxin.topro.inpnurseservice.request.InpIOSearchRequest" >
  53. select
  54. <include refid="Base_Column_List" />
  55. from inp_io
  56. where IIO_IsDel = 0
  57. <if test="patientNo != null" >
  58. AND PatientNo = #{patientNo,jdbcType=VARCHAR}
  59. </if>
  60. <if test="createTime != null">
  61. AND IIO_Measure_Time <![CDATA[>=]]> #{createTime}
  62. </if>
  63. <if test="endTime != null">
  64. AND IIO_Measure_Time <![CDATA[<=]]>#{endTime}
  65. </if>
  66. <if test="hiId != null">
  67. AND HI_ID = #{hiId,jdbcType=INTEGER}
  68. </if>
  69. <if test="irRecorder != null">
  70. AND IIO_Recordor = #{irRecorder,jdbcType=VARCHAR}
  71. </if>
  72. ORDER BY IIO_Record_Time DESC
  73. </select>
  74. <select id="selectSearchMeasureTime" resultMap="BaseResultMap" parameterType="com.xinxin.topro.inpnurseservice.request.InpIoSearchMeasurRequest" >
  75. select
  76. <include refid="Base_Column_List" />
  77. from inp_io
  78. where IIO_IsDel = 0
  79. <if test="type != null" >
  80. AND IIO_Type = #{type,jdbcType=INTEGER}
  81. </if>
  82. <if test="patientNo != null" >
  83. AND PatientNo = #{patientNo,jdbcType=VARCHAR}
  84. </if>
  85. <if test="dioId != null" >
  86. AND DIO_ID = #{dioId,jdbcType=INTEGER}
  87. </if>
  88. <if test="createTime != null">
  89. AND IIO_Measure_Time <![CDATA[>=]]> #{createTime}
  90. </if>
  91. <if test="endTime != null">
  92. AND IIO_Measure_Time <![CDATA[<]]>#{endTime}
  93. </if>
  94. <if test="hiId != null">
  95. AND HI_ID = #{hiId,jdbcType=INTEGER}
  96. </if>
  97. </select>
  98. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  99. delete from inp_io
  100. where IIO_ID = #{iioId,jdbcType=INTEGER}
  101. </delete>
  102. <insert id="batchInsert" parameterType="List" useGeneratedKeys="true" keyColumn="IIO_ID" keyProperty="iioId">
  103. insert into inp_io
  104. (PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IIO_Measure_Time, IIO_Recordor, IIO_Record_Time, IIO_Source,
  105. IC_ID, DIO_ID, IIO_Type, IIO_Amount, IIO_Unit, IIO_Nurse_Record, IIO_IsRecord, IIO_Operation_Time, IIO_Operator, IIO_FormerID,
  106. IIO_Original, IIO_Original_ID)
  107. VALUES
  108. <foreach collection="list" item="item" index="index" separator=",">
  109. (#{item.patientno,jdbcType=VARCHAR},#{item.hiId,jdbcType=INTEGER},
  110. #{item.ddDepdm,jdbcType=VARCHAR},#{item.dwWarddm,jdbcType=VARCHAR},#{item.dbBedno,jdbcType=VARCHAR},
  111. #{item.iioMeasureTime,jdbcType=TIMESTAMP},#{item.iioRecordor,jdbcType=VARCHAR},now(),#{item.iioSource,jdbcType=INTEGER},
  112. #{item.icId,jdbcType=INTEGER},#{item.dioId,jdbcType=INTEGER},#{item.iioType,jdbcType=INTEGER},#{item.iioAmount,jdbcType=VARCHAR},
  113. #{item.iioUnit,jdbcType=VARCHAR},#{item.iioNurseRecord,jdbcType=VARCHAR},#{item.iioIsrecord,jdbcType=INTEGER}, now(),
  114. #{item.iioOperator,jdbcType=VARCHAR},
  115. #{item.iioFormerid,jdbcType=INTEGER},#{item.iioOriginal,jdbcType=VARCHAR},#{item.iioOriginalId,jdbcType=INTEGER})
  116. </foreach>
  117. </insert>
  118. <insert id="insertSelective" useGeneratedKeys="true" keyProperty="iioId" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpIo" >
  119. insert into inp_io
  120. <trim prefix="(" suffix=")" suffixOverrides="," >
  121. <if test="iioId != null" >
  122. IIO_ID,
  123. </if>
  124. <if test="patientno != null" >
  125. PatientNo,
  126. </if>
  127. <if test="hiId != null" >
  128. HI_ID,
  129. </if>
  130. <if test="ddDepdm != null" >
  131. DD_DepDm,
  132. </if>
  133. <if test="dwWarddm != null" >
  134. DW_WardDm,
  135. </if>
  136. <if test="dbBedno != null" >
  137. DB_BedNo,
  138. </if>
  139. <if test="iioMeasureTime != null" >
  140. IIO_Measure_Time,
  141. </if>
  142. <if test="iioRecordor != null" >
  143. IIO_Recordor,
  144. </if>
  145. IIO_Record_Time,
  146. <if test="iioSource != null" >
  147. IIO_Source,
  148. </if>
  149. <if test="icId != null" >
  150. IC_ID,
  151. </if>
  152. <if test="dioId != null" >
  153. DIO_ID,
  154. </if>
  155. <if test="iioType != null" >
  156. IIO_Type,
  157. </if>
  158. <if test="iioAmount != null" >
  159. IIO_Amount,
  160. </if>
  161. <if test="iioUnit != null" >
  162. IIO_Unit,
  163. </if>
  164. <if test="iioNurseRecord != null" >
  165. IIO_Nurse_Record,
  166. </if>
  167. <if test="iioIsrecord != null" >
  168. IIO_IsRecord,
  169. </if>
  170. <if test="iioOperationTime != null" >
  171. IIO_Operation_Time,
  172. </if>
  173. <if test="iioOperator != null" >
  174. IIO_Operator,
  175. </if>
  176. <if test="iioIsdel != null" >
  177. IIO_IsDel,
  178. </if>
  179. <if test="iioFormerid != null" >
  180. IIO_FormerID,
  181. </if>
  182. <if test="iioAdviceCode != null" >
  183. IIO_AdviceCode,
  184. </if>
  185. <if test="iioAdvice != null" >
  186. IIO_Advice,
  187. </if>
  188. <if test="iioOriginal != null" >
  189. IIO_Original,
  190. </if>
  191. <if test="iioOriginalId != null" >
  192. IIO_Original_ID,
  193. </if>
  194. </trim>
  195. <trim prefix="values (" suffix=")" suffixOverrides="," >
  196. <if test="iioId != null" >
  197. #{iioId,jdbcType=INTEGER},
  198. </if>
  199. <if test="patientno != null" >
  200. #{patientno,jdbcType=VARCHAR},
  201. </if>
  202. <if test="hiId != null" >
  203. #{hiId,jdbcType=INTEGER},
  204. </if>
  205. <if test="ddDepdm != null" >
  206. #{ddDepdm,jdbcType=VARCHAR},
  207. </if>
  208. <if test="dwWarddm != null" >
  209. #{dwWarddm,jdbcType=VARCHAR},
  210. </if>
  211. <if test="dbBedno != null" >
  212. #{dbBedno,jdbcType=VARCHAR},
  213. </if>
  214. <if test="iioMeasureTime != null" >
  215. #{iioMeasureTime,jdbcType=TIMESTAMP},
  216. </if>
  217. <if test="iioRecordor != null" >
  218. #{iioRecordor,jdbcType=VARCHAR},
  219. </if>
  220. now(),
  221. <if test="iioSource != null" >
  222. #{iioSource,jdbcType=INTEGER},
  223. </if>
  224. <if test="icId != null" >
  225. #{icId,jdbcType=INTEGER},
  226. </if>
  227. <if test="dioId != null" >
  228. #{dioId,jdbcType=INTEGER},
  229. </if>
  230. <if test="iioType != null" >
  231. #{iioType,jdbcType=INTEGER},
  232. </if>
  233. <if test="iioAmount != null" >
  234. #{iioAmount,jdbcType=VARCHAR},
  235. </if>
  236. <if test="iioUnit != null" >
  237. #{iioUnit,jdbcType=VARCHAR},
  238. </if>
  239. <if test="iioNurseRecord != null" >
  240. #{iioNurseRecord,jdbcType=VARCHAR},
  241. </if>
  242. <if test="iioIsrecord != null" >
  243. #{iioIsrecord,jdbcType=INTEGER},
  244. </if>
  245. <if test="iioOperationTime != null" >
  246. #{iioOperationTime,jdbcType=TIMESTAMP},
  247. </if>
  248. <if test="iioOperator != null" >
  249. #{iioOperator,jdbcType=VARCHAR},
  250. </if>
  251. <if test="iioIsdel != null" >
  252. #{iioIsdel,jdbcType=INTEGER},
  253. </if>
  254. <if test="iioFormerid != null" >
  255. #{iioFormerid,jdbcType=INTEGER},
  256. </if>
  257. <if test="iioAdviceCode != null" >
  258. #{iioAdviceCode,jdbcType=VARCHAR},
  259. </if>
  260. <if test="iioAdvice != null" >
  261. #{iioAdvice,jdbcType=VARCHAR},
  262. </if>
  263. <if test="iioOriginal != null" >
  264. #{iioOriginal,jdbcType=VARCHAR},
  265. </if>
  266. <if test="iioOriginalId != null" >
  267. #{iioOriginalId,jdbcType=INTEGER},
  268. </if>
  269. </trim>
  270. </insert>
  271. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpIo" >
  272. update inp_io
  273. <set >
  274. <if test="patientno != null" >
  275. PatientNo = #{patientno,jdbcType=VARCHAR},
  276. </if>
  277. <if test="hiId != null" >
  278. HI_ID = #{hiId,jdbcType=INTEGER},
  279. </if>
  280. <if test="ddDepdm != null" >
  281. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  282. </if>
  283. <if test="dwWarddm != null" >
  284. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  285. </if>
  286. <if test="dbBedno != null" >
  287. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  288. </if>
  289. <if test="iioMeasureTime != null" >
  290. IIO_Measure_Time = #{iioMeasureTime,jdbcType=TIMESTAMP},
  291. </if>
  292. <if test="iioRecordor != null" >
  293. IIO_Recordor = #{iioRecordor,jdbcType=VARCHAR},
  294. </if>
  295. <if test="iioRecordTime != null" >
  296. IIO_Record_Time = #{iioRecordTime,jdbcType=TIMESTAMP},
  297. </if>
  298. <if test="iioSource != null" >
  299. IIO_Source = #{iioSource,jdbcType=INTEGER},
  300. </if>
  301. <if test="icId != null" >
  302. IC_ID = #{icId,jdbcType=INTEGER},
  303. </if>
  304. <if test="dioId != null" >
  305. DIO_ID = #{dioId,jdbcType=INTEGER},
  306. </if>
  307. <if test="iioType != null" >
  308. IIO_Type = #{iioType,jdbcType=INTEGER},
  309. </if>
  310. <if test="iioAmount != null" >
  311. IIO_Amount = #{iioAmount,jdbcType=VARCHAR},
  312. </if>
  313. <if test="iioUnit != null" >
  314. IIO_Unit = #{iioUnit,jdbcType=VARCHAR},
  315. </if>
  316. <if test="iioNurseRecord != null" >
  317. IIO_Nurse_Record = #{iioNurseRecord,jdbcType=VARCHAR},
  318. </if>
  319. <if test="iioIsrecord != null" >
  320. IIO_IsRecord = #{iioIsrecord,jdbcType=INTEGER},
  321. </if>
  322. <if test="iioOperationTime != null" >
  323. IIO_Operation_Time = #{iioOperationTime,jdbcType=TIMESTAMP},
  324. </if>
  325. <if test="iioOperator != null" >
  326. IIO_Operator = #{iioOperator,jdbcType=VARCHAR},
  327. </if>
  328. <if test="iioIsdel != null" >
  329. IIO_IsDel = #{iioIsdel,jdbcType=INTEGER},
  330. </if>
  331. <if test="iioFormerid != null" >
  332. IIO_FormerID = #{iioFormerid,jdbcType=INTEGER},
  333. </if>
  334. <if test="iioAdviceCode != null" >
  335. IIO_AdviceCode = #{iioAdviceCode,jdbcType=VARCHAR},
  336. </if>
  337. <if test="iioAdvice != null" >
  338. IIO_Advice = #{iioAdvice,jdbcType=VARCHAR},
  339. </if>
  340. <if test="iioOriginal != null" >
  341. IIO_Original = #{iioOriginal,jdbcType=VARCHAR},
  342. </if>
  343. <if test="iioOriginalId != null" >
  344. IIO_Original_ID = #{iioOriginalId,jdbcType=INTEGER},
  345. </if>
  346. </set>
  347. where IIO_ID = #{iioId,jdbcType=INTEGER}
  348. </update>
  349. <update id="updateByStatus" parameterType="java.lang.Integer" >
  350. update inp_io
  351. set IIO_IsDel = -1
  352. where IIO_ID = #{iioId,jdbcType=INTEGER}
  353. </update>
  354. <update id="updateBatchStatus" parameterType="List" >
  355. update inp_io
  356. set IIO_IsDel = -1
  357. where IIO_ID in
  358. <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
  359. #{item,jdbcType=INTEGER}
  360. </foreach>
  361. </update>
  362. <update id="updateRecordStatus" parameterType="com.xinxin.topro.inpnurseservice.vo.InpRecordOriginalVo" >
  363. update inp_io
  364. set IIO_IsDel = -1
  365. where
  366. <if test="source != null" >
  367. IIO_Source = #{source,jdbcType=INTEGER}
  368. </if>
  369. <if test="originalId != null" >
  370. AND IIO_Original_ID = #{originalId,jdbcType=INTEGER}
  371. </if>
  372. <if test="original != null" >
  373. AND IIO_Original = #{original,jdbcType=VARCHAR}
  374. </if>
  375. </update>
  376. <select id="selectByMeasureTime" resultMap="BaseResultMap" parameterType="com.xinxin.topro.inpnurseservice.vo.InpIoSelectByDataRangeVo" >
  377. select
  378. <include refid="Base_Column_List" />
  379. from inp_io
  380. where IIO_IsDel = 0
  381. <if test="patientNo != null" >
  382. AND PatientNo = #{patientNo,jdbcType=VARCHAR}
  383. </if>
  384. <if test="createTime != null">
  385. AND IIO_Measure_Time <![CDATA[>=]]> #{createTime,jdbcType=TIMESTAMP}
  386. </if>
  387. <if test="endTime != null">
  388. AND IIO_Measure_Time <![CDATA[<=]]>#{endTime,jdbcType=TIMESTAMP}
  389. </if>
  390. <if test="dwWarddm != null">
  391. AND DW_WardDm = #{dwWarddm,jdbcType=VARCHAR}
  392. </if>
  393. </select>
  394. <select id="selectSoureRecore" resultMap="BaseResultMap" parameterType="com.xinxin.topro.inpnurseservice.vo.InpRecordOriginalVo">
  395. select
  396. <include refid="Base_Column_List" />
  397. from inp_io
  398. where IIO_IsDel = 0
  399. <if test="source != null" >
  400. AND IIO_Source = #{source,jdbcType=INTEGER}
  401. </if>
  402. <if test="originalId != null" >
  403. AND IIO_Original_ID = #{originalId,jdbcType=INTEGER}
  404. </if>
  405. <if test="original != null" >
  406. AND IIO_Original = #{original,jdbcType=VARCHAR}
  407. </if>
  408. </select>
  409. <select id="selectFirstData" resultMap="BaseResultMap">
  410. select
  411. <include refid="Base_Column_List" />
  412. from inp_io
  413. where IIO_IsDel = 0
  414. AND PatientNo = #{patientNo,jdbcType=VARCHAR}
  415. ORDER BY IIO_Measure_Time
  416. LIMIT 1
  417. </select>
  418. </mapper>