| | |
| | | date_format(insertTime, '%Y-%m-%d') |
| | | ) = YEARWEEK(now()) |
| | | </select> |
| | | |
| | | |
| | | <select id="queryIdleDriver_" resultType="Driver"> |
| | | select * from ( |
| | | select |
| | | * |
| | | from t_driver |
| | | where flag != 3 and state = 2 and authState = 2 |
| | | <if test="null != companyId"> |
| | | <choose> |
| | | <when test="companyId != 1"> |
| | | and companyId = #{companyId} or franchiseeId = #{companyId} |
| | | </when> |
| | | <otherwise> |
| | | and companyId is null or companyId = 0 or companyId = 1 or franchiseeId is null or franchiseeId = 0 |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | </if> |
| | | and id in |
| | | ( |
| | | select driverId from t_driver_work where startTime < now() and state = 1 and `type` like CONCAT('%', #{type}, '%') |
| | | ) |
| | | and id in (select driverId from t_driver_orders where `type` = #{type}) |
| | | and carId in (select carId from t_car_service where `type` = #{type} |
| | | |
| | | <if test="null != serverCarModelId"> |
| | | and serverCarModelId = #{serverCarModelId} |
| | | </if> |
| | | ) |
| | | ) as aa <!--where aa.id not in ( |
| | | select driverId from t_order_private_car where isDelete = 1 and driverPay = 1 and state in (7, 8, 9) |
| | | union all |
| | | select driverId from t_order_logistics where isDelete = 1 and driverPay = 1 and state != 10 |
| | | )--> |
| | | </select> |
| | | </mapper> |