<?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.VehicleViolationsMapper">

    <select id="violationRecordslistPage"
            resultType="com.zcloud.primeport.persistence.dataobject.VehicleViolationsDO">
        SELECT
            f.licence_no,
            COUNT( f.id ) violation_count
        FROM
            vehicle_violations AS f
        WHERE
            f.delete_enum = 'FALSE'
        GROUP BY
            f.licence_no
    </select>
    <select id="listVehicleViolationByLicenceNo"
            resultType="com.zcloud.primeport.persistence.dataobject.VehicleViolationsDO">
        SELECT * FROM vehicle_violations WHERE licence_no = #{licenceNo} and delete_enum = 'FALSE' and violation_processing_status = 2
    </select>
</mapper>

