HomePageMapper.xml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  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.diagbot.mapper.HomePageMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.diagbot.entity.HomePage">
  6. <id column="home_page_id" property="homePageId" />
  7. <result column="hospital_id" property="hospitalId" />
  8. <result column="behospital_code" property="behospitalCode" />
  9. <result column="hospital_code" property="hospitalCode" />
  10. <result column="hospital_name" property="hospitalName" />
  11. <result column="org_code" property="orgCode" />
  12. <result column="pay_type" property="payType" />
  13. <result column="health_card" property="healthCard" />
  14. <result column="behospital_num" property="behospitalNum" />
  15. <result column="file_code" property="fileCode" />
  16. <result column="name" property="name" />
  17. <result column="sex" property="sex" />
  18. <result column="birthday" property="birthday" />
  19. <result column="age" property="age" />
  20. <result column="age_unit" property="ageUnit" />
  21. <result column="nationality" property="nationality" />
  22. <result column="newborn_month" property="newbornMonth" />
  23. <result column="newborn_day" property="newbornDay" />
  24. <result column="newborn_weight" property="newbornWeight" />
  25. <result column="newborn_behospital_weight" property="newbornBehospitalWeight" />
  26. <result column="born_address" property="bornAddress" />
  27. <result column="born_place" property="bornPlace" />
  28. <result column="nation" property="nation" />
  29. <result column="identity_card_no" property="identityCardNo" />
  30. <result column="job_type" property="jobType" />
  31. <result column="marriage" property="marriage" />
  32. <result column="cur_address" property="curAddress" />
  33. <result column="cur_phone" property="curPhone" />
  34. <result column="cur_post_code" property="curPostCode" />
  35. <result column="residence_address" property="residenceAddress" />
  36. <result column="residence_post_code" property="residencePostCode" />
  37. <result column="work_address" property="workAddress" />
  38. <result column="work_phone" property="workPhone" />
  39. <result column="work_post_code" property="workPostCode" />
  40. <result column="contact_name" property="contactName" />
  41. <result column="contact_relation" property="contactRelation" />
  42. <result column="contact_address" property="contactAddress" />
  43. <result column="contact_phone" property="contactPhone" />
  44. <result column="behospital_way" property="behospitalWay" />
  45. <result column="behospital_date" property="behospitalDate" />
  46. <result column="behospital_dept" property="behospitalDept" />
  47. <result column="behospital_ward" property="behospitalWard" />
  48. <result column="behospital_bed_id" property="behospitalBedId" />
  49. <result column="behospital_bed_code" property="behospitalBedCode" />
  50. <result column="change_dept" property="changeDept" />
  51. <result column="leave_hospital_date" property="leaveHospitalDate" />
  52. <result column="leave_hospital_dept" property="leaveHospitalDept" />
  53. <result column="leave_hospital_ward" property="leaveHospitalWard" />
  54. <result column="leave_hospital_bed_id" property="leaveHospitalBedId" />
  55. <result column="leave_hospital_bed_code" property="leaveHospitalBedCode" />
  56. <result column="behospital_day_num" property="behospitalDayNum" />
  57. <result column="outpatient_emr_diagnose" property="outpatientEmrDiagnose" />
  58. <result column="outpatient_emr_diagnose_code" property="outpatientEmrDiagnoseCode" />
  59. <result column="poison_factor" property="poisonFactor" />
  60. <result column="poison_factor_code" property="poisonFactorCode" />
  61. <result column="pathology_diagnose" property="pathologyDiagnose" />
  62. <result column="pathology_diagnose_code" property="pathologyDiagnoseCode" />
  63. <result column="pathology_diagnose_id" property="pathologyDiagnoseId" />
  64. <result column="is_med_allergy" property="isMedAllergy" />
  65. <result column="med_allergy_name" property="medAllergyName" />
  66. <result column="autopsy" property="autopsy" />
  67. <result column="blood_type" property="bloodType" />
  68. <result column="rh" property="rh" />
  69. <result column="dept_director" property="deptDirector" />
  70. <result column="director_doctor" property="directorDoctor" />
  71. <result column="attending_doctor" property="attendingDoctor" />
  72. <result column="behospital_doctor" property="behospitalDoctor" />
  73. <result column="response_nurse" property="responseNurse" />
  74. <result column="study_doctor" property="studyDoctor" />
  75. <result column="practice_doctor" property="practiceDoctor" />
  76. <result column="encode_man" property="encodeMan" />
  77. <result column="home_page_quality" property="homePageQuality" />
  78. <result column="qc_doctor" property="qcDoctor" />
  79. <result column="qc_nurse" property="qcNurse" />
  80. <result column="qc_date" property="qcDate" />
  81. <result column="leave_hospital_type" property="leaveHospitalType" />
  82. <result column="accept_org_code" property="acceptOrgCode" />
  83. <result column="again_behospital_plan" property="againBehospitalPlan" />
  84. <result column="again_behospital_goal" property="againBehospitalGoal" />
  85. <result column="tbi_before_day" property="tbiBeforeDay" />
  86. <result column="tbi_before_hour" property="tbiBeforeHour" />
  87. <result column="tbi_before_minute" property="tbiBeforeMinute" />
  88. <result column="tbi_after_day" property="tbiAfterDay" />
  89. <result column="tbi_after_hour" property="tbiAfterHour" />
  90. <result column="tbi_after_minute" property="tbiAfterMinute" />
  91. <result column="total_fee" property="totalFee" />
  92. <result column="own_fee" property="ownFee" />
  93. <result column="general_fee" property="generalFee" />
  94. <result column="service_fee" property="serviceFee" />
  95. <result column="nurse_fee" property="nurseFee" />
  96. <result column="other_fee" property="otherFee" />
  97. <result column="pathology_fee" property="pathologyFee" />
  98. <result column="lab_fee" property="labFee" />
  99. <result column="pacs_fee" property="pacsFee" />
  100. <result column="clinic_diagnose_fee" property="clinicDiagnoseFee" />
  101. <result column="not_operation_fee" property="notOperationFee" />
  102. <result column="clinic_physic_fee" property="clinicPhysicFee" />
  103. <result column="operation_treat_fee" property="operationTreatFee" />
  104. <result column="anaesthesia_fee" property="anaesthesiaFee" />
  105. <result column="operation_fee" property="operationFee" />
  106. <result column="health_type_fee" property="healthTypeFee" />
  107. <result column="chn_treat_fee" property="chnTreatFee" />
  108. <result column="western_med_fee" property="westernMedFee" />
  109. <result column="antibiosis_fee" property="antibiosisFee" />
  110. <result column="chn_med_fee" property="chnMedFee" />
  111. <result column="chn_herb_fee" property="chnHerbFee" />
  112. <result column="blood_fee" property="bloodFee" />
  113. <result column="albumen_fee" property="albumenFee" />
  114. <result column="globulin_fee" property="globulinFee" />
  115. <result column="blood_factor_fee" property="bloodFactorFee" />
  116. <result column="cell_factor_fee" property="cellFactorFee" />
  117. <result column="check_material_fee" property="checkMaterialFee" />
  118. <result column="treat_material_fee" property="treatMaterialFee" />
  119. <result column="operation_material_fee" property="operationMaterialFee" />
  120. <result column="other_type_fee" property="otherTypeFee" />
  121. <result column="single_diag_manage" property="singleDiagManage" />
  122. <result column="clinic_pathway_manage" property="clinicPathwayManage" />
  123. <result column="is_outpatient_behospital" property="isOutpatientBehospital" />
  124. <result column="is_leave_behospital" property="isLeaveBehospital" />
  125. <result column="is_operation_before_after" property="isOperationBeforeAfter" />
  126. <result column="is_clinic_pathology" property="isClinicPathology" />
  127. <result column="is_radiate_pathology" property="isRadiatePathology" />
  128. <result column="rescue_num" property="rescueNum" />
  129. <result column="rescue_success_num" property="rescueSuccessNum" />
  130. <result column="is_auto_leavehospital" property="isAutoLeavehospital" />
  131. <result column="return_to_type" property="returnToType" />
  132. <result column="is_deleted" property="isDeleted" />
  133. <result column="gmt_create" property="gmtCreate" />
  134. <result column="gmt_modified" property="gmtModified" />
  135. <result column="creator" property="creator" />
  136. <result column="modifier" property="modifier" />
  137. </resultMap>
  138. <!-- 按科室统计平均住院天数 -->
  139. <select id="getAverageDayNum" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.AverageStatisticsDTO">
  140. SELECT
  141. a.beh_dept_id as id,
  142. a.beh_dept_name as name,
  143. count(*) AS num,
  144. round( sum( CAST(b.behospital_day_num AS DECIMAL ( 18, 2 ) ))/ count(*), 2 ) AS averageValue,
  145. round( sum( CAST(b.behospital_day_num AS DECIMAL ( 18, 2 ) )), 2 ) AS totleValue
  146. FROM
  147. med_behospital_info a,
  148. med_home_page b
  149. WHERE
  150. a.hospital_id = b.hospital_id
  151. AND a.behospital_code = b.behospital_code
  152. AND a.is_deleted = 'N'
  153. AND b.is_deleted = 'N'
  154. AND a.is_placefile = '1'
  155. <![CDATA[AND a.qc_type_id <>0 ]]>
  156. <if test="hospitalId != null and hospitalId != ''">
  157. AND a.hospital_id = #{hospitalId}
  158. </if>
  159. <if test="startDate != null and startDate != ''">
  160. <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
  161. </if>
  162. <if test="endDate != null and endDate != ''">
  163. <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
  164. </if>
  165. GROUP BY
  166. a.beh_dept_id,
  167. a.beh_dept_name
  168. </select>
  169. <!-- 按科室统计平均费用 -->
  170. <select id="getAverageFee" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.AverageStatisticsDTO">
  171. SELECT
  172. a.beh_dept_id as id,
  173. a.beh_dept_name as name,
  174. count(*) AS num,
  175. round( sum( CAST(b.total_fee AS DECIMAL ( 18, 2 ) ))/ count(*), 2 ) AS averageValue,
  176. round( sum( CAST(b.total_fee AS DECIMAL ( 18, 2 ) )), 2 ) AS totleValue
  177. FROM
  178. med_behospital_info a,
  179. med_home_page b
  180. WHERE
  181. a.hospital_id = b.hospital_id
  182. AND a.behospital_code = b.behospital_code
  183. AND a.is_deleted = 'N'
  184. AND b.is_deleted = 'N'
  185. AND a.is_placefile = '1'
  186. <![CDATA[AND a.qc_type_id <>0 ]]>
  187. <if test="hospitalId != null and hospitalId != ''">
  188. AND a.hospital_id = #{hospitalId}
  189. </if>
  190. <if test="startDate != null and startDate != ''">
  191. <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
  192. </if>
  193. <if test="endDate != null and endDate != ''">
  194. <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
  195. </if>
  196. GROUP BY
  197. a.beh_dept_id,
  198. a.beh_dept_name
  199. </select>
  200. <!-- 按科室统计平均住院天数 (分页)-->
  201. <select id="getAverageDayNumPage" resultType="com.diagbot.dto.AverageStatisticsDTO">
  202. SELECT t1.*
  203. FROM
  204. (SELECT
  205. t.id,
  206. t.NAME,
  207. sum( t.averageValue ) AS averageValue,
  208. sum( t.lastAverageValue ) AS lastAverageValue,
  209. sum( t.lastYearAverageValue ) AS lastYearAverageValue
  210. FROM
  211. (
  212. (
  213. SELECT
  214. a.beh_dept_id AS id,
  215. a.beh_dept_name AS NAME,
  216. count(*) AS num,
  217. round( sum( CAST( b.behospital_day_num AS DECIMAL ( 18, 2 ) ))/ count(*), 2 ) AS averageValue,
  218. 0 AS lastAverageValue,
  219. 0 AS lastYearAverageValue
  220. FROM
  221. med_behospital_info a,
  222. med_home_page b
  223. WHERE
  224. a.hospital_id = b.hospital_id
  225. AND a.behospital_code = b.behospital_code
  226. AND a.is_deleted = 'N'
  227. AND b.is_deleted = 'N'
  228. AND a.is_placefile = '1'
  229. <![CDATA[AND a.qc_type_id <>0 ]]>
  230. <if test="filterPageByAverageVO.hospitalId != null and filterPageByAverageVO.hospitalId != ''">
  231. AND a.hospital_id = #{filterPageByAverageVO.hospitalId}
  232. </if>
  233. <if test="filterPageByAverageVO.startDate != null and filterPageByAverageVO.startDate != ''">
  234. <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageByAverageVO.startDate})]]>
  235. </if>
  236. <if test="filterPageByAverageVO.endDate != null and filterPageByAverageVO.endDate != ''">
  237. <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageByAverageVO.endDate})]]>
  238. </if>
  239. <if test="filterPageByAverageVO.name != null and filterPageByAverageVO.name != ''">
  240. AND a.beh_dept_name like CONCAT('%', #{filterPageByAverageVO.name},'%')
  241. </if>
  242. GROUP BY
  243. a.beh_dept_id,
  244. a.beh_dept_name
  245. ) UNION
  246. (
  247. SELECT
  248. a.beh_dept_id AS id,
  249. a.beh_dept_name AS NAME,
  250. count(*) AS num,
  251. 0 AS averageValue,
  252. round( sum( CAST( b.behospital_day_num AS DECIMAL ( 18, 2 ) ))/ count(*), 2 ) AS lastAverageValue,
  253. 0 AS lastYearAverageValue
  254. FROM
  255. med_behospital_info a,
  256. med_home_page b
  257. WHERE
  258. a.hospital_id = b.hospital_id
  259. AND a.behospital_code = b.behospital_code
  260. AND a.is_deleted = 'N'
  261. AND b.is_deleted = 'N'
  262. AND a.is_placefile = '1'
  263. <![CDATA[AND a.qc_type_id <>0 ]]>
  264. <if test="filterPageByAverageVO.hospitalId != null and filterPageByAverageVO.hospitalId != ''">
  265. AND a.hospital_id = #{filterPageByAverageVO.hospitalId}
  266. </if>
  267. <if test="filterPageByAverageVO.lastStartDate != null and filterPageByAverageVO.lastStartDate != ''">
  268. <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageByAverageVO.lastStartDate})]]>
  269. </if>
  270. <if test="filterPageByAverageVO.lastEndDate != null and filterPageByAverageVO.lastEndDate != ''">
  271. <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageByAverageVO.lastEndDate})]]>
  272. </if>
  273. <if test="filterPageByAverageVO.name != null and filterPageByAverageVO.name != ''">
  274. AND a.beh_dept_name like CONCAT('%', #{filterPageByAverageVO.name},'%')
  275. </if>
  276. GROUP BY
  277. a.beh_dept_id,
  278. a.beh_dept_name
  279. ) UNION
  280. (
  281. SELECT
  282. a.beh_dept_id AS id,
  283. a.beh_dept_name AS NAME,
  284. count(*) AS num,
  285. 0 AS averageValue,
  286. 0 AS lastAverageValue,
  287. round( sum( CAST( b.behospital_day_num AS DECIMAL ( 18, 2 ) ))/ count(*), 2 ) AS lastYearAverageValue
  288. FROM
  289. med_behospital_info a,
  290. med_home_page b
  291. WHERE
  292. a.hospital_id = b.hospital_id
  293. AND a.behospital_code = b.behospital_code
  294. AND a.is_deleted = 'N'
  295. AND b.is_deleted = 'N'
  296. AND a.is_placefile = '1'
  297. <![CDATA[AND a.qc_type_id <>0 ]]>
  298. <if test="filterPageByAverageVO.hospitalId != null and filterPageByAverageVO.hospitalId != ''">
  299. AND a.hospital_id = #{filterPageByAverageVO.hospitalId}
  300. </if>
  301. <if test="filterPageByAverageVO.lastYearStartDate != null and filterPageByAverageVO.lastYearStartDate != ''">
  302. <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageByAverageVO.lastYearStartDate})]]>
  303. </if>
  304. <if test="filterPageByAverageVO.lastYearEndDate != null and filterPageByAverageVO.lastYearEndDate != ''">
  305. <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageByAverageVO.lastYearEndDate})]]>
  306. </if>
  307. <if test="filterPageByAverageVO.name != null and filterPageByAverageVO.name != ''">
  308. AND a.beh_dept_name like CONCAT('%', #{filterPageByAverageVO.name},'%')
  309. </if>
  310. GROUP BY
  311. a.beh_dept_id,
  312. a.beh_dept_name
  313. )
  314. ) t
  315. GROUP BY
  316. t.id,
  317. t.NAME
  318. ORDER BY
  319. t.averageValue DESC,
  320. t.lastAverageValue DESC,
  321. t.lastYearAverageValue DESC)
  322. t1
  323. </select>
  324. <!-- 按科室统计平均费用(分页) -->
  325. <select id="getAverageFeePage" resultType="com.diagbot.dto.AverageStatisticsDTO">
  326. SELECT t1.*
  327. FROM
  328. (SELECT
  329. t.id,
  330. t.NAME,
  331. sum( t.averageValue ) AS averageValue,
  332. sum( t.lastAverageValue ) AS lastAverageValue,
  333. sum( t.lastYearAverageValue ) AS lastYearAverageValue
  334. FROM
  335. (
  336. (
  337. SELECT
  338. a.beh_dept_id AS id,
  339. a.beh_dept_name AS NAME,
  340. count(*) AS num,
  341. round( sum( CAST( b.total_fee AS DECIMAL ( 18, 2 ) ))/ count(*), 2 ) AS averageValue,
  342. 0 AS lastAverageValue,
  343. 0 AS lastYearAverageValue
  344. FROM
  345. med_behospital_info a,
  346. med_home_page b
  347. WHERE
  348. a.hospital_id = b.hospital_id
  349. AND a.behospital_code = b.behospital_code
  350. AND a.is_deleted = 'N'
  351. AND b.is_deleted = 'N'
  352. AND a.is_placefile = '1'
  353. <![CDATA[AND a.qc_type_id <>0 ]]>
  354. <if test="filterPageByAverageVO.hospitalId != null and filterPageByAverageVO.hospitalId != ''">
  355. AND a.hospital_id = #{filterPageByAverageVO.hospitalId}
  356. </if>
  357. <if test="filterPageByAverageVO.startDate != null and filterPageByAverageVO.startDate != ''">
  358. <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageByAverageVO.startDate})]]>
  359. </if>
  360. <if test="filterPageByAverageVO.endDate != null and filterPageByAverageVO.endDate != ''">
  361. <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageByAverageVO.endDate})]]>
  362. </if>
  363. <if test="filterPageByAverageVO.name != null and filterPageByAverageVO.name != ''">
  364. AND a.beh_dept_name like CONCAT('%', #{filterPageByAverageVO.name},'%')
  365. </if>
  366. GROUP BY
  367. a.beh_dept_id,
  368. a.beh_dept_name
  369. ) UNION
  370. (
  371. SELECT
  372. a.beh_dept_id AS id,
  373. a.beh_dept_name AS NAME,
  374. count(*) AS num,
  375. 0 AS averageValue,
  376. round( sum( CAST( b.total_fee AS DECIMAL ( 18, 2 ) ))/ count(*), 2 ) AS lastAverageValue,
  377. 0 AS lastYearAverageValue
  378. FROM
  379. med_behospital_info a,
  380. med_home_page b
  381. WHERE
  382. a.hospital_id = b.hospital_id
  383. AND a.behospital_code = b.behospital_code
  384. AND a.is_deleted = 'N'
  385. AND b.is_deleted = 'N'
  386. AND a.is_placefile = '1'
  387. <![CDATA[AND a.qc_type_id <>0 ]]>
  388. <if test="filterPageByAverageVO.hospitalId != null and filterPageByAverageVO.hospitalId != ''">
  389. AND a.hospital_id = #{filterPageByAverageVO.hospitalId}
  390. </if>
  391. <if test="filterPageByAverageVO.lastStartDate != null and filterPageByAverageVO.lastStartDate != ''">
  392. <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageByAverageVO.lastStartDate})]]>
  393. </if>
  394. <if test="filterPageByAverageVO.lastEndDate != null and filterPageByAverageVO.lastEndDate != ''">
  395. <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageByAverageVO.lastEndDate})]]>
  396. </if>
  397. <if test="filterPageByAverageVO.name != null and filterPageByAverageVO.name != ''">
  398. AND a.beh_dept_name like CONCAT('%', #{filterPageByAverageVO.name},'%')
  399. </if>
  400. GROUP BY
  401. a.beh_dept_id,
  402. a.beh_dept_name
  403. ) UNION
  404. (
  405. SELECT
  406. a.beh_dept_id AS id,
  407. a.beh_dept_name AS NAME,
  408. count(*) AS num,
  409. 0 AS averageValue,
  410. 0 AS lastAverageValue,
  411. round( sum( CAST( b.total_fee AS DECIMAL ( 18, 2 ) ))/ count(*), 2 ) AS lastYearAverageValue
  412. FROM
  413. med_behospital_info a,
  414. med_home_page b
  415. WHERE
  416. a.hospital_id = b.hospital_id
  417. AND a.behospital_code = b.behospital_code
  418. AND a.is_deleted = 'N'
  419. AND b.is_deleted = 'N'
  420. AND a.is_placefile = '1'
  421. <![CDATA[AND a.qc_type_id <>0 ]]>
  422. <if test="filterPageByAverageVO.hospitalId != null and filterPageByAverageVO.hospitalId != ''">
  423. AND a.hospital_id = #{filterPageByAverageVO.hospitalId}
  424. </if>
  425. <if test="filterPageByAverageVO.lastYearStartDate != null and filterPageByAverageVO.lastYearStartDate != ''">
  426. <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageByAverageVO.lastYearStartDate})]]>
  427. </if>
  428. <if test="filterPageByAverageVO.lastYearEndDate != null and filterPageByAverageVO.lastYearEndDate != ''">
  429. <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageByAverageVO.lastYearEndDate})]]>
  430. </if>
  431. <if test="filterPageByAverageVO.name != null and filterPageByAverageVO.name != ''">
  432. AND a.beh_dept_name like CONCAT('%', #{filterPageByAverageVO.name},'%')
  433. </if>
  434. GROUP BY
  435. a.beh_dept_id,
  436. a.beh_dept_name
  437. )
  438. ) t
  439. GROUP BY
  440. t.id,
  441. t.NAME
  442. ORDER BY
  443. t.averageValue DESC,
  444. t.lastAverageValue DESC,
  445. t.lastYearAverageValue DESC)
  446. t1
  447. </select>
  448. <update id="updateBatchByKey">
  449. <foreach collection="list" item="item" separator=";">
  450. update med_home_page
  451. <set>
  452. hospital_code = #{item.hospitalCode},
  453. hospital_name = #{item.hospitalName},
  454. org_code = #{item.orgCode},
  455. pay_type = #{item.payType},
  456. health_card = #{item.healthCard},
  457. behospital_num = #{item.behospitalNum},
  458. file_code = #{item.fileCode},
  459. name = #{item.name},
  460. sex = #{item.sex},
  461. birthday = #{item.birthday},
  462. age = #{item.age},
  463. age_unit = #{item.ageUnit},
  464. nationality = #{item.nationality},
  465. newborn_month = #{item.newbornMonth},
  466. newborn_day = #{item.newbornDay},
  467. newborn_weight = #{item.newbornWeight},
  468. newborn_behospital_weight = #{item.newbornBehospitalWeight},
  469. born_address = #{item.bornAddress},
  470. born_place = #{item.bornPlace},
  471. nation = #{item.nation},
  472. identity_card_no = #{item.identityCardNo},
  473. job_type = #{item.jobType},
  474. marriage = #{item.marriage},
  475. cur_address = #{item.curAddress},
  476. cur_phone = #{item.curPhone},
  477. cur_post_code = #{item.curPostCode},
  478. residence_address = #{item.residenceAddress},
  479. residence_post_code = #{item.residencePostCode},
  480. work_address = #{item.workAddress},
  481. work_phone = #{item.workPhone},
  482. work_post_code = #{item.workPostCode},
  483. contact_name = #{item.contactName},
  484. contact_relation = #{item.contactRelation},
  485. contact_address = #{item.contactAddress},
  486. contact_phone = #{item.contactPhone},
  487. behospital_way = #{item.behospitalWay},
  488. behospital_date = #{item.behospitalDate},
  489. behospital_dept = #{item.behospitalDept},
  490. behospital_ward = #{item.behospitalWard},
  491. behospital_bed_id = #{item.behospitalBedId},
  492. behospital_bed_code = #{item.behospitalBedCode},
  493. change_dept = #{item.changeDept},
  494. leave_hospital_date = #{item.leaveHospitalDate},
  495. leave_hospital_dept = #{item.leaveHospitalDept},
  496. leave_hospital_ward = #{item.leaveHospitalWard},
  497. leave_hospital_bed_id = #{item.leaveHospitalBedId},
  498. leave_hospital_bed_code = #{item.leaveHospitalBedCode},
  499. behospital_day_num = #{item.behospitalDayNum},
  500. outpatient_emr_diagnose = #{item.outpatientEmrDiagnose},
  501. outpatient_emr_diagnose_code = #{item.outpatientEmrDiagnoseCode},
  502. poison_factor = #{item.poisonFactor},
  503. poison_factor_code = #{item.poisonFactorCode},
  504. pathology_diagnose = #{item.pathologyDiagnose},
  505. pathology_diagnose_code = #{item.pathologyDiagnoseCode},
  506. pathology_diagnose_id = #{item.pathologyDiagnoseId},
  507. is_med_allergy = #{item.isMedAllergy},
  508. med_allergy_name = #{item.medAllergyName},
  509. autopsy = #{item.autopsy},
  510. blood_type = #{item.bloodType},
  511. rh = #{item.rh},
  512. dept_director = #{item.deptDirector},
  513. director_doctor = #{item.directorDoctor},
  514. attending_doctor = #{item.attendingDoctor},
  515. behospital_doctor = #{item.behospitalDoctor},
  516. response_nurse = #{item.responseNurse},
  517. study_doctor = #{item.studyDoctor},
  518. practice_doctor = #{item.practiceDoctor},
  519. encode_man = #{item.encodeMan},
  520. home_page_quality = #{item.homePageQuality},
  521. qc_doctor = #{item.qcDoctor},
  522. qc_nurse = #{item.qcNurse},
  523. qc_date = #{item.qcDate},
  524. leave_hospital_type = #{item.leaveHospitalType},
  525. accept_org_code = #{item.acceptOrgCode},
  526. again_behospital_plan = #{item.againBehospitalPlan},
  527. again_behospital_goal = #{item.againBehospitalGoal},
  528. tbi_before_day = #{item.tbiBeforeDay},
  529. tbi_before_hour = #{item.tbiBeforeHour},
  530. tbi_before_minute = #{item.tbiBeforeMinute},
  531. tbi_after_day = #{item.tbiAfterDay},
  532. tbi_after_hour = #{item.tbiAfterHour},
  533. tbi_after_minute = #{item.tbiAfterMinute},
  534. total_fee = #{item.totalFee},
  535. own_fee = #{item.ownFee},
  536. general_fee = #{item.generalFee},
  537. service_fee = #{item.serviceFee},
  538. nurse_fee = #{item.nurseFee},
  539. other_fee = #{item.otherFee},
  540. pathology_fee = #{item.pathologyFee},
  541. lab_fee = #{item.labFee},
  542. pacs_fee = #{item.pacsFee},
  543. clinic_diagnose_fee = #{item.clinicDiagnoseFee},
  544. not_operation_fee = #{item.notOperationFee},
  545. clinic_physic_fee = #{item.clinicPhysicFee},
  546. operation_treat_fee = #{item.operationTreatFee},
  547. anaesthesia_fee = #{item.anaesthesiaFee},
  548. operation_fee = #{item.operationFee},
  549. health_type_fee = #{item.healthTypeFee},
  550. chn_treat_fee = #{item.chnTreatFee},
  551. western_med_fee = #{item.westernMedFee},
  552. antibiosis_fee = #{item.antibiosisFee},
  553. chn_med_fee = #{item.chnMedFee},
  554. chn_herb_fee = #{item.chnHerbFee},
  555. blood_fee = #{item.bloodFee},
  556. albumen_fee = #{item.albumenFee},
  557. globulin_fee = #{item.globulinFee},
  558. blood_factor_fee = #{item.bloodFactorFee},
  559. cell_factor_fee = #{item.cellFactorFee},
  560. check_material_fee = #{item.checkMaterialFee},
  561. treat_material_fee = #{item.treatMaterialFee},
  562. operation_material_fee = #{item.operationMaterialFee},
  563. other_type_fee = #{item.otherTypeFee},
  564. single_diag_manage = #{item.singleDiagManage},
  565. clinic_pathway_manage = #{item.clinicPathwayManage},
  566. is_outpatient_behospital = #{item.isOutpatientBehospital},
  567. is_leave_behospital = #{item.isLeaveBehospital},
  568. is_operation_before_after = #{item.isOperationBeforeAfter},
  569. is_clinic_pathology = #{item.isClinicPathology},
  570. is_radiate_pathology = #{item.isRadiatePathology},
  571. rescue_num = #{item.rescueNum},
  572. rescue_success_num = #{item.rescueSuccessNum},
  573. is_auto_leavehospital = #{item.isAutoLeavehospital},
  574. return_to_type = #{item.returnToType},
  575. <if test="item.gmtModified != null">
  576. gmt_modified = #{item.gmtModified},
  577. </if>
  578. <if test="item.modifier != null">
  579. modifier = #{item.modifier},
  580. </if>
  581. </set>
  582. where home_page_id = #{item.homePageId} and hospital_id = #{item.hospitalId} and behospital_code = #{item.behospitalCode}
  583. </foreach>
  584. </update>
  585. </mapper>