InpBedShiftMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  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.InpBedShiftMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpBedShift" >
  5. <id column="IBS_ID" property="ibsId" 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="IBS_Shift" property="ibsShift" jdbcType="VARCHAR" />
  12. <result column="IBS_Time" property="ibsTime" jdbcType="TIMESTAMP" />
  13. <result column="IBS_Hander" property="ibsHander" jdbcType="VARCHAR" />
  14. <result column="IBS_Record_Time" property="ibsRecordTime" jdbcType="TIMESTAMP" />
  15. <result column="IBS_Hand_WardDm" property="ibsHandWarddm" jdbcType="VARCHAR" />
  16. <result column="IBS_Type" property="ibsType" jdbcType="INTEGER" />
  17. <result column="IBS_Receive_Shift" property="ibsReceiveShift" jdbcType="VARCHAR" />
  18. <result column="IBS_Receive_Time" property="ibsReceiveTime" jdbcType="TIMESTAMP" />
  19. <result column="IBS_Receiver" property="ibsReceiver" jdbcType="VARCHAR" />
  20. <result column="IBS_Status" property="ibsStatus" jdbcType="INTEGER" />
  21. <result column="IBS_Recordor" property="ibsRecordor" jdbcType="VARCHAR" />
  22. <result column="IBS_IsDel" property="ibsIsdel" jdbcType="INTEGER" />
  23. <result column="IBS_Operation_Time" property="ibsOperationTime" jdbcType="TIMESTAMP" />
  24. <result column="IBS_Operator" property="ibsOperator" jdbcType="VARCHAR" />
  25. </resultMap>
  26. <resultMap id="ResultMapWithBLOBs" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpBedShift" extends="BaseResultMap" >
  27. <result column="IBS_Content" property="ibsContent" jdbcType="LONGVARCHAR" />
  28. <result column="IBS_Remark" property="ibsRemark" jdbcType="LONGVARCHAR" />
  29. </resultMap>
  30. <sql id="Base_Column_List" >
  31. IBS_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IBS_Shift, IBS_Time, IBS_Hander,
  32. IBS_Record_Time, IBS_Hand_WardDm, IBS_Type, IBS_Receive_Shift, IBS_Receive_Time,
  33. IBS_Receiver, IBS_Status, IBS_Recordor, IBS_IsDel, IBS_Operation_Time, IBS_Operator
  34. </sql>
  35. <sql id="Blob_Column_List" >
  36. IBS_Content,IBS_Remark
  37. </sql>
  38. <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
  39. select
  40. <include refid="Base_Column_List" />
  41. ,
  42. <include refid="Blob_Column_List" />
  43. from inp_bed_shift
  44. where IBS_IsDel = 0 and IBS_ID = #{ibsId,jdbcType=INTEGER}
  45. </select>
  46. <select id="selectByPatientNo" resultMap="ResultMapWithBLOBs" parameterType="java.lang.String" >
  47. select
  48. <include refid="Base_Column_List" />
  49. ,
  50. <include refid="Blob_Column_List" />
  51. from inp_bed_shift
  52. where IBS_IsDel = 0 and PatientNo = #{PatientNo,jdbcType=VARCHAR}
  53. order by IBS_ID desc
  54. </select>
  55. <select id="selectByBedShift" resultMap="ResultMapWithBLOBs" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpBedShift" >
  56. select
  57. <include refid="Base_Column_List" />
  58. ,
  59. <include refid="Blob_Column_List" />
  60. from inp_bed_shift
  61. where IBS_IsDel = 0
  62. <if test="hiId != null" >
  63. and HI_ID = #{hiId,jdbcType=INTEGER}
  64. </if>
  65. <if test="dwWarddm != null" >
  66. and DW_WardDm = #{dwWarddm,jdbcType=VARCHAR}
  67. </if>
  68. <if test="beginTime != null" >
  69. and IBS_Time <![CDATA[>=]]> #{beginTime}
  70. </if>
  71. <if test="endTime != null" >
  72. and IBS_Time <![CDATA[<=]]> #{endTime}
  73. </if>
  74. order by IBS_Time desc
  75. </select>
  76. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  77. delete from inp_bed_shift
  78. where IBS_ID = #{ibsId,jdbcType=INTEGER}
  79. </delete>
  80. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpBedShift" >
  81. insert into inp_bed_shift (IBS_ID, PatientNo, HI_ID,
  82. DD_DepDm, DW_WardDm, DB_BedNo,
  83. IBS_Shift, IBS_Time, IBS_Hander,
  84. IBS_Record_Time, IBS_Hand_WardDm, IBS_Type,
  85. IBS_Receive_Shift, IBS_Receive_Time, IBS_Receiver,
  86. IBS_Status, IBS_Recordor, IBS_IsDel,
  87. IBS_Operation_Time, IBS_Operator, IBS_Content,IBS_Remark
  88. )
  89. values (#{ibsId,jdbcType=INTEGER}, #{patientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER},
  90. #{ddDepdm,jdbcType=VARCHAR}, #{dwWarddm,jdbcType=VARCHAR}, #{dbBedno,jdbcType=VARCHAR},
  91. #{ibsShift,jdbcType=VARCHAR}, #{ibsTime,jdbcType=TIMESTAMP}, #{ibsHander,jdbcType=VARCHAR},
  92. #{ibsRecordTime,jdbcType=TIMESTAMP}, #{ibsHandWarddm,jdbcType=VARCHAR}, #{ibsType,jdbcType=INTEGER},
  93. #{ibsReceiveShift,jdbcType=VARCHAR}, #{ibsReceiveTime,jdbcType=TIMESTAMP}, #{ibsReceiver,jdbcType=VARCHAR},
  94. #{ibsStatus,jdbcType=INTEGER}, #{ibsRecordor,jdbcType=VARCHAR}, #{ibsIsdel,jdbcType=INTEGER},
  95. #{ibsOperationTime,jdbcType=TIMESTAMP}, #{ibsOperator,jdbcType=VARCHAR}, #{ibsContent,jdbcType=LONGVARCHAR},#{ibsRemark,jdbcType=LONGVARCHAR}
  96. )
  97. </insert>
  98. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpBedShift" >
  99. insert into inp_bed_shift
  100. <trim prefix="(" suffix=")" suffixOverrides="," >
  101. <if test="ibsId != null" >
  102. IBS_ID,
  103. </if>
  104. <if test="patientno != null" >
  105. PatientNo,
  106. </if>
  107. <if test="hiId != null" >
  108. HI_ID,
  109. </if>
  110. <if test="ddDepdm != null" >
  111. DD_DepDm,
  112. </if>
  113. <if test="dwWarddm != null" >
  114. DW_WardDm,
  115. </if>
  116. <if test="dbBedno != null" >
  117. DB_BedNo,
  118. </if>
  119. <if test="ibsShift != null" >
  120. IBS_Shift,
  121. </if>
  122. <if test="ibsTime != null" >
  123. IBS_Time,
  124. </if>
  125. <if test="ibsHander != null" >
  126. IBS_Hander,
  127. </if>
  128. IBS_Record_Time,
  129. <if test="ibsHandWarddm != null" >
  130. IBS_Hand_WardDm,
  131. </if>
  132. <if test="ibsType != null" >
  133. IBS_Type,
  134. </if>
  135. <if test="ibsReceiveShift != null" >
  136. IBS_Receive_Shift,
  137. </if>
  138. <if test="ibsReceiveTime != null" >
  139. IBS_Receive_Time,
  140. </if>
  141. <if test="ibsReceiver != null" >
  142. IBS_Receiver,
  143. </if>
  144. <if test="ibsStatus != null" >
  145. IBS_Status,
  146. </if>
  147. <if test="ibsRecordor != null" >
  148. IBS_Recordor,
  149. </if>
  150. <if test="ibsIsdel != null" >
  151. IBS_IsDel,
  152. </if>
  153. IBS_Operation_Time,
  154. <if test="ibsOperator != null" >
  155. IBS_Operator,
  156. </if>
  157. <if test="ibsContent != null" >
  158. IBS_Content,
  159. </if>
  160. <if test="ibsRemark != null" >
  161. IBS_Remark,
  162. </if>
  163. </trim>
  164. <trim prefix="values (" suffix=")" suffixOverrides="," >
  165. <if test="ibsId != null" >
  166. #{ibsId,jdbcType=INTEGER},
  167. </if>
  168. <if test="patientno != null" >
  169. #{patientno,jdbcType=VARCHAR},
  170. </if>
  171. <if test="hiId != null" >
  172. #{hiId,jdbcType=INTEGER},
  173. </if>
  174. <if test="ddDepdm != null" >
  175. #{ddDepdm,jdbcType=VARCHAR},
  176. </if>
  177. <if test="dwWarddm != null" >
  178. #{dwWarddm,jdbcType=VARCHAR},
  179. </if>
  180. <if test="dbBedno != null" >
  181. #{dbBedno,jdbcType=VARCHAR},
  182. </if>
  183. <if test="ibsShift != null" >
  184. #{ibsShift,jdbcType=VARCHAR},
  185. </if>
  186. <if test="ibsTime != null" >
  187. #{ibsTime,jdbcType=TIMESTAMP},
  188. </if>
  189. <if test="ibsHander != null" >
  190. #{ibsHander,jdbcType=VARCHAR},
  191. </if>
  192. now(),
  193. <if test="ibsHandWarddm != null" >
  194. #{ibsHandWarddm,jdbcType=VARCHAR},
  195. </if>
  196. <if test="ibsType != null" >
  197. #{ibsType,jdbcType=INTEGER},
  198. </if>
  199. <if test="ibsReceiveShift != null" >
  200. #{ibsReceiveShift,jdbcType=VARCHAR},
  201. </if>
  202. <if test="ibsReceiveTime != null" >
  203. #{ibsReceiveTime,jdbcType=TIMESTAMP},
  204. </if>
  205. <if test="ibsReceiver != null" >
  206. #{ibsReceiver,jdbcType=VARCHAR},
  207. </if>
  208. <if test="ibsStatus != null" >
  209. #{ibsStatus,jdbcType=INTEGER},
  210. </if>
  211. <if test="ibsRecordor != null" >
  212. #{ibsRecordor,jdbcType=VARCHAR},
  213. </if>
  214. <if test="ibsIsdel != null" >
  215. #{ibsIsdel,jdbcType=INTEGER},
  216. </if>
  217. now(),
  218. <if test="ibsOperator != null" >
  219. #{ibsOperator,jdbcType=VARCHAR},
  220. </if>
  221. <if test="ibsContent != null" >
  222. #{ibsContent,jdbcType=LONGVARCHAR},
  223. </if>
  224. <if test="ibsRemark != null" >
  225. #{ibsRemark,jdbcType=LONGVARCHAR},
  226. </if>
  227. </trim>
  228. </insert>
  229. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpBedShift" >
  230. update inp_bed_shift
  231. <set >
  232. <if test="patientno != null" >
  233. PatientNo = #{patientno,jdbcType=VARCHAR},
  234. </if>
  235. <if test="hiId != null" >
  236. HI_ID = #{hiId,jdbcType=INTEGER},
  237. </if>
  238. <if test="ddDepdm != null" >
  239. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  240. </if>
  241. <if test="dwWarddm != null" >
  242. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  243. </if>
  244. <if test="dbBedno != null" >
  245. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  246. </if>
  247. <if test="ibsShift != null" >
  248. IBS_Shift = #{ibsShift,jdbcType=VARCHAR},
  249. </if>
  250. <if test="ibsTime != null" >
  251. IBS_Time = #{ibsTime,jdbcType=TIMESTAMP},
  252. </if>
  253. <if test="ibsHander != null" >
  254. IBS_Hander = #{ibsHander,jdbcType=VARCHAR},
  255. </if>
  256. <if test="ibsRecordTime != null" >
  257. IBS_Record_Time = #{ibsRecordTime,jdbcType=TIMESTAMP},
  258. </if>
  259. <if test="ibsHandWarddm != null" >
  260. IBS_Hand_WardDm = #{ibsHandWarddm,jdbcType=VARCHAR},
  261. </if>
  262. <if test="ibsType != null" >
  263. IBS_Type = #{ibsType,jdbcType=INTEGER},
  264. </if>
  265. <if test="ibsReceiveShift != null" >
  266. IBS_Receive_Shift = #{ibsReceiveShift,jdbcType=VARCHAR},
  267. </if>
  268. <if test="ibsReceiveTime != null" >
  269. IBS_Receive_Time = #{ibsReceiveTime,jdbcType=TIMESTAMP},
  270. </if>
  271. <if test="ibsReceiver != null" >
  272. IBS_Receiver = #{ibsReceiver,jdbcType=VARCHAR},
  273. </if>
  274. <if test="ibsStatus != null" >
  275. IBS_Status = #{ibsStatus,jdbcType=INTEGER},
  276. </if>
  277. <if test="ibsRecordor != null" >
  278. IBS_Recordor = #{ibsRecordor,jdbcType=VARCHAR},
  279. </if>
  280. <if test="ibsIsdel != null" >
  281. IBS_IsDel = #{ibsIsdel,jdbcType=INTEGER},
  282. </if>
  283. <if test="ibsOperationTime != null" >
  284. IBS_Operation_Time = #{ibsOperationTime,jdbcType=TIMESTAMP},
  285. </if>
  286. <if test="ibsOperator != null" >
  287. IBS_Operator = #{ibsOperator,jdbcType=VARCHAR},
  288. </if>
  289. <if test="ibsContent != null" >
  290. IBS_Content = #{ibsContent,jdbcType=LONGVARCHAR},
  291. </if>
  292. <if test="ibsRemark != null" >
  293. IBS_Remark = #{ibsRemark,jdbcType=LONGVARCHAR},
  294. </if>
  295. </set>
  296. where IBS_ID = #{ibsId,jdbcType=INTEGER}
  297. </update>
  298. <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpBedShift" >
  299. update inp_bed_shift
  300. set PatientNo = #{patientno,jdbcType=VARCHAR},
  301. HI_ID = #{hiId,jdbcType=INTEGER},
  302. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  303. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  304. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  305. IBS_Shift = #{ibsShift,jdbcType=VARCHAR},
  306. IBS_Time = #{ibsTime,jdbcType=TIMESTAMP},
  307. IBS_Hander = #{ibsHander,jdbcType=VARCHAR},
  308. IBS_Record_Time = #{ibsRecordTime,jdbcType=TIMESTAMP},
  309. IBS_Hand_WardDm = #{ibsHandWarddm,jdbcType=VARCHAR},
  310. IBS_Type = #{ibsType,jdbcType=INTEGER},
  311. IBS_Receive_Shift = #{ibsReceiveShift,jdbcType=VARCHAR},
  312. IBS_Receive_Time = #{ibsReceiveTime,jdbcType=TIMESTAMP},
  313. IBS_Receiver = #{ibsReceiver,jdbcType=VARCHAR},
  314. IBS_Status = #{ibsStatus,jdbcType=INTEGER},
  315. IBS_Recordor = #{ibsRecordor,jdbcType=VARCHAR},
  316. IBS_IsDel = #{ibsIsdel,jdbcType=INTEGER},
  317. IBS_Operation_Time = #{ibsOperationTime,jdbcType=TIMESTAMP},
  318. IBS_Operator = #{ibsOperator,jdbcType=VARCHAR},
  319. IBS_Content = #{ibsContent,jdbcType=LONGVARCHAR},
  320. IBS_Remark = #{ibsRemark,jdbcType=LONGVARCHAR}
  321. where IBS_ID = #{ibsId,jdbcType=INTEGER}
  322. </update>
  323. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpBedShift" >
  324. update inp_bed_shift
  325. set PatientNo = #{patientno,jdbcType=VARCHAR},
  326. HI_ID = #{hiId,jdbcType=INTEGER},
  327. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  328. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  329. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  330. IBS_Shift = #{ibsShift,jdbcType=VARCHAR},
  331. IBS_Time = #{ibsTime,jdbcType=TIMESTAMP},
  332. IBS_Hander = #{ibsHander,jdbcType=VARCHAR},
  333. IBS_Record_Time = #{ibsRecordTime,jdbcType=TIMESTAMP},
  334. IBS_Hand_WardDm = #{ibsHandWarddm,jdbcType=VARCHAR},
  335. IBS_Type = #{ibsType,jdbcType=INTEGER},
  336. IBS_Receive_Shift = #{ibsReceiveShift,jdbcType=VARCHAR},
  337. IBS_Receive_Time = #{ibsReceiveTime,jdbcType=TIMESTAMP},
  338. IBS_Receiver = #{ibsReceiver,jdbcType=VARCHAR},
  339. IBS_Status = #{ibsStatus,jdbcType=INTEGER},
  340. IBS_Recordor = #{ibsRecordor,jdbcType=VARCHAR},
  341. IBS_IsDel = #{ibsIsdel,jdbcType=INTEGER},
  342. IBS_Operation_Time = #{ibsOperationTime,jdbcType=TIMESTAMP},
  343. IBS_Operator = #{ibsOperator,jdbcType=VARCHAR},
  344. IBS_Remark = #{ibsRemark,jdbcType=VARCHAR}
  345. where IBS_ID = #{ibsId,jdbcType=INTEGER}
  346. </update>
  347. <update id="updateStatusBatch" parameterType="List" >
  348. update inp_bed_shift
  349. set IBS_IsDel = -1
  350. where IBS_ID in
  351. <foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
  352. #{item,jdbcType=INTEGER}
  353. </foreach>
  354. </update>
  355. </mapper>