Explorar o código

院内统计中查看申请科室和执行科室

xiaochan %!s(int64=4) %!d(string=hai) anos
pai
achega
3e5d37ae9b

+ 18 - 6
src/main/java/thyyxxk/webserver/dao/his/querydata/QueryDrugsAndProjectsDao.java

@@ -89,7 +89,8 @@ public interface QueryDrugsAndProjectsDao {
      * @param chargeCode 编码
      * @return 返回查询的数据
      */
-    @Select("select * from (" +
+    @Select("<script>" +
+            "select * from (" +
             "SELECT " +
             "    rtrim(a.inpatient_no) patient,a.admiss_times times,rtrim(b.name) name,b.social_no social_no,b.employer_tel phone,c.admiss_date,c.dis_date,a.charge_date charge_date, " +
             "    (select name from zd_unit_code where code=c.small_dept) dept, " +
@@ -101,7 +102,10 @@ public interface QueryDrugsAndProjectsDao {
             "  and a.inpatient_no=b.inpatient_no " +
             "  and a.inpatient_no=c.inpatient_no " +
             "  and a.admiss_times=c.admiss_times " +
-            "  and charge_date >= #{startTime} and charge_date <= #{endTime} " +
+            "  and charge_date &gt;= #{startTime} and charge_date &lt;= #{endTime} " +
+            "<if test=\"dept != '' and dept !=null \">" +
+            "  and a.exec_unit = #{dept} " +
+            "</if>" +
             "group by charge_code_mx,a.inpatient_no,a.admiss_times,b.name,b.social_no,b.employer_tel,c.admiss_date,c.dis_date,c.small_dept,a.exec_unit,c.responce_type,a.charge_date " +
             "union all " +
             "SELECT " +
@@ -115,7 +119,10 @@ public interface QueryDrugsAndProjectsDao {
             "  and a.inpatient_no=b.inpatient_no " +
             "  and a.inpatient_no=c.inpatient_no " +
             "  and a.admiss_times=c.admiss_times " +
-            "  and charge_date >= #{startTime} and charge_date <= #{endTime} " +
+            "  and charge_date &gt;= #{startTime} and charge_date &lt;= #{endTime} " +
+            "<if test=\"dept != '' and dept !=null \">" +
+            "  and a.exec_unit = #{dept} " +
+            "</if>" +
             "group by charge_code_mx,a.inpatient_no,a.admiss_times,b.name,b.social_no,b.employer_tel,c.admiss_date,c.dis_date,c.small_dept,a.exec_unit,c.responce_type,a.charge_date " +
             "union all " +
             "    select rtrim(a.patient_id) patient,a.times times,rtrim(b.name) name ,b.social_no social_no,b.phone_no phone," +
@@ -127,11 +134,16 @@ public interface QueryDrugsAndProjectsDao {
             "where a.patient_id = b.patient_id " +
             "and a.times = b.times " +
             "and charge_item_code = #{chargeCode} " +
-            "and charge_date >= #{startTime} and charge_date <= #{endTime} " +
-            "group by  charge_item_code,a.patient_id,a.times,b.name,social_no,phone_no,charge_date,exec_dept,a.warn_dept) temp")
+            "and charge_date &gt;= #{startTime} and charge_date &lt;= #{endTime} " +
+            "<if test=\"dept != '' and dept !=null \">" +
+            "and a.exec_dept = #{dept} " +
+            "</if>" +
+            "group by  charge_item_code,a.patient_id,a.times,b.name,social_no,phone_no,charge_date,exec_dept,a.warn_dept) temp" +
+            "</script>")
     List<QueryDrugsAndProjects> chaXunXiangMuHuoYaoPinJuTiXinXi(@Param("startTime") String startTime,
                                                                 @Param("endTime") String endTime,
-                                                                @Param("chargeCode") String chargeCode);
+                                                                @Param("chargeCode") String chargeCode,
+                                                                @Param("dept") String dept);
 
 
     /**

+ 3 - 2
src/main/java/thyyxxk/webserver/service/querydata/QueryDrugsAndProjectsService.java

@@ -76,7 +76,8 @@ public class QueryDrugsAndProjectsService {
      */
     public ResultVo<List<QueryDrugsAndProjects>> chaKanXiangQing(QueryDrugsAndProjects param) {
         log.info("查看项目或药品详情:{}", JSON.toJSONStringWithDateFormat(param, GetDateFormat.DATE_TIME));
-        List<QueryDrugsAndProjects> xiangMuList = dao.chaXunXiangMuHuoYaoPinJuTiXinXi(param.getStartTime(), param.getEndTime(), param.getChargeCode());
+        List<QueryDrugsAndProjects> xiangMuList = dao.chaXunXiangMuHuoYaoPinJuTiXinXi(param.getStartTime(), param.getEndTime(), param.getChargeCode(), param.getDept());
+
         // 获取患者 id 的 list
         List<String> patientList = new ArrayList<>();
         // 获取诊断的详细情况
@@ -90,7 +91,7 @@ public class QueryDrugsAndProjectsService {
         }
         // 判断 这个不能 大于 2100 不然会报错 分成 100 来查
         if (patientList.size() > 0) {
-            List<List<String>> fenDuanChaXun = ListUtils.partition(patientList, 100);
+            List<List<String>> fenDuanChaXun = ListUtils.partition(patientList, 20);
             for (List<String> strings : fenDuanChaXun) {
                 zhenDuanList.addAll(dao.queryZhenDuan(strings));
             }

+ 1 - 1
src/main/resources/application.yml

@@ -8,7 +8,7 @@ spring:
     cache: false
   datasource:
     dynamic:
-      primary: dev
+      primary: his
       strict: false
       datasource:
         his: