package com.ltkj.hosp.mapper; 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接口 * * @author ltkj_赵佳豪&李格 * @date 2023-04-11 */ @Mapper public interface TjSamplingMapper extends BaseMapper { /** * 查询体检采样管理 * * @param id 体检采样管理主键 * @return 体检采样管理 */ public TjSampling selectTjSamplingById(String id); /** * 查询体检采样管理列表 * * @param tjSampling 体检采样管理 * @return 体检采样管理集合 */ public List selectTjSamplingList(TjSampling tjSampling); /** * 新增体检采样管理 * * @param tjSampling 体检采样管理 * @return 结果 */ public int insertTjSampling(TjSampling tjSampling); /** * 修改体检采样管理 * * @param tjSampling 体检采样管理 * @return 结果 */ public int updateTjSampling(TjSampling tjSampling); /** * 删除体检采样管理 * * @param id 体检采样管理主键 * @return 结果 */ public int deleteTjSamplingById(String id); /** * 批量删除体检采样管理 * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteTjSamplingByIds(String[] ids); @Select({""}) Map hebingCaiYangInFo(@Param("ids") List ids); @Select({""}) int panduanshifoukeyihebing(@Param("ids") List ids); // @Update({""}) boolean updateHeBingXm(@Param("ids") List ids,@Param("parentId")String parentId); @Select({""}) int pdsfczhbxm(@Param("ids") List ids); @Select({""}) TjSampling getTjSamplingByHb(@Param("ids") List ids); @Select({""}) List getTjSamplingListByHb(@Param("ids") List ids); @Delete({""}) boolean deletedTjSamplingListByHb(@Param("ids") List ids); // @Update({""}) boolean updateHeBingXms(@Param("ids") List 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({ "" }) int deleteByTjNumAndCusIdAndJxbz(@Param("tjNum") String tjNum,@Param("userId") Long userId,@Param("ids")List ids); @Delete("DELETE FROM tj_sampling WHERE tj_num = #{tjNum} AND cus_id = #{userId} and jxbz = #{jxbz} ") int deleteByTjNumAndCusIdAndJxbzo(@Param("tjNum") String tjNum,@Param("userId") Long userId,@Param("jxbz")String jxbz); @Select({""}) String getBuKeHebingProName(@Param("ids")List 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); @Update("UPDATE tj_sampling a SET\n" + "a.update_time=SYSDATE(),\n" + "a.update_by= #{userName},\n" + "a.update_id= #{userId},\n" + "a.create_id = #{userId}\n"+ "WHERE a.tj_num=#{tjNum}") boolean updateUserIdByTjNum(@Param("tjNum")String tjNum,@Param("userName")String userName,@Param("userId") String userId); @Update("UPDATE tj_sampling a SET\n" + "a.update_time=SYSDATE(),\n" + "a.update_by= #{userName},\n" + "a.update_id= #{userId},\n" + "a.create_id = #{userId}\n"+ "WHERE a.tj_num=#{tjNum} AND a.jxbz = #{jxbz}") boolean updateUserIdByTjNumAndJxbz(@Param("tjNum")String tjNum,@Param("userName")String userName,@Param("userId") String userId,@Param("jxbz") String jxbz); @Select("SELECT COUNT(*) FROM tj_sampling a WHERE a.deleted=0 AND a.tj_num=#{tjh} AND LOCATE(#{proId},a.pro_id)") int isExistProId(@Param("tjh") String tjh,@Param("proId") String proId); }