package com.fs.his.mapper;

import java.util.List;
import com.fs.his.domain.FsInquiryDisease;
import com.fs.his.vo.FsInquiryDiseaseVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 问诊疾病Mapper接口
 *
 * @author fs
 * @date 2024-08-02
 */
public interface FsInquiryDiseaseMapper
{
    /**
     * 查询问诊疾病
     *
     * @param diseaseId 问诊疾病主键
     * @return 问诊疾病
     */
    public FsInquiryDisease selectFsInquiryDiseaseByDiseaseId(Long diseaseId);

    /**
     * 查询问诊疾病列表
     *
     * @param fsInquiryDisease 问诊疾病
     * @return 问诊疾病集合
     */
    public List<FsInquiryDisease> selectFsInquiryDiseaseList(FsInquiryDisease fsInquiryDisease);

    /**
     * 新增问诊疾病
     *
     * @param fsInquiryDisease 问诊疾病
     * @return 结果
     */
    public int insertFsInquiryDisease(FsInquiryDisease fsInquiryDisease);

    /**
     * 修改问诊疾病
     *
     * @param fsInquiryDisease 问诊疾病
     * @return 结果
     */
    public int updateFsInquiryDisease(FsInquiryDisease fsInquiryDisease);

    /**
     * 删除问诊疾病
     *
     * @param diseaseId 问诊疾病主键
     * @return 结果
     */
    public int deleteFsInquiryDiseaseByDiseaseId(Long diseaseId);

    /**
     * 批量删除问诊疾病
     *
     * @param diseaseIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteFsInquiryDiseaseByDiseaseIds(Long[] diseaseIds);

    @Select({"<script> " +
            "select d.disease_id as dict_value,d.disease_name as dict_label,'primary' as list_class  " +
            " from fs_inquiry_disease d  " +
            "where 1=1  " +
            "<if test = 'maps.diseaseId != null  '> " +
            "and d.disease_id = #{maps.diseaseId} " +
            "</if>" +
            "<if test = 'maps.diseaseName != null and  maps.diseaseName != \"\"  '> " +
            "and d.disease_name like concat('%', #{maps.diseaseName}, '%') " +
            "</if>" +
            " order by d.disease_id desc "+
            "</script>"})
    List<FsInquiryDiseaseVO> selectFsInquiryDiseaseListVO(@Param("maps") FsInquiryDisease fsInquiryDisease);
}
