<?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.unis.crk.cplbusiness.mapper.DispatchEhicleManagementMapper">

        <!-- 通用查询映射结果 -->
        <resultMap id="BaseResultMap" type="com.unis.crk.cplbusiness.entity.DispatchEhicleManagement">
                    <id column="dataId" property="dataId" />
                    <result column="unitid" property="unitid" />
                    <result column="builder" property="builder" />
                    <result column="builderDate" property="builderDate" />
                    <result column="editor" property="editor" />
                    <result column="modifyDate" property="modifyDate" />
                    <result column="updateTime" property="updateTime" />
                    <result column="license_plate_number" property="licensePlateNumber" />
                    <result column="ehicle_type" property="ehicleType" />
                    <result column="ehicle_brand" property="ehicleBrand" />
                    <result column="license_plate_model" property="licensePlateModel" />
                    <result column="date_of_production" property="dateOfProduction" />
                    <result column="purchase_time" property="purchaseTime" />
                    <result column="purchase_unit" property="purchaseUnit" />
                    <result column="purchase_price" property="purchasePrice" />
                    <result column="initial_kilometers" property="initialKilometers" />
                    <result column="current_state" property="currentState" />
                    <result column="fuel_consumption" property="fuelConsumption" />
                    <result column="engine_number" property="engineNumber" />
                    <result column="vehicle_load" property="vehicleLoad" />
                    <result column="seat" property="seat" />
                    <result column="annual_review_date" property="annualReviewDate" />
                    <result column="annual_review_items model" property="annualReviewItems model" />
                    <result column="annual_review" property="annualReview" />
                    <result column="date_of_next_annual_review" property="dateOfNextAnnualReview" />
                    <result column="insured_time" property="insuredTime" />
                    <result column="insurance_company" property="insuranceCompany" />
                    <result column="insurance_coverage" property="insuranceCoverage" />
                    <result column="date_of_issue" property="dateOfIssue" />
                    <result column="front_photo" property="frontPhoto" />
                    <result column="profile_photo" property="profilePhoto" />
                    <result column="driver" property="driver" />

        </resultMap>

    <select id="selectMyMapsPage" resultType="java.util.Map">
        SELECT
               dataId,
               license_plate_number,
               ehicle_type,
               ehicle_brand,
               date_of_production,
               purchase_time
        FROM  dispatch_ehicle_management
        <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
            where  ${ew.sqlSegment}
        </if>
        ORDER BY
        purchase_time DESC
    </select>
</mapper>
