inpScheduleMapper.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  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.InpScheduleMapper">
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSchedule" >
  5. <id column="IS_ID" property="isId" 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="IS_Code" property="isCode" jdbcType="VARCHAR" />
  12. <result column="IS_Name" property="isName" jdbcType="VARCHAR" />
  13. <result column="IS_Review_Reason" property="isReviewReason" jdbcType="VARCHAR" />
  14. <result column="IS_Review_Time" property="isReviewTime" jdbcType="TIMESTAMP" />
  15. <result column="IS_Remark" property="isRemark" jdbcType="VARCHAR" />
  16. <result column="IS_Time_Point" property="isTimePoint" jdbcType="VARCHAR" />
  17. <result column="IS_Recorder" property="isRecorder" jdbcType="VARCHAR" />
  18. <result column="IS_Record_Time" property="isRecordTime" jdbcType="TIMESTAMP" />
  19. <result column="IS_IsReview" property="isIsreview" jdbcType="INTEGER" />
  20. <result column="IS_Operator" property="isOperator" jdbcType="VARCHAR" />
  21. <result column="IS_Operat_Time" property="isOperatTime" jdbcType="TIMESTAMP" />
  22. <result column="IS_Review_ID" property="isReviewId" jdbcType="VARCHAR" />
  23. <result column="IS_Review_Source" property="isReviewSource" jdbcType="VARCHAR" />
  24. <result column="IS_Degree" property="isDegree" jdbcType="VARCHAR" />
  25. <result column="IS_IsDel" property="isIsdel" jdbcType="INTEGER" />
  26. <result column="IS_Start_Time" property="isStartTime" jdbcType="TIMESTAMP"/>
  27. <result column="IS_End_Time" property="isEndTime" jdbcType="TIMESTAMP"/>
  28. </resultMap>
  29. <sql id="Base_Column_List" >
  30. IS_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IS_Code, IS_Name, IS_Review_Reason,
  31. IS_Review_Time, IS_Remark, IS_Time_Point, IS_Recorder, IS_Record_Time, IS_IsReview,
  32. IS_Operator, IS_Operat_Time, IS_Review_ID, IS_Review_Source, IS_Degree, IS_IsDel,IS_Start_Time,IS_End_Time
  33. </sql>
  34. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  35. select
  36. <include refid="Base_Column_List" />
  37. from inp_schedule
  38. where IS_ID = #{isId,jdbcType=INTEGER}
  39. </select>
  40. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  41. delete from inp_schedule
  42. where IS_ID = #{isId,jdbcType=INTEGER}
  43. </delete>
  44. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSchedule" >
  45. insert into inp_schedule (IS_ID, PatientNo, HI_ID,
  46. DD_DepDm, DW_WardDm, DB_BedNo,
  47. IS_Code, IS_Name, IS_Review_Reason,
  48. IS_Review_Time, IS_Remark, IS_Time_Point,
  49. IS_Recorder, IS_Record_Time, IS_IsReview,
  50. IS_Operator, IS_Operat_Time, IS_Review_ID,
  51. IS_Review_Source, IS_Degree, IS_IsDel,IS_Start_Time,IS_End_Time
  52. )
  53. values (#{isId,jdbcType=INTEGER}, #{patientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER},
  54. #{ddDepdm,jdbcType=VARCHAR}, #{dwWarddm,jdbcType=VARCHAR}, #{dbBedno,jdbcType=VARCHAR},
  55. #{isCode,jdbcType=VARCHAR}, #{isName,jdbcType=VARCHAR}, #{isReviewReason,jdbcType=VARCHAR},
  56. #{isReviewTime,jdbcType=TIMESTAMP}, #{isRemark,jdbcType=VARCHAR}, #{isTimePoint,jdbcType=VARCHAR},
  57. #{isRecorder,jdbcType=VARCHAR}, #{isRecordTime,jdbcType=TIMESTAMP}, #{isIsreview,jdbcType=INTEGER},
  58. #{isOperator,jdbcType=VARCHAR}, #{isOperatTime,jdbcType=TIMESTAMP}, #{isReviewId,jdbcType=VARCHAR},
  59. #{isReviewSource,jdbcType=VARCHAR}, #{isDegree,jdbcType=VARCHAR}, #{isIsdel,jdbcType=INTEGER},
  60. #{isStartTime,jdbcType=TIMESTAMP},#{isEndTime,jdbcType=TIMESTAMP}
  61. )
  62. </insert>
  63. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSchedule" >
  64. insert into inp_schedule
  65. <trim prefix="(" suffix=")" suffixOverrides="," >
  66. <if test="isId != null" >
  67. IS_ID,
  68. </if>
  69. <if test="patientno != null" >
  70. PatientNo,
  71. </if>
  72. <if test="hiId != null" >
  73. HI_ID,
  74. </if>
  75. <if test="ddDepdm != null" >
  76. DD_DepDm,
  77. </if>
  78. <if test="dwWarddm != null" >
  79. DW_WardDm,
  80. </if>
  81. <if test="dbBedno != null" >
  82. DB_BedNo,
  83. </if>
  84. <if test="isCode != null" >
  85. IS_Code,
  86. </if>
  87. <if test="isName != null" >
  88. IS_Name,
  89. </if>
  90. <if test="isReviewReason != null" >
  91. IS_Review_Reason,
  92. </if>
  93. <if test="isReviewTime != null" >
  94. IS_Review_Time,
  95. </if>
  96. <if test="isRemark != null" >
  97. IS_Remark,
  98. </if>
  99. <if test="isTimePoint != null" >
  100. IS_Time_Point,
  101. </if>
  102. <if test="isRecorder != null" >
  103. IS_Recorder,
  104. </if>
  105. <if test="isRecordTime != null" >
  106. IS_Record_Time,
  107. </if>
  108. <if test="isIsreview != null" >
  109. IS_IsReview,
  110. </if>
  111. <if test="isOperator != null" >
  112. IS_Operator,
  113. </if>
  114. <if test="isOperatTime != null" >
  115. IS_Operat_Time,
  116. </if>
  117. <if test="isReviewId != null" >
  118. IS_Review_ID,
  119. </if>
  120. <if test="isReviewSource != null" >
  121. IS_Review_Source,
  122. </if>
  123. <if test="isDegree != null" >
  124. IS_Degree,
  125. </if>
  126. <if test="isIsdel != null" >
  127. IS_IsDel,
  128. </if>
  129. <if test="isStartTime != null">
  130. IS_Start_Time,
  131. </if>
  132. <if test="isEndTime != null">
  133. IS_End_Time
  134. </if>
  135. </trim>
  136. <trim prefix="values (" suffix=")" suffixOverrides="," >
  137. <if test="isId != null" >
  138. #{isId,jdbcType=INTEGER},
  139. </if>
  140. <if test="patientno != null" >
  141. #{patientno,jdbcType=VARCHAR},
  142. </if>
  143. <if test="hiId != null" >
  144. #{hiId,jdbcType=INTEGER},
  145. </if>
  146. <if test="ddDepdm != null" >
  147. #{ddDepdm,jdbcType=VARCHAR},
  148. </if>
  149. <if test="dwWarddm != null" >
  150. #{dwWarddm,jdbcType=VARCHAR},
  151. </if>
  152. <if test="dbBedno != null" >
  153. #{dbBedno,jdbcType=VARCHAR},
  154. </if>
  155. <if test="isCode != null" >
  156. #{isCode,jdbcType=VARCHAR},
  157. </if>
  158. <if test="isName != null" >
  159. #{isName,jdbcType=VARCHAR},
  160. </if>
  161. <if test="isReviewReason != null" >
  162. #{isReviewReason,jdbcType=VARCHAR},
  163. </if>
  164. <if test="isReviewTime != null" >
  165. #{isReviewTime,jdbcType=TIMESTAMP},
  166. </if>
  167. <if test="isRemark != null" >
  168. #{isRemark,jdbcType=VARCHAR},
  169. </if>
  170. <if test="isTimePoint != null" >
  171. #{isTimePoint,jdbcType=VARCHAR},
  172. </if>
  173. <if test="isRecorder != null" >
  174. #{isRecorder,jdbcType=VARCHAR},
  175. </if>
  176. <if test="isRecordTime != null" >
  177. #{isRecordTime,jdbcType=TIMESTAMP},
  178. </if>
  179. <if test="isIsreview != null" >
  180. #{isIsreview,jdbcType=INTEGER},
  181. </if>
  182. <if test="isOperator != null" >
  183. #{isOperator,jdbcType=VARCHAR},
  184. </if>
  185. <if test="isOperatTime != null" >
  186. #{isOperatTime,jdbcType=TIMESTAMP},
  187. </if>
  188. <if test="isReviewId != null" >
  189. #{isReviewId,jdbcType=VARCHAR},
  190. </if>
  191. <if test="isReviewSource != null" >
  192. #{isReviewSource,jdbcType=VARCHAR},
  193. </if>
  194. <if test="isDegree != null" >
  195. #{isDegree,jdbcType=VARCHAR},
  196. </if>
  197. <if test="isIsdel != null" >
  198. #{isIsdel,jdbcType=INTEGER},
  199. </if>
  200. <if test="isStartTime != null">
  201. #{isStartTime,jdbcType=TIMESTAMP},
  202. </if>
  203. <if test="isEndTime != null">
  204. #{isEndTime,jdbcType=TIMESTAMP},
  205. </if>
  206. </trim>
  207. </insert>
  208. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSchedule" >
  209. update inp_schedule
  210. <set >
  211. <if test="patientno != null" >
  212. PatientNo = #{patientno,jdbcType=VARCHAR},
  213. </if>
  214. <if test="hiId != null" >
  215. HI_ID = #{hiId,jdbcType=INTEGER},
  216. </if>
  217. <if test="ddDepdm != null" >
  218. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  219. </if>
  220. <if test="dwWarddm != null" >
  221. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  222. </if>
  223. <if test="dbBedno != null" >
  224. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  225. </if>
  226. <if test="isCode != null" >
  227. IS_Code = #{isCode,jdbcType=VARCHAR},
  228. </if>
  229. <if test="isName != null" >
  230. IS_Name = #{isName,jdbcType=VARCHAR},
  231. </if>
  232. <if test="isReviewReason != null" >
  233. IS_Review_Reason = #{isReviewReason,jdbcType=VARCHAR},
  234. </if>
  235. <if test="isReviewTime != null" >
  236. IS_Review_Time = #{isReviewTime,jdbcType=TIMESTAMP},
  237. </if>
  238. <if test="isRemark != null" >
  239. IS_Remark = #{isRemark,jdbcType=VARCHAR},
  240. </if>
  241. <if test="isTimePoint != null" >
  242. IS_Time_Point = #{isTimePoint,jdbcType=VARCHAR},
  243. </if>
  244. <if test="isRecorder != null" >
  245. IS_Recorder = #{isRecorder,jdbcType=VARCHAR},
  246. </if>
  247. <if test="isRecordTime != null" >
  248. IS_Record_Time = #{isRecordTime,jdbcType=TIMESTAMP},
  249. </if>
  250. <if test="isIsreview != null" >
  251. IS_IsReview = #{isIsreview,jdbcType=INTEGER},
  252. </if>
  253. <if test="isOperator != null" >
  254. IS_Operator = #{isOperator,jdbcType=VARCHAR},
  255. </if>
  256. <if test="isOperatTime != null" >
  257. IS_Operat_Time = #{isOperatTime,jdbcType=TIMESTAMP},
  258. </if>
  259. <if test="isReviewId != null" >
  260. IS_Review_ID = #{isReviewId,jdbcType=VARCHAR},
  261. </if>
  262. <if test="isReviewSource != null" >
  263. IS_Review_Source = #{isReviewSource,jdbcType=VARCHAR},
  264. </if>
  265. <if test="isDegree != null" >
  266. IS_Degree = #{isDegree,jdbcType=VARCHAR},
  267. </if>
  268. <if test="isIsdel != null" >
  269. IS_IsDel = #{isIsdel,jdbcType=INTEGER},
  270. </if>
  271. <if test="isStartTime != null">
  272. IS_Start_Time = #{isStartTime,jdbcType=TIMESTAMP},
  273. </if>
  274. <if test="isEndTime != null">
  275. IS_End_Time = #{isEndTime,jdbcType=TIMESTAMP},
  276. </if>
  277. </set>
  278. where IS_ID = #{isId,jdbcType=INTEGER}
  279. </update>
  280. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSchedule" >
  281. update inp_schedule
  282. set PatientNo = #{patientno,jdbcType=VARCHAR},
  283. HI_ID = #{hiId,jdbcType=INTEGER},
  284. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  285. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  286. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  287. IS_Code = #{isCode,jdbcType=VARCHAR},
  288. IS_Name = #{isName,jdbcType=VARCHAR},
  289. IS_Review_Reason = #{isReviewReason,jdbcType=VARCHAR},
  290. IS_Review_Time = #{isReviewTime,jdbcType=TIMESTAMP},
  291. IS_Remark = #{isRemark,jdbcType=VARCHAR},
  292. IS_Time_Point = #{isTimePoint,jdbcType=VARCHAR},
  293. IS_Recorder = #{isRecorder,jdbcType=VARCHAR},
  294. IS_Record_Time = #{isRecordTime,jdbcType=TIMESTAMP},
  295. IS_IsReview = #{isIsreview,jdbcType=INTEGER},
  296. IS_Operator = #{isOperator,jdbcType=VARCHAR},
  297. IS_Operat_Time = #{isOperatTime,jdbcType=TIMESTAMP},
  298. IS_Review_ID = #{isReviewId,jdbcType=VARCHAR},
  299. IS_Review_Source = #{isReviewSource,jdbcType=VARCHAR},
  300. IS_Degree = #{isDegree,jdbcType=VARCHAR},
  301. IS_IsDel = #{isIsdel,jdbcType=INTEGER},
  302. IS_Start_Time = #{isStartTime,jdbcType=TIMESTAMP},
  303. IS_End_Time = #{isEndTime,jdbcType=TIMESTAMP}
  304. where IS_ID = #{isId,jdbcType=INTEGER}
  305. </update>
  306. <select id="selectByIsCode" resultMap="BaseResultMap"
  307. parameterType="com.xinxin.topro.inpnurseservice.vo.InpscheduleSearchForCodeVo">
  308. select IS_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IS_Code, IS_Name, IS_Review_Reason,
  309. IS_Review_Time, IS_Remark, IS_Time_Point, IS_Recorder, IS_Record_Time, IS_IsReview,
  310. IS_Operator, IS_Operat_Time, IS_Review_ID, IS_Review_Source, IS_Degree, IS_IsDel,IS_Start_Time,IS_End_Time
  311. from inp_schedule
  312. where IS_IsDel= 0 and IS_IsReview = 0
  313. <if test="hiId != null">
  314. and HI_ID = #{hiId,jdbcType=INTEGER}
  315. </if>
  316. <if test="dwWarddm != null">
  317. and DW_WardDm = #{dwWarddm,jdbcType=VARCHAR}
  318. </if>
  319. <if test="isCode != null">
  320. and IS_Code = #{isCode,jdbcType=VARCHAR}
  321. </if>
  322. <if test="beginDate != null">
  323. AND IS_Review_Time <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP}
  324. </if>
  325. <if test="endDate!= null">
  326. AND IS_Review_Time <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP}
  327. </if>
  328. <if test="isTimePoint != null">
  329. and IS_Time_Point =#{isTimePoint,jdbcType=VARCHAR}
  330. </if>
  331. </select>
  332. <select id="selectByWardIdNoPoint" resultType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSchedule"
  333. parameterType="com.xinxin.topro.inpnurseservice.vo.InpScheduleInfoVo">
  334. select IS_ID isId, PatientNo patientno, HI_ID hiId, DD_DepDm ddDepdm, DW_WardDm dwWarddm, DB_BedNo dbBedno,
  335. IS_Code isCode, IS_Name isName, IS_Review_Reason isReviewReason,IS_Review_Time isReviewTime, IS_Remark isRemark,
  336. IS_Time_Point isTimePoint, IS_Recorder isRecorder, IS_Record_Time isRecordTime, IS_IsReview isIsreview,
  337. IS_Operator isOperator, IS_Operat_Time isOperatTime, IS_Review_ID isReviewId, IS_Review_Source isReviewSource,
  338. IS_Degree isDegree, IS_IsDel isIsdel,IS_Start_Time isStartTime,IS_End_Time isEndTime
  339. from inp_schedule
  340. where IS_IsDel = 0
  341. and DW_WardDm = #{wardId,jdbcType=VARCHAR}
  342. and IS_Review_Time between #{beginDate,jdbcType=TIMESTAMP} and #{endDate,jdbcType=TIMESTAMP}
  343. </select>
  344. <select id="selectByWardId" resultType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSchedule"
  345. parameterType="com.xinxin.topro.inpnurseservice.vo.InpScheduleInfoVo">
  346. select IS_ID isId, PatientNo patientno, HI_ID hiId, DD_DepDm ddDepdm, DW_WardDm dwWarddm, DB_BedNo dbBedno,
  347. IS_Code isCode, IS_Name isName, IS_Review_Reason isReviewReason,IS_Review_Time isReviewTime, IS_Remark isRemark,
  348. IS_Time_Point isTimePoint, IS_Recorder isRecorder, IS_Record_Time isRecordTime, IS_IsReview isIsreview,
  349. IS_Operator isOperator, IS_Operat_Time isOperatTime, IS_Review_ID isReviewId, IS_Review_Source isReviewSource,
  350. IS_Degree isDegree, IS_IsDel isIsdel,IS_Start_Time isStartTime,IS_End_Time isEndTime
  351. from inp_schedule
  352. where IS_IsDel = 0
  353. and DW_WardDm = #{wardId,jdbcType=VARCHAR}
  354. and IS_Review_Time between #{beginDate,jdbcType=TIMESTAMP} and #{endDate,jdbcType=TIMESTAMP}
  355. and IS_Time_Point= #{timePoint,jdbcType=VARCHAR}
  356. </select>
  357. <update id="updateIsReviewByFinish" >
  358. UPDATE inp_schedule
  359. SET IS_IsReview= 1,
  360. IS_Review_ID=#{ivId,jdbcType=INTEGER}
  361. WHERE IS_IsReview = 0
  362. <if test="patientNo != null">
  363. and PatientNo=#{patientNo,jdbcType=VARCHAR}
  364. </if>
  365. <if test="beginDate != null">
  366. AND IS_Review_Time <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP}
  367. </if>
  368. <if test="endDate != null">
  369. AND IS_Review_Time <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP}
  370. </if>
  371. <if test="timePoint != null">
  372. and IS_Time_Point= #{timePoint,jdbcType=VARCHAR}
  373. </if>
  374. <if test="isCode != null">
  375. and IS_Code=#{isCode,jdbcType=VARCHAR}
  376. </if>
  377. </update>
  378. <select id="selectFinishByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
  379. select
  380. <include refid="Base_Column_List"/>
  381. from inp_schedule
  382. where IS_IsReview= 1 and IS_ID = #{isId,jdbcType=INTEGER}
  383. </select>
  384. <select id="selectByPatientNo" resultMap="BaseResultMap">
  385. select
  386. <include refid="Base_Column_List"/>
  387. from inp_schedule
  388. where IS_IsReview= 0
  389. <if test="patientNo != null">
  390. and PatientNo=#{patientNo,jdbcType=VARCHAR}
  391. </if>
  392. <if test="hiId != null">
  393. and HI_ID = #{hiId,jdbcType=INTEGER}
  394. </if>
  395. <if test="beginDate != null">
  396. AND IS_Review_Time <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP}
  397. </if>
  398. <if test="endDate != null">
  399. AND IS_Review_Time <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP}
  400. </if>
  401. order by IS_Review_Time ASC
  402. </select>
  403. <update id="updateIsDelByIsReviewId" >
  404. update inp_schedule
  405. set IS_IsDel=-1
  406. where IS_IsReview=0
  407. <if test="isReviewSource != null">
  408. and IS_Review_Source=#{isReviewSource,jdbcType=VARCHAR}
  409. </if>
  410. <if test="list != null">
  411. and IS_Review_ID in
  412. <foreach collection="list" item="item" separator="," open="(" close=")">
  413. #{item}
  414. </foreach>
  415. </if>
  416. </update>
  417. <update id="bulkUpdateIsReviewByFinish" >
  418. UPDATE inp_schedule
  419. SET IS_IsReview= 1,
  420. IS_Review_ID=#{ivId,jdbcType=INTEGER}
  421. WHERE IS_IsReview = 0
  422. <if test="patientNo != null">
  423. and PatientNo= #{patientNo,jdbcType=VARCHAR}
  424. </if>
  425. <if test="beginDate != null">
  426. AND IS_Review_Time <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP}
  427. </if>
  428. <if test="endDate != null">
  429. AND IS_Review_Time <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP}
  430. </if>
  431. <if test="timePoint != null">
  432. and IS_Time_Point= #{timePoint,jdbcType=VARCHAR}
  433. </if>
  434. <if test="list != null">
  435. and IS_Code in
  436. <foreach collection="list" item="item" separator="," index="index" close=")" open="(">
  437. #{item}
  438. </foreach>
  439. </if>
  440. </update>
  441. <update id="batchUpdateIsReviewByFinish" parameterType="java.util.List">
  442. <foreach collection="list" item="item" index="index" separator=";">
  443. UPDATE inp_schedule
  444. SET IS_IsReview= 1,
  445. IS_Review_ID=#{item.reviewId,jdbcType=INTEGER}
  446. WHERE IS_IsReview = 0
  447. and PatientNo= #{item.patientNo,jdbcType=VARCHAR}
  448. AND IS_Review_Time <![CDATA[>=]]> #{item.beginDate,jdbcType=TIMESTAMP}
  449. AND IS_Review_Time <![CDATA[<=]]> #{item.endDate,jdbcType=TIMESTAMP}
  450. and IS_Time_Point= #{item.timePoint,jdbcType=VARCHAR}
  451. and IS_Code = #{item.code,jdbcType=VARCHAR}
  452. </foreach>
  453. </update>
  454. <insert id="bulkInsert" useGeneratedKeys="true" keyProperty = "isId">
  455. insert into inp_schedule (IS_ID, PatientNo, HI_ID,
  456. DD_DepDm, DW_WardDm, DB_BedNo,
  457. IS_Code, IS_Name, IS_Review_Reason,
  458. IS_Review_Time, IS_Remark, IS_Time_Point,
  459. IS_Recorder, IS_Record_Time, IS_IsReview,
  460. IS_Operator, IS_Operat_Time, IS_Review_ID,
  461. IS_Review_Source, IS_Degree, IS_IsDel,IS_Start_Time,IS_End_Time
  462. )
  463. values <foreach collection="list" item="item" separator=",">
  464. (#{item.isId,jdbcType=INTEGER}, #{item.patientno,jdbcType=VARCHAR}, #{item.hiId,jdbcType=INTEGER},
  465. #{item.ddDepdm,jdbcType=VARCHAR}, #{item.dwWarddm,jdbcType=VARCHAR}, #{item.dbBedno,jdbcType=VARCHAR},
  466. #{item.isCode,jdbcType=VARCHAR}, #{item.isName,jdbcType=VARCHAR}, #{item.isReviewReason,jdbcType=VARCHAR},
  467. #{item.isReviewTime,jdbcType=TIMESTAMP}, #{item.isRemark,jdbcType=VARCHAR}, #{item.isTimePoint,jdbcType=VARCHAR},
  468. #{item.isRecorder,jdbcType=VARCHAR}, #{item.isRecordTime,jdbcType=TIMESTAMP}, #{item.isIsreview,jdbcType=INTEGER},
  469. #{item.isOperator,jdbcType=VARCHAR}, #{item.isOperatTime,jdbcType=TIMESTAMP}, #{item.isReviewId,jdbcType=VARCHAR},
  470. #{item.isReviewSource,jdbcType=VARCHAR}, #{item.isDegree,jdbcType=VARCHAR}, #{item.isIsdel,jdbcType=INTEGER},
  471. #{item.isStartTime,jdbcType=TIMESTAMP},#{item.isEndTime,jdbcType=TIMESTAMP}
  472. )
  473. </foreach>
  474. </insert>
  475. <update id="bulkUpdateIsReviewByList" >
  476. <if test="list != null">
  477. <foreach collection="list" item="item" index="index" open="" close="" separator=";">
  478. UPDATE inp_schedule
  479. SET IS_IsReview= 1,
  480. IS_Review_ID=#{item.ivId,jdbcType=INTEGER}
  481. WHERE IS_IsReview = 0
  482. <if test="beginDate != null">
  483. AND IS_Review_Time <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP}
  484. </if>
  485. <if test="endDate != null">
  486. AND IS_Review_Time <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP}
  487. </if>
  488. and PatientNo = #{item.patientNo,jdbcType=VARCHAR}
  489. and IS_Time_Point= #{item.timePoint,jdbcType=VARCHAR}
  490. and IS_Code = #{item.code,jdbcType=VARCHAR}
  491. </foreach>
  492. </if>
  493. </update>
  494. <update id="updateByTimeAndPatientNo">
  495. UPDATE inp_schedule
  496. SET IS_IsReview= 1,
  497. IS_Review_ID=#{iaId,jdbcType=INTEGER},
  498. IS_Operator = #{isOperator,jdbcType=VARCHAR},
  499. IS_Operat_Time = #{isOperatTime,jdbcType=TIMESTAMP},
  500. IS_Review_Source = #{isReviewSource,jdbcType=VARCHAR}
  501. WHERE IS_IsReview = 0
  502. AND IS_Start_Time <![CDATA[<=]]> #{recordTime,jdbcType=TIMESTAMP}
  503. AND IS_End_Time <![CDATA[>=]]> #{recordTime,jdbcType=TIMESTAMP}
  504. AND PatientNo = #{patientNo,jdbcType=VARCHAR}
  505. AND IS_Code = #{isCode,jdbcType=VARCHAR}
  506. AND DW_WardDm = #{dwWardDm,jdbcType=VARCHAR}
  507. AND IS_IsDel = 0
  508. </update>
  509. <select id="selectByDateRangeAndPatientList" resultMap="BaseResultMap">
  510. select
  511. <include refid="Base_Column_List"/>
  512. from inp_schedule
  513. where IS_IsReview = 0
  514. and IS_IsDel=0
  515. <if test="beginDate != null">
  516. AND IS_Review_Time <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP}
  517. </if>
  518. <if test="endDate != null">
  519. AND IS_Review_Time <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP}
  520. </if>
  521. <if test="list!=null">
  522. and PatientNo in
  523. <foreach collection="list" item="item" separator="," open="(" close=")" index="index">
  524. #{item}
  525. </foreach>
  526. </if>
  527. </select>
  528. <select id="selectByISCodes" resultMap="BaseResultMap">
  529. select
  530. <include refid="Base_Column_List"/>
  531. from inp_schedule
  532. where IS_IsReview = 0
  533. and IS_IsDel=0
  534. <if test="hiId != null">
  535. and HI_ID = #{hiId}
  536. </if>
  537. <if test="dwWardDm != null">
  538. and DW_WardDm = #{dwWardDm}
  539. </if>
  540. <if test="patientNo != null">
  541. and patientNo = #{patientNo}
  542. </if>
  543. <if test="list != null and list.size > 0">
  544. and is_code in
  545. <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
  546. #{item}
  547. </foreach>
  548. </if>
  549. limit 1
  550. </select>
  551. <update id="deleteInpScheduleByCode">
  552. UPDATE inp_schedule
  553. SET IS_IsDel = -1
  554. WHERE IS_IsReview = 0
  555. AND PatientNo = #{patientNo,jdbcType=VARCHAR}
  556. AND IS_Code = #{isCode,jdbcType=VARCHAR}
  557. AND DW_WardDm = #{dwWardDm,jdbcType=VARCHAR}
  558. AND HI_ID = #{hiId,jdbcType=INTEGER}
  559. AND IS_IsDel = 0
  560. </update>
  561. <update id="updateBySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSchedule">
  562. UPDATE inp_schedule
  563. SET
  564. IS_IsReview= 1
  565. WHERE
  566. IS_IsDel = 0
  567. <if test="patientno != null" >
  568. AND PatientNo = #{patientno,jdbcType=VARCHAR}
  569. </if>
  570. <if test="hiId != null" >
  571. AND HI_ID = #{hiId,jdbcType=INTEGER}
  572. </if>
  573. <if test="dwWarddm != null" >
  574. AND DW_WardDm = #{dwWarddm,jdbcType=VARCHAR}
  575. </if>
  576. <if test="isReviewId != null" >
  577. AND IS_Review_ID = #{isReviewId,jdbcType=VARCHAR}
  578. </if>
  579. <if test="isReviewSource != null" >
  580. AND IS_Review_Source = #{isReviewSource,jdbcType=VARCHAR}
  581. </if>
  582. </update>
  583. <select id="selectIsReviewByList" resultType="java.lang.Integer">
  584. <foreach collection="list" item="item" index="index" open="" close="" separator=";">
  585. select is_id from inp_schedule
  586. WHERE IS_IsReview = 0
  587. and IS_IsDel = 0
  588. <if test="beginDate != null">
  589. AND IS_Review_Time <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP}
  590. </if>
  591. <if test="endDate != null">
  592. AND IS_Review_Time <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP}
  593. </if>
  594. <if test="timePoint !=null">
  595. and is_time_point =#{timePoint,jdbcType=VARCHAR}
  596. </if>
  597. and PatientNo = #{item.patientNo,jdbcType=VARCHAR}
  598. and IS_Code = #{item.code,jdbcType=VARCHAR}
  599. </foreach>
  600. </select>
  601. <select id="selectScheduleByCode" resultMap="BaseResultMap">
  602. select
  603. <include refid="Base_Column_List"/>
  604. from inp_schedule
  605. WHERE IS_IsReview = 0
  606. and IS_IsDel = 0
  607. <if test="beginDate != null">
  608. AND IS_Review_Time <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP}
  609. </if>
  610. <if test="endDate != null">
  611. AND IS_Review_Time <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP}
  612. </if>
  613. <if test="timePoint !=null">
  614. and is_time_point =#{timePoint,jdbcType=VARCHAR}
  615. </if>
  616. <if test="isCode !=null">
  617. and IS_Code = #{isCode,jdbcType=VARCHAR}
  618. </if>
  619. and PatientNo in
  620. <foreach collection="list" separator="," open="(" close=")" index="index" item="item">
  621. #{item,jdbcType=VARCHAR}
  622. </foreach>
  623. </select>
  624. <select id="selectByCodeAndIsIsreview" resultMap="BaseResultMap">
  625. SELECT
  626. <include refid="Base_Column_List"/>
  627. FROM
  628. inp_schedule
  629. WHERE
  630. IS_Code = #{isCode,jdbcType=VARCHAR}
  631. AND IS_IsReview = #{isIsreview,jdbcType=INTEGER}
  632. AND IS_IsDel = 0
  633. </select>
  634. </mapper>