From c04dbb5e2307ecc935930da05ab2d17bc0b72914 Mon Sep 17 00:00:00 2001
From: lige <bestlige@outlook.com>
Date: 星期日, 04 二月 2024 16:15:47 +0800
Subject: [PATCH] sous
---
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderMapper.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 51 insertions(+), 2 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 e8afa31..33cf20a 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,7 +5,9 @@
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ltkj.hosp.domain.TjCustomer;
import com.ltkj.hosp.domain.TjOrder;
+import com.ltkj.hosp.vodomain.LineChartsVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@@ -75,10 +77,35 @@
public int deleteTjOrderByOrderIds(Long[] orderIds);
- List<TjOrder> getOrderList(Integer cusId);
+ @Select(" select * from tj_order where 1 = 1 and deleted=0 and user_id = #{cusId}")
+ List<TjOrder> getOrderList(Long cusId);
List<TjOrder> getOrderList1();
+
+// @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")
+// List<Map<Object, Object>> getLine();
@Select("select aa.date,\n" +
" sum(if(c.tj_type='鍥㈤槦', ifnull(c.coun,0),0)) as tdcoun,\n" +
@@ -102,7 +129,7 @@
" group by date_format(report_time, '%Y-%m-%d')\n" +
" ) c on c.dat =aa.date\n" +
"group by aa.date")
- List<Map<Object, Object>> getLine();
+ List<LineChartsVo> getLine();
@Select("SELECT * FROM tj_order WHERE tj_number RLIKE #{tjNum} AND deleted='0' ORDER BY create_time DESC")
@@ -149,4 +176,26 @@
@Select("SELECT * FROM tj_order WHERE deleted='0' and user_id = #{userId} AND !ISNULL(finish_time) " +
"and !ISNULL(confirm_time) ")
List<TjOrder> getCsTjOrderListByCusId1(Long userId);
+
+
+ @Select("SELECT GROUP_CONCAT( DISTINCT b.pro_name SEPARATOR ';' ) aa FROM tj_order_remark a" +
+ " LEFT JOIN tj_project b ON a.pro_id=b.pro_id WHERE a.deleted=0 AND a.tj_number= #{tjNum} AND a.type !=2")
+ String getHistoryTjOrderProByTjNum(String tjNum);
+
+
+ @Select("SELECT * FROM tj_order WHERE deleted='0' and user_id =#{userId}" +
+ " AND !ISNULL(finish_time) ORDER BY create_time DESC LIMIT 1")
+ TjOrder getLastTjOrderListByCusId(Long userId);
+
+
+ //瀛樺偍杩囩▼涓撶敤鎺ュ彛(鎬绘)
+ List<List<?>> getCunChuGuoChengCustomerList(Map<String,Object> map);
+
+
+ //瀛樺偍杩囩▼涓撶敤鎺ュ彛(鍒濆)
+ List<List<?>> getCsCunChuGuoChengCustomerList(Map<String,Object> map);
+
+
+ @Select("SELECT count(*) FROM tj_order a WHERE a.deleted=0 and a.card_id=#{cardId}")
+ int selectTjOrderByCardId(String cardId);
}
--
Gitblit v1.8.0