InpPlanObjectiveMapper.xml 12 KB

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