# SvaEmailTargetServiceImpl.java

    package cloud.wconnect.workperformance.service.sva.scheduleactual.impl;

    import cloud.wconnect.workperformance.entity.sva.SvaEmailTarget;
    import cloud.wconnect.workperformance.mapper.sva.SvaEmailTargetMapper;
    import cloud.wconnect.workperformance.service.sva.scheduleactual.ISvaEmailTargetService;
    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>
     * sva 数据权限的邮件配置（收件人、抄送人） 服务实现类
     * </p>
     *
     * @author zc
     * @since 2023-06-21
     */
    @Service
    @DS("work_performance")
    public class SvaEmailTargetServiceImpl extends ServiceImpl<SvaEmailTargetMapper, SvaEmailTarget> implements ISvaEmailTargetService {

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

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