package com.fs.his.mapper;

import java.util.List;
import com.fs.his.domain.FsDoctorWords;
import com.fs.his.param.FsDoctorWordsListUParam;
import com.fs.his.vo.FsDoctorWordsListUVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * doctorWordsMapper接口
 *
 * @author fs
 * @date 2023-10-12
 */
public interface FsDoctorWordsMapper
{
    /**
     * 查询doctorWords
     *
     * @param id doctorWords主键
     * @return doctorWords
     */
    public FsDoctorWords selectFsDoctorWordsById(Long id);

    /**
     * 查询doctorWords列表
     *
     * @param fsDoctorWords doctorWords
     * @return doctorWords集合
     */
    public List<FsDoctorWords> selectFsDoctorWordsList(FsDoctorWords fsDoctorWords);

    /**
     * 新增doctorWords
     *
     * @param fsDoctorWords doctorWords
     * @return 结果
     */
    public int insertFsDoctorWords(FsDoctorWords fsDoctorWords);

    /**
     * 修改doctorWords
     *
     * @param fsDoctorWords doctorWords
     * @return 结果
     */
    public int updateFsDoctorWords(FsDoctorWords fsDoctorWords);

    /**
     * 删除doctorWords
     *
     * @param id doctorWords主键
     * @return 结果
     */
    public int deleteFsDoctorWordsById(Long id);

    /**
     * 批量删除doctorWords
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteFsDoctorWordsByIds(Long[] ids);
    @Select({"<script> " +
            "select w.*  from fs_doctor_words w    " +
            "where 1=1  " +
            "<if test = ' maps.keyword!=null and maps.keyword != \"\"  '> " +
            "and w.content like concat('%', #{maps.keyword}, '%') " +
            "</if>" +
            "<if test = ' maps.doctorId!=null  '> " +
            "and w.doctor_id = #{maps.doctorId} " +
            "</if>" +
            " order by w.create_time desc "+
            "</script>"})
    List<FsDoctorWordsListUVO> selectFsDoctorWordsListUVO(@Param("maps")FsDoctorWordsListUParam param);
}
