# SalesOperatingStatisticsServiceImpl.java

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

    import cloud.wconnect.workperformance.entity.mor.SalesOperatingStatistics;
    import cloud.wconnect.workperformance.mapper.mor.SalesOperatingStatisticsMapper;
    import cloud.wconnect.workperformance.service.mor.ISalesOperatingStatisticsService;
    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.apache.commons.collections.CollectionUtils;
    import org.springframework.stereotype.Service;

    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.List;

    /**
     * <p>
     * Monthly OT Report - Sales source 资产运营收入分析 服务实现类
     * </p>
     *
     * @author zc
     * @since 2024-05-31
     */
    @Service
    @DS("work_performance")
    public class SalesOperatingStatisticsServiceImpl extends ServiceImpl<SalesOperatingStatisticsMapper, SalesOperatingStatistics> implements ISalesOperatingStatisticsService {

        /**
         * 获取指定资产、日期范围的 operating 数据
         *
         * @param propertyIds 资产id集合
         * @param minDate     开始日期(yyyyMMdd)
         * @param maxDate     结束日期(yyyyMMdd)
         * @return java.util.List<cloud.wconnect.workperformance.entity.mor.SalesOperatingStatistics>
         * @author lichen
         * @date 2025/11/22
         */
        @Override
        public List<SalesOperatingStatistics> listByDateRange(List<Integer> propertyIds, Integer minDate, Integer maxDate) {
            if (CollectionUtils.isEmpty(propertyIds)) return Collections.emptyList();
            return list(new QueryWrapper<SalesOperatingStatistics>().lambda()
                    .in(SalesOperatingStatistics::getPropertyId, propertyIds)
                    .between(SalesOperatingStatistics::getTheDate, minDate, maxDate));
        }

        /**
         * 批量更新，支持更新为null
         *
         * @param list 更新的数据集合
         * @author lichen
         * @date 2025/11/25
         */
        @Override
        public void batchUpdateWithNull(ArrayList<SalesOperatingStatistics> list) {
            if (CollectionUtils.isEmpty(list)) return;
            baseMapper.batchUpdateWithNull(list);
        }
    }