<?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.njzscloud.supervisory.biz.mapper.BizTruckMapper">

    <resultMap id="pagingMap" autoMapping="true" type="com.njzscloud.supervisory.biz.pojo.result.SearchTruckResult">
        <result property="truckLicenseDate" column="truck_license_date" typeHandler="com.njzscloud.common.mp.support.handler.j.JsonTypeHandler"/>
        <result property="qualificationDate" column="qualification_date" typeHandler="com.njzscloud.common.mp.support.handler.j.JsonTypeHandler"/>
        <result property="certificationDate" column="certification_date" typeHandler="com.njzscloud.common.mp.support.handler.j.JsonTypeHandler"/>
    </resultMap>
    <select id="paging" resultMap="pagingMap">
        SELECT
        a.id,
        a.user_id,
        b.uscc,
        a.company_id,
        b.company_name,
        a.license_plate,
        a.truck_license,
        a.vn_code,
        a.qualification,
        a.carrying_capacity,
        a.gps,
        a.creator_id,
        a.modifier_id,
        a.create_time,
        a.modify_time,
        a.deleted,
        a.disabled,
        a.audit_status,
        a.audit_memo,
        a.truck_license_date,
        a.qualification_date,
        a.certification_date
        FROM biz_truck a
        INNER JOIN biz_company b ON b.id = a.company_id AND b.deleted = 0
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            ${ew.customSqlSegment}
        </if>
    </select>
</mapper>
