From a7984ee3e52625f8df474fb2f8f5478451ffefa3 Mon Sep 17 00:00:00 2001
From: zhaowenxuan <chacca165@163.com>
Date: 星期六, 12 十月 2024 15:20:26 +0800
Subject: [PATCH] 修改参数名

---
 ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderMapper.java |   85 ++++++++++++++++++++++++++++--------------
 1 files changed, 56 insertions(+), 29 deletions(-)

diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderMapper.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderMapper.java
index 6ed856c..b42e88c 100644
--- a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderMapper.java
+++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderMapper.java
@@ -109,27 +109,31 @@
 //    List<Map<Object, Object>> getLine();
 
     @Select("select aa.date,\n" +
-            "      sum(if(c.tj_type='鍥㈤槦', ifnull(c.coun,0),0)) as tdcoun,\n" +
-            "      sum(if(c.tj_type='涓汉', ifnull(c.coun,0),0)) as grcoun,\n" +
-            "      sum(if(c.tj_type='鎶ュ憡', ifnull(c.coun,0),0)) as bgcoun \n" +
-            "  from (\n" +
-            "      SELECT date_sub(CURDATE(),interval @i:=@i+1 day) as date\n" +
-            "      from (select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all \n" +
-            "            select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all   \n" +
-            "            select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all  \n" +
-            "            select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all  \n" +
-            "            select 1 union all select 1) as a,\n" +
-            "            (select @i:= -1) b) aa \n" +
-            "  left join (\n" +
-            "      select date_format(create_time, '%Y-%m-%d') dat, tj_type, count(*) coun\n" +
-            "      from tj_order where DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= date(create_time)\n" +
-            "      group by date_format(create_time, '%Y-%m-%d'),tj_type\n" +
-            "      union\n" +
-            "      select date_format(report_time, '%Y-%m-%d') dat, '鎶ュ憡' tj_type, count(*) coun\n" +
-            "      from tj_order where DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= date(create_time)\n" +
-            "      group by date_format(report_time, '%Y-%m-%d')\n" +
-            "      ) c on c.dat =aa.date\n" +
-            "group by aa.date")
+            "                  sum(if(c.tj_type='1', ifnull(c.coun,0),0)) as tdcoun,\n" +
+            "                  sum(if(c.tj_type='2', ifnull(c.coun,0),0)) as grcoun,\n" +
+            "                  sum(if(c.tj_type='3', ifnull(c.coun,0),0)) as bgcoun \n" +
+            "              from (\n" +
+            "                  SELECT date_sub(CURDATE(),interval @i:=@i+1 day) as date\n" +
+            "                  from (select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all \n" +
+            "                        select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all \n" +
+            "                        select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all \n" +
+            "                        select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all \n" +
+            "                        select 1 union all select 1) as a,\n" +
+            "                        (select @i:= -1) b) aa\n" +
+            "              left join (\n" +
+            "                     select date_format(create_time, '%Y-%m-%d') dat, tj_type, count(*) coun\n" +
+            "                  from tj_order where deleted=0 AND tj_type=2 AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= date(create_time)\n" +
+            "                  group by date_format(create_time, '%Y-%m-%d')\t\n" +
+            "\t\t\t\tunion\n" +
+            "                  select date_format(create_time, '%Y-%m-%d') dat,tj_type, count(*) coun\n" +
+            "                  from tj_order where deleted=0 AND tj_type=1 AND  DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= date(create_time)\n" +
+            "                  group by date_format(create_time, '%Y-%m-%d')\t\t\t\t\t\n" +
+            "\t\t\t\tunion\n" +
+            "                  select date_format(create_time, '%Y-%m-%d') dat, 3 tj_type, count(*) coun\n" +
+            "                  from tj_order where deleted=0 AND !ISNULL(report_time) AND  DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= date(create_time)\n" +
+            "                  group by date_format(create_time, '%Y-%m-%d')\n" +
+            "                  ) c on c.dat =aa.date\n" +
+            "            group by aa.date")
     List<LineChartsVo> getLine();
 
 
@@ -230,15 +234,38 @@
     Map<String ,Object > selectDjdUserInfo(@Param("tjNumber")String tjNumber);
 
 
-    @Select("SELECT a.jcsqdh FROM ltkj_outpinexamapply a WHERE a.cardId=#{cardId}")
-    String getHuoQuJcsqdh(String cardId);
-    @Delete("DELETE FROM ltkj_outpinexamapply WHERE cardId=#{cardId}")
-    String delHuoQuJcsqdh(String cardId);
+    @Select("SELECT a.sqdh FROM ltkj_jianchajianyan_tree a WHERE a.card_id=#{cardId} AND a.type='妫�鏌�' GROUP BY a.sqdh")
+    List<String> getHuoQuJcsqdh(String cardId);
+    @Delete("DELETE FROM ltkj_jianchajianyan_tree WHERE card_id=#{cardId} AND type='妫�鏌�'")
+    Boolean delHuoQuJcsqdh(String cardId);
 
 
 
-    @Select("SELECT a.jysqdh FROM ltkj_outpintestapply a WHERE a.cardId='20240604000001'")
-    String getHuoQuJysqdh(String cardId);
-    @Delete("DELETE FROM ltkj_outpintestapply WHERE cardId=#{cardId}")
-    String delHuoQuJysqdh(String cardId);
+    @Select("SELECT a.sqdh FROM ltkj_jianchajianyan_tree a WHERE a.card_id=#{cardId} AND a.type='妫�楠�' GROUP BY a.sqdh")
+    List<String> getHuoQuJysqdh(String cardId);
+    @Delete("DELETE FROM ltkj_jianchajianyan_tree WHERE card_id=#{cardId} AND type='妫�楠�'")
+    Boolean delHuoQuJysqdh(String cardId);
+
+    @Select("SELECT a.sqdh FROM ltkj_jianchajianyan_tree a WHERE a.card_id=#{cardId} AND a.type='澶勭疆' GROUP BY a.sqdh")
+    List<String> getHuoQuZlsqdh(String cardId);
+    @Delete("DELETE FROM ltkj_jianchajianyan_tree  WHERE card_id=#{cardId} AND type='澶勭疆'")
+    Boolean delHuoQuZlsqdh(String cardId);
+
+
+    List<Map<String, Object>> getTjTongJiJieKou(Map<String, Object> map);
+
+    @Select("SELECT a.sqdh FROM ltkj_jianchajianyan_tree a WHERE a.card_id=#{cardId} and a.jxbz=#{bldh} AND a.type='妫�鏌�' GROUP BY a.sqdh")
+    List<String> getHuoQuBlJcsqdh(@Param("cardId") String cardId,@Param("bldh") String bldh);
+    @Delete("DELETE FROM ltkj_jianchajianyan_tree  WHERE card_id=#{cardId} and jxbz=#{bldh} AND type='妫�鏌�'")
+    Boolean delHuoQuBlJcsqdh(@Param("cardId")String cardId, @Param("bldh")String bldh);
+
+    @Select("SELECT a.sqdh FROM ltkj_jianchajianyan_tree a WHERE a.card_id=#{cardId} and a.jxbz=#{bldh} AND a.type='妫�楠�' GROUP BY a.sqdh")
+    List<String> getHuoQuBlJysqdh(@Param("cardId")String cardId,@Param("bldh") String bldh);
+    @Delete("DELETE FROM ltkj_jianchajianyan_tree  WHERE card_id=#{cardId} and jxbz=#{bldh}  AND type='妫�楠�'")
+    Boolean delHuoQuBlJysqdh(@Param("cardId")String cardId,@Param("bldh") String bldh);
+
+    @Select("SELECT a.sqdh FROM ltkj_jianchajianyan_tree a WHERE a.card_id=#{cardId} and a.jxbz=#{bldh}  AND a.type='澶勭疆' GROUP BY a.sqdh")
+    List<String> getHuoQuBlZlsqdh(@Param("cardId")String cardId,@Param("bldh") String bldh);
+    @Delete("DELETE FROM ltkj_jianchajianyan_tree  WHERE card_id=#{cardId} and jxbz=#{bldh} AND type='澶勭疆'")
+    Boolean delHuoQuZlsqdh(@Param("cardId")String cardId,@Param("bldh") String bldh);
 }

--
Gitblit v1.8.0