From af6f1f6ad2f3fffeeed75f1a742a5bb63141db60 Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期四, 01 八月 2024 18:44:34 +0800
Subject: [PATCH] zjh 2024/08/01-1

---
 ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderDetailMapper.java |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderDetailMapper.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderDetailMapper.java
index 53e306a..160b19c 100644
--- a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderDetailMapper.java
+++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderDetailMapper.java
@@ -121,12 +121,14 @@
             "  create_id,\n" +
             "  pro_type) \n" +
             "  \n" +
-            "  SELECT #{orderId},a.pro_id,IFNULL(b.pro_default,''),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) FROM tb_transition a LEFT JOIN tj_project b ON a.pro_id=b.pro_id  WHERE a.cus_id=#{cusId} \n" +
+            "  SELECT #{orderId},a.pro_id,IFNULL(b.pro_default,''),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0)" +
+            " FROM tb_transition a LEFT JOIN tj_project b ON a.pro_id=b.pro_id  WHERE a.cus_id=#{cusId} AND a.card_id=#{cardId} \n" +
             "\t\t\n" +
             "\tUNION\n" +
             "  \n" +
-            "\tSELECT #{orderId},a.parent_pro_id,IFNULL(b.pro_default,''),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) FROM tb_transition a LEFT JOIN tj_project b ON a.parent_pro_id=b.pro_id  WHERE a.cus_id=#{cusId}  GROUP BY a.parent_pro_id")
-     boolean saveTjOrderDetailsByCusId(@Param("cusId")String cusId,@Param("orderId")String orderId,@Param("userName")String userName,@Param("userId") String userId);
+            "\tSELECT #{orderId},a.parent_pro_id,IFNULL(b.pro_default,''),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) " +
+            "FROM tb_transition a LEFT JOIN tj_project b ON a.parent_pro_id=b.pro_id  WHERE a.cus_id=#{cusId} AND a.card_id=#{cardId} GROUP BY a.parent_pro_id")
+     boolean saveTjOrderDetailsByCusId(@Param("cusId")String cusId,@Param("orderId")String orderId,@Param("userName")String userName,@Param("userId") String userId,@Param("cardId") String cardId);
 
 
     @Insert("\tINSERT INTO tj_order_detail(\n" +
@@ -141,12 +143,14 @@
             "  create_id,\n" +
             "  pro_type) \n" +
             "  \n" +
-            "  SELECT #{orderId},a.pro_id,IFNULL(b.pro_default,''),'1',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) FROM tb_transition a LEFT JOIN tj_project b ON a.pro_id=b.pro_id  WHERE a.cus_id=#{cusId} \n" +
+            "  SELECT #{orderId},a.pro_id,IFNULL(b.pro_default,''),'1',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) " +
+            "FROM tb_transition a LEFT JOIN tj_project b ON a.pro_id=b.pro_id  WHERE a.cus_id=#{cusId} AND a.card_id=#{cardId} \n" +
             "\t\t\n" +
             "\tUNION\n" +
             "  \n" +
-            "\tSELECT #{orderId},a.parent_pro_id,IFNULL(b.pro_default,''),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) FROM tb_transition a LEFT JOIN tj_project b ON a.parent_pro_id=b.pro_id  WHERE a.cus_id=#{cusId}  GROUP BY a.parent_pro_id")
-    boolean saveJSYTjOrderDetailsByCusId(@Param("cusId")String cusId,@Param("orderId")String orderId,@Param("userName")String userName,@Param("userId") String userId);
+            "\tSELECT #{orderId},a.parent_pro_id,IFNULL(b.pro_default,''),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0)" +
+            " FROM tb_transition a LEFT JOIN tj_project b ON a.parent_pro_id=b.pro_id  WHERE a.cus_id=#{cusId} AND a.card_id=#{cardId} GROUP BY a.parent_pro_id")
+    boolean saveJSYTjOrderDetailsByCusId(@Param("cusId")String cusId,@Param("orderId")String orderId,@Param("userName")String userName,@Param("userId") String userId,@Param("cardId") String cardId);
 
 
 
@@ -160,10 +164,10 @@
             "\tcreate_time,\n" +
             "\tcreate_id\n" +
             ")\n" +
-            "SELECT #{tjNum},b.cus_id,b.cus_name,'1633660948860522619','绾煶鍚槇'," +
+            "SELECT #{tjNum},b.cus_id,b.cus_name,'1740177341251154247','绾煶鍚槇'," +
             "#{userName},SYSDATE(),#{userId} FROM tb_transition a LEFT JOIN tj_customer b " +
-            "ON a.cus_id=b.cus_idcard WHERE a.cus_id=#{cusId} AND a.parent_pro_id IN('1633660948860522619') GROUP BY a.cus_id")
-    boolean saveTjPureToneTesByCusId(@Param("cusId")String cusId,@Param("tjNum")String tjNum,@Param("userName")String userName,@Param("userId") String userId);
+            "ON a.cus_id=b.cus_idcard WHERE a.cus_id=#{cusId} AND a.card_id=#{cardId}  AND a.parent_pro_id IN('1740177341251154247') GROUP BY a.cus_id")
+    boolean saveTjPureToneTesByCusId(@Param("cusId")String cusId,@Param("tjNum")String tjNum,@Param("userName")String userName,@Param("userId") String userId,@Param("cardId") String cardId);
 
 
     @Update("UPDATE tj_order_detail a SET\n" +

--
Gitblit v1.8.0