<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.xxfc.platform.vehicle.mapper.VehicleHolidayPriceInfoMapper">

    <select id="getAll" resultType="com.xxfc.platform.vehicle.pojo.vo.VehicleHolidayPriceInfoVo">
        select festival_id, festival_day, MIN(festival_date) as startTime, MAX(festival_date) as endTime, rent_price, rent_free_day,vehicle_id from vehicle_holiday_price_info
        where is_del = 0
        GROUP BY festival_id,festival_day,rent_price, rent_free_day,vehicle_id
        HAVING vehicle_id = #{vehicleId}
        <if test="festivalId != null">
            and festival_id = #{festivalId}
        </if>
    </select>

    <select id="selectMaxFestivalId" resultType="java.lang.Integer">
            select max(festival_id) from vehicle_holiday_price_info
    </select>
</mapper>