# ReportRemarkServiceImpl.java

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

    import cloud.wconnect.workperformance.entity.monthlyreport.ReportRemark;
    import cloud.wconnect.workperformance.mapper.monthlyreport.ReportRemarkMapper;
    import cloud.wconnect.workperformance.service.monthlyreport.IReportRemarkService;
    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.Objects;

    /**
     * <p>
     * 月报区域备注表 服务实现类
     * </p>
     *
     * @author lichen
     * @since 2023-09-01
     */
    @Service
    @DS("monthly_report")
    public class ReportRemarkServiceImpl extends ServiceImpl<ReportRemarkMapper, ReportRemark> implements IReportRemarkService {

        /**
         * 根据报告id和区域id查询备注
         *
         * @param reportId 报告id
         * @param areaId   区域id
         * @return java.lang.String
         * @author lichen
         * @date 2023/9/1
         */
        @Override
        public String listByReportIdAndAreaId(Long reportId, int areaId) {
            ReportRemark reportRemark = getOne(new LambdaQueryWrapper<ReportRemark>()
                    .eq(ReportRemark::getReportId, reportId)
                    .eq(ReportRemark::getAreaId, areaId)
                    .last("limit 1"));
            return Objects.nonNull(reportRemark) ? reportRemark.getRemark(): "";
        }
    }