Browse Source

优化挂号失效判断

hurugang 2 năm trước cách đây
mục cha
commit
f82d3db212

+ 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);