Pu Zhibing
2025-04-12 582893600b9310b881c96f3ffb8ff713481b26fb
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TReassignMapper.xml
@@ -88,10 +88,18 @@
        SELECT dd.*,c1.name as companyName,c2.name as franchiseeName from t_driver AS dd
        LEFT JOIN t_company as c1 on c1.id = dd.companyId
        LEFT JOIN t_company as c2 on c2.id = dd.franchiseeId
        LEFT JOIN (SELECT * from t_driver_service where type = 1) as ds on ds.driverId = dd.id
        <where>
            dd.id != driverId and
            (dd.companyId = #{companyId} or dd.franchiseeId = #{companyId}) and dd.authState = 2 and dd.state = 2 and (ds.id is not null ) and (dd.carId is not null)
            dd.id != #{driverId} and dd.authState = 2 and dd.state = 2
            and dd.id in
            (
            select driverId from t_driver_work where startTime &lt; now() and state = 1 and `type` like CONCAT('%', #{type}, '%')
            )
            and dd.id in (select driverId from t_driver_orders where `type` = #{type})
            and dd.carId in (select carId from t_car_service where `type` = #{type}
            <if test="null != serverCarModelId">
                and serverCarModelId = #{serverCarModelId}
            </if>
            )
            <if test="name != null and name != ''">
                and CONCAT(dd.firstName, ' ', dd.lastName) LIKE CONCAT('%',#{name},'%')
            </if>
@@ -108,10 +116,18 @@
        SELECT dd.*,c1.name as companyName,c2.name as franchiseeName from t_driver AS dd
        LEFT JOIN t_company as c1 on c1.id = dd.companyId
        LEFT JOIN t_company as c2 on c2.id = dd.franchiseeId
        LEFT JOIN (SELECT * from t_driver_service where type = #{type}) as ds on ds.driverId = dd.id
        <where>
            dd.id != driverId and
            (dd.companyId = #{companyId} or dd.franchiseeId = #{companyId}) and dd.authState = 2 and dd.state = 2 and (ds.id is not null ) and (dd.carId is not null)
            dd.id != #{driverId} and dd.authState = 2 and dd.state = 2
            and dd.id in
            (
            select driverId from t_driver_work where startTime &lt; now() and state = 1 and `type` like CONCAT('%', #{type}, '%')
            )
            and dd.id in (select driverId from t_driver_orders where `type` = #{type})
            and dd.carId in (select carId from t_car_service where `type` = #{type}
            <if test="null != serverCarModelId">
                and serverCarModelId = #{serverCarModelId}
            </if>
            )
            <if test="name != null and name != ''">
                and CONCAT(dd.firstName, ' ', dd.lastName) LIKE CONCAT('%',#{name},'%')
            </if>