Browse Source

已通过的审核不列入“已驳回”的选项中

lighter 1 year ago
parent
commit
23cf0617c2

+ 8 - 4
src/main/java/thyyxxk/webserver/dao/his/inpatient/casefrontsheet/QualityVerificationDao.java

@@ -12,11 +12,15 @@ public interface QualityVerificationDao extends BaseMapper<FrontsheetQualityVeri
 
     @Select("select user_code from dj_user_role where role_id=66")
     List<String> selectAuditors();
-    
-    @Select("select distinct pat_no,times,pat_name,pat_gender,doctor_code,doctor_name, " +
-            "max(application_time) as applicationTime from t_frontsheet_quality_verification " +
+
+    @Select("select * from ( " +
+            "select distinct pat_no,times,pat_name,pat_gender,doctor_code,doctor_name, " +
+            "max(application_time) as applicationTime, " +
+            "approved=(select count(1) from t_frontsheet_quality_verification d where d.pat_no=a.pat_no and d.times=a.times and d.audit_state='APPROVED') " +
+            "from t_frontsheet_quality_verification a " +
             "where audit_state='REJECTED' and application_time>=#{start} and application_time<=#{end} " +
             "${statement} " +
-            "group by pat_no, times, pat_name, pat_gender, doctor_code, doctor_name")
+            "group by pat_no, times, pat_name, pat_gender, doctor_code, doctor_name" +
+            ") t where t.approved=0")
     List<FrontsheetQualityVerification> selectRejectedRecords(String start, String end, String statement);
 }