package com.fs.company.mapper;

import java.util.List;
import com.fs.company.domain.CompanyVoiceConfig;
import com.fs.company.vo.CompanyVoiceConfigListVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 呼叫频率配置Mapper接口
 * 
 * @author fs
 * @date 2021-11-13
 */
public interface CompanyVoiceConfigMapper 
{
    /**
     * 查询呼叫频率配置
     * 
     * @param configId 呼叫频率配置ID
     * @return 呼叫频率配置
     */
    public CompanyVoiceConfig selectCompanyVoiceConfigById(Long configId);

    /**
     * 查询呼叫频率配置列表
     * 
     * @param companyVoiceConfig 呼叫频率配置
     * @return 呼叫频率配置集合
     */
    public List<CompanyVoiceConfig> selectCompanyVoiceConfigList(CompanyVoiceConfig companyVoiceConfig);

    /**
     * 新增呼叫频率配置
     * 
     * @param companyVoiceConfig 呼叫频率配置
     * @return 结果
     */
    public int insertCompanyVoiceConfig(CompanyVoiceConfig companyVoiceConfig);

    /**
     * 修改呼叫频率配置
     * 
     * @param companyVoiceConfig 呼叫频率配置
     * @return 结果
     */
    public int updateCompanyVoiceConfig(CompanyVoiceConfig companyVoiceConfig);

    /**
     * 删除呼叫频率配置
     * 
     * @param configId 呼叫频率配置ID
     * @return 结果
     */
    public int deleteCompanyVoiceConfigById(Long configId);

    /**
     * 批量删除呼叫频率配置
     * 
     * @param configIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteCompanyVoiceConfigByIds(Long[] configIds);
    @Select("select * from company_voice_config where company_id=#{companyId}")
    CompanyVoiceConfig selectCompanyVoiceConfigByCompanyId(Long companyId);
    @Select({"<script> " +
            "select cc.*,c.company_name " +
            "from company_voice_config cc left join company c  on c.company_id=cc.company_id  " +
            "where 1=1 " +
            "<if test = 'maps.companyId != null  '> " +
            "and cc.company_id = #{maps.companyId}" +
            "</if>" +
            "order by cc.config_id desc " +
            "</script>"})
    List<CompanyVoiceConfigListVO> selectCompanyVoiceConfigListVO(@Param("maps")CompanyVoiceConfig companyVoiceConfig);
}
