# GmwrEmailTargetServiceImpl.java

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

    import cloud.wconnect.workperformance.entity.gmwr.GmwrEmailTarget;
    import cloud.wconnect.workperformance.mapper.gmwr.GmwrEmailTargetMapper;
    import cloud.wconnect.workperformance.service.gmwr.IGmwrEmailTargetService;
    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>
     * Weekly GM Report 功能的邮件配置（收件人、抄送人）表 服务实现类
     * </p>
     *
     * @author zc
     * @since 2025-01-24
     */
    @Service
    @DS("work_performance")
    public class GmwrEmailTargetServiceImpl extends ServiceImpl<GmwrEmailTargetMapper, GmwrEmailTarget> implements IGmwrEmailTargetService {

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

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