Browse Source

Merge branch 'dev/20201123_1.4.8'

chengyao 4 years ago
parent
commit
b56fbf3ae6
1 changed files with 13 additions and 17 deletions
  1. 13 17
      src/main/resources/mapper/BehospitalInfoMapper.xml

+ 13 - 17
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -41,7 +41,7 @@
 
     <select id="getPage" resultType="com.diagbot.dto.BehospitalInfoDTO">
         SELECT * FROM (
-        select t.*,
+        select   t.*,
         CASE WHEN ISNULL(g.status) THEN 0 ELSE g.status END check_status,
         CASE WHEN ISNULL(h.status) THEN 0 ELSE h.status END mr_status,
         g.check_type AS ch_type,
@@ -52,7 +52,7 @@
         h.check_time AS mr_time
         from (
         select a.*, ifnull(b.level,'未评分') as `level`, b.grade_type, b.score_res, b.gmt_create as
-        grade_time, c.age, e.score_res as score_bn from med_behospital_info a
+        grade_time,IF(c.age is null, null,CONCAT( c.age,IF(c.age_unit is null, "",c.age_unit)))as age,e.score_res as score_bn from med_behospital_info a
         LEFT JOIN med_qcresult_info b
         on a.behospital_code = b.behospital_code and b.is_deleted = 'N'
         left join med_home_page c
@@ -349,7 +349,7 @@
         b.score_res,
         e.score_res as score_bn,
         b.gmt_create AS grade_time,
-        c.age
+        IF(c.age is null, null,CONCAT( c.age,IF(c.age_unit is null, "",c.age_unit)))as age
         FROM
         med_behospital_info a
         JOIN sys_user_dept d
@@ -468,7 +468,7 @@
         b.score_res,
         e.score_res as score_bn,
         b.gmt_create AS grade_time,
-        c.age
+        IF(c.age is null, null,CONCAT( c.age,IF(c.age_unit is null, "",c.age_unit)))as age
         FROM
         med_behospital_info a
         JOIN
@@ -582,7 +582,7 @@
         h.check_time AS mr_time
         from (
         select a.*, ifnull(b.level,'未评分') as `level`, b.grade_type, b.score_res, b.gmt_create as
-        grade_time, c.age, e.score_res as score_bn from med_behospital_info a
+        grade_time,IF(c.age is null, null,CONCAT( c.age,IF(c.age_unit is null, "",c.age_unit)))as age, e.score_res as score_bn from med_behospital_info a
         LEFT JOIN med_qcresult_info b
         on a.behospital_code = b.behospital_code and b.is_deleted = 'N'
         LEFT JOIN med_qcresult_cases e
@@ -3924,7 +3924,7 @@
         t1.gmt_create AS gradeTime,
         t1.diagnose,
         t1.ward_name AS wardName,
-        t2.age,
+        IF(t2.age is null, null,CONCAT( t2.age,IF(t2.age_unit is null, "",t2.age_unit)))as age,
         t1.file_code AS fileCode,
         t1.checkStatus,
         t1.mrStatus,
@@ -4287,7 +4287,7 @@
     </select>
 
     <update id="updateBatchByKey">
-        <foreach collection="list" item="item" separator=";">
+        <foreach collection="list" item="item"  separator=";">
             update med_behospital_info
             <set>
                 <if test="item.name != null">
@@ -5190,7 +5190,7 @@
     <select id="getAge" resultType="java.util.Map">
         SELECT
         a.behospital_code as behospitalCode,
-        a.age as age
+        IF(a.age is null, null,CONCAT( a.age,IF(a.age_unit is null, "",a.age_unit)))as age
         FROM
         med_home_page a
         WHERE
@@ -5237,11 +5237,7 @@
         t1.mrName,
         t1.chTime,
         t1.mrTime,
-        <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType !=1">
-            t2.age,
-        </if>
-
-        t1.file_code AS fileCode
+         t1.file_code AS fileCode
         FROM
         (
         SELECT be.*,
@@ -6448,7 +6444,7 @@
         t1.gmt_create AS gradeTime,
         t1.diagnose AS diagnose,
         t1.ward_name AS wardName,
-        t2.age AS age,
+        IF(t2.age is null, null,CONCAT( t2.age,IF(t2.age_unit is null, "",t2.age_unit)))as age,
         t1.file_code AS fileCode,
         t1.checkStatus AS checkStatus,
         t1.mrStatus AS mrStatus,
@@ -7282,7 +7278,7 @@
         t1.gmt_create AS gradeTime,
         t1.diagnose,
         t1.ward_name AS wardName,
-        t2.age,
+        IF(t2.age is null, null,CONCAT( t2.age,IF(t2.age_unit is null, "",t2.age_unit)))as age,
         t1.file_code AS fileCode,
         t1.checkStatus,
         t1.mrStatus,
@@ -7550,7 +7546,7 @@
         t1.gmt_create AS gradeTime,
         t1.diagnose,
         t1.ward_name AS wardName,
-        t2.age,
+        IF(t2.age is null, null,CONCAT( t2.age,IF(t2.age_unit is null, "",t2.age_unit)))as age,
         t1.file_code AS fileCode,
         t1.checkStatus,
         t1.mrStatus,
@@ -9272,7 +9268,7 @@
         t1.gmt_create AS gradeTime,
         t1.diagnose,
         t1.ward_name AS wardName,
-        t2.age,
+        IF(t2.age is null, null,CONCAT( t2.age,IF(t2.age_unit is null, "",t2.age_unit)))as age,
         t1.file_code AS fileCode,
         t1.checkStatus,
         t1.mrStatus,