| | |
| | | <select id="getCanSelectPrivateCarDriverList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | 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 |
| | | LEFT JOIN t_company as c2 on c2.id = dd.companyId |
| | | <where> |
| | | (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 id="getCanSelectSmallDriverList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | 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 |
| | | LEFT JOIN t_company as c2 on c2.id = dd.companyId |
| | | <where> |
| | | (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> |
| | |
| | | left join t_driver_line f on (a.id = f.driverId) |
| | | left join t_line_shift g on (f.lineId = g.lineId) |
| | | left join t_company as h on (h.id = a.companyId) |
| | | left join t_company as i on (i.id = a.franchiseeId) |
| | | where a.authState = 2 and a.state != 1 and a.flag != 3 and if(a.franchiseeId is null or a.franchiseeId = 0, a.companyId = #{companyId}, a.franchiseeId = #{companyId}) |
| | | left join t_company as i on (i.id = a.companyId) |
| | | where a.authState = 2 and a.state != 1 and a.flag != 3 and a.companyId = #{companyId} |
| | | and a.id in (select driverId from t_driver_work where state = 1 and type like '%3%') |
| | | and b.type = 3 and c.type = 3 and e.type = 3 and e.serverCarModelId = #{serverCarModelId} and f.lineId = #{lineId} and g.id = #{lineShiftId} |
| | | and a.id in (select driverId from t_line_shift_driver where lineShiftId = #{lineShiftId} and DATE_FORMAT(`day`, '%Y-%m-%d') = DATE_FORMAT(#{time}, '%Y-%m-%d') and laveSeat >= #{num}) |