# ReportAttachmentServiceImpl.java

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

    import cloud.wconnect.workperformance.entity.monthlyreport.ReportAttachment;
    import cloud.wconnect.workperformance.mapper.monthlyreport.ReportAttachmentMapper;
    import cloud.wconnect.workperformance.service.monthlyreport.IReportAttachmentService;
    import com.baomidou.dynamic.datasource.annotation.DS;
    import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
    import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
    import org.springframework.stereotype.Service;

    import java.util.List;

    /**
     * <p>
     * 月报区域附件表 服务实现类
     * </p>
     *
     * @author lichen
     * @since 2023-09-01
     */
    @Service
    @DS("monthly_report")
    public class ReportAttachmentServiceImpl extends ServiceImpl<ReportAttachmentMapper, ReportAttachment> implements IReportAttachmentService {

        /**
         * 查询附件信息
         *
         * @param propertyId 资产id
         * @param reportId   月报id
         * @param areaId     区域id
         * @return java.util.List<cloud.wconnect.workperformance.entity.monthlyreport.ReportAttachment>
         * @author lichen
         * @date 2023/9/4
         */
        @Override
        public List<ReportAttachment> listByReportIdAndAreaId(Integer propertyId, Long reportId, int areaId) {
            return list(new LambdaQueryWrapper<ReportAttachment>()
                    .eq(ReportAttachment::getReportId,reportId)
                    .eq(ReportAttachment::getPropertyId,propertyId)
                    .eq(ReportAttachment::getAreaId,areaId)
                    .orderByAsc(ReportAttachment::getId));
        }

        /**
         * 删除附件信息
         *
         * @param propertyId 资产id
         * @param reportId   月报id
         * @param areaId     区域id
         * @return void
         * @author lichen
         * @date 2023/9/4
         */
        @Override
        public void removeByReportIdAndAreaId(Integer propertyId, Long reportId, int areaId) {
            remove(new LambdaQueryWrapper<ReportAttachment>()
                    .eq(ReportAttachment::getReportId,reportId)
                    .eq(ReportAttachment::getPropertyId,propertyId)
                    .eq(ReportAttachment::getAreaId,areaId));
        }
    }