zjh
2025-06-05 2c19fa65dc87ea8f3d81f84154f4eeabff7f8d00
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/LtkjExamJcsqdMapper.java
@@ -2,13 +2,16 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltkj.common.annotation.DataSource;
import com.ltkj.common.core.domain.AjaxResult;
import com.ltkj.common.enums.DataSourceType;
import com.ltkj.hosp.sqlDomain.LtkjExamJcbgd;
import com.ltkj.hosp.sqlDomain.LtkjExamJcsqd;
import com.ltkj.hosp.sqlDomain.LtkjHysqd;
import org.apache.ibatis.annotations.*;
import org.springframework.beans.factory.annotation.Qualifier;
import java.util.List;
import java.util.Map;
/**
 * @Company: 西安路泰科技有限公司
@@ -16,22 +19,57 @@
 * @Date: 2023/12/11 17:56
 */
@Mapper
@DataSource(value = DataSourceType.MASTER)
//@DataSource(value = DataSourceType.MASTER)
public interface LtkjExamJcsqdMapper extends BaseMapper<LtkjExamJcsqd> {
    @Select ("SELECT * FROM ltkj_exam_jcsqd a WHERE a.tjh=#{tjh} AND a.tmh=#{tmh} ")
    @Select ("SELECT * FROM ltkj_exam_jcsqd a WHERE a.tjh=#{tjh} AND a.tmh=#{tmh}  and a.lx=0  ")
    LtkjExamJcsqd getLtkjJcsqdByTjhAndTmh(@Param("tjh") String tjh,@Param("tmh") String tmh);
    @Delete ("DELETE FROM ltkj_exam_jcsqd WHERE tjh=#{tjh} AND tmh=#{tmh} ")
    void  deletedLtkjJcsqdByTjhAndTmh(@Param("tjh")String tjh,@Param("tmh")String tmh);
    @Delete ("DELETE FROM ltkj_exam_jcsqd WHERE tjh=#{tjh}  and lx=0  and sgorzd=0  ")
    void  deletedLtkjJcsqdByTjhAndTmh(@Param("tjh")String tjh);
    @Delete ("DELETE FROM ltkj_exam_jcsqd WHERE tjh=#{tjh} and tmh=#{tmh}   and lx=1 ")
    void  deletedLtkjJcsqdByTjhandtmh(@Param("tjh") String tjh,@Param("tmh") String tmh);
    @Delete ("DELETE FROM ltkj_exam_jcsqd WHERE tjh=#{tjh} and tmh=#{tmh}   and lx=0 ")
    void  sdtbdeletedLtkjJcsqdByTjhandtmh(@Param("tjh") String tjh,@Param("tmh") String tmh);
    @Delete ("DELETE FROM ltkj_exam_jcsqd WHERE tjh=#{tjh} and lx=1 ")
    void  deletedLtkjJcsqdByTjhandtmh1(@Param("tjh") String tjh);
    @Select("SELECT * FROM ltkj_exam_jcsqd a WHERE a.tjh=#{tjh}")
    List<LtkjExamJcsqd> getLtkjJcsqdByTjh(String tjh);
    @Insert("INSERT INTO  ltkj_exam_jcsqd \n" +
    @Insert("INSERT INTO  ltkj_exam_jcsqd (`tjh`, `tmh`, `jclx`, `jczlx`, `bgys`, `bgysid`, " +
            "`sqsj`, `jgsj`, `jcxmmc`, `jcxmid`, `bw`, `jgzt`, `jgbx`, `lx`, `create_time`)\n" +
            "SELECT a.tjh,a.tmh,NULL jclx,NULL jczlx,a.shysxm bgys,a.shysdm bgysid,a.sqsj,a.zdsj jgsj, a.xmmc jcxmmc,a.xmdm jcxmid,a.jcbw bw,\n" +
            "CONCAT(a.bg_nr,'(',a.yxzd,',',a.yxbx,')') jgzt\n" +
            "FROM ltkj_exam_jcbgd a WHERE a.tjh=#{tjh} GROUP BY a.tmh;")
            "a.yxzd jgzt,a.bg_nr jgbx,'0',sysdate()\n" +
            "FROM ltkj_exam_jcbgd a WHERE a.tjh=#{tjh} and a.lx=0  GROUP BY a.xmmc")
    void saveLtkjExamJcsqd(String tjh);
    @Insert("INSERT INTO  ltkj_exam_jcsqd (`tjh`, `tmh`, `jclx`, `jczlx`, `bgys`, `bgysid`, " +
            "`sqsj`, `jgsj`, `jcxmmc`, `jcxmid`, `bw`, `jgzt`, `jgbx`, `lx`, `create_time`)\n" +
            "SELECT a.tjh,a.tmh,NULL jclx,NULL jczlx,a.shysxm bgys,a.shysdm bgysid,a.sqsj,a.zdsj jgsj, a.xmmc jcxmmc,a.xmdm jcxmid,a.jcbw bw,\n" +
            "a.yxzd jgzt,a.bg_nr jgbx,'1',sysdate()\n" +
            "FROM ltkj_exam_jcbgd a WHERE a.tjh=#{tjh} and a.tmh=#{tmh} and a.lx=1  GROUP BY a.xmmc")
    void saveXdtLtkjExamJcsqd(@Param("tjh") String tjh,@Param("tmh")String tmh);
    @Select("SELECT a.tjh,a.tmh,NULL jclx,NULL jczlx,a.shysxm bgys,a.shysdm bgysid,a.sqsj,a.zdsj jgsj, a.xmmc jcxmmc,a.xmdm jcxmid,a.jcbw bw," +
            "a.yxzd jgzt,a.yxbx jgbx FROM ltkj_exam_jcbgd a WHERE a.tjh=#{tjh} GROUP BY a.xmmc")
    List<LtkjExamJcbgd> queryLtkjExamJcsqdByTjh(String tjh);
    @DataSource(value = DataSourceType.SLAVE_HIS)
    @Qualifier (value = "slaveHisDataSource")
    List<Map<String, Object>> getTjJcProByHisCall(@Param("ksmc") String ksmc,
                                                  @Param("str_in")String strIn,
                                                  @Param("brid")String brid,
                                                  @Param("pagecount")int pagecount,
                                                  @Param("page")int page,
                                                  @Param("status")String status);
    @Delete ("DELETE FROM ltkj_exam_jcsqd WHERE tjh=#{tjh} and jcxmid = #{xmid} and lx=0 and sgorzd=1 ")
    void deletedLtkjJcsqdByTjhAndProId(@Param("tjh") String tjh,@Param("xmid") String xmid);
}