PdaTransfusionMapper.xml 14 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.PdaTransfusionMapper">
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.PdaTransfusion">
  5. <id column="PT_ID" jdbcType="INTEGER" property="ptId" />
  6. <result column="PT_PatientNo" jdbcType="VARCHAR" property="ptPatientno" />
  7. <result column="HI_ID" jdbcType="INTEGER" property="hiId" />
  8. <result column="DD_DepDm" jdbcType="VARCHAR" property="ddDepdm" />
  9. <result column="DW_WardDm" jdbcType="VARCHAR" property="dwWarddm" />
  10. <result column="DB_BedNo" jdbcType="VARCHAR" property="dbBedno" />
  11. <result column="PT_Operator" jdbcType="VARCHAR" property="ptOperator" />
  12. <result column="PT_OperateTime" jdbcType="TIMESTAMP" property="ptOperatetime" />
  13. <result column="PT_CheckMan" jdbcType="VARCHAR" property="ptCheckman" />
  14. <result column="PT_CheckTime" jdbcType="TIMESTAMP" property="ptChecktime" />
  15. <result column="PT_Executor" jdbcType="VARCHAR" property="ptExecutor" />
  16. <result column="PT_ExecuteTime" jdbcType="TIMESTAMP" property="ptExecutetime" />
  17. <result column="PT_BarCode" jdbcType="VARCHAR" property="ptBarcode" />
  18. <result column="PT_AdviceCode" jdbcType="VARCHAR" property="ptAdvicecode" />
  19. <result column="PT_Status" jdbcType="INTEGER" property="ptStatus" />
  20. <result column="PT_IsDel" jdbcType="INTEGER" property="ptIsdel" />
  21. <result column="PT_Version" jdbcType="INTEGER" property="ptVersion" />
  22. <result column="PT_Exception_Code" jdbcType="VARCHAR" property="ptExceptionCode" />
  23. <result column="PT_Exception" jdbcType="VARCHAR" property="ptException" />
  24. <result column="PT_Exception_Code2" jdbcType="VARCHAR" property="ptExceptionCode2" />
  25. <result column="PT_Exception2" jdbcType="VARCHAR" property="ptException2" />
  26. <result column="PT_Measure" jdbcType="VARCHAR" property="ptMeasure" />
  27. <result column="PT_Dose" jdbcType="DOUBLE" property="ptDose" />
  28. <result column="PT_DoseUnit" jdbcType="VARCHAR" property="ptDoseunit" />
  29. <result column="PT_Name" jdbcType="VARCHAR" property="ptName" />
  30. <result column="PT_Remark" jdbcType="VARCHAR" property="ptRemark" />
  31. <result column="chartNo" jdbcType="VARCHAR" property="chartNo" />
  32. <result column="patinetName" jdbcType="VARCHAR" property="patinetName" />
  33. </resultMap>
  34. <sql id="Base_Column_List">
  35. PT_ID, PT_PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, PT_Operator, PT_OperateTime,
  36. PT_CheckMan, PT_CheckTime, PT_Executor, PT_ExecuteTime, PT_BarCode, PT_AdviceCode,
  37. PT_Status, PT_IsDel, PT_Version, PT_Exception_Code, PT_Exception, PT_Exception_Code2,
  38. PT_Exception2, PT_Measure, PT_Dose, PT_DoseUnit, PT_Name, PT_Remark
  39. </sql>
  40. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  41. select
  42. <include refid="Base_Column_List" />
  43. from pda_transfusion
  44. where PT_IsDel = 0 and PT_ID = #{ptId,jdbcType=INTEGER}
  45. </select>
  46. <select id="selectByBarCode" resultMap="BaseResultMap" >
  47. select
  48. <include refid="Base_Column_List" />
  49. from pda_transfusion
  50. where PT_BarCode = #{barCode,jdbcType=VARCHAR} AND PT_IsDel = 0 and PT_Version = 1 limit 1
  51. </select>
  52. <select id="selectBySelective" resultMap="BaseResultMap" parameterType="java.lang.String" >
  53. select a.*,c.IP_Med_Rec chartNo, c.IP_Name patinetName
  54. from pda_transfusion a
  55. INNER JOIN inp_patient c on a.PT_PatientNo = c.IP_PatientNo
  56. where a.PT_IsDel = 0
  57. AND a.DW_WardDm = #{departNo} and a.PT_ExecuteTime &gt;= #{execSTime} and a.PT_ExecuteTime &lt;= #{execETime}
  58. <if test='beds!=null'> and DB_BedNo in <foreach item='item' index='index' collection='beds' open='(' separator=',' close=')'> #{item} </foreach></if>
  59. and c.IP_Status = #{inHospitalStatus}
  60. </select>
  61. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  62. delete from pda_transfusion
  63. where PT_ID = #{ptId,jdbcType=INTEGER}
  64. </delete>
  65. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.PdaTransfusion">
  66. insert into pda_transfusion (PT_ID, PT_PatientNo, HI_ID,
  67. DD_DepDm, DW_WardDm, DB_BedNo,
  68. PT_Operator, PT_OperateTime, PT_CheckMan,
  69. PT_CheckTime, PT_Executor, PT_ExecuteTime,
  70. PT_BarCode, PT_AdviceCode, PT_Status,
  71. PT_IsDel, PT_Version, PT_Exception_Code,
  72. PT_Exception, PT_Exception_Code2, PT_Exception2,
  73. PT_Measure, PT_Dose, PT_DoseUnit,
  74. PT_Name, PT_Remark)
  75. values (#{ptId,jdbcType=INTEGER}, #{ptPatientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER},
  76. #{ddDepdm,jdbcType=VARCHAR}, #{dwWarddm,jdbcType=VARCHAR}, #{dbBedno,jdbcType=VARCHAR},
  77. #{ptOperator,jdbcType=VARCHAR}, #{ptOperatetime,jdbcType=TIMESTAMP}, #{ptCheckman,jdbcType=VARCHAR},
  78. #{ptChecktime,jdbcType=TIMESTAMP}, #{ptExecutor,jdbcType=VARCHAR}, #{ptExecutetime,jdbcType=TIMESTAMP},
  79. #{ptBarcode,jdbcType=VARCHAR}, #{ptAdvicecode,jdbcType=VARCHAR}, #{ptStatus,jdbcType=INTEGER},
  80. #{ptIsdel,jdbcType=INTEGER}, #{ptVersion,jdbcType=INTEGER}, #{ptExceptionCode,jdbcType=VARCHAR},
  81. #{ptException,jdbcType=VARCHAR}, #{ptExceptionCode2,jdbcType=VARCHAR}, #{ptException2,jdbcType=VARCHAR},
  82. #{ptMeasure,jdbcType=VARCHAR}, #{ptDose,jdbcType=DOUBLE}, #{ptDoseunit,jdbcType=VARCHAR},
  83. #{ptName,jdbcType=VARCHAR}, #{ptRemark,jdbcType=VARCHAR})
  84. </insert>
  85. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.PdaTransfusion">
  86. insert into pda_transfusion
  87. <trim prefix="(" suffix=")" suffixOverrides=",">
  88. <if test="ptId != null">
  89. PT_ID,
  90. </if>
  91. <if test="ptPatientno != null">
  92. PT_PatientNo,
  93. </if>
  94. <if test="hiId != null">
  95. HI_ID,
  96. </if>
  97. <if test="ddDepdm != null">
  98. DD_DepDm,
  99. </if>
  100. <if test="dwWarddm != null">
  101. DW_WardDm,
  102. </if>
  103. <if test="dbBedno != null">
  104. DB_BedNo,
  105. </if>
  106. <if test="ptOperator != null">
  107. PT_Operator,
  108. </if>
  109. <if test="ptOperatetime != null">
  110. PT_OperateTime,
  111. </if>
  112. <if test="ptCheckman != null">
  113. PT_CheckMan,
  114. </if>
  115. <if test="ptChecktime != null">
  116. PT_CheckTime,
  117. </if>
  118. <if test="ptExecutor != null">
  119. PT_Executor,
  120. </if>
  121. <if test="ptExecutetime != null">
  122. PT_ExecuteTime,
  123. </if>
  124. <if test="ptBarcode != null">
  125. PT_BarCode,
  126. </if>
  127. <if test="ptAdvicecode != null">
  128. PT_AdviceCode,
  129. </if>
  130. <if test="ptStatus != null">
  131. PT_Status,
  132. </if>
  133. <if test="ptIsdel != null">
  134. PT_IsDel,
  135. </if>
  136. <if test="ptVersion != null">
  137. PT_Version,
  138. </if>
  139. <if test="ptExceptionCode != null">
  140. PT_Exception_Code,
  141. </if>
  142. <if test="ptException != null">
  143. PT_Exception,
  144. </if>
  145. <if test="ptExceptionCode2 != null">
  146. PT_Exception_Code2,
  147. </if>
  148. <if test="ptException2 != null">
  149. PT_Exception2,
  150. </if>
  151. <if test="ptMeasure != null">
  152. PT_Measure,
  153. </if>
  154. <if test="ptDose != null">
  155. PT_Dose,
  156. </if>
  157. <if test="ptDoseunit != null">
  158. PT_DoseUnit,
  159. </if>
  160. <if test="ptName != null">
  161. PT_Name,
  162. </if>
  163. <if test="ptRemark != null">
  164. PT_Remark,
  165. </if>
  166. </trim>
  167. <trim prefix="values (" suffix=")" suffixOverrides=",">
  168. <if test="ptId != null">
  169. #{ptId,jdbcType=INTEGER},
  170. </if>
  171. <if test="ptPatientno != null">
  172. #{ptPatientno,jdbcType=VARCHAR},
  173. </if>
  174. <if test="hiId != null">
  175. #{hiId,jdbcType=INTEGER},
  176. </if>
  177. <if test="ddDepdm != null">
  178. #{ddDepdm,jdbcType=VARCHAR},
  179. </if>
  180. <if test="dwWarddm != null">
  181. #{dwWarddm,jdbcType=VARCHAR},
  182. </if>
  183. <if test="dbBedno != null">
  184. #{dbBedno,jdbcType=VARCHAR},
  185. </if>
  186. <if test="ptOperator != null">
  187. #{ptOperator,jdbcType=VARCHAR},
  188. </if>
  189. <if test="ptOperatetime != null">
  190. #{ptOperatetime,jdbcType=TIMESTAMP},
  191. </if>
  192. <if test="ptCheckman != null">
  193. #{ptCheckman,jdbcType=VARCHAR},
  194. </if>
  195. <if test="ptChecktime != null">
  196. #{ptChecktime,jdbcType=TIMESTAMP},
  197. </if>
  198. <if test="ptExecutor != null">
  199. #{ptExecutor,jdbcType=VARCHAR},
  200. </if>
  201. <if test="ptExecutetime != null">
  202. #{ptExecutetime,jdbcType=TIMESTAMP},
  203. </if>
  204. <if test="ptBarcode != null">
  205. #{ptBarcode,jdbcType=VARCHAR},
  206. </if>
  207. <if test="ptAdvicecode != null">
  208. #{ptAdvicecode,jdbcType=VARCHAR},
  209. </if>
  210. <if test="ptStatus != null">
  211. #{ptStatus,jdbcType=INTEGER},
  212. </if>
  213. <if test="ptIsdel != null">
  214. #{ptIsdel,jdbcType=INTEGER},
  215. </if>
  216. <if test="ptVersion != null">
  217. #{ptVersion,jdbcType=INTEGER},
  218. </if>
  219. <if test="ptExceptionCode != null">
  220. #{ptExceptionCode,jdbcType=VARCHAR},
  221. </if>
  222. <if test="ptException != null">
  223. #{ptException,jdbcType=VARCHAR},
  224. </if>
  225. <if test="ptExceptionCode2 != null">
  226. #{ptExceptionCode2,jdbcType=VARCHAR},
  227. </if>
  228. <if test="ptException2 != null">
  229. #{ptException2,jdbcType=VARCHAR},
  230. </if>
  231. <if test="ptMeasure != null">
  232. #{ptMeasure,jdbcType=VARCHAR},
  233. </if>
  234. <if test="ptDose != null">
  235. #{ptDose,jdbcType=DOUBLE},
  236. </if>
  237. <if test="ptDoseunit != null">
  238. #{ptDoseunit,jdbcType=VARCHAR},
  239. </if>
  240. <if test="ptName != null">
  241. #{ptName,jdbcType=VARCHAR},
  242. </if>
  243. <if test="ptRemark != null">
  244. #{ptRemark,jdbcType=VARCHAR},
  245. </if>
  246. </trim>
  247. </insert>
  248. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.PdaTransfusion">
  249. update pda_transfusion
  250. <set>
  251. <if test="ptPatientno != null">
  252. PT_PatientNo = #{ptPatientno,jdbcType=VARCHAR},
  253. </if>
  254. <if test="hiId != null">
  255. HI_ID = #{hiId,jdbcType=INTEGER},
  256. </if>
  257. <if test="ddDepdm != null">
  258. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  259. </if>
  260. <if test="dwWarddm != null">
  261. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  262. </if>
  263. <if test="dbBedno != null">
  264. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  265. </if>
  266. <if test="ptOperator != null">
  267. PT_Operator = #{ptOperator,jdbcType=VARCHAR},
  268. </if>
  269. <if test="ptOperatetime != null">
  270. PT_OperateTime = #{ptOperatetime,jdbcType=TIMESTAMP},
  271. </if>
  272. <if test="ptCheckman != null">
  273. PT_CheckMan = #{ptCheckman,jdbcType=VARCHAR},
  274. </if>
  275. <if test="ptChecktime != null">
  276. PT_CheckTime = #{ptChecktime,jdbcType=TIMESTAMP},
  277. </if>
  278. <if test="ptExecutor != null">
  279. PT_Executor = #{ptExecutor,jdbcType=VARCHAR},
  280. </if>
  281. <if test="ptExecutetime != null">
  282. PT_ExecuteTime = #{ptExecutetime,jdbcType=TIMESTAMP},
  283. </if>
  284. <if test="ptBarcode != null">
  285. PT_BarCode = #{ptBarcode,jdbcType=VARCHAR},
  286. </if>
  287. <if test="ptAdvicecode != null">
  288. PT_AdviceCode = #{ptAdvicecode,jdbcType=VARCHAR},
  289. </if>
  290. <if test="ptStatus != null">
  291. PT_Status = #{ptStatus,jdbcType=INTEGER},
  292. </if>
  293. <if test="ptIsdel != null">
  294. PT_IsDel = #{ptIsdel,jdbcType=INTEGER},
  295. </if>
  296. <if test="ptVersion != null">
  297. PT_Version = #{ptVersion,jdbcType=INTEGER},
  298. </if>
  299. <if test="ptExceptionCode != null">
  300. PT_Exception_Code = #{ptExceptionCode,jdbcType=VARCHAR},
  301. </if>
  302. <if test="ptException != null">
  303. PT_Exception = #{ptException,jdbcType=VARCHAR},
  304. </if>
  305. <if test="ptExceptionCode2 != null">
  306. PT_Exception_Code2 = #{ptExceptionCode2,jdbcType=VARCHAR},
  307. </if>
  308. <if test="ptException2 != null">
  309. PT_Exception2 = #{ptException2,jdbcType=VARCHAR},
  310. </if>
  311. <if test="ptMeasure != null">
  312. PT_Measure = #{ptMeasure,jdbcType=VARCHAR},
  313. </if>
  314. <if test="ptDose != null">
  315. PT_Dose = #{ptDose,jdbcType=DOUBLE},
  316. </if>
  317. <if test="ptDoseunit != null">
  318. PT_DoseUnit = #{ptDoseunit,jdbcType=VARCHAR},
  319. </if>
  320. <if test="ptName != null">
  321. PT_Name = #{ptName,jdbcType=VARCHAR},
  322. </if>
  323. <if test="ptRemark != null">
  324. PT_Remark = #{ptRemark,jdbcType=VARCHAR},
  325. </if>
  326. </set>
  327. where PT_ID = #{ptId,jdbcType=INTEGER}
  328. </update>
  329. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.PdaTransfusion">
  330. update pda_transfusion
  331. set PT_PatientNo = #{ptPatientno,jdbcType=VARCHAR},
  332. HI_ID = #{hiId,jdbcType=INTEGER},
  333. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  334. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  335. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  336. PT_Operator = #{ptOperator,jdbcType=VARCHAR},
  337. PT_OperateTime = #{ptOperatetime,jdbcType=TIMESTAMP},
  338. PT_CheckMan = #{ptCheckman,jdbcType=VARCHAR},
  339. PT_CheckTime = #{ptChecktime,jdbcType=TIMESTAMP},
  340. PT_Executor = #{ptExecutor,jdbcType=VARCHAR},
  341. PT_ExecuteTime = #{ptExecutetime,jdbcType=TIMESTAMP},
  342. PT_BarCode = #{ptBarcode,jdbcType=VARCHAR},
  343. PT_AdviceCode = #{ptAdvicecode,jdbcType=VARCHAR},
  344. PT_Status = #{ptStatus,jdbcType=INTEGER},
  345. PT_IsDel = #{ptIsdel,jdbcType=INTEGER},
  346. PT_Version = #{ptVersion,jdbcType=INTEGER},
  347. PT_Exception_Code = #{ptExceptionCode,jdbcType=VARCHAR},
  348. PT_Exception = #{ptException,jdbcType=VARCHAR},
  349. PT_Exception_Code2 = #{ptExceptionCode2,jdbcType=VARCHAR},
  350. PT_Exception2 = #{ptException2,jdbcType=VARCHAR},
  351. PT_Measure = #{ptMeasure,jdbcType=VARCHAR},
  352. PT_Dose = #{ptDose,jdbcType=DOUBLE},
  353. PT_DoseUnit = #{ptDoseunit,jdbcType=VARCHAR},
  354. PT_Name = #{ptName,jdbcType=VARCHAR},
  355. PT_Remark = #{ptRemark,jdbcType=VARCHAR}
  356. where PT_ID = #{ptId,jdbcType=INTEGER}
  357. </update>
  358. </mapper>