# HkEfficiencyDetailServiceImpl.java

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

    import cloud.wconnect.commonlib.pojo.dto.PropertyDTO;
    import cloud.wconnect.workperformance.entity.hkefficiency.HkEfficiencyDetail;
    import cloud.wconnect.workperformance.mapper.hkefficiency.HkEfficiencyDetailMapper;
    import cloud.wconnect.workperformance.service.hkefficiency.IHkEfficiencyDetailService;
    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>
     * Housekeeping Efficiency detail 服务实现类
     * </p>
     *
     * @author zc
     * @since 2024-02-26
     */
    @Service
    @DS("work_performance")
    public class HkEfficiencyDetailServiceImpl extends ServiceImpl<HkEfficiencyDetailMapper, HkEfficiencyDetail> implements IHkEfficiencyDetailService {

        /**
         * 根据日期范围获取 HK details 数据
         *
         * @param propertyId 资产 id
         * @param startDate  开始时间戳
         * @param endDate    结束时间戳
         * @return HousekeepingEfficiencyDetail 集合
         * @author zc
         * @date 2024/2/26
         */
        @Override
        public List<HkEfficiencyDetail> listByTheDateRange(int propertyId, long startDate, long endDate) {
            return list(new QueryWrapper<HkEfficiencyDetail>().lambda()
                    .eq(HkEfficiencyDetail::getPropertyId, propertyId)
                    .between(HkEfficiencyDetail::getTheDate, startDate, endDate));
        }

        /**
         * 删除指定日期、资产范围内的 HK details 数据
         *
         * @param propertyDTO 资产
         * @param startDate   开始日期(时间戳)
         * @param endDate     结束日期(时间戳)
         * @author zc
         * @date 2024/3/4
         */
        @Override
        public void deleteByDateRange(PropertyDTO propertyDTO, long startDate, long endDate) {
            remove(new QueryWrapper<HkEfficiencyDetail>().lambda()
                    .eq(HkEfficiencyDetail::getPropertyId, propertyDTO.getId())
                    .between(HkEfficiencyDetail::getTheDate, startDate, endDate));
        }
    }