# HistoryBARRateNHoursServiceImpl.java

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

    import cloud.wconnect.rateshop.entity.revenue.HistoryBARRateNHours;
    import cloud.wconnect.rateshop.mapper.revenue.HistoryBARRateNHoursMapper;
    import cloud.wconnect.rateshop.service.revenue.IHistoryBARRateNHoursService;
    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个时刻的历史BAR房价 服务实现类
     * </p>
     *
     * @author lichen
     * @since 2024-05-14
     */
    @Service
    @DS("rate_shop")
    public class HistoryBARRateNHoursServiceImpl extends ServiceImpl<HistoryBARRateNHoursMapper, HistoryBARRateNHours> implements IHistoryBARRateNHoursService {

        /**
         * 查询酒店指定日期指定币种下的房价
         *
         * @param targetDate 目标日期（yyyyMMdd）
         * @param hotelId    酒店ID
         * @param currencyId 币种ID
         * @param propertyId 资产ID
         * @param pos        销售地区
         * @return cloud.wconnect.rateshop.entity.revenue.HistoryBARRateNHours
         * @author lichen
         * @date 2024/5/28
         */
        @Override
        public HistoryBARRateNHours get(Integer targetDate, Integer hotelId, Integer currencyId, Integer propertyId, String pos) {
            return getOne(new LambdaQueryWrapper<HistoryBARRateNHours>()
                    .eq(HistoryBARRateNHours::getTargetDate, targetDate)
                    .eq(HistoryBARRateNHours::getHotelId, hotelId)
                    .eq(HistoryBARRateNHours::getCurrencyId, currencyId)
                    .eq(HistoryBARRateNHours::getPos, pos)
                    .eq(HistoryBARRateNHours::getPropertyId, propertyId));
        }

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