| | |
| | | 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 < 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> |
| | |
| | | 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 < 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> |