InpOpenRecordMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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.InpOpenRecordMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpOpenRecord" >
  5. <id column="IOR_ID" property="iorId" 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="IOR_Measure_Time" property="iorMeasureTime" jdbcType="TIMESTAMP" />
  12. <result column="IOR_Recordor" property="iorRecordor" jdbcType="VARCHAR" />
  13. <result column="IOR_Record_Time" property="iorRecordTime" jdbcType="TIMESTAMP" />
  14. <result column="IOR_Level" property="iorLevel" jdbcType="INTEGER" />
  15. <result column="IOR_Operation_Time" property="iorOperationTime" jdbcType="TIMESTAMP" />
  16. <result column="IOR_Operator" property="iorOperator" jdbcType="VARCHAR" />
  17. <result column="IOR_IsDel" property="iorIsdel" jdbcType="INTEGER" />
  18. <result column="IOR_Remark" property="iorRemark" jdbcType="VARCHAR" />
  19. <result column="IOR_FormerID" property="iorFormerid" jdbcType="INTEGER" />
  20. <result column="IOR_IsPrint" property="iorIsprint" jdbcType="INTEGER" />
  21. <result column="IOR_Printer" property="iorPrinter" jdbcType="VARCHAR" />
  22. <result column="IOR_Out_Time" property="iorOutTime" jdbcType="TIMESTAMP" />
  23. <result column="IOR_Out_Operator" property="iorOutOperator" jdbcType="VARCHAR" />
  24. <result column="IOR_Back_Time" property="iorBackTime" jdbcType="TIMESTAMP" />
  25. <result column="IOR_Back_Operator" property="iorBackOperator" jdbcType="VARCHAR" />
  26. <result column="IOR_Cooperate" property="iorCooperate" jdbcType="VARCHAR" />
  27. </resultMap>
  28. <resultMap id="ResultMap" extends="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpOpenRecordVo">
  29. <result column="iorOutOperatorName" property="iorOutOperatorName" jdbcType="VARCHAR" />
  30. <result column="iorBackOperatorName" property="iorBackOperatorName" jdbcType="VARCHAR" />
  31. </resultMap>
  32. <sql id="Base_Column_List" >
  33. IOR_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IOR_Measure_Time, IOR_Recordor,
  34. IOR_Record_Time, IOR_Level, IOR_Operation_Time, IOR_Operator, IOR_IsDel, IOR_Remark,
  35. IOR_FormerID, IOR_IsPrint, IOR_Printer, IOR_Out_Time, IOR_Out_Operator, IOR_Back_Time,
  36. IOR_Back_Operator, IOR_Cooperate
  37. </sql>
  38. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  39. select
  40. <include refid="Base_Column_List" />
  41. from inp_open_record
  42. where IOR_ID = #{iorId,jdbcType=INTEGER}
  43. </select>
  44. <select id="selectByPatient" resultMap="ResultMap">
  45. select <include refid="Base_Column_List"/>,
  46. (select UI_Name from sys_userinfo b where a.IOR_Out_Operator = b.UI_Code) iorOutOperatorName,
  47. (select UI_Name from sys_userinfo b where a.IOR_Back_Operator = b.UI_Code) iorBackOperatorName
  48. from inp_open_record a
  49. where a.PatientNo=#{patientNO,jdbcType=VARCHAR} and a.IOR_IsDel='0'
  50. and a.IOR_Measure_Time between #{startTime,jdbcType=TIMESTAMP} and #{endTime,jdbcType=TIMESTAMP} order by IOR_Measure_Time desc
  51. </select>
  52. <select id="selectByPatientPrint" resultMap="ResultMap">
  53. select <include refid="Base_Column_List"/>,
  54. (select UI_Name from sys_userinfo b where a.IOR_Out_Operator = b.UI_Code) iorOutOperatorName,
  55. (select UI_Name from sys_userinfo b where a.IOR_Back_Operator = b.UI_Code) iorBackOperatorName
  56. from inp_open_record a
  57. where a.PatientNo=#{patientNO,jdbcType=VARCHAR} and a.IOR_IsDel='0'
  58. and a.IOR_Measure_Time between #{startTime,jdbcType=TIMESTAMP} and #{endTime,jdbcType=TIMESTAMP} order by IOR_Measure_Time asc
  59. </select>
  60. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  61. delete from inp_open_record
  62. where IOR_ID = #{iorId,jdbcType=INTEGER}
  63. </delete>
  64. <update id="delIroById">
  65. update inp_open_record set IOR_IsDel=-1,IOR_Operator=#{iorOperator,jdbcType=VARCHAR},
  66. IOR_Operation_Time =#{iorOperationTime,jdbcType=TIMESTAMP}
  67. where IOR_ID = #{iorId,jdbcType=INTEGER}
  68. </update>
  69. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpOpenRecord" >
  70. insert into inp_open_record (IOR_ID, PatientNo, HI_ID,
  71. DD_DepDm, DW_WardDm, DB_BedNo,
  72. IOR_Measure_Time, IOR_Recordor, IOR_Record_Time,
  73. IOR_Level, IOR_Operation_Time, IOR_Operator,
  74. IOR_IsDel, IOR_Remark, IOR_FormerID,
  75. IOR_IsPrint, IOR_Printer, IOR_Out_Time,
  76. IOR_Out_Operator, IOR_Back_Time, IOR_Back_Operator,
  77. IOR_Cooperate)
  78. values (#{iorId,jdbcType=INTEGER}, #{patientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER},
  79. #{ddDepdm,jdbcType=VARCHAR}, #{dwWarddm,jdbcType=VARCHAR}, #{dbBedno,jdbcType=VARCHAR},
  80. #{iorMeasureTime,jdbcType=TIMESTAMP}, #{iorRecordor,jdbcType=VARCHAR}, #{iorRecordTime,jdbcType=TIMESTAMP},
  81. #{iorLevel,jdbcType=INTEGER}, #{iorOperationTime,jdbcType=TIMESTAMP}, #{iorOperator,jdbcType=VARCHAR},
  82. #{iorIsdel,jdbcType=INTEGER}, #{iorRemark,jdbcType=VARCHAR}, #{iorFormerid,jdbcType=INTEGER},
  83. #{iorIsprint,jdbcType=INTEGER}, #{iorPrinter,jdbcType=VARCHAR}, #{iorOutTime,jdbcType=TIMESTAMP},
  84. #{iorOutOperator,jdbcType=VARCHAR}, #{iorBackTime,jdbcType=TIMESTAMP}, #{iorBackOperator,jdbcType=VARCHAR},
  85. #{iorCooperate,jdbcType=VARCHAR})
  86. </insert>
  87. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpOpenRecord" >
  88. insert into inp_open_record
  89. <trim prefix="(" suffix=")" suffixOverrides="," >
  90. <if test="iorId != null" >
  91. IOR_ID,
  92. </if>
  93. <if test="patientno != null" >
  94. PatientNo,
  95. </if>
  96. <if test="hiId != null" >
  97. HI_ID,
  98. </if>
  99. <if test="ddDepdm != null" >
  100. DD_DepDm,
  101. </if>
  102. <if test="dwWarddm != null" >
  103. DW_WardDm,
  104. </if>
  105. <if test="dbBedno != null" >
  106. DB_BedNo,
  107. </if>
  108. <if test="iorMeasureTime != null" >
  109. IOR_Measure_Time,
  110. </if>
  111. <if test="iorRecordor != null" >
  112. IOR_Recordor,
  113. </if>
  114. <if test="iorRecordTime != null" >
  115. IOR_Record_Time,
  116. </if>
  117. <if test="iorLevel != null" >
  118. IOR_Level,
  119. </if>
  120. <if test="iorOperationTime != null" >
  121. IOR_Operation_Time,
  122. </if>
  123. <if test="iorOperator != null" >
  124. IOR_Operator,
  125. </if>
  126. <if test="iorIsdel != null" >
  127. IOR_IsDel,
  128. </if>
  129. <if test="iorRemark != null" >
  130. IOR_Remark,
  131. </if>
  132. <if test="iorFormerid != null" >
  133. IOR_FormerID,
  134. </if>
  135. <if test="iorIsprint != null" >
  136. IOR_IsPrint,
  137. </if>
  138. <if test="iorPrinter != null" >
  139. IOR_Printer,
  140. </if>
  141. <if test="iorOutTime != null" >
  142. IOR_Out_Time,
  143. </if>
  144. <if test="iorOutOperator != null" >
  145. IOR_Out_Operator,
  146. </if>
  147. <if test="iorBackTime != null" >
  148. IOR_Back_Time,
  149. </if>
  150. <if test="iorBackOperator != null" >
  151. IOR_Back_Operator,
  152. </if>
  153. <if test="iorCooperate != null" >
  154. IOR_Cooperate,
  155. </if>
  156. </trim>
  157. <trim prefix="values (" suffix=")" suffixOverrides="," >
  158. <if test="iorId != null" >
  159. #{iorId,jdbcType=INTEGER},
  160. </if>
  161. <if test="patientno != null" >
  162. #{patientno,jdbcType=VARCHAR},
  163. </if>
  164. <if test="hiId != null" >
  165. #{hiId,jdbcType=INTEGER},
  166. </if>
  167. <if test="ddDepdm != null" >
  168. #{ddDepdm,jdbcType=VARCHAR},
  169. </if>
  170. <if test="dwWarddm != null" >
  171. #{dwWarddm,jdbcType=VARCHAR},
  172. </if>
  173. <if test="dbBedno != null" >
  174. #{dbBedno,jdbcType=VARCHAR},
  175. </if>
  176. <if test="iorMeasureTime != null" >
  177. #{iorMeasureTime,jdbcType=TIMESTAMP},
  178. </if>
  179. <if test="iorRecordor != null" >
  180. #{iorRecordor,jdbcType=VARCHAR},
  181. </if>
  182. <if test="iorRecordTime != null" >
  183. #{iorRecordTime,jdbcType=TIMESTAMP},
  184. </if>
  185. <if test="iorLevel != null" >
  186. #{iorLevel,jdbcType=INTEGER},
  187. </if>
  188. <if test="iorOperationTime != null" >
  189. #{iorOperationTime,jdbcType=TIMESTAMP},
  190. </if>
  191. <if test="iorOperator != null" >
  192. #{iorOperator,jdbcType=VARCHAR},
  193. </if>
  194. <if test="iorIsdel != null" >
  195. #{iorIsdel,jdbcType=INTEGER},
  196. </if>
  197. <if test="iorRemark != null" >
  198. #{iorRemark,jdbcType=VARCHAR},
  199. </if>
  200. <if test="iorFormerid != null" >
  201. #{iorFormerid,jdbcType=INTEGER},
  202. </if>
  203. <if test="iorIsprint != null" >
  204. #{iorIsprint,jdbcType=INTEGER},
  205. </if>
  206. <if test="iorPrinter != null" >
  207. #{iorPrinter,jdbcType=VARCHAR},
  208. </if>
  209. <if test="iorOutTime != null" >
  210. #{iorOutTime,jdbcType=TIMESTAMP},
  211. </if>
  212. <if test="iorOutOperator != null" >
  213. #{iorOutOperator,jdbcType=VARCHAR},
  214. </if>
  215. <if test="iorBackTime != null" >
  216. #{iorBackTime,jdbcType=TIMESTAMP},
  217. </if>
  218. <if test="iorBackOperator != null" >
  219. #{iorBackOperator,jdbcType=VARCHAR},
  220. </if>
  221. <if test="iorCooperate != null" >
  222. #{iorCooperate,jdbcType=VARCHAR},
  223. </if>
  224. </trim>
  225. </insert>
  226. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpOpenRecord" >
  227. update inp_open_record
  228. <set >
  229. <if test="patientno != null" >
  230. PatientNo = #{patientno,jdbcType=VARCHAR},
  231. </if>
  232. <if test="hiId != null" >
  233. HI_ID = #{hiId,jdbcType=INTEGER},
  234. </if>
  235. <if test="ddDepdm != null" >
  236. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  237. </if>
  238. <if test="dwWarddm != null" >
  239. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  240. </if>
  241. <if test="dbBedno != null" >
  242. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  243. </if>
  244. <if test="iorMeasureTime != null" >
  245. IOR_Measure_Time = #{iorMeasureTime,jdbcType=TIMESTAMP},
  246. </if>
  247. <if test="iorRecordor != null" >
  248. IOR_Recordor = #{iorRecordor,jdbcType=VARCHAR},
  249. </if>
  250. <if test="iorRecordTime != null" >
  251. IOR_Record_Time = #{iorRecordTime,jdbcType=TIMESTAMP},
  252. </if>
  253. <if test="iorLevel != null" >
  254. IOR_Level = #{iorLevel,jdbcType=INTEGER},
  255. </if>
  256. <if test="iorOperationTime != null" >
  257. IOR_Operation_Time = #{iorOperationTime,jdbcType=TIMESTAMP},
  258. </if>
  259. <if test="iorOperator != null" >
  260. IOR_Operator = #{iorOperator,jdbcType=VARCHAR},
  261. </if>
  262. <if test="iorIsdel != null" >
  263. IOR_IsDel = #{iorIsdel,jdbcType=INTEGER},
  264. </if>
  265. <if test="iorRemark != null" >
  266. IOR_Remark = #{iorRemark,jdbcType=VARCHAR},
  267. </if>
  268. <if test="iorFormerid != null" >
  269. IOR_FormerID = #{iorFormerid,jdbcType=INTEGER},
  270. </if>
  271. <if test="iorIsprint != null" >
  272. IOR_IsPrint = #{iorIsprint,jdbcType=INTEGER},
  273. </if>
  274. <if test="iorPrinter != null" >
  275. IOR_Printer = #{iorPrinter,jdbcType=VARCHAR},
  276. </if>
  277. <if test="iorOutTime != null" >
  278. IOR_Out_Time = #{iorOutTime,jdbcType=TIMESTAMP},
  279. </if>
  280. <if test="iorOutOperator != null" >
  281. IOR_Out_Operator = #{iorOutOperator,jdbcType=VARCHAR},
  282. </if>
  283. <if test="iorBackTime != null" >
  284. IOR_Back_Time = #{iorBackTime,jdbcType=TIMESTAMP},
  285. </if>
  286. <if test="iorBackOperator != null" >
  287. IOR_Back_Operator = #{iorBackOperator,jdbcType=VARCHAR},
  288. </if>
  289. <if test="iorCooperate != null" >
  290. IOR_Cooperate = #{iorCooperate,jdbcType=VARCHAR},
  291. </if>
  292. </set>
  293. where IOR_ID = #{iorId,jdbcType=INTEGER}
  294. </update>
  295. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpOpenRecord" >
  296. update inp_open_record
  297. set PatientNo = #{patientno,jdbcType=VARCHAR},
  298. HI_ID = #{hiId,jdbcType=INTEGER},
  299. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  300. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  301. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  302. IOR_Measure_Time = #{iorMeasureTime,jdbcType=TIMESTAMP},
  303. IOR_Recordor = #{iorRecordor,jdbcType=VARCHAR},
  304. IOR_Record_Time = #{iorRecordTime,jdbcType=TIMESTAMP},
  305. IOR_Level = #{iorLevel,jdbcType=INTEGER},
  306. IOR_Operation_Time = #{iorOperationTime,jdbcType=TIMESTAMP},
  307. IOR_Operator = #{iorOperator,jdbcType=VARCHAR},
  308. IOR_IsDel = #{iorIsdel,jdbcType=INTEGER},
  309. IOR_Remark = #{iorRemark,jdbcType=VARCHAR},
  310. IOR_FormerID = #{iorFormerid,jdbcType=INTEGER},
  311. IOR_IsPrint = #{iorIsprint,jdbcType=INTEGER},
  312. IOR_Printer = #{iorPrinter,jdbcType=VARCHAR},
  313. IOR_Out_Time = #{iorOutTime,jdbcType=TIMESTAMP},
  314. IOR_Out_Operator = #{iorOutOperator,jdbcType=VARCHAR},
  315. IOR_Back_Time = #{iorBackTime,jdbcType=TIMESTAMP},
  316. IOR_Back_Operator = #{iorBackOperator,jdbcType=VARCHAR},
  317. IOR_Cooperate = #{iorCooperate,jdbcType=VARCHAR}
  318. where IOR_ID = #{iorId,jdbcType=INTEGER}
  319. </update>
  320. </mapper>