InpComplicationMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  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.InpComplicationMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplication" >
  5. <id column="ICOM_ID" property="icomId" 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="ICOM_Measure_Time" property="icomMeasureTime" jdbcType="TIMESTAMP" />
  12. <result column="ICOM_Recordor" property="icomRecordor" jdbcType="VARCHAR" />
  13. <result column="ICOM_Record_Time" property="icomRecordTime" jdbcType="TIMESTAMP" />
  14. <result column="ICOM_Order_ID" property="icomOrderId" jdbcType="VARCHAR" />
  15. <result column="ICOM_Order_Name" property="icomOrderName" jdbcType="VARCHAR" />
  16. <result column="ICOM_Complication_Code" property="icomComplicationCode" jdbcType="VARCHAR" />
  17. <result column="ICOM_Complication" property="icomComplication" jdbcType="VARCHAR" />
  18. <result column="ICOM_IsDel" property="icomIsdel" jdbcType="INTEGER" />
  19. <result column="ICOM_Symptom" property="icomSymptom" jdbcType="VARCHAR" />
  20. <result column="ICOM_Measure" property="icomMeasure" jdbcType="VARCHAR" />
  21. <result column="ICOM_Result" property="icomResult" jdbcType="VARCHAR" />
  22. <result column="ICOM_Tool_Code" property="icomToolCode" jdbcType="VARCHAR" />
  23. <result column="ICOM_Tool" property="icomTool" jdbcType="VARCHAR" />
  24. <result column="ICOM_Part_Code" property="icomPartCode" jdbcType="VARCHAR" />
  25. <result column="ICOM_Part" property="icomPart" jdbcType="VARCHAR" />
  26. </resultMap>
  27. <sql id="Base_Column_List" >
  28. ICOM_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, ICOM_Measure_Time, ICOM_Recordor,
  29. ICOM_Record_Time, ICOM_Order_ID, ICOM_Order_Name, ICOM_Complication_Code, ICOM_Complication,
  30. ICOM_IsDel, ICOM_Symptom, ICOM_Measure, ICOM_Result, ICOM_Tool_Code, ICOM_Tool, ICOM_Part_Code,
  31. ICOM_Part
  32. </sql>
  33. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  34. select
  35. <include refid="Base_Column_List" />
  36. from inp_complication
  37. where ICOM_ID = #{icomId,jdbcType=INTEGER}
  38. and ICOM_IsDel = 0
  39. </select>
  40. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplication" useGeneratedKeys="true" keyProperty="icomId">
  41. insert into inp_complication (PatientNo, HI_ID,
  42. DD_DepDm, DW_WardDm, DB_BedNo,
  43. ICOM_Measure_Time, ICOM_Recordor, ICOM_Record_Time,
  44. ICOM_Order_ID, ICOM_Order_Name, ICOM_Complication_Code,
  45. ICOM_Complication, ICOM_IsDel, ICOM_Symptom,
  46. ICOM_Measure, ICOM_Result, ICOM_Tool_Code,
  47. ICOM_Tool, ICOM_Part_Code, ICOM_Part
  48. )
  49. values (#{patientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER},
  50. #{ddDepdm,jdbcType=VARCHAR}, #{dwWarddm,jdbcType=VARCHAR}, #{dbBedno,jdbcType=VARCHAR},
  51. #{icomMeasureTime,jdbcType=TIMESTAMP}, #{icomRecordor,jdbcType=VARCHAR}, now(),
  52. #{icomOrderId,jdbcType=VARCHAR}, #{icomOrderName,jdbcType=VARCHAR}, #{icomComplicationCode,jdbcType=VARCHAR},
  53. #{icomComplication,jdbcType=VARCHAR},0, #{icomSymptom,jdbcType=VARCHAR},
  54. #{icomMeasure,jdbcType=VARCHAR}, #{icomResult,jdbcType=VARCHAR}, #{icomToolCode,jdbcType=VARCHAR},
  55. #{icomTool,jdbcType=VARCHAR}, #{icomPartCode,jdbcType=VARCHAR}, #{icomPart,jdbcType=VARCHAR}
  56. )
  57. </insert>
  58. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplication" >
  59. insert into inp_complication
  60. <trim prefix="(" suffix=")" suffixOverrides="," >
  61. <if test="icomId != null" >
  62. ICOM_ID,
  63. </if>
  64. <if test="patientno != null" >
  65. PatientNo,
  66. </if>
  67. <if test="hiId != null" >
  68. HI_ID,
  69. </if>
  70. <if test="ddDepdm != null" >
  71. DD_DepDm,
  72. </if>
  73. <if test="dwWarddm != null" >
  74. DW_WardDm,
  75. </if>
  76. <if test="dbBedno != null" >
  77. DB_BedNo,
  78. </if>
  79. <if test="icomMeasureTime != null" >
  80. ICOM_Measure_Time,
  81. </if>
  82. <if test="icomRecordor != null" >
  83. ICOM_Recordor,
  84. </if>
  85. <if test="icomRecordTime != null" >
  86. ICOM_Record_Time,
  87. </if>
  88. <if test="icomOrderId != null" >
  89. ICOM_Order_ID,
  90. </if>
  91. <if test="icomOrderName != null" >
  92. ICOM_Order_Name,
  93. </if>
  94. <if test="icomComplicationCode != null" >
  95. ICOM_Complication_Code,
  96. </if>
  97. <if test="icomComplication != null" >
  98. ICOM_Complication,
  99. </if>
  100. <if test="icomIsdel != null" >
  101. ICOM_IsDel,
  102. </if>
  103. <if test="icomSymptom != null" >
  104. ICOM_Symptom,
  105. </if>
  106. <if test="icomMeasure != null" >
  107. ICOM_Measure,
  108. </if>
  109. <if test="icomResult != null" >
  110. ICOM_Result,
  111. </if>
  112. <if test="icomToolCode != null" >
  113. ICOM_Tool_Code,
  114. </if>
  115. <if test="icomTool != null" >
  116. ICOM_Tool,
  117. </if>
  118. <if test="icomPartCode != null" >
  119. ICOM_Part_Code,
  120. </if>
  121. <if test="icomPart != null" >
  122. ICOM_Part,
  123. </if>
  124. </trim>
  125. <trim prefix="values (" suffix=")" suffixOverrides="," >
  126. <if test="icomId != null" >
  127. #{icomId,jdbcType=INTEGER},
  128. </if>
  129. <if test="patientno != null" >
  130. #{patientno,jdbcType=VARCHAR},
  131. </if>
  132. <if test="hiId != null" >
  133. #{hiId,jdbcType=INTEGER},
  134. </if>
  135. <if test="ddDepdm != null" >
  136. #{ddDepdm,jdbcType=VARCHAR},
  137. </if>
  138. <if test="dwWarddm != null" >
  139. #{dwWarddm,jdbcType=VARCHAR},
  140. </if>
  141. <if test="dbBedno != null" >
  142. #{dbBedno,jdbcType=VARCHAR},
  143. </if>
  144. <if test="icomMeasureTime != null" >
  145. #{icomMeasureTime,jdbcType=TIMESTAMP},
  146. </if>
  147. <if test="icomRecordor != null" >
  148. #{icomRecordor,jdbcType=VARCHAR},
  149. </if>
  150. <if test="icomRecordTime != null" >
  151. #{icomRecordTime,jdbcType=TIMESTAMP},
  152. </if>
  153. <if test="icomOrderId != null" >
  154. #{icomOrderId,jdbcType=VARCHAR},
  155. </if>
  156. <if test="icomOrderName != null" >
  157. #{icomOrderName,jdbcType=VARCHAR},
  158. </if>
  159. <if test="icomComplicationCode != null" >
  160. #{icomComplicationCode,jdbcType=VARCHAR},
  161. </if>
  162. <if test="icomComplication != null" >
  163. #{icomComplication,jdbcType=VARCHAR},
  164. </if>
  165. <if test="icomIsdel != null" >
  166. #{icomIsdel,jdbcType=INTEGER},
  167. </if>
  168. <if test="icomSymptom != null" >
  169. #{icomSymptom,jdbcType=VARCHAR},
  170. </if>
  171. <if test="icomMeasure != null" >
  172. #{icomMeasure,jdbcType=VARCHAR},
  173. </if>
  174. <if test="icomResult != null" >
  175. #{icomResult,jdbcType=VARCHAR},
  176. </if>
  177. <if test="icomToolCode != null" >
  178. #{icomToolCode,jdbcType=VARCHAR},
  179. </if>
  180. <if test="icomTool != null" >
  181. #{icomTool,jdbcType=VARCHAR},
  182. </if>
  183. <if test="icomPartCode != null" >
  184. #{icomPartCode,jdbcType=VARCHAR},
  185. </if>
  186. <if test="icomPart != null" >
  187. #{icomPart,jdbcType=VARCHAR},
  188. </if>
  189. </trim>
  190. </insert>
  191. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplication" >
  192. update inp_complication
  193. <set >
  194. <if test="patientno != null" >
  195. PatientNo = #{patientno,jdbcType=VARCHAR},
  196. </if>
  197. <if test="hiId != null" >
  198. HI_ID = #{hiId,jdbcType=INTEGER},
  199. </if>
  200. <if test="ddDepdm != null" >
  201. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  202. </if>
  203. <if test="dwWarddm != null" >
  204. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  205. </if>
  206. <if test="dbBedno != null" >
  207. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  208. </if>
  209. <if test="icomMeasureTime != null" >
  210. ICOM_Measure_Time = #{icomMeasureTime,jdbcType=TIMESTAMP},
  211. </if>
  212. <if test="icomRecordor != null" >
  213. ICOM_Recordor = #{icomRecordor,jdbcType=VARCHAR},
  214. </if>
  215. <if test="icomOrderId != null" >
  216. ICOM_Order_ID = #{icomOrderId,jdbcType=VARCHAR},
  217. </if>
  218. <if test="icomOrderName != null" >
  219. ICOM_Order_Name = #{icomOrderName,jdbcType=VARCHAR},
  220. </if>
  221. <if test="icomComplicationCode != null" >
  222. ICOM_Complication_Code = #{icomComplicationCode,jdbcType=VARCHAR},
  223. </if>
  224. <if test="icomComplication != null" >
  225. ICOM_Complication = #{icomComplication,jdbcType=VARCHAR},
  226. </if>
  227. <if test="icomToolCode != null" >
  228. ICOM_Tool_Code = #{icomToolCode,jdbcType=VARCHAR},
  229. </if>
  230. <if test="icomTool != null" >
  231. ICOM_Tool = #{icomTool,jdbcType=VARCHAR},
  232. </if>
  233. <if test="icomPartCode != null" >
  234. ICOM_Part_Code = #{icomPartCode,jdbcType=VARCHAR},
  235. </if>
  236. <if test="icomPart != null" >
  237. ICOM_Part = #{icomPart,jdbcType=VARCHAR},
  238. </if>
  239. ICOM_Symptom = #{icomSymptom,jdbcType=VARCHAR},
  240. ICOM_Measure = #{icomMeasure,jdbcType=VARCHAR},
  241. ICOM_Result = #{icomResult,jdbcType=VARCHAR}
  242. </set>
  243. where ICOM_ID = #{icomId,jdbcType=INTEGER}
  244. </update>
  245. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplication" >
  246. update inp_complication
  247. set PatientNo = #{patientno,jdbcType=VARCHAR},
  248. HI_ID = #{hiId,jdbcType=INTEGER},
  249. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  250. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  251. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  252. ICOM_Measure_Time = #{icomMeasureTime,jdbcType=TIMESTAMP},
  253. ICOM_Recordor = #{icomRecordor,jdbcType=VARCHAR},
  254. ICOM_Record_Time = #{icomRecordTime,jdbcType=TIMESTAMP},
  255. ICOM_Order_ID = #{icomOrderId,jdbcType=VARCHAR},
  256. ICOM_Order_Name = #{icomOrderName,jdbcType=VARCHAR},
  257. ICOM_Complication_Code = #{icomComplicationCode,jdbcType=VARCHAR},
  258. ICOM_Complication = #{icomComplication,jdbcType=VARCHAR},
  259. ICOM_IsDel = #{icomIsdel,jdbcType=INTEGER},
  260. ICOM_Symptom = #{icomSymptom,jdbcType=VARCHAR},
  261. ICOM_Measure = #{icomMeasure,jdbcType=VARCHAR},
  262. ICOM_Result = #{icomResult,jdbcType=VARCHAR},
  263. ICOM_Tool_Code = #{icomToolCode,jdbcType=VARCHAR},
  264. ICOM_Tool = #{icomTool,jdbcType=VARCHAR},
  265. ICOM_Part_Code = #{icomPartCode,jdbcType=VARCHAR},
  266. ICOM_Part = #{icomPart,jdbcType=VARCHAR}
  267. where ICOM_ID = #{icomId,jdbcType=INTEGER}
  268. </update>
  269. <update id="delById">
  270. update inp_complication
  271. set ICOM_IsDel = -1,
  272. ICOM_Record_Time = now(),
  273. ICOM_Recordor = #{icomRecordor,jdbcType=VARCHAR}
  274. where ICOM_ID = #{icomId,jdbcType=INTEGER}
  275. </update>
  276. <resultMap id="RelationResultMap" type="com.xinxin.topro.inpnurseservice.response.ComplicationListResponse" extends="BaseResultMap">
  277. <result column="wardStr" property="wardStr" jdbcType="VARCHAR" />
  278. <collection property="measureList" ofType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplicationMeasure" >
  279. <result column="ICM_Name" property="icmName" jdbcType="VARCHAR" />
  280. </collection>
  281. <collection property="resultList" ofType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplicationResult" >
  282. <result column="ICR_Name" property="icrName" jdbcType="VARCHAR" />
  283. </collection>
  284. <collection property="symptomList" ofType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplicationSymptom" >
  285. <result column="ICS_Name" property="icsName" jdbcType="VARCHAR" />
  286. </collection>
  287. </resultMap>
  288. <select id="selectRelationListByPatient" resultMap="RelationResultMap">
  289. select
  290. ic.*,
  291. (select dw.DW_WardName from dic_ward dw where dw.DW_WardDm = ic.DW_WardDm and ic.HI_ID = dw.HI_ID and dw.DW_IsDel = 0) wardStr,
  292. icm.ICM_Name,
  293. icr.ICR_Name,
  294. ics.ICS_Name
  295. from inp_complication ic
  296. left join inp_complication_measure icm on ic.ICOM_ID = icm.ICOM_ID and icm.ICM_IsDel = 0
  297. left join inp_complication_result icr on ic.ICOM_ID = icr.ICOM_ID and icr.ICR_IsDel = 0
  298. left join inp_complication_symptom ics on ic.ICOM_ID = ics.ICOM_ID and ics.ICS_IsDel = 0
  299. where ic.HI_ID = #{hiId,jdbcType=INTEGER}
  300. and ic.PatientNo = #{patientNo,jdbcType=VARCHAR}
  301. and ic.ICOM_IsDel = 0
  302. order by ic.ICOM_Record_Time,ic.ICOM_ID
  303. </select>
  304. </mapper>