Преглед на файлове

优化挂号失效判断

hurugang преди 2 години
родител
ревизия
f82d3db212
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzyReqrecMapper.java

+ 2 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzyReqrecMapper.java

@@ -156,12 +156,12 @@ public interface MzyReqrecMapper {
      * @return
      */
     @Select({"<script>",
-            "select count(1) from mzy_reqrec WITH(NOLOCK) where patient_id=#{patientId} and visit_date>#{befoDate} ",
+            "select count(1) from mzy_reqrec WITH(NOLOCK) where patient_id=#{patientId} and isnull(visit_date,request_day)>#{befoDate} ",
             "<when test='doctorCode!=null'>",
             " and visit_doctor =#{doctorCode} ",
             "</when>",
             "<when test='deptCode!=null'>",
-            " and visit_dept =#{deptCode}",
+            " and isnull(visit_dept,unit_code) =#{deptCode}",
             "</when>",
              "</script>"})
     Integer selectValidMzyReqrec(@Param("patientId")String patientId,@Param("doctorCode")String doctorCode,@Param("deptCode")String deptCode,@Param("befoDate")Date befoDate);