2 Commity 8391b9cb69 ... e5264498c8

Autor SHA1 Wiadomość Data
  cb e5264498c8 Merge remote-tracking branch 'origin/his/yiwufuyou_new' into his/yiwufuyou_new 3 miesięcy temu
  cb bc54efdee2 sql改动产生BUG回滚原先版本。 3 miesięcy temu

+ 1 - 1
src/main/java/com/diagbot/task/PlacefileTask.java

@@ -54,7 +54,7 @@ public class PlacefileTask implements SchedulingConfigurer {
             public Date nextExecutionTime(TriggerContext triggerContext) {
                 //2.1 从数据库获取执行周期
                 task = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
-                        .eq("cron_code", "PLACEFILETASK"), false);
+                        .eq("cron_code", "PLACEFILETASK").eq("is_deleted","N"), false);
                 // 下面是默认,当数据库中获取不到动态执行周期时,则使用默认的
                 //每天晚上12点执行
                 String cron = "0 0 0 * * ?";

+ 103 - 107
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -44,113 +44,109 @@
     </resultMap>
 
     <select id="getPage" resultType="com.diagbot.dto.BehospitalInfoDTO">
-        <if test="qcType != 0">
-            SELECT * FROM (
-            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,
-            h.check_type AS mr_type,
-            g.check_name AS ch_name,
-            h.check_name AS mr_name,
-            g.check_time AS ch_time,
-            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,
-            IF(c.age IS NULL, NULL, CONCAT(IFNULL(c.age, ''), IFNULL(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 ON a.behospital_code = c.behospital_code AND c.is_deleted = 'N'
-            LEFT JOIN med_qcresult_cases e ON a.behospital_code = e.behospital_code AND e.is_deleted = 'N' AND e.cases_id = 243
-            ) t
-            LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type IN (0, 2)) g ON t.behospital_code = g.behospital_code AND t.hospital_id = g.hospital_id
-            LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 1) h ON t.behospital_code = h.behospital_code AND t.hospital_id = h.hospital_id
-            WHERE t.is_deleted = 'N'
-            <if test="isDaytime != null and isDaytime != ''">
-                AND t.is_daytime = #{isDaytime}
-            </if>
-            <if test="diagnose != null and diagnose != ''">
-                AND t.diagnose LIKE CONCAT('%', #{diagnose}, '%')
-            </if>
-            <if test="deptName != null and deptName != ''">
-                AND t.beh_dept_name = #{deptName}
-            </if>
-            <if test="doctorName != null and doctorName != ''">
-                AND CONCAT(
-                IFNULL(t.doctor_name, ''),
-                IFNULL(t.beh_doctor_name, ''),
-                IFNULL(t.director_doctor_name, '')
-                ) LIKE CONCAT('%', #{doctorName}, '%')
-            </if>
-            <if test="name != null and name != ''">
-                AND t.name LIKE CONCAT('%', #{name}, '%')
-            </if>
-            <if test="doctorCode != null and doctorCode != ''">
-                AND (t.doctor_id = #{doctorCode}
-                OR t.beh_doctor_id = #{doctorCode}
-                OR t.director_doctor_id = #{doctorCode})
-            </if>
-            <if test="hospitalId != null">
-                AND t.hospital_id = #{hospitalId}
-            </if>
-            <if test="behospitalCode != null and behospitalCode != ''">
-                AND t.behospital_code LIKE CONCAT('%', #{behospitalCode}, '%')
-            </if>
-            <if test="fileCode != null and fileCode != ''">
-                AND t.file_code LIKE CONCAT('%', #{fileCode}, '%')
-            </if>
-            <if test="behosDateStart != null">
-                <![CDATA[ AND t.behospital_date >= #{behosDateStart}]]>
-            </if>
-            <if test="behosDateEnd != null">
-                <![CDATA[ AND t.behospital_date < #{behosDateEnd}]]>
-            </if>
-            <if test="leaveHosDateStart != null">
-                <![CDATA[ AND t.leave_hospital_date >= #{leaveHosDateStart}]]>
-            </if>
-            <if test="leaveHosDateEnd != null">
-                <![CDATA[ AND t.leave_hospital_date < #{leaveHosDateEnd}]]>
-            </if>
-            <if test="level != null and level != ''">
-                AND t.level = #{level}
-            </if>
-            <if test="isPlacefile != null and isPlacefile != ''">
-                AND t.is_placefile = #{isPlacefile}
-            </if>
-            AND t.qc_type_id != 0
-            ) p
-            WHERE p.is_deleted = 'N'
-            <if test="checkStatus != null">
-                AND p.check_status = #{checkStatus}
-            </if>
-            <if test="mrStatus != null">
-                AND p.mr_status = #{mrStatus}
-            </if>
-            <if test="chName != null and chName != ''">
-                AND p.ch_name LIKE CONCAT('%', #{chName}, '%')
-            </if>
-            <if test="mrName != null and mrName != ''">
-                AND p.mr_name LIKE CONCAT('%', #{mrName}, '%')
-            </if>
-            <if test="chTimeStart != null">
-                <![CDATA[ AND p.ch_time >= #{chTimeStart}]]>
-            </if>
-            <if test="chTimeEnd != null">
-                <![CDATA[ AND p.ch_time < #{chTimeEnd}]]>
-            </if>
-            <if test="mrTimeStart != null">
-                <![CDATA[ AND p.mr_time >= #{mrTimeStart}]]>
-            </if>
-            <if test="mrTimeEnd != null">
-                <![CDATA[ AND p.mr_time < #{mrTimeEnd}]]>
-            </if>
+        SELECT * FROM (
+        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,
+        h.check_type AS mr_type,
+        g.check_name AS ch_name,
+        h.check_name AS mr_name,
+        g.check_time AS ch_time,
+        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,IF(c.age is null, null,CONCAT( ifnull(c.age,'') ,ifnull(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
+        on a.behospital_code = c.behospital_code and c.is_deleted = 'N'
+        LEFT JOIN med_qcresult_cases e
+        on  a.behospital_code = e.behospital_code
+        AND e.is_deleted = 'N'
+        and e.cases_id = 243
+        ) t
+        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type in(0,2) ) g
+        ON t.behospital_code = g.behospital_code
+        AND t.hospital_id = g.hospital_id
+        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N'AND check_type = 1 ) h
+        ON t.behospital_code = h.behospital_code
+        AND t.hospital_id = h.hospital_id
+        where t.is_deleted = 'N'
+        <if test="isDaytime != null and isDaytime != ''">
+            AND t.is_daytime = #{isDaytime}
+        </if>
+        <if test="diagnose != null and diagnose != ''">
+            AND t.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
+        </if>
+        <if test="deptName != null and deptName != ''">
+            and t.beh_dept_name= #{deptName}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            and CONCAT(
+            IFNULL(t.doctor_name,''),IFNULL(t.beh_doctor_name,''),IFNULL(t.director_doctor_name,''))
+            like CONCAT('%',#{doctorName},'%')
+        </if>
+        <if test="name != null and name != ''">
+            and t.name like CONCAT('%',#{name},'%')
+        </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            and (t.doctor_id = #{doctorCode}
+            or t.beh_doctor_id = #{doctorCode}
+            or t.director_doctor_id = #{doctorCode})
+        </if>
+        <if test="hospitalId != null">
+            and t.hospital_id = #{hospitalId}
+        </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            and t.behospital_code like CONCAT('%',#{behospitalCode},'%')
+        </if>
+        <if test="fileCode != null and fileCode != ''">
+            and t.file_code like CONCAT('%',#{fileCode},'%')
+        </if>
+        <if test="behosDateStart != null">
+            <![CDATA[ and t.behospital_date >= #{behosDateStart}]]>
+        </if>
+        <if test="behosDateEnd != null">
+            <![CDATA[ and t.behospital_date < #{behosDateEnd}]]>
+        </if>
+        <if test="leaveHosDateStart != null">
+            <![CDATA[ and t.leave_hospital_date >= #{leaveHosDateStart}]]>
+        </if>
+        <if test="leaveHosDateEnd != null">
+            <![CDATA[ and t.leave_hospital_date < #{leaveHosDateEnd}]]>
+        </if>
+        <if test="level != null and level != ''">
+            and t.level = #{level}
+        </if>
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and t.is_placefile = #{isPlacefile}
+        </if>
+        and t.qc_type_id != 0) p
+        where p.is_deleted="N"
+        <if test="checkStatus != null ">
+            and p.check_status = #{checkStatus}
+        </if>
+        <if test="mrStatus != null ">
+            AND p.mr_status = #{mrStatus}
+        </if>
+        <if test="chName != null and chName !=''">
+            AND p.ch_name like CONCAT('%',#{chName},'%')
+        </if>
+        <if test="mrName != null and mrName !=''">
+            AND p.mr_name like CONCAT('%',#{mrName},'%')
+        </if>
+        <if test="chTimeStart != null">
+            <![CDATA[ and p.ch_time >= #{chTimeStart}]]>
+        </if>
+        <if test="chTimeEnd != null">
+            <![CDATA[ and p.ch_time < #{chTimeEnd}]]>
+        </if>
+        <if test="mrTimeStart != null">
+            <![CDATA[ and p.mr_time >= #{mrTimeStart}]]>
+        </if>
+        <if test="mrTimeEnd != null">
+            <![CDATA[ and p.mr_time < #{mrTimeEnd}]]>
         </if>
     </select>