# SalesEmailTargetServiceImpl.java

    package cloud.wconnect.workperformance.service.mor.impl;

    import cloud.wconnect.workperformance.entity.mor.SalesEmailTarget;
    import cloud.wconnect.workperformance.mapper.mor.SalesEmailTargetMapper;
    import cloud.wconnect.workperformance.service.mor.ISalesEmailTargetService;
    import com.baomidou.dynamic.datasource.annotation.DS;
    import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
    import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
    import org.springframework.stereotype.Service;

    import java.util.List;

    /**
     * <p>
     * Monthly OT Report - Sales source 邮件配置（收件人、抄送人） 服务实现类
     * </p>
     *
     * @author zc
     * @since 2024-05-31
     */
    @Service
    @DS("work_performance")
    public class SalesEmailTargetServiceImpl extends ServiceImpl<SalesEmailTargetMapper, SalesEmailTarget> implements ISalesEmailTargetService {

        /**
         * 获取邮件通知对象
         *
         * @param configId 邮件配置 id
         * @return 邮件通知对象
         * @author zc
         * @date 2024/6/1
         */
        @Override
        public List<SalesEmailTarget> listByConfigId(int configId) {
            return list(new QueryWrapper<SalesEmailTarget>().lambda()
                    .eq(SalesEmailTarget::getConfigId, configId));
        }

        /**
         * 根据配置 id 删除 target
         *
         * @param emailConfigId 邮件配置 id
         * @author zc
         * @date 2024/6/1
         */
        @Override
        public void removeByConfigId(int emailConfigId) {
            remove(new QueryWrapper<SalesEmailTarget>().lambda()
                    .eq(SalesEmailTarget::getConfigId, emailConfigId));
        }
    }