package thyyxxk.webserver.dao.his.medicalinsurance;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import thyyxxk.webserver.entity.querydata.TSetlDeptConf;

import java.util.List;

/**
 * <p>
 * 结算单上传科室配置表 Mapper 接口
 * </p>
 *
 * @author lihong
 * @since 2023-01-09
 */
@Mapper
public interface TSetlDeptConfDao extends BaseMapper<TSetlDeptConf> {
    @Insert("<script>" +
            "insert into t_setl_dept_conf (code, name, type_flag, dept_code)"+
            "  values " +
            " <foreach collection='list' item='item'  separator=','>" +
            " (#{item.code},#{item.name},#{item.typeFlag},#{item.deptCode}) "+
            " </foreach>" +
            " </script>")
    void batchSaveData(List<TSetlDeptConf> list);
    @Select("<script>" +
            " select rtrim(code_rs) code_rs from a_employee_mi where  code in ( " +
            " <foreach collection='codes' item='item'  separator=','>" +
            "  #{item}" +
            " </foreach>" +
            " )"+
            "</script>")
    List<String> getCodeRs(List<String> codes);
    /**
     * @description:获取编码员角色的员工号
     * @author: lihong
     * @date: 2023/1/10 9:27
     * @return: java.util.List<java.lang.String>
     **/
    @Select(" select rtrim(a.code_rs) code_rs " +
            " from a_employee_mi a " +
            "         join dj_user_role b on a.code = b.user_code " +
            "  where b.role_id = 49")
    List<String> getBmyCodeRs();
}
