<?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.VehicleBookHourInfoMapper" >
      <resultMap id="BaseResultMap" type="com.xxfc.platform.vehicle.entity.VehicleBookHourInfo" >
          <!--
            WARNING - @mbg.generated
          -->
            <id column="id" property="id" jdbcType="INTEGER" />
            <result column="vehicle_id" property="vehicleId" jdbcType="VARCHAR" />
            <result column="year_month_day" property="yearMonthDay" jdbcType="VARCHAR" />
            <result column="booked_hour" property="bookedHour" jdbcType="INTEGER" />
            <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
            <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
      </resultMap>

      <select id="selectByVehicleAndDate" parameterType="com.xxfc.platform.vehicle.pojo.VehicleBookHourInfoDto" resultType="com.xxfc.platform.vehicle.entity.VehicleBookHourInfo">
          select * from vehicle_book_hour_info
          where vehicle_id = #{vehicleId} and year_month_day = #{yearMonthDay}
      </select>
    <select id="selectByVehicleAndId" parameterType="com.xxfc.platform.vehicle.pojo.VehicleBookHourInfoDto" resultType="com.xxfc.platform.vehicle.entity.VehicleBookHourInfo">
          select * from vehicle_book_hour_info
          where vehicle_id = #{vehicleId} and book_record_id = #{bookRecordId} and year_month_day = #{yearMonthDay}
      </select>
    <select id="selectByBookRecordId" parameterType="java.lang.Integer" resultType="com.xxfc.platform.vehicle.entity.VehicleBookHourInfo">
          select * from vehicle_book_hour_info
          where book_record_id = #{bookRecordId}
      </select>
    <select id="selectByVehicleAndDateList" parameterType="java.util.Map" resultType="com.xxfc.platform.vehicle.entity.VehicleBookHourInfo">
          select * from vehicle_book_hour_info
          where vehicle_id = #{vehicleId} and year_month_day in
        <foreach collection="list" item="yearMonthDay" index="index" open="(" close=")" separator=",">
          #{yearMonthDay}
        </foreach>
      </select>

</mapper>