Browse Source

优化门诊给药方式排序

hurugang 3 years ago
parent
commit
d5d529718a

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

@@ -13,14 +13,14 @@ public interface MzZdSupplyTypeMapper {
      * @return
      */
     @Select("select rtrim(supply_code) supply_code,rtrim(supply_name) supply_name,rtrim(supply_occ) supply_occ,rtrim(del_flag) del_flag,sort_code,rtrim(class_code) class_code,rtrim(print_name) print_name" +
-            ",rtrim(py_code) py_code,rtrim(d_code) wb_code,rtrim(child_code) child_code,rtrim(try_flag) try_flag from mz_zd_supply_type where ISNULL(del_flag, 0) =0 ")
+            ",rtrim(py_code) py_code,rtrim(d_code) wb_code,rtrim(child_code) child_code,rtrim(try_flag) try_flag from mz_zd_supply_type where ISNULL(del_flag, 0) =0 order by supply_name ")
     List<MzZdSupplyType> selectMzZdSupplyTypeInUsed();
 
     /**
      * 查询在使用的给药方式编码
      * @return
      */
-    @Select("select rtrim(supply_code) supply_code from mz_zd_supply_type where ISNULL(del_flag, 0) =0 ")
+    @Select("select rtrim(supply_code) supply_code from mz_zd_supply_type where ISNULL(del_flag, 0) =0 order by supply_name ")
     List<String> selectMzZdSupplyTypeCodeInUsed();
 
     /**

+ 5 - 3
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzfzPatientOrderMapper.java

@@ -27,7 +27,7 @@ public interface MzfzPatientOrderMapper {
      * @return
      */
     @Select({"<script>",
-            "select count(*) count from ${tableName} WITH(NOLOCK) where 1=1 ",
+            "select count(*) count from ${tableName} WITH(NOLOCK) where 1=1 and DateDiff(hh,visit_date,getDate()) &lt;=24 ",
             "<when test='statusFlagList!=null'>",
             " and status_flag in ",
             "<foreach item='item' index='index' collection='statusFlagList' open='(' separator=',' close=')'>",
@@ -75,7 +75,7 @@ public interface MzfzPatientOrderMapper {
      */
     @Select({"<script>",
             "select top ${pageSize} rtrim(patient_id) patient_id,times,name,dept_code,room_code,doctor_code,gh_no,visit_date,slow_flag,serial_no,req_type,req_order,ampm,fz_no,status_flag,call_time,fz_flag FROM (SELECT ROW_NUMBER() OVER (ORDER BY mzfz_patient_order_page.fz_no asc) AS RowNumber,",
-            "* from ${tableName} mzfz_patient_order_page WITH(NOLOCK) where 1=1 ",
+            "* from ${tableName} mzfz_patient_order_page WITH(NOLOCK) where 1=1 and DateDiff(hh,visit_date,getDate()) &lt;=24 ",
             "<when test='statusFlagList!=null'>",
             " and status_flag in ",
             "<foreach item='item' index='index' collection='statusFlagList' open='(' separator=',' close=')'>",
@@ -185,7 +185,9 @@ public interface MzfzPatientOrderMapper {
             "<when test='deptNo!=null'>",
             " or dept_code =#{deptNo}",
             "</when>"
-            , ") or req_type = 10 or req_type = 16) and status_flag in (0,1,2,3)</script>"})
+            , ") or req_type = 10 or req_type = 16) and DateDiff(hh,visit_date,getDate()) &lt;=24",
+            // " and status_flag in (0,1,2,3)" ,
+            "</script>"})
     List<MzfzPatientOrder> selectByPatientId(@Param("patientId") String patientId, @Param("deptNo") String deptNo, @Param("userIdCode") String userIdCode);