From e7ac7e5702f6ac1f88403485de232e5494a1c76a Mon Sep 17 00:00:00 2001
From: zhaowenxuan <chacca165@163.com>
Date: 星期一, 11 八月 2025 13:55:57 +0800
Subject: [PATCH] 修改错误日志打印
---
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderMapper.java | 256 +++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 225 insertions(+), 31 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 624d55e..17a9ede 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
@@ -5,6 +5,7 @@
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ltkj.hosp.domain.LtkjJianchajianyanTree;
import com.ltkj.hosp.domain.TjCustomer;
import com.ltkj.hosp.domain.TjOrder;
import com.ltkj.hosp.vodomain.LineChartsVo;
@@ -109,27 +110,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();
@@ -140,8 +145,11 @@
@Select("SELECT * FROM tj_order WHERE user_id = #{cusId} AND deleted='0' ORDER BY create_time DESC")
public List<TjOrder> getOrderListByCusId(@Param("cusId") String cusId);
- @Select("SELECT * FROM tj_order WHERE tj_number = #{tjNum} AND deleted='0' ")
+ @Select("SELECT * FROM tj_order WHERE tj_number = #{tjNum} AND deleted=0 ")
public TjOrder getOrderByTjNum(String tjNum);
+
+ @Select("SELECT * FROM tj_order WHERE card_id = #{cardId} AND deleted='0' ")
+ public TjOrder getOrderByCardId(String cardId);
List<TjOrder> getTjOrderList(@Param("tjNum")String tjNum,
@Param("checkStatus")Integer checkStatus,
@@ -213,21 +221,97 @@
* @param tjNumber 浣撴鍗曞彿
* @return
*/
- @Select("SELECT @num := @num + 1 AS xh, d.dept_name ksmc, d.official_web ksdz, e.tjxm FROM sys_dept d JOIN ( select aa.ksmc,GROUP_CONCAT( DISTINCT aa.pro_name ORDER BY aa.pro_name DESC SEPARATOR ';' ) tjxm from ( SELECT (case when f.ksmc in ('涓存瀹�','鍖栭獙瀹�','','') or c.pro_name like '%娴嬪畾%' then '妫�楠岀' when c.pro_name like '%蹇冪數鍥�%' then '蹇冪數鍥惧' when f.ksmc='x鍏夊' or c.pro_name like '%X绾挎憚褰�%' then '鏀惧皠绉�' when c.pro_name like '%鑹茶%' then '鐪肩' \t\t\t\twhen c.pro_name like '%瓒�%' or c.pro_name like '%澶氭櫘鍕�%' then 'B瓒呭' when (replace(f.ksmc,' ','')='' or f.ksmc is null) and c.dept_id<>'100' then d.dept_name when c.pro_name like '%CT%' then 'CT瀹�' else '浣撴涓績' end ) ksmc, c.pro_name FROM tj_order a JOIN tj_order_detail b ON b.order_id = a.order_id JOIN tj_project c ON c.pro_id = b.pro_id left join his_mxfyxm e on e.mxfyxmbm=c.his_xmbm left join ltkj_his_dept f on f.ksbm = CONCAT('00',(case when e.hsks is null then '' else e.hsks end)) join sys_dept d on d.dept_id=c.dept_id WHERE a.tj_number = #{tjNumber} ) aa GROUP BY ksmc ) e ON e.ksmc = d.dept_name , (SELECT @num := 0) a WHERE d.parent_id = '100' ORDER BY xh")
- List<Map<String ,String >> selectDjdInfo(@Param("tjNumber")String tjNumber);
+// @Select("SELECT @num := @num + 1 AS xh, d.dept_name ksmc, d.official_web ksdz, e.tjxm FROM sys_dept d JOIN " +
+// "( select aa.ksmc,GROUP_CONCAT( DISTINCT aa.pro_name ORDER BY aa.pro_name DESC SEPARATOR ';' ) tjxm from " +
+// "( SELECT (case when f.ksmc in ('涓存瀹�','鍖栭獙瀹�','','') or c.pro_name like '%娴嬪畾%' then '妫�楠岀' " +
+// " when c.pro_name like '%蹇冪數鍥�%' then '蹇冪數鍥惧' when f.ksmc='x鍏夊' or c.pro_name like '%X绾挎憚褰�%' then '鏀惧皠绉�' when c.pro_name like '%鑹茶%' then '鐪肩' " +
+// "\t\t\t\twhen c.pro_name like '%瓒�%' or c.pro_name like '%澶氭櫘鍕�%' then 'B瓒呭' when (replace(f.ksmc,' ','')='' or f.ksmc is null) and c.dept_id<>'100' then " +
+// " d.dept_name when c.pro_name like '%CT%' then 'CT瀹�' else '浣撴涓績' end ) ksmc, c.pro_name FROM tj_order a JOIN tj_order_detail b ON b.order_id = a.order_id " +
+// "JOIN tj_project c ON c.pro_id = b.pro_id left join his_mxfyxm e on e.mxfyxmbm=c.his_xmbm left join ltkj_his_dept f on f.ksbm = CONCAT('00'," +
+// "(case when e.hsks is null then '' else e.hsks end)) join sys_dept d on d.dept_id=c.dept_id WHERE a.tj_number = #{tjNumber} ) aa GROUP BY ksmc ) e ON e.ksmc = " +
+// "d.dept_name , (SELECT @num := 0) a WHERE d.parent_id = '100' ORDER BY xh")
+// List<Map<String ,String >> selectDjdInfo(@Param("tjNumber")String tjNumber);
+
+
+// @Select("SELECT \n" +
+// " ROW_NUMBER() OVER (ORDER BY d.djd_num) AS xh, " +
+// " REPLACE(d.dept_name, '闂ㄨ瘖', '') AS ksmc,\n" +
+// " ifnull(d.official_web,'') AS ksdz,\n" +
+// " e.tjxm,\n" +
+// " e.tjjg\n" +
+// "FROM sys_dept d\n" +
+// "JOIN (\n" +
+// " SELECT\n" +
+// " c.dept_id,\n" +
+// " GROUP_CONCAT(DISTINCT c1.pro_name ORDER BY c1.pro_name DESC SEPARATOR ';') AS tjxm,\n" +
+// " SUM(b.ord_price) AS tjjg\n" +
+// " FROM tb_transition b\n" +
+// " JOIN tj_project c ON c.pro_id = b.parent_pro_id\n" +
+// " JOIN tj_project c1 ON c1.pro_id = b.parent_pro_id\n" +
+// " WHERE trim(b.tj_num) = #{tjNumber} \n" +
+// " AND c.pro_parent_id = 0\n" +
+// " AND c1.pro_name NOT IN ('涓讳换鍖诲笀璇婃煡', '(tj)浣撴璐�(鐗╃悊妫�鏌�)')\n" +
+// " AND c1.pro_name NOT LIKE '%涓讳换鍖诲笀璇婃煡%'\n" +
+// " GROUP BY c.dept_id\n" +
+// ") e ON e.dept_id = d.dept_id\n" +
+// "ORDER BY d.djd_num")
+ @Select("SELECT \n" +
+ " @rownum := @rownum + 1 AS xh,\n" +
+ " t.ksmc,\n" +
+ " t.ksdz,\n" +
+ " t.tjxm,\n" +
+ " t.tjjg\n" +
+ "FROM (\n" +
+ " SELECT \n" +
+ " REPLACE(d.dept_name, '闂ㄨ瘖', '') AS ksmc,\n" +
+ " IFNULL(d.official_web, '') AS ksdz,\n" +
+ " e.tjxm,\n" +
+ " e.tjjg,\n" +
+ " d.djd_num\n" +
+ " FROM sys_dept d\n" +
+ " JOIN (\n" +
+ " SELECT\n" +
+ " c.dept_id,\n" +
+ " GROUP_CONCAT(DISTINCT c1.pro_name ORDER BY c1.pro_name DESC SEPARATOR ';') AS tjxm,\n" +
+ " SUM(b.ord_price) AS tjjg\n" +
+ " FROM tb_transition b\n" +
+ " JOIN tj_project c ON c.pro_id = b.parent_pro_id\n" +
+ " JOIN tj_project c1 ON c1.pro_id = b.parent_pro_id\n" +
+ " WHERE TRIM(b.tj_num) = #{tjNumber} \n" +
+ " AND c.pro_parent_id = 0\n" +
+ " AND c1.pro_name NOT IN ('涓讳换鍖诲笀璇婃煡', '(tj)浣撴璐�(鐗╃悊妫�鏌�)')\n" +
+ " AND c1.pro_name NOT LIKE '%涓讳换鍖诲笀璇婃煡%'\n" +
+ " GROUP BY c.dept_id\n" +
+ " ) e ON e.dept_id = d.dept_id\n" +
+ ") t, (SELECT @rownum := 0) r\n" +
+ "ORDER BY t.djd_num;\n")
+ List<Map<String ,Object >> selectDjdInfo(@Param("tjNumber")String tjNumber);
/**
* 鏌ヨ瀵兼鍗曠敤鎴蜂俊鎭�
* @param tjNumber
* @return
*/
- @Select("select c.tj_number tjh,a.cus_name tjname, b.dict_label sex,a.create_time tjsj,ifnull(d.cn_name,'') dwmc,a.cus_phone lxdh\n" +
+ @Select("select c.tj_number tjh,a.cus_name tjname, b.dict_label sex,c.create_time tjsj,ifnull(c.firm_name,'') dwmc,a.cus_phone lxdh,ifnull(c.firm_dept_name,'') dwbm,\n" +
+ "ifnull((select dict_label from sys_dict_data where dict_type ='dict_team' and status=0 and dict_value=c.tj_type),'') tjlx,\n" +
+ "( (\n" +
+ " SELECT\n" +
+ " sum( b1.ord_price ) \n" +
+ " FROM\n" +
+ " tb_transition b1\n" +
+ " JOIN tj_project c1 ON c1.pro_id = b1.parent_pro_id \n" +
+ " AND c1.pro_parent_id = 0 \n" +
+ " WHERE\n" +
+ " b1.tj_num = c.tj_number \n" +
+ " )*(IFNULL(c.discount,10)/10)) tjze,c.card_id ,CONCAT(cast(a.age as char),e.dict_label) nl,(SELECT tb.pac_name FROM tb_transition tb" +
+ " WHERE tb.tj_num = c.tj_number GROUP BY tb.pac_id)tcmc,a.his_jzkh\n" +
"from tj_order c \n" +
- " join tj_customer a on a.cus_id= c.user_id \n" +
- " join (select dict_value,dict_label from sys_dict_data where dict_type='sys_user_sex') b on b.dict_value = a.cus_sex\n" +
- " left join dict_comp d on d.drug_manufacturer_id = c.firm_id\n" +
- "where c.tj_number=#{tjNumber}")
- Map<String ,Object > selectDjdUserInfo(@Param("tjNumber")String tjNumber);
+ "\tjoin tj_customer a on a.cus_id= c.user_id \n" +
+ " join (select dict_value,dict_label from sys_dict_data where dict_type='sys_user_sex') b on b.dict_value = a.cus_sex\n" +
+ "\tleft join dict_comp d on d.drug_manufacturer_id = c.firm_id\n" +
+ "join (select dict_label,dict_value from sys_dict_data where dict_type='dict_ageunit') e on e.dict_value = a.age_unit\n" +
+ "where trim(c.tj_number)=#{tjNumber}")
+ Map<String ,Object > selectDjdUserInfo(@Param("tjNumber") String tjNumber);
@Select("SELECT a.sqdh FROM ltkj_jianchajianyan_tree a WHERE a.card_id=#{cardId} AND a.type='妫�鏌�' GROUP BY a.sqdh")
@@ -239,13 +323,16 @@
@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);
+ Boolean delHuoQuZlsqdha(String cardId);
List<Map<String, Object>> getTjTongJiJieKou(Map<String, Object> map);
@@ -264,4 +351,111 @@
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);
+
+
+ List<List<?>> getgetBghsList(Map<String,Object> map);
+
+
+ @Select({"<script>","SELECT * FROM ltkj_jianchajianyan_tree a WHERE a.card_id=#{cardId} AND a.jxbz IN ","<foreach collection='bldh' item='id' open='(' separator=',' close=')'>",
+ "#{id}",
+ "</foreach>",
+ "</script>" })
+ List<LtkjJianchajianyanTree> getBuLuXmXinXi(@Param("bldh") List<String> bldh,@Param("cardId")String cardId);
+
+ @Select("SELECT a.sqdh FROM ltkj_jianchajianyan_tree a WHERE a.card_id=#{cardId} and a.jxbz=#{bldh} AND a.type='妫�鏌�' AND a.service = 'pacs' GROUP BY a.sqdh")
+ List<String> getBlJcsqdhByPacsAndBldh(@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='妫�楠�' AND a.service = 'lis' GROUP BY a.sqdh")
+ List<String> getBlJysqdhByLisAndBldh(@Param("cardId") String cardId,@Param("bldh") String bldh);
+
+ @Select("SELECT a.sqdh FROM ltkj_jianchajianyan_tree a WHERE a.card_id=#{cardId} AND a.type='妫�鏌�' AND a.service = 'pacs' GROUP BY a.sqdh")
+ List<String> getBlJcsqdhByPacs(String cardId);
+
+ @Select("SELECT a.sqdh FROM ltkj_jianchajianyan_tree a WHERE a.card_id=#{cardId} AND a.type='妫�楠�' AND a.service = 'lis' GROUP BY a.sqdh")
+ List<String> getBlJysqdhByLis(String cardId);
+
+
+ @Select("SELECT\n" +
+ " DISTINCT a.tj_number \n" +
+ "FROM\n" +
+ " tj_order_remark a\n" +
+ " JOIN sys_dept b ON b.dept_id = a.dept_id \n" +
+ "WHERE\n" +
+ " a.deleted = 0 \n" +
+ " AND b.org_type = 1 \n" +
+ " AND a.type=0")
+ List<String> getDingShiTongBuJianYanTjNum();
+
+
+ @Select(" SELECT\n" +
+ " DISTINCT a.tj_number \n" +
+ "FROM\n" +
+ " tj_order_remark a\n" +
+ " JOIN sys_dept b ON b.dept_id = a.dept_id \n" +
+ "WHERE\n" +
+ " a.deleted = 0 \n" +
+ " AND b.org_type = 2 \n" +
+ " AND a.type =0")
+ List<String> getDingShiTongBuJianChaTjNum();
+
+
+
+
+ void tjQiandaodengji(Map<String,Object> map);
+
+ void tjLispacstongbujianyi(Map<String, Object> map);
+
+ List<List<?>> getTjBgdyList(Map<String, Object> map);
+
+ @Select(" SELECT\n" +
+ " DISTINCT a.tj_number \n" +
+ "FROM\n" +
+ " tj_order_remark a\n" +
+ " JOIN sys_dept b ON b.dept_id = a.dept_id \n" +
+ "WHERE\n" +
+ " a.deleted = 0 \n" +
+ " AND b.org_type = 2 \n")
+ List<String> getJianChaTjNum();
+
+
+ @Select("SELECT a.tj_number FROM tj_order a WHERE a.deleted=0 AND a.check_status=0 AND\n" +
+ "ISNULL(a.report_time)")
+ List<String> getJianChaTjNumWsh();
+
+
+
+
+
+ List<List<?>> getYxJcList(Map<String,Object> map);
+
+
+ @Select("SELECT count(*) FROM tj_order WHERE tj_number = #{tjNum}")
+ int getOrderCountByTjNum(String tjNum);
+
+
+
+ //瀛樺偍杩囩▼涓撶敤鎺ュ彛(鎬绘)
+ List<List<?>> getEsjCunChuGuoChengCustomerList(Map<String,Object> map);
+
+
+ @Select("SELECT * FROM tj_order WHERE tj_number = card_id ")
+ List<TjOrder> getOrderListBypiliangqiandaofasong();
+
+
+ @Select("SELECT COUNT(*) FROM tj_order a WHERE a.deleted=0 AND " +
+ "(a.firm_id=#{compId} OR a.team_no=#{teamNo}) AND a.pac_id=#{pacId}")
+ Integer getTjTeamSelectRecordCount(@Param("teamNo") String teamNo,@Param("compId") String compId,@Param("pacId") String pacId);
+
+ @Select(" SELECT aa.pacname pacname FROM (\n" +
+ " SELECT TRIM(a.pac_name) pacname FROM tj_package a WHERE a.pac_id=#{pacId}\n" +
+ " \n" +
+ " UNION \n" +
+ " \n" +
+ " SELECT TRIM(b.dw_dept_name) pacname FROM tj_dw_grouping b WHERE b.id=#{pacId}) aa GROUP BY aa.pacname\n" +
+ " ")
+ String getpacName(String pacId);
+
+
+ @Select(" SELECT SUM(a.paid_in) FROM tj_flowing_water a WHERE a.deleted=0 AND a.pay_stasus=1 AND a.order_id=#{orderId} ")
+ String gettjzj(Long orderId);
}
--
Gitblit v1.8.0