<?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="org.springblade.transport.mapper.EquipmentLedgerMapper">
    <select id="selectEquipmentLedgerPage" resultType="org.springblade.transport.pojo.vo.EquipmentLedgerVO">
        SELECT * FROM blade_equipment_ledger
        WHERE is_deleted = 0
        <if test="equipmentLedger.vehicleNo != null and equipmentLedger.vehicleNo != ''">AND vehicle_no LIKE CONCAT('%', #{equipmentLedger.vehicleNo}, '%')</if>
        <if test="equipmentLedger.vehicleType != null and equipmentLedger.vehicleType != ''">AND vehicle_type = #{equipmentLedger.vehicleType}</if>
        <if test="equipmentLedger.equipmentCode != null and equipmentLedger.equipmentCode != ''">AND equipment_code LIKE CONCAT('%', #{equipmentLedger.equipmentCode}, '%')</if>
        <if test="equipmentLedger.createDept != null">AND create_dept = #{equipmentLedger.createDept}</if>
        ORDER BY create_time DESC
    </select>
</mapper>
