<?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.zcloud.primeport.persistence.mapper.VehicleBlackMapper">

    <select id="getInfoById" resultType="com.zcloud.primeport.persistence.dataobject.VehicleBlackDO">
        SELECT
            b.id
            b.licence_no
        FROM
            vehicle_black b
        WHERE
            b.id = #{id}
    </select>
    <select id="listPage" resultType="com.zcloud.primeport.persistence.dataobject.VehicleBlackDO">
        SELECT
        b.id,
        b.licence_type,
        b.licence_type_name,
        b.licence_no,
        b.vehicle_type,
        b.vehicle_type_name
        FROM
            vehicle_black AS b
        WHERE
            b.delete_enum = 'FALSE'
        <if test="params.licenceNo != null and params.licenceNo != ''">
            AND b.licence_no LIKE CONCAT('%', #{params.licenceNo}, '%')
        </if>
    </select>
</mapper>

