# HistoryRateNHoursManualServiceImpl.java

    package cloud.wconnect.rateshop.service.revenue.impl;

    import cloud.wconnect.rateshop.entity.revenue.HistoryRateNHoursManual;
    import cloud.wconnect.rateshop.mapper.revenue.HistoryRateNHoursManualMapper;
    import cloud.wconnect.rateshop.service.revenue.IHistoryRateNHoursManualService;
    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>
     * 酒店当日N个时刻的历史房价 服务实现类
     * </p>
     *
     * @author lichen
     * @since 2024-03-25
     */
    @Service
    @DS("rate_shop")
    public class HistoryRateNHoursManualServiceImpl extends ServiceImpl<HistoryRateNHoursManualMapper, HistoryRateNHoursManual> implements IHistoryRateNHoursManualService {

        /**
         * 查询酒店指定日期指定币种下的房价
         *
         * @param targetDates 目标日期（yyyyMMdd）
         * @param hotelId     酒店ID
         * @param currencyId  币种ID
         * @param propertyId  资产ID
         * @param rateType    房价类型1:早鸟价 2:BAR房价
         * @param pos         销售地区
         * @return java.util.List<cloud.wconnect.rateshop.entity.revenue.HistoryRateNHoursManual>
         * @author lichen
         * @date 2024/3/25
         */
        @Override
        public List<HistoryRateNHoursManual> list(List<Integer> targetDates, Integer hotelId, Integer currencyId,
                                                  Integer propertyId, Integer rateType, String pos) {
            return list(new LambdaQueryWrapper<HistoryRateNHoursManual>()
                    .eq(HistoryRateNHoursManual::getPropertyId, propertyId)
                    .eq(HistoryRateNHoursManual::getHotelId, hotelId)
                    .in(HistoryRateNHoursManual::getTargetDate, targetDates)
                    .eq(HistoryRateNHoursManual::getCurrencyId, currencyId)
                    .eq(HistoryRateNHoursManual::getPos, pos)
                    .eq(HistoryRateNHoursManual::getRateType, rateType));
        }

        /**
         * 查询酒店指定日期（精确到小时）指定币种下的房价
         *
         * @param targetDate 目标日期（yyyyMMdd）
         * @param hotelId    酒店ID
         * @param currencyId 币种ID
         * @param propertyId 资产ID
         * @param hour       小时数
         * @param rateType   房价类型1:早鸟价 2:BAR房价
         * @param pos        销售地区
         * @return cloud.wconnect.rateshop.entity.revenue.HistoryRateNHoursManual
         * @author lichen
         * @date 2024/3/28
         */
        @Override
        public HistoryRateNHoursManual get(Integer targetDate, Integer hotelId, Integer currencyId, Integer propertyId,
                                           Integer hour, Integer rateType, String pos) {
            return getOne(new LambdaQueryWrapper<HistoryRateNHoursManual>()
                    .eq(HistoryRateNHoursManual::getPropertyId, propertyId)
                    .eq(HistoryRateNHoursManual::getHotelId, hotelId)
                    .eq(HistoryRateNHoursManual::getTargetDate, targetDate)
                    .eq(HistoryRateNHoursManual::getCurrencyId, currencyId)
                    .eq(HistoryRateNHoursManual::getPos, pos)
                    .eq(HistoryRateNHoursManual::getRateType, rateType)
                    .eq(HistoryRateNHoursManual::getHour, hour));
        }
    }