From c5a0c0b290cba50f76d17843ac062ffa935b15d6 Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期三, 30 十月 2024 18:03:18 +0800
Subject: [PATCH] zjh20241030

---
 ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjSamplingMapper.java |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjSamplingMapper.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjSamplingMapper.java
index 9630fbf..b0de598 100644
--- a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjSamplingMapper.java
+++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjSamplingMapper.java
@@ -128,4 +128,38 @@
 //            "</foreach>",
 //            "</script>"})
     boolean updateHeBingXms(@Param("ids") List<String> ids);
+
+    @Delete("DELETE FROM tj_sampling WHERE tj_num = #{tjNum} AND cus_id = #{userId}")
+    int deleteByTjNumAndCusId(@Param("tjNum") String tjNum,@Param("userId") Long userId);
+
+    @Delete({
+            "<script>",
+            "DELETE FROM tj_sampling WHERE tj_num = #{tjNum} AND cus_id = #{userId} and jxbz in ",
+            "<foreach collection='ids' item='id' open='(' separator=',' close=')'>",
+            "#{id}",
+            "</foreach>",
+            "</script>"
+    })
+    int deleteByTjNumAndCusIdAndJxbz(@Param("tjNum") String tjNum,@Param("userId") Long userId,@Param("ids")List<String> ids);
+
+
+    @Select({"<script>","SELECT\n" +
+            "  IFNULL(GROUP_CONCAT( aa.pro_name SEPARATOR ' ; ' ),NULL)\n" +
+            "FROM\n" +
+            "  (\n" +
+            "  SELECT\n" +
+            "    a.jyxmdm,\n" +
+            "    a.pro_name,\n" +
+            "    b.jyxmmc,\n" +
+            "    b.jybbdm,\n" +
+            "    b.jyfldm \n" +
+            "  FROM\n" +
+            "    `tj_sampling` a\n" +
+            "    LEFT JOIN ltkj_jyxmzd b ON a.jyxmdm = b.jyxmdm   WHERE a.id " +
+            "IN ","<foreach collection='ids' item='id' open='(' separator=',' close=')'>",
+            "#{id}",
+            "</foreach>"
+            +") aa " + "WHERE\n" + "  aa.jyfldm NOT IN ( SELECT c.flbm FROM lis_jyflhb c);",
+            "</script>"})
+    String getBuKeHebingProName(@Param("ids")List<String> ids);
 }

--
Gitblit v1.8.0