InpSkinTestResultMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  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.InpSkinTestResultMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSkinTestResult" >
  5. <id column="PST_ID" property="pstId" 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="PST_Recordor" property="pstRecordor" jdbcType="VARCHAR" />
  12. <result column="PST_Record_Time" property="pstRecordTime" jdbcType="TIMESTAMP" />
  13. <result column="PST_IsDel" property="pstIsdel" jdbcType="INTEGER" />
  14. <result column="PST_AdviceCode" property="pstAdvicecode" jdbcType="VARCHAR" />
  15. <result column="PST_BarCode" property="pstBarcode" jdbcType="VARCHAR" />
  16. <result column="PST_State" property="pstState" jdbcType="INTEGER" />
  17. <result column="PST_Result" property="pstResult" jdbcType="VARCHAR" />
  18. <result column="PST_Start_Time" property="pstStartTime" jdbcType="TIMESTAMP" />
  19. <result column="PST_End_Time" property="pstEndTime" jdbcType="TIMESTAMP" />
  20. <result column="PST_SK_Name" property="pstSkName" jdbcType="VARCHAR" />
  21. <result column="PST_Broad_Category" property="pstBroadCategory" jdbcType="VARCHAR" />
  22. <result column="PST_Micro_Category" property="pstMicroCategory" jdbcType="VARCHAR" />
  23. <result column="PST_Gatherer" property="pstGatherer" jdbcType="VARCHAR" />
  24. <result column="PST_gather_Time" property="pstGatherTime" jdbcType="TIMESTAMP" />
  25. <result column="PST_Option" property="pstOption" jdbcType="VARCHAR" />
  26. <result column="PST_Checker" property="pstChecker" jdbcType="VARCHAR" />
  27. <result column="PST_Check_Time" property="pstCheckTime" jdbcType="TIMESTAMP" />
  28. </resultMap>
  29. <sql id="Base_Column_List" >
  30. PST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, PST_Recordor, PST_Record_Time,
  31. PST_IsDel, PST_AdviceCode, PST_BarCode, PST_State, PST_Result, PST_Start_Time, PST_End_Time,
  32. PST_SK_Name, PST_Broad_Category, PST_Micro_Category, PST_Gatherer, PST_gather_Time,PST_Option,PST_Checker,PST_Check_Time
  33. </sql>
  34. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  35. select
  36. <include refid="Base_Column_List" />
  37. from pda_skin_test
  38. where PST_ID = #{pstId,jdbcType=INTEGER}
  39. </select>
  40. <select id="selectByBarCode" resultMap="BaseResultMap" parameterType="java.lang.String" >
  41. select
  42. <include refid="Base_Column_List" />
  43. from pda_skin_test
  44. where PST_State = 0 AND PST_IsDel = 0 AND PST_BarCode = #{pstBarcode,jdbcType=VARCHAR}
  45. </select>
  46. <select id="selectByPatientNo" resultMap="BaseResultMap" parameterType="java.lang.String" >
  47. select
  48. <include refid="Base_Column_List" />
  49. from pda_skin_test
  50. where PST_State = 0 AND PST_IsDel = 0 AND PatientNo = #{patientNo,jdbcType=INTEGER}
  51. </select>
  52. <select id="selectByUserID" resultMap="BaseResultMap" parameterType="java.lang.String" >
  53. select
  54. <include refid="Base_Column_List" />
  55. from pda_skin_test
  56. where PST_State = 0 AND PST_IsDel = 0 AND PST_Gatherer = #{userID,jdbcType=VARCHAR}
  57. </select>
  58. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  59. delete from pda_skin_test
  60. where PST_ID = #{pstId,jdbcType=INTEGER}
  61. </delete>
  62. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmapper.InpSkinTestResultMapper" >
  63. insert into pda_skin_test (PST_ID, PatientNo, HI_ID,
  64. DD_DepDm, DW_WardDm, DB_BedNo,
  65. PST_Recordor, PST_Record_Time, PST_IsDel,
  66. PST_AdviceCode, PST_BarCode, PST_State,
  67. PST_Result, PST_Start_Time, PST_End_Time,
  68. PST_SK_Name, PST_Broad_Category, PST_Micro_Category,
  69. PST_Gatherer, PST_gather_Time,PST_Option,PST_Checker,PST_Check_Time)
  70. values (#{pstId,jdbcType=INTEGER}, #{patientno,jdbcType=INTEGER}, #{hiId,jdbcType=INTEGER},
  71. #{ddDepdm,jdbcType=VARCHAR}, #{dwWarddm,jdbcType=VARCHAR}, #{dbBedno,jdbcType=VARCHAR},
  72. #{pstRecordor,jdbcType=VARCHAR}, #{pstRecordTime,jdbcType=TIMESTAMP}, #{pstIsdel,jdbcType=INTEGER},
  73. #{pstAdvicecode,jdbcType=VARCHAR}, #{pstBarcode,jdbcType=VARCHAR}, #{pstState,jdbcType=INTEGER},
  74. #{pstResult,jdbcType=VARCHAR}, #{pstStartTime,jdbcType=TIMESTAMP}, #{pstEndTime,jdbcType=TIMESTAMP},
  75. #{pstSkName,jdbcType=VARCHAR}, #{pstBroadCategory,jdbcType=VARCHAR}, #{pstMicroCategory,jdbcType=VARCHAR},
  76. #{pstGatherer,jdbcType=VARCHAR}, #{pstGatherTime,jdbcType=TIMESTAMP},
  77. #{pstOption,jdbcType=VARCHAR}, #{pstChecker,jdbcType=VARCHAR}, #{pstCheckTime,jdbcType=TIMESTAMP})
  78. </insert>
  79. <insert id="insertCollectList" parameterType="java.util.List" >
  80. insert into pda_skin_test (PST_ID, PatientNo, HI_ID,
  81. DD_DepDm, DW_WardDm, DB_BedNo,
  82. PST_Recordor, PST_Record_Time, PST_IsDel,
  83. PST_AdviceCode, PST_BarCode, PST_State,
  84. PST_Result, PST_Start_Time, PST_End_Time,
  85. PST_SK_Name, PST_Broad_Category, PST_Micro_Category,
  86. PST_Gatherer, PST_gather_Time,PST_Option,PST_Checker,PST_Check_Time)
  87. values <foreach collection="list" item="item" index="index" separator=",">
  88. (#{item.pstId,jdbcType=INTEGER}, #{item.patientno,jdbcType=INTEGER}, #{item.hiId,jdbcType=INTEGER},
  89. #{item.ddDepdm,jdbcType=VARCHAR}, #{item.dwWarddm,jdbcType=VARCHAR}, #{item.dbBedno,jdbcType=VARCHAR},
  90. #{item.pstRecordor,jdbcType=VARCHAR}, #{item.pstRecordTime,jdbcType=TIMESTAMP}, #{item.pstIsdel,jdbcType=INTEGER},
  91. #{item.pstAdvicecode,jdbcType=VARCHAR}, #{item.pstBarcode,jdbcType=VARCHAR}, #{item.pstState,jdbcType=INTEGER},
  92. #{item.pstResult,jdbcType=VARCHAR}, #{item.pstStartTime,jdbcType=TIMESTAMP}, #{item.pstEndTime,jdbcType=TIMESTAMP},
  93. #{item.pstSkName,jdbcType=VARCHAR}, #{item.pstBroadCategory,jdbcType=VARCHAR}, #{item.pstMicroCategory,jdbcType=VARCHAR},
  94. #{item.pstGatherer,jdbcType=VARCHAR}, #{item.pstGatherTime,jdbcType=TIMESTAMP},
  95. #{item.pstOption,jdbcType=VARCHAR}, #{item.pstChecker,jdbcType=VARCHAR}, #{item.pstCheckTime,jdbcType=TIMESTAMP})
  96. </foreach>
  97. </insert>
  98. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmapper.InpSkinTestResultMapper" >
  99. insert into pda_skin_test
  100. <trim prefix="(" suffix=")" suffixOverrides="," >
  101. <if test="pstId != null" >
  102. PST_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="pstRecordor != null" >
  120. PST_Recordor,
  121. </if>
  122. <if test="pstRecordTime != null" >
  123. PST_Record_Time,
  124. </if>
  125. <if test="pstIsdel != null" >
  126. PST_IsDel,
  127. </if>
  128. <if test="pstAdvicecode != null" >
  129. PST_AdviceCode,
  130. </if>
  131. <if test="pstBarcode != null" >
  132. PST_BarCode,
  133. </if>
  134. <if test="pstState != null" >
  135. PST_State,
  136. </if>
  137. <if test="pstResult != null" >
  138. PST_Result,
  139. </if>
  140. <if test="pstStartTime != null" >
  141. PST_Start_Time,
  142. </if>
  143. <if test="pstEndTime != null" >
  144. PST_End_Time,
  145. </if>
  146. <if test="pstSkName != null" >
  147. PST_SK_Name,
  148. </if>
  149. <if test="pstBroadCategory != null" >
  150. PST_Broad_Category,
  151. </if>
  152. <if test="pstMicroCategory != null" >
  153. PST_Micro_Category,
  154. </if>
  155. <if test="pstGatherer != null" >
  156. PST_Gatherer,
  157. </if>
  158. <if test="pstGatherTime != null" >
  159. PST_gather_Time,
  160. </if>
  161. <if test="pstOption != null" >
  162. PST_Option,
  163. </if>
  164. <if test="pstChecker != null" >
  165. PST_Checker,
  166. </if>
  167. <if test="pstCheckTime != null" >
  168. PST_Check_Time,
  169. </if>
  170. </trim>
  171. <trim prefix="values (" suffix=")" suffixOverrides="," >
  172. <if test="pstId != null" >
  173. #{pstId,jdbcType=INTEGER},
  174. </if>
  175. <if test="patientno != null" >
  176. #{patientno,jdbcType=INTEGER},
  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="pstRecordor != null" >
  191. #{pstRecordor,jdbcType=VARCHAR},
  192. </if>
  193. <if test="pstRecordTime != null" >
  194. #{pstRecordTime,jdbcType=TIMESTAMP},
  195. </if>
  196. <if test="pstIsdel != null" >
  197. #{pstIsdel,jdbcType=INTEGER},
  198. </if>
  199. <if test="pstAdvicecode != null" >
  200. #{pstAdvicecode,jdbcType=VARCHAR},
  201. </if>
  202. <if test="pstBarcode != null" >
  203. #{pstBarcode,jdbcType=VARCHAR},
  204. </if>
  205. <if test="pstState != null" >
  206. #{pstState,jdbcType=INTEGER},
  207. </if>
  208. <if test="pstResult != null" >
  209. #{pstResult,jdbcType=VARCHAR},
  210. </if>
  211. <if test="pstStartTime != null" >
  212. #{pstStartTime,jdbcType=TIMESTAMP},
  213. </if>
  214. <if test="pstEndTime != null" >
  215. #{pstEndTime,jdbcType=TIMESTAMP},
  216. </if>
  217. <if test="pstSkName != null" >
  218. #{pstSkName,jdbcType=VARCHAR},
  219. </if>
  220. <if test="pstBroadCategory != null" >
  221. #{pstBroadCategory,jdbcType=VARCHAR},
  222. </if>
  223. <if test="pstMicroCategory != null" >
  224. #{pstMicroCategory,jdbcType=VARCHAR},
  225. </if>
  226. <if test="pstGatherer != null" >
  227. #{pstGatherer,jdbcType=VARCHAR},
  228. </if>
  229. <if test="pstGatherTime != null" >
  230. #{pstGatherTime,jdbcType=TIMESTAMP},
  231. </if>
  232. <if test="pstOption != null" >
  233. #{PST_Option,jdbcType=VARCHAR},
  234. </if>
  235. <if test="pstChecker != null" >
  236. #{PST_Checker,jdbcType=VARCHAR},
  237. </if>
  238. <if test="pstCheckTime != null" >
  239. #{PST_Check_Time,jdbcType=TIMESTAMP},
  240. </if>
  241. </trim>
  242. </insert>
  243. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmapper.InpSkinTestResultMapper" >
  244. update pda_skin_test
  245. <set >
  246. <if test="patientno != null" >
  247. PatientNo = #{patientno,jdbcType=INTEGER},
  248. </if>
  249. <if test="hiId != null" >
  250. HI_ID = #{hiId,jdbcType=INTEGER},
  251. </if>
  252. <if test="ddDepdm != null" >
  253. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  254. </if>
  255. <if test="dwWarddm != null" >
  256. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  257. </if>
  258. <if test="dbBedno != null" >
  259. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  260. </if>
  261. <if test="pstRecordor != null" >
  262. PST_Recordor = #{pstRecordor,jdbcType=VARCHAR},
  263. </if>
  264. <if test="pstRecordTime != null" >
  265. PST_Record_Time = #{pstRecordTime,jdbcType=TIMESTAMP},
  266. </if>
  267. <if test="pstIsdel != null" >
  268. PST_IsDel = #{pstIsdel,jdbcType=INTEGER},
  269. </if>
  270. <if test="pstAdvicecode != null" >
  271. PST_AdviceCode = #{pstAdvicecode,jdbcType=VARCHAR},
  272. </if>
  273. <if test="pstBarcode != null" >
  274. PST_BarCode = #{pstBarcode,jdbcType=VARCHAR},
  275. </if>
  276. <if test="pstState != null" >
  277. PST_State = #{pstState,jdbcType=INTEGER},
  278. </if>
  279. <if test="pstResult != null" >
  280. PST_Result = #{pstResult,jdbcType=VARCHAR},
  281. </if>
  282. <if test="pstStartTime != null" >
  283. PST_Start_Time = #{pstStartTime,jdbcType=TIMESTAMP},
  284. </if>
  285. <if test="pstEndTime != null" >
  286. PST_End_Time = #{pstEndTime,jdbcType=TIMESTAMP},
  287. </if>
  288. <if test="pstSkName != null" >
  289. PST_SK_Name = #{pstSkName,jdbcType=VARCHAR},
  290. </if>
  291. <if test="pstBroadCategory != null" >
  292. PST_Broad_Category = #{pstBroadCategory,jdbcType=VARCHAR},
  293. </if>
  294. <if test="pstMicroCategory != null" >
  295. PST_Micro_Category = #{pstMicroCategory,jdbcType=VARCHAR},
  296. </if>
  297. <if test="pstGatherer != null" >
  298. PST_Gatherer = #{pstGatherer,jdbcType=VARCHAR},
  299. </if>
  300. <if test="pstGatherTime != null" >
  301. PST_gather_Time = #{pstGatherTime,jdbcType=TIMESTAMP},
  302. </if>
  303. <if test="pstOption != null" >
  304. PST_Option = #{pstOption,jdbcType=VARCHAR},
  305. </if>
  306. <if test="pstChecker != null" >
  307. PST_Checker = #{pstChecker,jdbcType=VARCHAR},
  308. </if>
  309. <if test="pstCheckTime != null" >
  310. PST_Check_Time = #{pstCheckTime,jdbcType=TIMESTAMP},
  311. </if>
  312. </set>
  313. where PST_ID = #{pstId,jdbcType=INTEGER}
  314. </update>
  315. <select id="selectBySelective" resultMap="BaseResultMap" parameterType="java.lang.String" >
  316. select a.*,b.bedNo,b.chartNo,b.dose,b.doseUnit,b.wayName,b.usage,b.orderTime,b.OrderUserName,b.ptName patinetName,b.itemName
  317. from pda_skin_test a
  318. INNER JOIN inp_patient c on a.PatientNo = c.IP_PatientNo
  319. LEFT JOIN v_expand_order b on a.PST_AdviceCode = b.RecordId
  320. where a.PST_IsDel = 0
  321. AND a.DW_WardDm = #{departNo} and a.PST_Start_Time &gt;= #{execSTime} and a.PST_Start_Time &lt;= #{execETime}
  322. <if test='beds!=null'> and c.DB_BedNo in <foreach item='item' index='index' collection='beds' open='(' separator=',' close=')'> #{item} </foreach></if>
  323. and c.IP_Status = #{inHospitalStatus}
  324. </select>
  325. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmapper.InpSkinTestResultMapper" >
  326. update pda_skin_test
  327. set PatientNo = #{patientno,jdbcType=INTEGER},
  328. HI_ID = #{hiId,jdbcType=INTEGER},
  329. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  330. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  331. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  332. PST_Recordor = #{pstRecordor,jdbcType=VARCHAR},
  333. PST_Record_Time = #{pstRecordTime,jdbcType=TIMESTAMP},
  334. PST_IsDel = #{pstIsdel,jdbcType=INTEGER},
  335. PST_AdviceCode = #{pstAdvicecode,jdbcType=VARCHAR},
  336. PST_BarCode = #{pstBarcode,jdbcType=VARCHAR},
  337. PST_State = #{pstState,jdbcType=INTEGER},
  338. PST_Result = #{pstResult,jdbcType=VARCHAR},
  339. PST_Start_Time = #{pstStartTime,jdbcType=TIMESTAMP},
  340. PST_End_Time = #{pstEndTime,jdbcType=TIMESTAMP},
  341. PST_SK_Name = #{pstSkName,jdbcType=VARCHAR},
  342. PST_Broad_Category = #{pstBroadCategory,jdbcType=VARCHAR},
  343. PST_Micro_Category = #{pstMicroCategory,jdbcType=VARCHAR},
  344. PST_Gatherer = #{pstGatherer,jdbcType=VARCHAR},
  345. PST_gather_Time = #{pstGatherTime,jdbcType=TIMESTAMP},
  346. PST_Option = #{pstOption,jdbcType=VARCHAR},
  347. PST_Checker = #{pstChecker,jdbcType=VARCHAR},
  348. PST_Check_Time = #{pstCheckTime,jdbcType=TIMESTAMP}
  349. where PST_ID = #{pstId,jdbcType=INTEGER}
  350. </update>
  351. <update id="batchUpdate" parameterType="java.util.List" >
  352. <foreach collection="list" item="item" index="index" open="" close="" separator=";">
  353. update pda_skin_test
  354. set PST_State = 1,
  355. PST_Recordor = #{item.pstRecordor,jdbcType=VARCHAR},
  356. PST_Record_Time = #{item.pstRecordTime,jdbcType=TIMESTAMP},
  357. PST_Result = #{item.pstResult,jdbcType=VARCHAR},
  358. PST_Option = #{item.pstOption,jdbcType=VARCHAR},
  359. PST_Checker = #{item.pstChecker,jdbcType=VARCHAR},
  360. PST_Check_Time = #{item.pstCheckTime,jdbcType=TIMESTAMP}
  361. where PST_ID = #{item.pstId,jdbcType=INTEGER}
  362. </foreach>
  363. </update>
  364. </mapper>