InpPlanMeasureMapper.xml 13 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.InpPlanMeasureMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPlanMeasure" >
  5. <id column="IPM_ID" property="ipmId" jdbcType="INTEGER" />
  6. <result column="IPD_ID" property="ipdId" jdbcType="INTEGER" />
  7. <result column="IPO_ID" property="ipoId" jdbcType="INTEGER" />
  8. <result column="PatientNo" property="patientno" jdbcType="VARCHAR" />
  9. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  10. <result column="DD_DepDm" property="ddDepdm" jdbcType="VARCHAR" />
  11. <result column="DW_WardDm" property="dwWarddm" jdbcType="VARCHAR" />
  12. <result column="DB_BedNo" property="dbBedno" jdbcType="VARCHAR" />
  13. <result column="IPM_Code" property="ipmCode" jdbcType="VARCHAR" />
  14. <result column="IPM_Name" property="ipmName" jdbcType="VARCHAR" />
  15. <result column="IPM_Type" property="ipmType" jdbcType="INTEGER" />
  16. <result column="IPM_Status" property="ipmStatus" jdbcType="INTEGER" />
  17. <result column="IPM_Recordor" property="ipmRecordor" jdbcType="VARCHAR" />
  18. <result column="IPM_Record_Time" property="ipmRecordTime" jdbcType="TIMESTAMP" />
  19. <result column="IPM_Nurse_Record" property="ipmNurseRecord" jdbcType="VARCHAR" />
  20. <result column="IPM_IsRecord" property="ipmIsrecord" jdbcType="INTEGER" />
  21. <result column="IPM_Operation_Time" property="ipmOperationTime" jdbcType="TIMESTAMP" />
  22. <result column="IPM_Operator" property="ipmOperator" jdbcType="VARCHAR" />
  23. <result column="IPM_IsDel" property="ipmIsdel" jdbcType="INTEGER" />
  24. </resultMap>
  25. <sql id="Base_Column_List" >
  26. IPM_ID, IPD_ID, IPO_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IPM_Code,
  27. IPM_Name, IPM_Type, IPM_Status, IPM_Recordor, IPM_Record_Time, IPM_Nurse_Record,
  28. IPM_IsRecord, IPM_Operation_Time, IPM_Operator, IPM_IsDel
  29. </sql>
  30. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  31. select
  32. <include refid="Base_Column_List" />
  33. from inp_plan_measure
  34. where IPM_IsDel = 0 AND IPM_ID = #{ipmId,jdbcType=INTEGER}
  35. </select>
  36. <select id="selectByIds" resultMap="BaseResultMap" parameterType="java.util.List" >
  37. select
  38. <include refid="Base_Column_List" />
  39. from inp_plan_measure
  40. where IPM_IsDel = 0
  41. AND IPM_ID IN
  42. <foreach collection="list" item="item" index="index" open='(' separator=',' close=')'>
  43. #{item,jdbcType=INTEGER}
  44. </foreach>
  45. </select>
  46. <select id="selectAll" resultMap="BaseResultMap" parameterType="com.xinxin.topro.inpnurseservice.request.InpPlanMeasureInfoRequest" >
  47. select
  48. <include refid="Base_Column_List" />
  49. from inp_plan_measure
  50. where IPM_IsDel = 0
  51. <if test="ipdID != null" >
  52. AND IPD_ID = #{ipdID,jdbcType=INTEGER}
  53. </if>
  54. <if test="ipoID != null" >
  55. AND IPO_ID = #{ipoID,jdbcType=INTEGER}
  56. </if>
  57. <if test="patientNo != null" >
  58. AND PatientNo = #{patientNo,jdbcType=VARCHAR}
  59. </if>
  60. <if test="list != null" >
  61. AND IPD_ID in <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
  62. #{item,jdbcType=INTEGER}
  63. </foreach>
  64. </if>
  65. ORDER BY IPM_ID DESC
  66. </select>
  67. <select id="selectAllList" resultMap="BaseResultMap" parameterType="com.xinxin.topro.inpnurseservice.request.InpPlanSearchInfoRequest" >
  68. select
  69. <include refid="Base_Column_List" />
  70. from inp_plan_measure
  71. where IPM_IsDel = 0
  72. <if test="ipdID != null" >
  73. AND IPD_ID = #{ipdID,jdbcType=INTEGER}
  74. </if>
  75. <if test="patientNo != null" >
  76. AND PatientNo = #{patientNo,jdbcType=VARCHAR}
  77. </if>
  78. <if test="ids != null" >
  79. AND IPD_ID in <foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
  80. #{item,jdbcType=INTEGER}
  81. </foreach>
  82. </if>
  83. ORDER BY IPM_ID DESC
  84. </select>
  85. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  86. delete from inp_plan_measure
  87. where IPM_ID = #{ipmId,jdbcType=INTEGER}
  88. </delete>
  89. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPlanMeasure" >
  90. insert into inp_plan_measure (IPM_ID, IPD_ID, IPO_ID,
  91. PatientNo, HI_ID, DD_DepDm,
  92. DW_WardDm, DB_BedNo, IPM_Code,
  93. IPM_Name, IPM_Type, IPM_Status,
  94. IPM_Recordor, IPM_Record_Time, IPM_Nurse_Record,
  95. IPM_IsRecord, IPM_Operation_Time, IPM_Operator,
  96. IPM_IsDel)
  97. values (#{ipmId,jdbcType=INTEGER}, #{ipdId,jdbcType=INTEGER}, #{ipoId,jdbcType=INTEGER},
  98. #{patientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER}, #{ddDepdm,jdbcType=VARCHAR},
  99. #{dwWarddm,jdbcType=VARCHAR}, #{dbBedno,jdbcType=VARCHAR}, #{ipmCode,jdbcType=VARCHAR},
  100. #{ipmName,jdbcType=VARCHAR}, #{ipmType,jdbcType=INTEGER}, #{ipmStatus,jdbcType=INTEGER},
  101. #{ipmRecordor,jdbcType=VARCHAR}, #{ipmRecordTime,jdbcType=TIMESTAMP}, #{ipmNurseRecord,jdbcType=VARCHAR},
  102. #{ipmIsrecord,jdbcType=INTEGER}, #{ipmOperationTime,jdbcType=TIMESTAMP}, #{ipmOperator,jdbcType=VARCHAR},
  103. #{ipmIsdel,jdbcType=INTEGER})
  104. </insert>
  105. <insert id="insertByBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="ipmId" keyColumn="IPM_ID">
  106. insert into inp_plan_measure (IPD_ID, IPO_ID,
  107. PatientNo, HI_ID, DD_DepDm,
  108. DW_WardDm, DB_BedNo, IPM_Code,
  109. IPM_Name, IPM_Recordor, IPM_Record_Time, IPM_Operation_Time, IPM_Operator)
  110. values
  111. <foreach collection="list" item="item" index="index" separator=",">
  112. (#{item.ipdId,jdbcType=INTEGER}, #{item.ipoId,jdbcType=INTEGER},
  113. #{item.patientno,jdbcType=INTEGER}, #{item.hiId,jdbcType=INTEGER}, #{item.ddDepdm,jdbcType=VARCHAR},
  114. #{item.dwWarddm,jdbcType=VARCHAR}, #{item.dbBedno,jdbcType=VARCHAR}, #{item.ipmCode,jdbcType=VARCHAR},
  115. #{item.ipmName,jdbcType=VARCHAR}, #{item.ipmRecordor,jdbcType=VARCHAR}, #{item.ipmRecordTime,jdbcType=TIMESTAMP}, now(), #{item.ipmOperator,jdbcType=VARCHAR})
  116. </foreach>
  117. </insert>
  118. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPlanMeasure" >
  119. insert into inp_plan_measure
  120. <trim prefix="(" suffix=")" suffixOverrides="," >
  121. <if test="ipmId != null" >
  122. IPM_ID,
  123. </if>
  124. <if test="ipdId != null" >
  125. IPD_ID,
  126. </if>
  127. <if test="ipoId != null" >
  128. IPO_ID,
  129. </if>
  130. <if test="patientno != null" >
  131. PatientNo,
  132. </if>
  133. <if test="hiId != null" >
  134. HI_ID,
  135. </if>
  136. <if test="ddDepdm != null" >
  137. DD_DepDm,
  138. </if>
  139. <if test="dwWarddm != null" >
  140. DW_WardDm,
  141. </if>
  142. <if test="dbBedno != null" >
  143. DB_BedNo,
  144. </if>
  145. <if test="ipmCode != null" >
  146. IPM_Code,
  147. </if>
  148. <if test="ipmName != null" >
  149. IPM_Name,
  150. </if>
  151. <if test="ipmType != null" >
  152. IPM_Type,
  153. </if>
  154. <if test="ipmStatus != null" >
  155. IPM_Status,
  156. </if>
  157. <if test="ipmRecordor != null" >
  158. IPM_Recordor,
  159. </if>
  160. <if test="ipmRecordTime != null" >
  161. IPM_Record_Time,
  162. </if>
  163. <if test="ipmNurseRecord != null" >
  164. IPM_Nurse_Record,
  165. </if>
  166. <if test="ipmIsrecord != null" >
  167. IPM_IsRecord,
  168. </if>
  169. <if test="ipmOperationTime != null" >
  170. IPM_Operation_Time,
  171. </if>
  172. <if test="ipmOperator != null" >
  173. IPM_Operator,
  174. </if>
  175. <if test="ipmIsdel != null" >
  176. IPM_IsDel,
  177. </if>
  178. </trim>
  179. <trim prefix="values (" suffix=")" suffixOverrides="," >
  180. <if test="ipmId != null" >
  181. #{ipmId,jdbcType=INTEGER},
  182. </if>
  183. <if test="ipdId != null" >
  184. #{ipdId,jdbcType=INTEGER},
  185. </if>
  186. <if test="ipoId != null" >
  187. #{ipoId,jdbcType=INTEGER},
  188. </if>
  189. <if test="patientno != null" >
  190. #{patientno,jdbcType=VARCHAR},
  191. </if>
  192. <if test="hiId != null" >
  193. #{hiId,jdbcType=INTEGER},
  194. </if>
  195. <if test="ddDepdm != null" >
  196. #{ddDepdm,jdbcType=VARCHAR},
  197. </if>
  198. <if test="dwWarddm != null" >
  199. #{dwWarddm,jdbcType=VARCHAR},
  200. </if>
  201. <if test="dbBedno != null" >
  202. #{dbBedno,jdbcType=VARCHAR},
  203. </if>
  204. <if test="ipmCode != null" >
  205. #{ipmCode,jdbcType=VARCHAR},
  206. </if>
  207. <if test="ipmName != null" >
  208. #{ipmName,jdbcType=VARCHAR},
  209. </if>
  210. <if test="ipmType != null" >
  211. #{ipmType,jdbcType=INTEGER},
  212. </if>
  213. <if test="ipmStatus != null" >
  214. #{ipmStatus,jdbcType=INTEGER},
  215. </if>
  216. <if test="ipmRecordor != null" >
  217. #{ipmRecordor,jdbcType=VARCHAR},
  218. </if>
  219. <if test="ipmRecordTime != null" >
  220. #{ipmRecordTime,jdbcType=TIMESTAMP},
  221. </if>
  222. <if test="ipmNurseRecord != null" >
  223. #{ipmNurseRecord,jdbcType=VARCHAR},
  224. </if>
  225. <if test="ipmIsrecord != null" >
  226. #{ipmIsrecord,jdbcType=INTEGER},
  227. </if>
  228. <if test="ipmOperationTime != null" >
  229. #{ipmOperationTime,jdbcType=TIMESTAMP},
  230. </if>
  231. <if test="ipmOperator != null" >
  232. #{ipmOperator,jdbcType=VARCHAR},
  233. </if>
  234. <if test="ipmIsdel != null" >
  235. #{ipmIsdel,jdbcType=INTEGER},
  236. </if>
  237. </trim>
  238. </insert>
  239. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPlanMeasure" >
  240. update inp_plan_measure
  241. <set >
  242. <if test="ipdId != null" >
  243. IPD_ID = #{ipdId,jdbcType=INTEGER},
  244. </if>
  245. <if test="ipoId != null" >
  246. IPO_ID = #{ipoId,jdbcType=INTEGER},
  247. </if>
  248. <if test="patientno != null" >
  249. PatientNo = #{patientno,jdbcType=VARCHAR},
  250. </if>
  251. <if test="hiId != null" >
  252. HI_ID = #{hiId,jdbcType=INTEGER},
  253. </if>
  254. <if test="ddDepdm != null" >
  255. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  256. </if>
  257. <if test="dwWarddm != null" >
  258. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  259. </if>
  260. <if test="dbBedno != null" >
  261. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  262. </if>
  263. <if test="ipmCode != null" >
  264. IPM_Code = #{ipmCode,jdbcType=VARCHAR},
  265. </if>
  266. <if test="ipmName != null" >
  267. IPM_Name = #{ipmName,jdbcType=VARCHAR},
  268. </if>
  269. <if test="ipmType != null" >
  270. IPM_Type = #{ipmType,jdbcType=INTEGER},
  271. </if>
  272. <if test="ipmStatus != null" >
  273. IPM_Status = #{ipmStatus,jdbcType=INTEGER},
  274. </if>
  275. <if test="ipmRecordor != null" >
  276. IPM_Recordor = #{ipmRecordor,jdbcType=VARCHAR},
  277. </if>
  278. <if test="ipmRecordTime != null" >
  279. IPM_Record_Time = #{ipmRecordTime,jdbcType=TIMESTAMP},
  280. </if>
  281. <if test="ipmNurseRecord != null" >
  282. IPM_Nurse_Record = #{ipmNurseRecord,jdbcType=VARCHAR},
  283. </if>
  284. <if test="ipmIsrecord != null" >
  285. IPM_IsRecord = #{ipmIsrecord,jdbcType=INTEGER},
  286. </if>
  287. <if test="ipmOperationTime != null" >
  288. IPM_Operation_Time = #{ipmOperationTime,jdbcType=TIMESTAMP},
  289. </if>
  290. <if test="ipmOperator != null" >
  291. IPM_Operator = #{ipmOperator,jdbcType=VARCHAR},
  292. </if>
  293. <if test="ipmIsdel != null" >
  294. IPM_IsDel = #{ipmIsdel,jdbcType=INTEGER},
  295. </if>
  296. </set>
  297. where IPM_ID = #{ipmId,jdbcType=INTEGER}
  298. </update>
  299. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPlanMeasure" >
  300. update inp_plan_measure
  301. set IPD_ID = #{ipdId,jdbcType=INTEGER},
  302. IPO_ID = #{ipoId,jdbcType=INTEGER},
  303. PatientNo = #{patientno,jdbcType=VARCHAR},
  304. HI_ID = #{hiId,jdbcType=INTEGER},
  305. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  306. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  307. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  308. IPM_Code = #{ipmCode,jdbcType=VARCHAR},
  309. IPM_Name = #{ipmName,jdbcType=VARCHAR},
  310. IPM_Type = #{ipmType,jdbcType=INTEGER},
  311. IPM_Status = #{ipmStatus,jdbcType=INTEGER},
  312. IPM_Recordor = #{ipmRecordor,jdbcType=VARCHAR},
  313. IPM_Record_Time = #{ipmRecordTime,jdbcType=TIMESTAMP},
  314. IPM_Nurse_Record = #{ipmNurseRecord,jdbcType=VARCHAR},
  315. IPM_IsRecord = #{ipmIsrecord,jdbcType=INTEGER},
  316. IPM_Operation_Time = #{ipmOperationTime,jdbcType=TIMESTAMP},
  317. IPM_Operator = #{ipmOperator,jdbcType=VARCHAR},
  318. IPM_IsDel = #{ipmIsdel,jdbcType=INTEGER}
  319. where IPM_ID = #{ipmId,jdbcType=INTEGER}
  320. </update>
  321. <update id="updateStatusList" parameterType="java.util.List" >
  322. update inp_plan_measure
  323. set IPM_Status = 1
  324. where IPM_ID IN
  325. <foreach collection="list" item="item" separator="," open="(" close=")" index="index">
  326. #{item,jdbcType=INTEGER}
  327. </foreach>
  328. </update>
  329. <update id="updateBatchStatus" parameterType="java.util.List" >
  330. update inp_plan_measure
  331. set IPM_IsDel = -1
  332. where IPM_ID in
  333. <foreach collection="list" item="item" separator="," open="(" close=")" index="index">
  334. #{item,jdbcType=INTEGER}
  335. </foreach>
  336. </update>
  337. <update id="updateStatusIpdId" parameterType="java.lang.Integer" >
  338. update inp_plan_measure
  339. set IPM_IsDel = -1
  340. where IPD_ID = #{ipdId,jdbcType=INTEGER}
  341. </update>
  342. <update id="updateStatusIpoId" parameterType="java.lang.Integer" >
  343. update inp_plan_measure
  344. set IPM_IsDel = -1
  345. where IPO_ID = #{ipoId,jdbcType=INTEGER}
  346. </update>
  347. <update id="updateIpmStatus" parameterType="java.lang.Integer" >
  348. update inp_plan_measure
  349. set IPM_Status = 1
  350. where IPD_ID = #{ipdId,jdbcType=INTEGER}
  351. </update>
  352. </mapper>