| | |
| | | cc.* FROM t_company as cc |
| | | LEFT JOIN (SELECT * FROM sys_user where roleType = 3) as ui on ui.objectId = cc.id |
| | | LEFT JOIN (select * from t_company where type = 2 and flag != 3) as ci on ci.id = cc.superiorId |
| | | LEFT JOIN (SELECT COUNT(id) as num,franchiseeId FROM t_car where state = 1 GROUP BY franchiseeId) as ca on ca.franchiseeId = cc.id |
| | | LEFT JOIN (SELECT COUNT(id) as num,franchiseeId FROM t_driver where flag != 3 GROUP BY franchiseeId) as di on di.franchiseeId = cc.id) as o |
| | | LEFT JOIN (SELECT COUNT(id) as num,companyId FROM t_car where state = 1 GROUP BY companyId) as ca on ca.companyId = cc.id |
| | | LEFT JOIN (SELECT COUNT(id) as num,companyId FROM t_driver where flag != 3 GROUP BY companyId) as di on di.companyId = cc.id) as o |
| | | <where> |
| | | o.type = 3 and o.flag != 3 |
| | | <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> |
| | |
| | | left join t_driver b on (a.driverId = b.id) |
| | | where 1 = 1 |
| | | <if test="null != companyId"> |
| | | and if(b.franchiseeId is null or b.franchiseeId = 0, b.companyId = #{companyId}, b.franchiseeId = #{companyId}) |
| | | and b.companyId = #{companyId} |
| | | </if> |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(a.startTime, '%Y-%m-%d') between #{start} and #{end} |