InpPlanCauseMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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.InpPlanCauseMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPlanCause" >
  5. <id column="IPC_ID" property="ipcId" jdbcType="INTEGER" />
  6. <result column="IPD_ID" property="ipdId" jdbcType="INTEGER" />
  7. <result column="PatientNo" property="patientno" jdbcType="VARCHAR" />
  8. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  9. <result column="DD_DepDm" property="ddDepdm" jdbcType="VARCHAR" />
  10. <result column="DW_WardDm" property="dwWarddm" jdbcType="VARCHAR" />
  11. <result column="DB_BedNo" property="dbBedno" jdbcType="VARCHAR" />
  12. <result column="IPC_Code" property="ipcCode" jdbcType="VARCHAR" />
  13. <result column="IPC_Name" property="ipcName" jdbcType="VARCHAR" />
  14. <result column="IPC_Status" property="ipcStatus" jdbcType="INTEGER" />
  15. <result column="IPC_Recordor" property="ipcRecordor" jdbcType="VARCHAR" />
  16. <result column="IPC_Record_Time" property="ipcRecordTime" jdbcType="TIMESTAMP" />
  17. <result column="IPC_Nurse_Record" property="ipcNurseRecord" jdbcType="VARCHAR" />
  18. <result column="IPC_IsRecord" property="ipcIsrecord" jdbcType="INTEGER" />
  19. <result column="IPC_Operation_Time" property="ipcOperationTime" jdbcType="TIMESTAMP" />
  20. <result column="IPC_Operator" property="ipcOperator" jdbcType="VARCHAR" />
  21. <result column="IPC_IsDel" property="ipcIsdel" jdbcType="INTEGER" />
  22. </resultMap>
  23. <sql id="Base_Column_List" >
  24. IPC_ID, IPD_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IPC_Code, IPC_Name,
  25. IPC_Status, IPC_Recordor, IPC_Record_Time, IPC_Nurse_Record, IPC_IsRecord, IPC_Operation_Time,
  26. IPC_Operator, IPC_IsDel
  27. </sql>
  28. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  29. select
  30. <include refid="Base_Column_List" />
  31. from inp_plan_cause
  32. where IPC_IsDel = 0 AND IPC_ID = #{ipcId,jdbcType=INTEGER}
  33. </select>
  34. <select id="selectAll" resultMap="BaseResultMap" parameterType="com.xinxin.topro.inpnurseservice.request.InpPlanSearchInfoRequest" >
  35. select
  36. <include refid="Base_Column_List" />
  37. from inp_plan_cause
  38. where IPC_IsDel = 0
  39. <if test="patientNo != null" >
  40. AND PatientNo = #{patientNo,jdbcType=VARCHAR}
  41. </if>
  42. <if test="ipdID != null" >
  43. AND IPD_ID = #{ipdID,jdbcType=INTEGER}
  44. </if>
  45. <if test="ids != null" >
  46. AND IPD_ID IN
  47. <foreach item='item' index='index' collection='ids' open='(' separator=',' close=')'>
  48. #{item}
  49. </foreach>
  50. </if>
  51. ORDER BY IPC_ID DESC
  52. </select>
  53. <select id="selectByIpdId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  54. select
  55. <include refid="Base_Column_List" />
  56. from inp_plan_cause
  57. where IPC_IsDel = 0 AND IPD_ID = #{ipdID,jdbcType=INTEGER}
  58. ORDER BY IPC_ID DESC
  59. </select>
  60. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  61. delete from inp_plan_cause
  62. where IPC_ID = #{ipcId,jdbcType=INTEGER}
  63. </delete>
  64. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPlanCause" >
  65. insert into inp_plan_cause (IPC_ID, IPD_ID, PatientNo,
  66. HI_ID, DD_DepDm, DW_WardDm,
  67. DB_BedNo, IPC_Code, IPC_Name,
  68. IPC_Status, IPC_Recordor, IPC_Record_Time,
  69. IPC_Nurse_Record, IPC_IsRecord, IPC_Operation_Time,
  70. IPC_Operator, IPC_IsDel)
  71. values (#{ipcId,jdbcType=INTEGER}, #{ipdId,jdbcType=INTEGER}, #{patientno,jdbcType=VARCHAR},
  72. #{hiId,jdbcType=INTEGER}, #{ddDepdm,jdbcType=VARCHAR}, #{dwWarddm,jdbcType=VARCHAR},
  73. #{dbBedno,jdbcType=VARCHAR}, #{ipcCode,jdbcType=VARCHAR}, #{ipcName,jdbcType=VARCHAR},
  74. #{ipcStatus,jdbcType=INTEGER}, #{ipcRecordor,jdbcType=VARCHAR}, #{ipcRecordTime,jdbcType=TIMESTAMP},
  75. #{ipcNurseRecord,jdbcType=VARCHAR}, #{ipcIsrecord,jdbcType=INTEGER}, #{ipcOperationTime,jdbcType=TIMESTAMP},
  76. #{ipcOperator,jdbcType=VARCHAR}, #{ipcIsdel,jdbcType=INTEGER})
  77. </insert>
  78. <insert id="insertByBatch" parameterType="java.util.List" >
  79. insert into inp_plan_cause (IPD_ID, PatientNo,
  80. HI_ID, DD_DepDm, DW_WardDm,
  81. DB_BedNo, IPC_Code, IPC_Name,
  82. IPC_Recordor, IPC_Record_Time,
  83. IPC_Operation_Time, IPC_Operator)
  84. values
  85. <foreach collection="list" item="item" index="index" separator=",">
  86. (#{item.ipdId,jdbcType=INTEGER}, #{item.patientno,jdbcType=INTEGER},
  87. #{item.hiId,jdbcType=INTEGER}, #{item.ddDepdm,jdbcType=VARCHAR}, #{item.dwWarddm,jdbcType=VARCHAR},
  88. #{item.dbBedno,jdbcType=VARCHAR}, #{item.ipcCode,jdbcType=VARCHAR}, #{item.ipcName,jdbcType=VARCHAR},
  89. #{item.ipcRecordor,jdbcType=VARCHAR}, #{item.ipcRecordTime,jdbcType=TIMESTAMP},
  90. now(),#{item.ipcOperator,jdbcType=VARCHAR})
  91. </foreach>
  92. </insert>
  93. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPlanCause" >
  94. insert into inp_plan_cause
  95. <trim prefix="(" suffix=")" suffixOverrides="," >
  96. <if test="ipcId != null" >
  97. IPC_ID,
  98. </if>
  99. <if test="ipdId != null" >
  100. IPD_ID,
  101. </if>
  102. <if test="patientno != null" >
  103. PatientNo,
  104. </if>
  105. <if test="hiId != null" >
  106. HI_ID,
  107. </if>
  108. <if test="ddDepdm != null" >
  109. DD_DepDm,
  110. </if>
  111. <if test="dwWarddm != null" >
  112. DW_WardDm,
  113. </if>
  114. <if test="dbBedno != null" >
  115. DB_BedNo,
  116. </if>
  117. <if test="ipcCode != null" >
  118. IPC_Code,
  119. </if>
  120. <if test="ipcName != null" >
  121. IPC_Name,
  122. </if>
  123. <if test="ipcStatus != null" >
  124. IPC_Status,
  125. </if>
  126. <if test="ipcRecordor != null" >
  127. IPC_Recordor,
  128. </if>
  129. <if test="ipcRecordTime != null" >
  130. IPC_Record_Time,
  131. </if>
  132. <if test="ipcNurseRecord != null" >
  133. IPC_Nurse_Record,
  134. </if>
  135. <if test="ipcIsrecord != null" >
  136. IPC_IsRecord,
  137. </if>
  138. <if test="ipcOperationTime != null" >
  139. IPC_Operation_Time,
  140. </if>
  141. <if test="ipcOperator != null" >
  142. IPC_Operator,
  143. </if>
  144. <if test="ipcIsdel != null" >
  145. IPC_IsDel,
  146. </if>
  147. </trim>
  148. <trim prefix="values (" suffix=")" suffixOverrides="," >
  149. <if test="ipcId != null" >
  150. #{ipcId,jdbcType=INTEGER},
  151. </if>
  152. <if test="ipdId != null" >
  153. #{ipdId,jdbcType=INTEGER},
  154. </if>
  155. <if test="patientno != null" >
  156. #{patientno,jdbcType=VARCHAR},
  157. </if>
  158. <if test="hiId != null" >
  159. #{hiId,jdbcType=INTEGER},
  160. </if>
  161. <if test="ddDepdm != null" >
  162. #{ddDepdm,jdbcType=VARCHAR},
  163. </if>
  164. <if test="dwWarddm != null" >
  165. #{dwWarddm,jdbcType=VARCHAR},
  166. </if>
  167. <if test="dbBedno != null" >
  168. #{dbBedno,jdbcType=VARCHAR},
  169. </if>
  170. <if test="ipcCode != null" >
  171. #{ipcCode,jdbcType=VARCHAR},
  172. </if>
  173. <if test="ipcName != null" >
  174. #{ipcName,jdbcType=VARCHAR},
  175. </if>
  176. <if test="ipcStatus != null" >
  177. #{ipcStatus,jdbcType=INTEGER},
  178. </if>
  179. <if test="ipcRecordor != null" >
  180. #{ipcRecordor,jdbcType=VARCHAR},
  181. </if>
  182. <if test="ipcRecordTime != null" >
  183. #{ipcRecordTime,jdbcType=TIMESTAMP},
  184. </if>
  185. <if test="ipcNurseRecord != null" >
  186. #{ipcNurseRecord,jdbcType=VARCHAR},
  187. </if>
  188. <if test="ipcIsrecord != null" >
  189. #{ipcIsrecord,jdbcType=INTEGER},
  190. </if>
  191. <if test="ipcOperationTime != null" >
  192. #{ipcOperationTime,jdbcType=TIMESTAMP},
  193. </if>
  194. <if test="ipcOperator != null" >
  195. #{ipcOperator,jdbcType=VARCHAR},
  196. </if>
  197. <if test="ipcIsdel != null" >
  198. #{ipcIsdel,jdbcType=INTEGER},
  199. </if>
  200. </trim>
  201. </insert>
  202. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPlanCause" >
  203. update inp_plan_cause
  204. <set >
  205. <if test="ipdId != null" >
  206. IPD_ID = #{ipdId,jdbcType=INTEGER},
  207. </if>
  208. <if test="patientno != null" >
  209. PatientNo = #{patientno,jdbcType=VARCHAR},
  210. </if>
  211. <if test="hiId != null" >
  212. HI_ID = #{hiId,jdbcType=INTEGER},
  213. </if>
  214. <if test="ddDepdm != null" >
  215. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  216. </if>
  217. <if test="dwWarddm != null" >
  218. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  219. </if>
  220. <if test="dbBedno != null" >
  221. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  222. </if>
  223. <if test="ipcCode != null" >
  224. IPC_Code = #{ipcCode,jdbcType=VARCHAR},
  225. </if>
  226. <if test="ipcName != null" >
  227. IPC_Name = #{ipcName,jdbcType=VARCHAR},
  228. </if>
  229. <if test="ipcStatus != null" >
  230. IPC_Status = #{ipcStatus,jdbcType=INTEGER},
  231. </if>
  232. <if test="ipcRecordor != null" >
  233. IPC_Recordor = #{ipcRecordor,jdbcType=VARCHAR},
  234. </if>
  235. <if test="ipcRecordTime != null" >
  236. IPC_Record_Time = #{ipcRecordTime,jdbcType=TIMESTAMP},
  237. </if>
  238. <if test="ipcNurseRecord != null" >
  239. IPC_Nurse_Record = #{ipcNurseRecord,jdbcType=VARCHAR},
  240. </if>
  241. <if test="ipcIsrecord != null" >
  242. IPC_IsRecord = #{ipcIsrecord,jdbcType=INTEGER},
  243. </if>
  244. <if test="ipcOperationTime != null" >
  245. IPC_Operation_Time = #{ipcOperationTime,jdbcType=TIMESTAMP},
  246. </if>
  247. <if test="ipcOperator != null" >
  248. IPC_Operator = #{ipcOperator,jdbcType=VARCHAR},
  249. </if>
  250. <if test="ipcIsdel != null" >
  251. IPC_IsDel = #{ipcIsdel,jdbcType=INTEGER},
  252. </if>
  253. </set>
  254. where IPC_ID = #{ipcId,jdbcType=INTEGER}
  255. </update>
  256. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPlanCause" >
  257. update inp_plan_cause
  258. set IPD_ID = #{ipdId,jdbcType=INTEGER},
  259. PatientNo = #{patientno,jdbcType=VARCHAR},
  260. HI_ID = #{hiId,jdbcType=INTEGER},
  261. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  262. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  263. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  264. IPC_Code = #{ipcCode,jdbcType=VARCHAR},
  265. IPC_Name = #{ipcName,jdbcType=VARCHAR},
  266. IPC_Status = #{ipcStatus,jdbcType=INTEGER},
  267. IPC_Recordor = #{ipcRecordor,jdbcType=VARCHAR},
  268. IPC_Record_Time = #{ipcRecordTime,jdbcType=TIMESTAMP},
  269. IPC_Nurse_Record = #{ipcNurseRecord,jdbcType=VARCHAR},
  270. IPC_IsRecord = #{ipcIsrecord,jdbcType=INTEGER},
  271. IPC_Operation_Time = #{ipcOperationTime,jdbcType=TIMESTAMP},
  272. IPC_Operator = #{ipcOperator,jdbcType=VARCHAR},
  273. IPC_IsDel = #{ipcIsdel,jdbcType=INTEGER}
  274. where IPC_ID = #{ipcId,jdbcType=INTEGER}
  275. </update>
  276. <update id="updateStatus" parameterType="java.lang.Integer" >
  277. update inp_plan_cause
  278. set IPC_IsDel = -1
  279. where IPC_ID = #{ipcId,jdbcType=INTEGER}
  280. </update>
  281. <update id="updateStatusIpdId" parameterType="java.lang.Integer" >
  282. update inp_plan_cause
  283. set IPC_IsDel = -1
  284. where IPD_ID = #{ipdId,jdbcType=INTEGER}
  285. </update>
  286. <update id="updateIpcStatus" parameterType="java.lang.Integer" >
  287. update inp_plan_cause
  288. set IPC_Status = 1
  289. where IPD_ID = #{ipdId,jdbcType=INTEGER}
  290. </update>
  291. </mapper>