InpGuidanceMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  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.InpGuidanceMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpGuidance" >
  5. <id column="IG_ID" property="igId" 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="IG_Guidance_Code" property="igGuidanceCode" jdbcType="VARCHAR" />
  12. <result column="IG_Guidance_Name" property="igGuidanceName" jdbcType="VARCHAR" />
  13. <result column="IG_Recordor" property="igRecordor" jdbcType="VARCHAR" />
  14. <result column="IG_Record_Time" property="igRecordTime" jdbcType="TIMESTAMP" />
  15. <result column="IG_Del_Reason" property="igDelReason" jdbcType="VARCHAR" />
  16. <result column="IG_Guiding_Time" property="igGuidingTime" jdbcType="TIMESTAMP" />
  17. <result column="IG_Guiding_Obiect" property="igGuidingObiect" jdbcType="VARCHAR" />
  18. <result column="IG_Guiding_Response" property="igGuidingResponse" jdbcType="VARCHAR" />
  19. <result column="IG_Operation_Time" property="igOperationTime" jdbcType="TIMESTAMP" />
  20. <result column="IG_Operator" property="igOperator" jdbcType="VARCHAR" />
  21. <result column="IG_Nurse_Record" property="igNurseRecord" jdbcType="VARCHAR" />
  22. <result column="IG_IsRecord" property="igIsrecord" jdbcType="INTEGER" />
  23. <result column="IG_IsDel" property="igIsdel" jdbcType="INTEGER" />
  24. <result column="IG_Iscomplete" property="igIscomplete" jdbcType="INTEGER" />
  25. <result column="IG_Original" property="igOriginal" jdbcType="VARCHAR" />
  26. <result column="IG_Original_ID" property="igOriginalId" jdbcType="INTEGER" />
  27. <result column="IG_FormerID" property="igFormerId" jdbcType="INTEGER" />
  28. <result column="IG_Remark" property="igRemark" jdbcType="VARCHAR" />
  29. </resultMap>
  30. <sql id="Base_Column_List" >
  31. IG_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IG_Guidance_Code, IG_Guidance_Name,
  32. IG_Recordor, IG_Record_Time, IG_Del_Reason, IG_Guiding_Time, IG_Guiding_Obiect, IG_Guiding_Response,
  33. IG_Operation_Time, IG_Operator, IG_Nurse_Record, IG_IsRecord, IG_IsDel, IG_Iscomplete,IG_Original,
  34. IG_Original_ID,IG_FormerID,IG_Remark
  35. </sql>
  36. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  37. select
  38. <include refid="Base_Column_List" />
  39. from inp_guidance
  40. where IG_IsDel = 0 AND IG_ID = #{igId,jdbcType=INTEGER}
  41. </select>
  42. <select id="selectAllIds" resultMap="BaseResultMap">
  43. select
  44. <include refid="Base_Column_List" />
  45. from inp_guidance
  46. where IG_IsDel = 0 AND IG_ID in
  47. <foreach collection="list" item="item" separator="," index="index" open="(" close=")">
  48. #{item,jdbcType=INTEGER}
  49. </foreach>
  50. </select>
  51. <select id="selectAll" resultMap="BaseResultMap" parameterType="java.lang.String" >
  52. select
  53. <include refid="Base_Column_List" />
  54. from inp_guidance
  55. where IG_IsDel = 0 AND PatientNo = #{PatientNo,jdbcType=VARCHAR}
  56. Order By IG_Guiding_Time DESC
  57. </select>
  58. <select id="selectIsEndGuidance" resultMap="BaseResultMap">
  59. select
  60. <include refid="Base_Column_List" />
  61. from inp_guidance
  62. where IG_IsDel = 0 AND IG_Iscomplete = 0 AND PatientNo = #{patientNo,jdbcType=VARCHAR}
  63. AND HI_ID = #{hiId,jdbcType=INTEGER}
  64. Order By IG_Guiding_Time DESC
  65. </select>
  66. <select id="selectPrintAll" resultMap="BaseResultMap" parameterType="java.lang.String" >
  67. select
  68. <include refid="Base_Column_List" />
  69. from inp_guidance
  70. where IG_IsDel = 0 AND PatientNo = #{PatientNo,jdbcType=VARCHAR}
  71. Order By IG_Guiding_Time ASC
  72. </select>
  73. <select id="selectAllList" resultMap="BaseResultMap">
  74. select
  75. <include refid="Base_Column_List" />
  76. from inp_guidance
  77. where IG_IsDel = 0
  78. Order By IG_Record_Time DESC
  79. </select>
  80. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  81. delete from inp_guidance
  82. where IG_ID = #{igId,jdbcType=INTEGER}
  83. </delete>
  84. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpGuidance" >
  85. insert into inp_guidance (IG_ID, PatientNo, HI_ID,
  86. DD_DepDm, DW_WardDm, DB_BedNo,
  87. IG_Guidance_Code, IG_Guidance_Name, IG_Recordor,
  88. IG_Record_Time, IG_Del_Reason, IG_Guiding_Time,
  89. IG_Guiding_Obiect, IG_Guiding_Response, IG_Operation_Time,
  90. IG_Operator, IG_Nurse_Record, IG_IsRecord,
  91. IG_IsDel,IG_Iscomplete,IG_Original,IG_Original_ID,IG_FormerID,IG_Remark)
  92. values (#{igId,jdbcType=INTEGER}, #{patientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER},
  93. #{ddDepdm,jdbcType=VARCHAR}, #{dwWarddm,jdbcType=VARCHAR}, #{dbBedno,jdbcType=VARCHAR},
  94. #{igGuidanceCode,jdbcType=VARCHAR}, #{igGuidanceName,jdbcType=VARCHAR}, #{igRecordor,jdbcType=VARCHAR},
  95. #{igRecordTime,jdbcType=TIMESTAMP}, #{igDelReason,jdbcType=VARCHAR}, #{igGuidingTime,jdbcType=TIMESTAMP},
  96. #{igGuidingObiect,jdbcType=VARCHAR}, #{igGuidingResponse,jdbcType=VARCHAR}, #{igOperationTime,jdbcType=TIMESTAMP},
  97. #{igOperator,jdbcType=VARCHAR}, #{igNurseRecord,jdbcType=VARCHAR}, #{igIsrecord,jdbcType=INTEGER},
  98. #{igIsdel,jdbcType=INTEGER},#{igIscomplete,jdbcType=INTEGER},#{igOriginal,jdbcType=VARCHAR},#{igOriginalId,jdbcType=INTEGER},
  99. #{igFormerId,jdbcType=INTEGER},#{igRemark,jdbcType=VARCHAR})
  100. </insert>
  101. <insert id="batchInsert" parameterType="List" useGeneratedKeys="true" keyProperty="igId" keyColumn="IG_ID">
  102. insert into inp_guidance (PatientNo, HI_ID,
  103. DD_DepDm, DW_WardDm, DB_BedNo,
  104. IG_Guidance_Code, IG_Guidance_Name, IG_Recordor,
  105. IG_Record_Time, IG_Del_Reason, IG_Guiding_Time,
  106. IG_Guiding_Obiect, IG_Guiding_Response, IG_Operation_Time,
  107. IG_Operator,IG_Original,IG_Original_ID,IG_FormerID,IG_Remark)
  108. values
  109. <foreach collection ="list" item="item" index="index" separator =",">
  110. (#{item.patientno,jdbcType=VARCHAR}, #{item.hiId,jdbcType=INTEGER},
  111. #{item.ddDepdm,jdbcType=VARCHAR}, #{item.dwWarddm,jdbcType=VARCHAR}, #{item.dbBedno,jdbcType=VARCHAR},
  112. #{item.igGuidanceCode,jdbcType=VARCHAR}, #{item.igGuidanceName,jdbcType=VARCHAR}, #{item.igRecordor,jdbcType=VARCHAR},
  113. #{item.igRecordTime,jdbcType=TIMESTAMP}, #{item.igDelReason,jdbcType=VARCHAR}, #{item.igGuidingTime,jdbcType=TIMESTAMP},
  114. #{item.igGuidingObiect,jdbcType=VARCHAR}, #{item.igGuidingResponse,jdbcType=VARCHAR}, now(),
  115. #{item.igOperator,jdbcType=VARCHAR},#{item.igOriginal,jdbcType=VARCHAR},#{item.igOriginalId,jdbcType=INTEGER},
  116. #{item.igFormerId,jdbcType=INTEGER},#{item.igRemark,jdbcType=VARCHAR})
  117. </foreach>
  118. </insert>
  119. <insert id="insertSelective" useGeneratedKeys="true" keyProperty="igId" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpGuidance" >
  120. insert into inp_guidance
  121. <trim prefix="(" suffix=")" suffixOverrides="," >
  122. <if test="igId != null" >
  123. IG_ID,
  124. </if>
  125. <if test="patientno != null" >
  126. PatientNo,
  127. </if>
  128. <if test="hiId != null" >
  129. HI_ID,
  130. </if>
  131. <if test="ddDepdm != null" >
  132. DD_DepDm,
  133. </if>
  134. <if test="dwWarddm != null" >
  135. DW_WardDm,
  136. </if>
  137. <if test="dbBedno != null" >
  138. DB_BedNo,
  139. </if>
  140. <if test="igGuidanceCode != null" >
  141. IG_Guidance_Code,
  142. </if>
  143. <if test="igGuidanceName != null" >
  144. IG_Guidance_Name,
  145. </if>
  146. <if test="igRecordor != null" >
  147. IG_Recordor,
  148. </if>
  149. IG_Record_Time,
  150. <if test="igDelReason != null" >
  151. IG_Del_Reason,
  152. </if>
  153. <if test="igGuidingTime != null" >
  154. IG_Guiding_Time,
  155. </if>
  156. <if test="igGuidingObiect != null" >
  157. IG_Guiding_Obiect,
  158. </if>
  159. <if test="igGuidingResponse != null" >
  160. IG_Guiding_Response,
  161. </if>
  162. IG_Operation_Time,
  163. <if test="igOperator != null" >
  164. IG_Operator,
  165. </if>
  166. <if test="igNurseRecord != null" >
  167. IG_Nurse_Record,
  168. </if>
  169. IG_IsRecord,
  170. <if test="igIsdel != null" >
  171. IG_IsDel,
  172. </if>
  173. <if test="igIscomplete != null" >
  174. IG_Iscomplete,
  175. </if>
  176. <if test="igOriginal != null" >
  177. IG_Original,
  178. </if>
  179. <if test="igOriginalId != null" >
  180. IG_Original_ID,
  181. </if>
  182. <if test="igFormerId != null" >
  183. IG_FormerID,
  184. </if>
  185. <if test="igRemark != null" >
  186. IG_Remark,
  187. </if>
  188. </trim>
  189. <trim prefix="values (" suffix=")" suffixOverrides="," >
  190. <if test="igId != null" >
  191. #{igId,jdbcType=INTEGER},
  192. </if>
  193. <if test="patientno != null" >
  194. #{patientno,jdbcType=VARCHAR},
  195. </if>
  196. <if test="hiId != null" >
  197. #{hiId,jdbcType=INTEGER},
  198. </if>
  199. <if test="ddDepdm != null" >
  200. #{ddDepdm,jdbcType=VARCHAR},
  201. </if>
  202. <if test="dwWarddm != null" >
  203. #{dwWarddm,jdbcType=VARCHAR},
  204. </if>
  205. <if test="dbBedno != null" >
  206. #{dbBedno,jdbcType=VARCHAR},
  207. </if>
  208. <if test="igGuidanceCode != null" >
  209. #{igGuidanceCode,jdbcType=VARCHAR},
  210. </if>
  211. <if test="igGuidanceName != null" >
  212. #{igGuidanceName,jdbcType=VARCHAR},
  213. </if>
  214. <if test="igRecordor != null" >
  215. #{igRecordor,jdbcType=VARCHAR},
  216. </if>
  217. now(),
  218. <if test="igDelReason != null" >
  219. #{igDelReason,jdbcType=VARCHAR},
  220. </if>
  221. <if test="igGuidingTime != null" >
  222. #{igGuidingTime,jdbcType=TIMESTAMP},
  223. </if>
  224. <if test="igGuidingObiect != null" >
  225. #{igGuidingObiect,jdbcType=VARCHAR},
  226. </if>
  227. <if test="igGuidingResponse != null" >
  228. #{igGuidingResponse,jdbcType=VARCHAR},
  229. </if>
  230. now(),
  231. <if test="igOperator != null" >
  232. #{igOperator,jdbcType=VARCHAR},
  233. </if>
  234. <if test="igNurseRecord != null" >
  235. #{igNurseRecord,jdbcType=VARCHAR},
  236. </if>
  237. 0,
  238. <if test="igIsdel != null" >
  239. #{igIsdel,jdbcType=INTEGER},
  240. </if>
  241. <if test="igIscomplete != null" >
  242. #{igIscomplete,jdbcType=INTEGER},
  243. </if>
  244. <if test="igOriginal != null" >
  245. #{igOriginal,jdbcType=VARCHAR},
  246. </if>
  247. <if test="igOriginalId != null" >
  248. #{igOriginalId,jdbcType=INTEGER},
  249. </if>
  250. <if test="igFormerId != null" >
  251. #{igFormerId,jdbcType=INTEGER},
  252. </if>
  253. <if test="igRemark != null" >
  254. #{igRemark,jdbcType=VARCHAR},
  255. </if>
  256. </trim>
  257. </insert>
  258. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpGuidance" >
  259. update inp_guidance
  260. <set >
  261. <if test="patientno != null" >
  262. PatientNo = #{patientno,jdbcType=VARCHAR},
  263. </if>
  264. <if test="hiId != null" >
  265. HI_ID = #{hiId,jdbcType=INTEGER},
  266. </if>
  267. <if test="ddDepdm != null" >
  268. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  269. </if>
  270. <if test="dwWarddm != null" >
  271. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  272. </if>
  273. <if test="dbBedno != null" >
  274. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  275. </if>
  276. <if test="igGuidanceCode != null" >
  277. IG_Guidance_Code = #{igGuidanceCode,jdbcType=VARCHAR},
  278. </if>
  279. <if test="igGuidanceName != null" >
  280. IG_Guidance_Name = #{igGuidanceName,jdbcType=VARCHAR},
  281. </if>
  282. <if test="igRecordor != null" >
  283. IG_Recordor = #{igRecordor,jdbcType=VARCHAR},
  284. </if>
  285. <if test="igRecordTime != null" >
  286. IG_Record_Time = #{igRecordTime,jdbcType=TIMESTAMP},
  287. </if>
  288. <if test="igDelReason != null" >
  289. IG_Del_Reason = #{igDelReason,jdbcType=VARCHAR},
  290. </if>
  291. <if test="igGuidingTime != null" >
  292. IG_Guiding_Time = #{igGuidingTime,jdbcType=TIMESTAMP},
  293. </if>
  294. <if test="igGuidingObiect != null" >
  295. IG_Guiding_Obiect = #{igGuidingObiect,jdbcType=VARCHAR},
  296. </if>
  297. <if test="igGuidingResponse != null" >
  298. IG_Guiding_Response = #{igGuidingResponse,jdbcType=VARCHAR},
  299. </if>
  300. <if test="igOperationTime != null" >
  301. IG_Operation_Time = #{igOperationTime,jdbcType=TIMESTAMP},
  302. </if>
  303. <if test="igOperator != null" >
  304. IG_Operator = #{igOperator,jdbcType=VARCHAR},
  305. </if>
  306. <if test="igNurseRecord != null" >
  307. IG_Nurse_Record = #{igNurseRecord,jdbcType=VARCHAR},
  308. </if>
  309. <if test="igIsrecord != null" >
  310. IG_IsRecord = #{igIsrecord,jdbcType=INTEGER},
  311. </if>
  312. <if test="igIsdel != null" >
  313. IG_IsDel = #{igIsdel,jdbcType=INTEGER},
  314. </if>
  315. <if test="igIscomplete != null" >
  316. IG_Iscomplete = #{igIscomplete,jdbcType=INTEGER},
  317. </if>
  318. <if test="igFormerId != null" >
  319. IG_FormerID = #{igFormerId,jdbcType=INTEGER},
  320. </if>
  321. <if test="igRemark != null" >
  322. IG_Remark = #{igRemark,jdbcType=VARCHAR},
  323. </if>
  324. </set>
  325. where IG_ID = #{igId,jdbcType=INTEGER}
  326. </update>
  327. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpGuidance" >
  328. update inp_guidance
  329. set PatientNo = #{patientno,jdbcType=VARCHAR},
  330. HI_ID = #{hiId,jdbcType=INTEGER},
  331. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  332. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  333. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  334. IG_Guidance_Code = #{igGuidanceCode,jdbcType=VARCHAR},
  335. IG_Guidance_Name = #{igGuidanceName,jdbcType=VARCHAR},
  336. IG_Recordor = #{igRecordor,jdbcType=VARCHAR},
  337. IG_Record_Time = #{igRecordTime,jdbcType=TIMESTAMP},
  338. IG_Del_Reason = #{igDelReason,jdbcType=VARCHAR},
  339. IG_Guiding_Time = #{igGuidingTime,jdbcType=TIMESTAMP},
  340. IG_Guiding_Obiect = #{igGuidingObiect,jdbcType=VARCHAR},
  341. IG_Guiding_Response = #{igGuidingResponse,jdbcType=VARCHAR},
  342. IG_Operation_Time = #{igOperationTime,jdbcType=TIMESTAMP},
  343. IG_Operator = #{igOperator,jdbcType=VARCHAR},
  344. IG_Nurse_Record = #{igNurseRecord,jdbcType=VARCHAR},
  345. IG_IsRecord = #{igIsrecord,jdbcType=INTEGER},
  346. IG_IsDel = #{igIsdel,jdbcType=INTEGER},
  347. IG_Iscomplete = #{igIscomplete,jdbcType=INTEGER},
  348. IG_Remark = #{igRemark,jdbcType=VARCHAR}
  349. where IG_ID = #{igId,jdbcType=INTEGER}
  350. </update>
  351. <update id="batchUpdate" parameterType="java.util.List" >
  352. update inp_guidance
  353. set IG_IsDel = -1
  354. where IG_ID IN
  355. <foreach collection="list" item="item" separator="," open="(" close=")" index="index">
  356. #{item,jdbcType=INTEGER}
  357. </foreach>
  358. </update>
  359. <update id="updateBatchResoan" >
  360. update inp_guidance
  361. set
  362. IG_Del_Reason = #{reason,jdbcType=VARCHAR},
  363. IG_Iscomplete = 1,
  364. IG_Operation_Time = now(),
  365. IG_Operator = #{uiCode,jdbcType=VARCHAR}
  366. where IG_ID IN
  367. <foreach collection="list" item="item" separator="," open="(" close=")" index="index">
  368. #{item,jdbcType=INTEGER}
  369. </foreach>
  370. </update>
  371. <update id="updateIsComplete" parameterType="java.lang.Integer" >
  372. update inp_guidance
  373. set IG_Iscomplete = 1
  374. where IG_ID = #{igId,jdbcType=INTEGER}
  375. </update>
  376. <update id="updateIsNotComplete" parameterType="java.lang.Integer" >
  377. update inp_guidance
  378. set IG_Iscomplete = 0
  379. where IG_ID = #{igId,jdbcType=INTEGER}
  380. </update>
  381. <select id="selectByIgId" resultMap="BaseResultMap" parameterType="java.lang.Integer">
  382. select
  383. <include refid="Base_Column_List"/>
  384. from inp_guidance
  385. where IG_IsDel = -1 AND IG_ID = #{igId,jdbcType=INTEGER}
  386. </select>
  387. </mapper>