From 672ce84d5ce6545a0e81709ea736c69cbbef8c1a Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期四, 24 四月 2025 18:12:47 +0800
Subject: [PATCH] zjh20250424

---
 ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TestMapper.java |  177 +++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 149 insertions(+), 28 deletions(-)

diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TestMapper.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TestMapper.java
index 4150ea3..1575abc 100644
--- a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TestMapper.java
+++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TestMapper.java
@@ -3,6 +3,7 @@
 import com.ltkj.common.annotation.DataSource;
 import com.ltkj.common.enums.DataSourceType;
 import com.ltkj.hosp.sqlDomain.*;
+import org.apache.ibatis.annotations.Delete;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -216,22 +217,36 @@
                                                   @Param("nn")String nn);
 
     @DataSource(value = DataSourceType.SLAVE_PACS)
-    @Select({"<script>" +
-                "select * from V_JCBGLBHIS where mzh is not null " +
-                "<when test='name != null'>" +
-                "and name = #{name}" +
-                "</when>" +
-                "<when test='mzh != null'>" +
-                "and mzh = #{mzh}" +
-                "</when>" +
-                "<when test='start != null and end != null'>" +
-                "and examinationDate between #{start} and #{end}" +
-                "</when>" +
-                "order by examinationDate" +
+//    @Select({"<script>" +
+//                "select * from V_JCBGLBHIS where mzh is not null " +
+//                "and (mzh = #{mzh} or name = #{name} )" +
+//                "order by examinationDate" +
+//            "</script>"})
+    @Select({"<script>",
+            "SELECT * FROM V_JCBGLBHIS ",
+            "WHERE name = #{name} ",
+            "<if test='mzh != null and mzh != \"\"'>",
+            "   OR mzh = #{mzh} ",
+            "</if>",
+            "ORDER BY examinationDate",
             "</script>"})
-    List<Map<String ,Object>> getPacsJcList(@Param("name")String name,@Param("mzh")String mzh,@Param("start")String start,@Param("end")String end);
+    List<Map<String, Object>> getPacsJcList(@Param("name") String name, @Param("mzh") String mzh, @Param("start") String start, @Param("end") String end);
 
 
+    @DataSource(value = DataSourceType.SLAVE_HIS)
+//    @Select({"<script>" +
+//            "select * from V_JYBGHIS where mzh is not null " +
+//            "and (mzh = #{mzh} or name = #{name} )" +
+//            "order by examinationDate" +
+//            "</script>"})
+    @Select({"<script>",
+            "select * from V_JYBGHIS where name = #{name}",
+            "<if test='mzh != null and mzh != \"\"'>",
+            "   OR mzh = #{mzh} ",
+            "</if>",
+            "order by examinationDate",
+            "</script>"})
+    List<Map<String ,Object>> getLisJyList(@Param("name")String name,@Param("mzh")String mzh,@Param("start")String start,@Param("end")String end);
 
     @DataSource(value = DataSourceType.SLAVE_LIS)
     @Select("select t.* from vi_his_patientresult t \n" +
@@ -254,12 +269,16 @@
             "  a.SENDDOCTOR sqrxm,\n" +
             "  '8001' sqrdm,\n" +
             "  a.AUDITDOCTOR shrxm,\n" +
-            "  '宸插' jybgjg\n" +
+            "  '宸插' jybgjg,\n" +
+            "  SYSDATE() create_time\n" +
             "  \n" +
             "FROM\n" +
             "  vi_his_patientinfo a\n" +
-            "WHERE a.HOSPITALID='chkwyy' AND  a.PATIENTTYPE=3 AND a.GH_PATIENTNO =#{tjNum}")
-    List<LtkjHysqd> getCcXZxYyLtkjHysqdByLisVi(String tjNum);
+            "WHERE  a.PATIENTTYPE=3 AND a.GH_PATIENTNO =#{tjNum}  AND a.HOSPITALID =#{dqyyyqbm}")
+    List<LtkjHysqd> getCcXZxYyLtkjHysqdByLisVi(@Param("tjNum") String tjNum,@Param("dqyyyqbm") String dqyyyqbm);
+
+
+
 
 
     @DataSource(value = DataSourceType.SLAVE_LIS)
@@ -279,13 +298,63 @@
             "  NULL shys,\n" +
             "  b.AUDITDOCTOR shysmc,\n" +
             "  NULL tpurl,\n" +
-            "  a.JUDGE ycbz\n" +
+            "  a.JUDGE ycbz,\n" +
+            "  SYSDATE() create_time\n" +
             "FROM\n" +
             "  vi_his_patientresult a JOIN vi_his_patientinfo b ON b.SAMPLEID=a.SAMPLEID\n" +
-            "WHERE b.HOSPITALID='chkwyy' AND b.PATIENTTYPE=3 AND\n" +
+            "WHERE  b.PATIENTTYPE=3 AND\n" +
             "  a.SAMPLEID = #{tmh}")
     List<LtkjHybgd> getCcXZxYyLtkjHybgdByLisVi(String tmh);
 
+
+//    @DataSource(value = DataSourceType.SLAVE_WS)
+    @Select("SELECT aa.tjh,CONCAT(aa.tjh,RIGHT(ws.pro_id, 6)) tmh,aa.bbbh,aa.bbmc,ws.pro_id xmid,aa.xmmc,aa.sqsj,aa.sqys,aa.jgsj,aa.sqdh,aa.sqrxm,aa.sqrdm,aa.jybgjg,aa.create_time FROM tj_wsxm ws LEFT JOIN (\n" +
+            "   SELECT\n" +
+            "        a.brid tjh,\n" +
+            "         a.brid tmh,\n" +
+            "        NULL bbbh,\n" +
+            "        NULL bbmc,\n" +
+            "        a.xmmc xmid,\n" +
+            "        REGEXP_REPLACE(a.xmmc, '[0-9]', '') xmmc,\n" +
+            "        a.bgsj sqsj,\n" +
+            "        a.bgys sqys,\n" +
+            "        a.bgsj jgsj,\n" +
+            "        null sqdh,\n" +
+            "        null sqrxm,\n" +
+            "        '8001' sqrdm,\n" +
+            "        a.bgys shrxm,\n" +
+            "        '宸插' jybgjg,\n" +
+            "        SYSDATE() create_time  \n" +
+            "      FROM\n" +
+            "        aws a \n" +
+            "      WHERE  a.brid=#{tjNum} GROUP BY REGEXP_REPLACE(a.xmmc, '[0-9]', '') )aa ON ws.pro_name=aa.xmmc WHERE LOCATE(ws.pro_name,aa.xmmc);")
+    List<LtkjHysqd> getWsxmLtkjHysqdByLisVi(String tjNum);
+
+//    @DataSource(value = DataSourceType.SLAVE_WS)
+    @Select("SELECT CONCAT(aa.tmh,RIGHT(ws.pro_id, 6)) tmh,aa.jcxmid,aa.jcxm,NULL tdh,aa.jyjg,null jgdw,null fwzdz,null fwzgz,aa.jysj,aa.shsj,NULL shys,aa.shysmc,NULL tpurl,NULL ycbz,aa.create_time\n" +
+            " FROM tj_wsxm ws \n" +
+            " LEFT JOIN (\n" +
+            "   SELECT distinct a.brid tmh,a.xmbm jcxmid,a.xmmc jcxm,NULL tdh,a.result jyjg,null jgdw,null fwzdz,null fwzgz,null fwz,a.bgsj jysj,a.bgys jyys,a.bgsj shsj," +
+            " NULL shys,a.bgys shysmc, NULL tpurl,NULL ycbz,SYSDATE()  create_time FROM aws a WHERE  a.brid =#{tmh} )aa \n" +
+            "\t\tON ws.pro_name=REGEXP_REPLACE(aa.jcxm, '[0-9]', '') WHERE LOCATE(ws.pro_name,REGEXP_REPLACE(aa.jcxm, '[0-9]', ''))")
+    List<LtkjHybgd> getWsxmLtkjHybgdByLisVi(String tmh);
+
+
+
+//        @DataSource(value = DataSourceType.SLAVE_WS)
+//    @Select("SELECT * from  lis_result a where  a.brid=#{tjNum}")
+//    List<Aws> getWsxmLtkjHysqdByLisViBySLAVEWS(String tjNum);
+
+    @DataSource(value = DataSourceType.SLAVE_WS)
+    @Select("select t.brid,t.xmbm,t.xmmc,t.result,t.gdpd ,t.xmckz,t.dw,t.bgys,max(bgsj) bgsj\n" +
+            "  from lis_result t WHERE t.brid=#{tjNum} \n" +
+            "  group by t.brid,t.xmbm,t.xmmc,t.result,t.gdpd,t.xmckz,t.dw,t.bgys")
+    List<Aws> getWsxmLtkjHysqdByLisViBySLAVEWS(String tjNum);
+
+
+//    @Delete("delete from  aws  where  brid=#{tjNum}")
+    @Delete("DELETE FROM aws WHERE brid=#{tjNum}")
+    void delWsxmjg(String tjNum);
 
 
     @DataSource(value = DataSourceType.SLAVE_PACS)
@@ -294,8 +363,8 @@
 
     @DataSource(value = DataSourceType.SLAVE_PACS)
     @Select("SELECT\n" +
-            "  a.HIS_ID tjh,\n" +
-            "  a.HIS_ID tmh,\n" +
+            "  trim(a.HIS_ID) tjh,\n" +
+            "  trim(a.HIS_ID) tmh,\n" +
             "  a.JCLX jclx,\n" +
             "  NULL jczlx,\n" +
             "  a.BGYS bgys,\n" +
@@ -303,21 +372,22 @@
             "  a.SQRJ sqsj,\n" +
             "  a.BGSJ jgsj,\n" +
             "  REPLACE(a.JCMC,'tj_','') jcxmmc,\n" +
-            "  a.JCMCID jcxmid,\n" +
+            "  trim(a.JCMID) jcxmid,\n" +
             "  a.JCBW bw,\n" +
             "  TRIM(a.JCJL) jgzt,\n" +
-            "  TRIM(a.JCSJ) jgbx\n" +
+            "  TRIM(a.JCSJ) jgbx,\n" +
+            "  SYSDATE create_time\n" +
             "   \n" +
             "FROM\n" +
-            "  ris.V_TJ_JCBGXX_NEWTJ a  WHERE a.HIS_ID=#{tjNum}")
-    List<LtkjExamJcsqd> getCcXZxYyPacsLtkjExamJcsqd(String tjNum);
+            "  ris.V_TJ_JCBGXX_NEWTJ a  WHERE trim(a.HIS_ID)=#{tjNum}   AND a.HOSTPITALID =#{dqyyyqbm} ")
+    List<LtkjExamJcsqd> getCcXZxYyPacsLtkjExamJcsqd(@Param("tjNum") String tjNum,@Param("dqyyyqbm") String dqyyyqbm);
 
 
     @DataSource(value = DataSourceType.SLAVE_PACS)
     @Select(" SELECT\n" +
-            "  a.HIS_ID tjh,\n" +
-            "  a.HIS_ID tmh,\n" +
-            "  a.JCMCID xmdm,\n" +
+            "  trim(a.HIS_ID) tjh,\n" +
+            "  trim(a.HIS_ID) tmh,\n" +
+            "  trim(a.JCMID) xmdm,\n" +
             "  a.JCMC xmmc,\n" +
             "  NULL bg_mig,\n" +
             "  NULL bg_url,\n" +
@@ -327,8 +397,59 @@
             "  TRIM(a.JCJL) yxbx,\n" +
             "  a.BGSJ zdsj,\n" +
             "  a.SQRJ sqsj,\n" +
-            "  a.JCBW jcbw\n" +
+            "  a.JCBW jcbw,\n" +
+            "  SYSDATE create_time\n" +
             "FROM\n" +
             "  ris.V_TJ_JCBGXX_NEWTJ a  WHERE a.HIS_ID=#{tjNum}")
     List<LtkjExamJcbgd> getCcXZxYyPacsLtkjExamJcbgd(String tjNum);
+
+
+    List<List<?>> tjplUpdateDetatilByVi(Map<String,Object> map);
+
+
+    @DataSource(value = DataSourceType.SLAVE_PACS)
+    @Select("SELECT\n" +
+            "  trim(a.HIS_ID) tjh,\n" +
+            "  trim(a.HIS_ID) tmh,\n" +
+            "  a.JCLX jclx,\n" +
+            "  NULL jczlx,\n" +
+            "  a.BGYS bgys,\n" +
+            "  NULL bgysid,\n" +
+            "  a.SQRJ sqsj,\n" +
+            "  a.BGSJ jgsj,\n" +
+            "  REPLACE(a.JCMC,'tj_','') jcxmmc,\n" +
+            "  trim(a.JCMID) jcxmid,\n" +
+            "  a.JCBW bw,\n" +
+            "  TRIM(a.JCJL) jgzt,\n" +
+            "  TRIM(a.JCSJ) jgbx,\n" +
+            "  SYSDATE create_time \n" +
+            "   \n" +
+            "FROM\n" +
+            "  LTEMR.V_TJ_JCBGXX_NEWTJ a  WHERE trim(a.HIS_ID)=#{tjNum}")
+    List<LtkjExamJcsqd> getCcXZxYyPacsLtkjExamJcsqd1(String tjNum);
+
+
+    @DataSource(value = DataSourceType.SLAVE_PACS)
+    @Select(" SELECT\n" +
+            "  trim(a.HIS_ID) tjh,\n" +
+            "  trim(a.HIS_ID) tmh,\n" +
+            "  trim(a.JCMID) xmdm,\n" +
+            "  a.JCMC xmmc,\n" +
+            "  NULL bg_mig,\n" +
+            "  NULL bg_url,\n" +
+            "  TRIM(a.JCSJ) bg_nr,\n" +
+            "  a.SHYS shysdm,\n" +
+            "  a.SHYS shysxm,\n" +
+            "  TRIM(a.JCJL) yxbx,\n" +
+            "  a.BGSJ zdsj,\n" +
+            "  a.SQRJ sqsj,\n" +
+            "  a.JCBW jcbw,\n" +
+            "  SYSDATE create_time\n" +
+            "FROM\n" +
+            "  LTEMR.V_TJ_JCBGXX_NEWTJ a  WHERE trim(a.HIS_ID)=#{tjNum}")
+    List<LtkjExamJcbgd> getCcXZxYyPacsLtkjExamJcbgd1(String tjNum);
+
+    @DataSource(value = DataSourceType.MASTER)
+    @Select("call tj_bingzhongtongji(#{p_start,mode=IN},#{p_end,mode=IN})")
+    List<Map<String ,Object>> getBingZhongInfo(@Param("p_start") String start,@Param("p_end") String end);
 }

--
Gitblit v1.8.0