Pu Zhibing
2025-06-19 a05b419384e148fc950c77553816a2d05144f4ae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?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.ruoyi.system.mapper.DriverMapper">
    
    
    <select id="getDriverList" resultType="com.ruoyi.system.query.DriverListResp">
        select a.id,
        a.name as driverName,
        b.name as enterpriseName,
        a.driving_license_number as drivingLicenseNumber,
        a.mailing_address as mailingAddress,
        a.emergency_contact as emergencyContact,
        a.emergency_phone as emergencyPhone,
        a.phone,
        a.contracting_company as contractingCompany
        from t_driver a
        left join t_enterprise b on (a.enterprise_id = b.id)
        <where>
            <if test="null != item.driverName and '' != item.driverName">
                and a.name like CONCAT('%', #{item.driverName}, '%')
            </if>
            <if test="null != item.enterpriseName and '' != item.enterpriseName">
                and b.name like CONCAT('%', #{item.enterpriseName}, '%')
            </if>
            <if test="null != item.phone and '' != item.phone">
                and a.phone like CONCAT('%', #{item.phone}, '%')
            </if>
            <if test="null != item.emergencyContact and '' != item.emergencyContact">
                and a.emergency_contact like CONCAT('%', #{item.emergencyContact}, '%')
            </if>
        </where>
        order by a.update_time desc
    </select>
 
</mapper>