ComExamReportMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  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.pubservice.mysqlmapper.ComExamReportMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.pubservice.mysqlModel.ComExamReport" >
  5. <id column="CER_ID" property="cerId" 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="CER_Advice_ID" property="cerAdviceId" jdbcType="VARCHAR" />
  12. <result column="CRE_Record_ID" property="creRecordId" jdbcType="VARCHAR" />
  13. <result column="CER_Visit_No" property="cerVisitNo" jdbcType="VARCHAR" />
  14. <result column="CER_Apply_No" property="cerApplyNo" jdbcType="VARCHAR" />
  15. <result column="CER_Report_Name" property="cerReportName" jdbcType="VARCHAR" />
  16. <result column="CER_Part_Code" property="cerPartCode" jdbcType="VARCHAR" />
  17. <result column="CER_Part" property="cerPart" jdbcType="VARCHAR" />
  18. <result column="CER_Model" property="cerModel" jdbcType="VARCHAR" />
  19. <result column="CER_Exam_Finding" property="cerExamFinding" jdbcType="VARCHAR" />
  20. <result column="CER_Exam_Result" property="cerExamResult" jdbcType="VARCHAR" />
  21. <result column="CER_Diag_Name" property="cerDiagName" jdbcType="VARCHAR" />
  22. <result column="CER_Image_ID" property="cerImageId" jdbcType="VARCHAR" />
  23. <result column="CER_Reporter" property="cerReporter" jdbcType="VARCHAR" />
  24. <result column="CER_Report_Time" property="cerReportTime" jdbcType="TIMESTAMP" />
  25. <result column="CER_Examiner" property="cerExaminer" jdbcType="VARCHAR" />
  26. <result column="CER_Exam_Time" property="cerExamTime" jdbcType="TIMESTAMP" />
  27. <result column="CER_Checker" property="cerChecker" jdbcType="VARCHAR" />
  28. <result column="CER_Check_Time" property="cerCheckTime" jdbcType="TIMESTAMP" />
  29. <result column="CER_IsDel" property="cerIsdel" jdbcType="INTEGER" />
  30. <result column="CER_Operation_Time" property="cerOperationTime" jdbcType="TIMESTAMP" />
  31. <result column="CER_Operator" property="cerOperator" jdbcType="VARCHAR" />
  32. <result column="CER_Delreason" property="cerDelreason" jdbcType="VARCHAR" />
  33. <result column="CER_IsInp" property="cerIsinp" jdbcType="INTEGER" />
  34. <result column="UI_Name" property="doctorName" jdbcType="VARCHAR" />
  35. </resultMap>
  36. <sql id="Base_Column_List" >
  37. CER_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, CER_Advice_ID, CRE_Record_ID,
  38. CER_Visit_No, CER_Apply_No, CER_Report_Name, CER_Part_Code, CER_Part, CER_Model,
  39. CER_Exam_Finding, CER_Exam_Result, CER_Diag_Name, CER_Image_ID, CER_Reporter, CER_Report_Time,
  40. CER_Examiner, CER_Exam_Time, CER_Checker, CER_Check_Time, CER_IsDel, CER_Operation_Time,
  41. CER_Operator, CER_Delreason, CER_IsInp
  42. </sql>
  43. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  44. select
  45. <include refid="Base_Column_List" />
  46. from com_exam_report
  47. where CER_ID = #{cerId,jdbcType=INTEGER}
  48. </select>
  49. <select id="selectByConditions" resultMap="BaseResultMap" >
  50. SELECT DISTINCT a.*, c.UI_Name doctorName from com_exam_report a
  51. LEFT JOIN inp_med_order b on a.CER_Advice_ID = b.IMO_Order_ID
  52. LEFT JOIN sys_userinfo c on b.IMO_Opener = c.UI_Code
  53. where a.PatientNo in
  54. <foreach collection="list" separator="," open="(" close=")" item="item">
  55. #{item,jdbcType=VARCHAR}
  56. </foreach>
  57. and a.CER_Report_Time &gt;= #{reportSTime,jdbcType=TIMESTAMP}
  58. and a.CER_Report_Time &lt; #{reportETime,jdbcType=TIMESTAMP}
  59. and IFNULL(a.CER_IsDel,0) = 0
  60. ORDER BY a.CER_Exam_Time desc
  61. </select>
  62. <select id="selectQuotaData" resultMap="BaseResultMap" >
  63. SELECT CER_Model,count(*) quota
  64. from com_exam_report
  65. where 1=1
  66. <if test="wardDm != null" >
  67. and DW_WardDm = #{wardDm,jdbcType=VARCHAR}
  68. </if>
  69. and CER_Report_Time &gt;= #{reportSTime,jdbcType=TIMESTAMP}
  70. and CER_Report_Time &lt; #{reportETime,jdbcType=TIMESTAMP}
  71. and IFNULL(CER_IsDel,0) = 0 GROUP BY CER_Model
  72. </select>
  73. <select id="selectByIds" resultMap="BaseResultMap" >
  74. select
  75. <include refid="Base_Column_List" />
  76. from com_exam_report
  77. where CER_ID in <foreach item='item' index='index' collection='list' open='(' separator=',' close=')'> #{item} </foreach>
  78. and IFNULL(CER_IsDel,0) = 0
  79. </select>
  80. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  81. delete from com_exam_report
  82. where CER_ID = #{cerId,jdbcType=VARCHAR}
  83. </delete>
  84. <insert id="insert" parameterType="com.xinxin.topro.pubservice.mysqlModel.ComExamReport" >
  85. insert into com_exam_report (CER_ID, PatientNo, HI_ID,
  86. DD_DepDm, DW_WardDm, DB_BedNo,
  87. CER_Advice_ID, CRE_Record_ID, CER_Visit_No,
  88. CER_Apply_No, CER_Report_Name, CER_Part_Code,
  89. CER_Part, CER_Model, CER_Exam_Finding,
  90. CER_Exam_Result, CER_Diag_Name, CER_Image_ID,
  91. CER_Reporter, CER_Report_Time, CER_Examiner,
  92. CER_Exam_Time, CER_Checker, CER_Check_Time,
  93. CER_IsDel, CER_Operation_Time, CER_Operator,
  94. CER_Delreason, CER_IsInp)
  95. values (#{cerId,jdbcType=INTEGER}, #{patientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER},
  96. #{ddDepdm,jdbcType=VARCHAR}, #{dwWarddm,jdbcType=VARCHAR}, #{dbBedno,jdbcType=VARCHAR},
  97. #{cerAdviceId,jdbcType=VARCHAR}, #{creRecordId,jdbcType=VARCHAR}, #{cerVisitNo,jdbcType=VARCHAR},
  98. #{cerApplyNo,jdbcType=VARCHAR}, #{cerReportName,jdbcType=VARCHAR}, #{cerPartCode,jdbcType=VARCHAR},
  99. #{cerPart,jdbcType=VARCHAR}, #{cerModel,jdbcType=VARCHAR}, #{cerExamFinding,jdbcType=VARCHAR},
  100. #{cerExamResult,jdbcType=VARCHAR}, #{cerDiagName,jdbcType=VARCHAR}, #{cerImageId,jdbcType=VARCHAR},
  101. #{cerReporter,jdbcType=VARCHAR}, #{cerReportTime,jdbcType=TIMESTAMP}, #{cerExaminer,jdbcType=VARCHAR},
  102. #{cerExamTime,jdbcType=TIMESTAMP}, #{cerChecker,jdbcType=VARCHAR}, #{cerCheckTime,jdbcType=TIMESTAMP},
  103. #{cerIsdel,jdbcType=INTEGER}, #{cerOperationTime,jdbcType=TIMESTAMP}, #{cerOperator,jdbcType=VARCHAR},
  104. #{cerDelreason,jdbcType=VARCHAR}, #{cerIsinp,jdbcType=INTEGER})
  105. </insert>
  106. <insert id="insertSelective" parameterType="com.xinxin.topro.pubservice.mysqlModel.ComExamReport" >
  107. insert into com_exam_report
  108. <trim prefix="(" suffix=")" suffixOverrides="," >
  109. <if test="cerId != null" >
  110. CER_ID,
  111. </if>
  112. <if test="patientno != null" >
  113. PatientNo,
  114. </if>
  115. <if test="hiId != null" >
  116. HI_ID,
  117. </if>
  118. <if test="ddDepdm != null" >
  119. DD_DepDm,
  120. </if>
  121. <if test="dwWarddm != null" >
  122. DW_WardDm,
  123. </if>
  124. <if test="dbBedno != null" >
  125. DB_BedNo,
  126. </if>
  127. <if test="cerAdviceId != null" >
  128. CER_Advice_ID,
  129. </if>
  130. <if test="creRecordId != null" >
  131. CRE_Record_ID,
  132. </if>
  133. <if test="cerVisitNo != null" >
  134. CER_Visit_No,
  135. </if>
  136. <if test="cerApplyNo != null" >
  137. CER_Apply_No,
  138. </if>
  139. <if test="cerReportName != null" >
  140. CER_Report_Name,
  141. </if>
  142. <if test="cerPartCode != null" >
  143. CER_Part_Code,
  144. </if>
  145. <if test="cerPart != null" >
  146. CER_Part,
  147. </if>
  148. <if test="cerModel != null" >
  149. CER_Model,
  150. </if>
  151. <if test="cerExamFinding != null" >
  152. CER_Exam_Finding,
  153. </if>
  154. <if test="cerExamResult != null" >
  155. CER_Exam_Result,
  156. </if>
  157. <if test="cerDiagName != null" >
  158. CER_Diag_Name,
  159. </if>
  160. <if test="cerImageId != null" >
  161. CER_Image_ID,
  162. </if>
  163. <if test="cerReporter != null" >
  164. CER_Reporter,
  165. </if>
  166. <if test="cerReportTime != null" >
  167. CER_Report_Time,
  168. </if>
  169. <if test="cerExaminer != null" >
  170. CER_Examiner,
  171. </if>
  172. <if test="cerExamTime != null" >
  173. CER_Exam_Time,
  174. </if>
  175. <if test="cerChecker != null" >
  176. CER_Checker,
  177. </if>
  178. <if test="cerCheckTime != null" >
  179. CER_Check_Time,
  180. </if>
  181. <if test="cerIsdel != null" >
  182. CER_IsDel,
  183. </if>
  184. <if test="cerOperationTime != null" >
  185. CER_Operation_Time,
  186. </if>
  187. <if test="cerOperator != null" >
  188. CER_Operator,
  189. </if>
  190. <if test="cerDelreason != null" >
  191. CER_Delreason,
  192. </if>
  193. <if test="cerIsinp != null" >
  194. CER_IsInp,
  195. </if>
  196. </trim>
  197. <trim prefix="values (" suffix=")" suffixOverrides="," >
  198. <if test="cerId != null" >
  199. #{cerId,jdbcType=INTEGER},
  200. </if>
  201. <if test="patientno != null" >
  202. #{patientno,jdbcType=VARCHAR},
  203. </if>
  204. <if test="hiId != null" >
  205. #{hiId,jdbcType=INTEGER},
  206. </if>
  207. <if test="ddDepdm != null" >
  208. #{ddDepdm,jdbcType=VARCHAR},
  209. </if>
  210. <if test="dwWarddm != null" >
  211. #{dwWarddm,jdbcType=VARCHAR},
  212. </if>
  213. <if test="dbBedno != null" >
  214. #{dbBedno,jdbcType=VARCHAR},
  215. </if>
  216. <if test="cerAdviceId != null" >
  217. #{cerAdviceId,jdbcType=VARCHAR},
  218. </if>
  219. <if test="creRecordId != null" >
  220. #{creRecordId,jdbcType=VARCHAR},
  221. </if>
  222. <if test="cerVisitNo != null" >
  223. #{cerVisitNo,jdbcType=VARCHAR},
  224. </if>
  225. <if test="cerApplyNo != null" >
  226. #{cerApplyNo,jdbcType=VARCHAR},
  227. </if>
  228. <if test="cerReportName != null" >
  229. #{cerReportName,jdbcType=VARCHAR},
  230. </if>
  231. <if test="cerPartCode != null" >
  232. #{cerPartCode,jdbcType=VARCHAR},
  233. </if>
  234. <if test="cerPart != null" >
  235. #{cerPart,jdbcType=VARCHAR},
  236. </if>
  237. <if test="cerModel != null" >
  238. #{cerModel,jdbcType=VARCHAR},
  239. </if>
  240. <if test="cerExamFinding != null" >
  241. #{cerExamFinding,jdbcType=VARCHAR},
  242. </if>
  243. <if test="cerExamResult != null" >
  244. #{cerExamResult,jdbcType=VARCHAR},
  245. </if>
  246. <if test="cerDiagName != null" >
  247. #{cerDiagName,jdbcType=VARCHAR},
  248. </if>
  249. <if test="cerImageId != null" >
  250. #{cerImageId,jdbcType=VARCHAR},
  251. </if>
  252. <if test="cerReporter != null" >
  253. #{cerReporter,jdbcType=VARCHAR},
  254. </if>
  255. <if test="cerReportTime != null" >
  256. #{cerReportTime,jdbcType=TIMESTAMP},
  257. </if>
  258. <if test="cerExaminer != null" >
  259. #{cerExaminer,jdbcType=VARCHAR},
  260. </if>
  261. <if test="cerExamTime != null" >
  262. #{cerExamTime,jdbcType=TIMESTAMP},
  263. </if>
  264. <if test="cerChecker != null" >
  265. #{cerChecker,jdbcType=VARCHAR},
  266. </if>
  267. <if test="cerCheckTime != null" >
  268. #{cerCheckTime,jdbcType=TIMESTAMP},
  269. </if>
  270. <if test="cerIsdel != null" >
  271. #{cerIsdel,jdbcType=INTEGER},
  272. </if>
  273. <if test="cerOperationTime != null" >
  274. #{cerOperationTime,jdbcType=TIMESTAMP},
  275. </if>
  276. <if test="cerOperator != null" >
  277. #{cerOperator,jdbcType=VARCHAR},
  278. </if>
  279. <if test="cerDelreason != null" >
  280. #{cerDelreason,jdbcType=VARCHAR},
  281. </if>
  282. <if test="cerIsinp != null" >
  283. #{cerIsinp,jdbcType=INTEGER},
  284. </if>
  285. </trim>
  286. </insert>
  287. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.pubservice.mysqlModel.ComExamReport" >
  288. update com_exam_report
  289. <set >
  290. <if test="patientno != null" >
  291. PatientNo = #{patientno,jdbcType=VARCHAR},
  292. </if>
  293. <if test="hiId != null" >
  294. HI_ID = #{hiId,jdbcType=INTEGER},
  295. </if>
  296. <if test="ddDepdm != null" >
  297. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  298. </if>
  299. <if test="dwWarddm != null" >
  300. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  301. </if>
  302. <if test="dbBedno != null" >
  303. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  304. </if>
  305. <if test="cerAdviceId != null" >
  306. CER_Advice_ID = #{cerAdviceId,jdbcType=VARCHAR},
  307. </if>
  308. <if test="creRecordId != null" >
  309. CRE_Record_ID = #{creRecordId,jdbcType=VARCHAR},
  310. </if>
  311. <if test="cerVisitNo != null" >
  312. CER_Visit_No = #{cerVisitNo,jdbcType=VARCHAR},
  313. </if>
  314. <if test="cerApplyNo != null" >
  315. CER_Apply_No = #{cerApplyNo,jdbcType=VARCHAR},
  316. </if>
  317. <if test="cerReportName != null" >
  318. CER_Report_Name = #{cerReportName,jdbcType=VARCHAR},
  319. </if>
  320. <if test="cerPartCode != null" >
  321. CER_Part_Code = #{cerPartCode,jdbcType=VARCHAR},
  322. </if>
  323. <if test="cerPart != null" >
  324. CER_Part = #{cerPart,jdbcType=VARCHAR},
  325. </if>
  326. <if test="cerModel != null" >
  327. CER_Model = #{cerModel,jdbcType=VARCHAR},
  328. </if>
  329. <if test="cerExamFinding != null" >
  330. CER_Exam_Finding = #{cerExamFinding,jdbcType=VARCHAR},
  331. </if>
  332. <if test="cerExamResult != null" >
  333. CER_Exam_Result = #{cerExamResult,jdbcType=VARCHAR},
  334. </if>
  335. <if test="cerDiagName != null" >
  336. CER_Diag_Name = #{cerDiagName,jdbcType=VARCHAR},
  337. </if>
  338. <if test="cerImageId != null" >
  339. CER_Image_ID = #{cerImageId,jdbcType=VARCHAR},
  340. </if>
  341. <if test="cerReporter != null" >
  342. CER_Reporter = #{cerReporter,jdbcType=VARCHAR},
  343. </if>
  344. <if test="cerReportTime != null" >
  345. CER_Report_Time = #{cerReportTime,jdbcType=TIMESTAMP},
  346. </if>
  347. <if test="cerExaminer != null" >
  348. CER_Examiner = #{cerExaminer,jdbcType=VARCHAR},
  349. </if>
  350. <if test="cerExamTime != null" >
  351. CER_Exam_Time = #{cerExamTime,jdbcType=TIMESTAMP},
  352. </if>
  353. <if test="cerChecker != null" >
  354. CER_Checker = #{cerChecker,jdbcType=VARCHAR},
  355. </if>
  356. <if test="cerCheckTime != null" >
  357. CER_Check_Time = #{cerCheckTime,jdbcType=TIMESTAMP},
  358. </if>
  359. <if test="cerIsdel != null" >
  360. CER_IsDel = #{cerIsdel,jdbcType=INTEGER},
  361. </if>
  362. <if test="cerOperationTime != null" >
  363. CER_Operation_Time = #{cerOperationTime,jdbcType=TIMESTAMP},
  364. </if>
  365. <if test="cerOperator != null" >
  366. CER_Operator = #{cerOperator,jdbcType=VARCHAR},
  367. </if>
  368. <if test="cerDelreason != null" >
  369. CER_Delreason = #{cerDelreason,jdbcType=VARCHAR},
  370. </if>
  371. <if test="cerIsinp != null" >
  372. CER_IsInp = #{cerIsinp,jdbcType=INTEGER},
  373. </if>
  374. </set>
  375. where CER_ID = #{cerId,jdbcType=INTEGER}
  376. </update>
  377. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.pubservice.mysqlModel.ComExamReport" >
  378. update com_exam_report
  379. set PatientNo = #{patientno,jdbcType=VARCHAR},
  380. HI_ID = #{hiId,jdbcType=INTEGER},
  381. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  382. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  383. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  384. CER_Advice_ID = #{cerAdviceId,jdbcType=VARCHAR},
  385. CRE_Record_ID = #{creRecordId,jdbcType=VARCHAR},
  386. CER_Visit_No = #{cerVisitNo,jdbcType=VARCHAR},
  387. CER_Apply_No = #{cerApplyNo,jdbcType=VARCHAR},
  388. CER_Report_Name = #{cerReportName,jdbcType=VARCHAR},
  389. CER_Part_Code = #{cerPartCode,jdbcType=VARCHAR},
  390. CER_Part = #{cerPart,jdbcType=VARCHAR},
  391. CER_Model = #{cerModel,jdbcType=VARCHAR},
  392. CER_Exam_Finding = #{cerExamFinding,jdbcType=VARCHAR},
  393. CER_Exam_Result = #{cerExamResult,jdbcType=VARCHAR},
  394. CER_Diag_Name = #{cerDiagName,jdbcType=VARCHAR},
  395. CER_Image_ID = #{cerImageId,jdbcType=VARCHAR},
  396. CER_Reporter = #{cerReporter,jdbcType=VARCHAR},
  397. CER_Report_Time = #{cerReportTime,jdbcType=TIMESTAMP},
  398. CER_Examiner = #{cerExaminer,jdbcType=VARCHAR},
  399. CER_Exam_Time = #{cerExamTime,jdbcType=TIMESTAMP},
  400. CER_Checker = #{cerChecker,jdbcType=VARCHAR},
  401. CER_Check_Time = #{cerCheckTime,jdbcType=TIMESTAMP},
  402. CER_IsDel = #{cerIsdel,jdbcType=INTEGER},
  403. CER_Operation_Time = #{cerOperationTime,jdbcType=TIMESTAMP},
  404. CER_Operator = #{cerOperator,jdbcType=VARCHAR},
  405. CER_Delreason = #{cerDelreason,jdbcType=VARCHAR},
  406. CER_IsInp = #{cerIsinp,jdbcType=INTEGER}
  407. where CER_ID = #{cerId,jdbcType=INTEGER}
  408. </update>
  409. </mapper>