Ver código fonte

住院号bug

xiaochan 3 anos atrás
pai
commit
76d254bbbe

+ 7 - 7
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/UpIdCollectionDao.java

@@ -241,13 +241,13 @@ public interface UpIdCollectionDao {
             "left join t_yb_setl_modify_req c on (a.pat_no = c.pat_no and a.times = c.times) " +
             "where revoked = 0 " +
             "<if test=\"startTime !=null and startTime != '' \">" +
-            " and setl_time &gt;= #{startTime} and setl_time &lt;= #{endTime} " +
+            " and a.setl_time &gt;= #{startTime} and a.setl_time &lt;= #{endTime} " +
             "</if>" +
             "<if test=\"setlType !=null and setlType != '' \">" +
-            "  and setl_type = #{setlType} " +
+            "  and a.setl_type = #{setlType} " +
             "</if>" +
             "<if test=\"patNo !=null and patNo != '' \">" +
-            "  and pat_no = #{patNo} " +
+            "  and a.pat_no = #{patNo} " +
             "</if>" +
             "<if test=\"insutypes.size > 0 \">" +
             "  and insutype in " +
@@ -255,7 +255,7 @@ public interface UpIdCollectionDao {
             "#{item}" +
             "</foreach>" +
             "</if>" +
-            "<if test=\"outDepts.size > 0 \">" +
+            "<if test=\"outDepts.size > 0 and outDepts != null \">" +
             "and small_dept in " +
             "<foreach collection='outDepts' item='item' index='index' open='(' close=')' separator=','>" +
             "#{item} " +
@@ -328,7 +328,7 @@ public interface UpIdCollectionDao {
             "  and setl_type = #{setlType} " +
             "</if>" +
             "<if test=\"patNo !=null and patNo != '' \">" +
-            "  and pat_no = #{patNo} " +
+            "  and a.pat_no = #{patNo} " +
             "</if>" +
             "<if test=\"insutypes.size > 0 \">" +
             "  and insutype in " +
@@ -437,12 +437,12 @@ public interface UpIdCollectionDao {
 
     @Select("<script>" +
             "select ward_code,ward_code_name = (select rtrim(name) from zd_unit_code where code = ward_code), " +
-            "       rtrim(inpatient_no) patNo " +
+            "       rtrim(inpatient_no) patNo,admiss_times times " +
             "from zy_detail_charge where inpatient_no in " +
             "<foreach collection='patNos' item='item' index='index' open='(' close=')' separator=','>" +
             "#{item}" +
             "</foreach>" +
-            "group by ward_code,inpatient_no" +
+            "group by ward_code,inpatient_no,admiss_times " +
             "</script>")
     List<SiSetlinfoTemp> zhuanKeKeShi(@Param("patNos") Set<String> patNos);
 

+ 1 - 1
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -418,10 +418,10 @@ public class SetlListUpldService {
         Map<String, ZyDisDiagYb> zhuZhenDuan = dao.zhuZhenDuan(inpatientNos).stream().collect(
                 Collectors.toMap(item -> item.getInpatientNo() + item.getAdmissTimes(), a -> a, (k1, k2) -> k1)
         );
+
         Map<String, List<SiSetlinfoTemp>> zhuanKeMap = dao.zhuanKeKeShi(inpatientNos).stream().collect(
                 Collectors.groupingBy(item -> item.getPatNo() + item.getTimes())
         );
-
         for (SiSetlinfoTemp item : page.getRecords()) {
             String key = item.getPatNo() + item.getTimes();
             String zhuanKeKey = item.getPatNo() + item.getTimes();