From 14f9208da19b7030a1c65a40897f9f4146a74d44 Mon Sep 17 00:00:00 2001 From: 赵文轩 <1652863494@qq.com> Date: 星期五, 01 十一月 2024 08:37:14 +0800 Subject: [PATCH] 增加申请业务类型 --- ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjSamplingMapper.java | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 113 insertions(+), 1 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 b7f5bf5..40e3b74 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 @@ -2,10 +2,11 @@ import java.util.Base64; import java.util.List; +import java.util.Map; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ltkj.hosp.domain.TjSampling; -import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.*; /** * 浣撴閲囨牱绠$悊Mapper鎺ュ彛 @@ -62,4 +63,115 @@ * @return 缁撴灉 */ public int deleteTjSamplingByIds(String[] ids); + + + @Select({"<script>","SELECT GROUP_CONCAT(a.pro_id SEPARATOR ',')proId,GROUP_CONCAT(a.pro_name SEPARATOR ' + ') proName FROM tj_sampling a WHERE a.deleted=0 AND a.id " + + "IN ","<foreach collection='ids' item='id' open='(' separator=',' close=')'>", + "#{id}", + "</foreach>", + "</script>"}) + Map<String, Object> hebingCaiYangInFo(@Param("ids") List<String> ids); + + + @Select({"<script>","SELECT COUNT(*) FROM(" + + "SELECT GROUP_CONCAT(a.pro_id SEPARATOR ',')proId,GROUP_CONCAT(a.pro_name SEPARATOR ' + ') proName FROM tj_sampling a WHERE a.deleted=0 AND a.id " + + "IN ","<foreach collection='ids' item='id' open='(' separator=',' close=')'>", + "#{id}", + "</foreach>", "GROUP BY a.specimen_type_code) aa" + + "</script>"}) + int panduanshifoukeyihebing(@Param("ids") List<String> ids); + + + +// @Update({"<script>","UPDATE tj_sampling a SET a.parent_id=#{parentId} WHERE a.id " + +// "IN ","<foreach collection='ids' item='id' open='(' separator=',' close=')'>", +// "#{id}", +// "</foreach>", +// "</script>"}) + boolean updateHeBingXm(@Param("ids") List<String> ids,@Param("parentId")String parentId); + + + @Select({"<script>","SELECT COUNT(*) FROM tj_sampling a " + + "WHERE a.deleted=0 AND a.is_merge=1 AND a.id IN ","<foreach collection='ids' item='id' open='(' separator=',' close=')'>", + "#{id}", + "</foreach>", + "</script>"}) + int pdsfczhbxm(@Param("ids") List<String> ids); + + @Select({"<script>","SELECT * FROM tj_sampling a " + + "WHERE a.deleted=0 AND a.is_merge=1 AND a.id IN ","<foreach collection='ids' item='id' open='(' separator=',' close=')'>", + "#{id}", + "</foreach>", + "</script>"}) + TjSampling getTjSamplingByHb(@Param("ids") List<String> ids); + + + @Select({"<script>","SELECT * FROM tj_sampling a " + + "WHERE a.deleted=0 AND !ISNULL(a.parent_id) AND a.is_merge=0 AND a.id IN ","<foreach collection='ids' item='id' open='(' separator=',' close=')'>", + "#{id}", + "</foreach>", + "</script>"}) + List<TjSampling> getTjSamplingListByHb(@Param("ids") List<String> ids); + + + @Delete({"<script>","DELETE FROM tj_sampling WHERE id " + + "IN ","<foreach collection='ids' item='id' open='(' separator=',' close=')'>", + "#{id}", + "</foreach>", + "</script>"}) + boolean deletedTjSamplingListByHb(@Param("ids") List<String> ids); + + +// @Update({"<script>","UPDATE tj_sampling a SET a.parent_id=null WHERE a.id " + +// "IN ","<foreach collection='ids' item='id' open='(' separator=',' close=')'>", +// "#{id}", +// "</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); + + @Select("SELECT COUNT( 1 ) FROM(\n" + + "\tSELECT\n" + + "\t\ta.jyxmdm,\n" + + "\t\tb.jyfldm \n" + + "\tFROM\n" + + "\t\t`tj_sampling` a\n" + + "\t\tLEFT JOIN ltkj_jyxmzd b ON a.jyxmdm = b.jyxmdm \n" + + "\tWHERE\n" + + "\t\ta.id = #{id} \n" + + "\t) aa WHERE aa.jyfldm NOT IN ( SELECT c.flbm FROM lis_jyflhb c )") + int isMergeItem(@Param("id") String id); } -- Gitblit v1.8.0