| | |
| | | <select id="getCompanyList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT * FROM (SELECT ui.account,IFNULL(ci.num,0) as franchiseeNum,IFNULL(ca.num,0) as carNumber,IFNULL(di.num,0) as driverNumber, |
| | | CONCAT(case when cc.isSpe = 1 then '专车,' else '' end, |
| | | case when cc.isTaxi = 1 then '出租车,' else '' end, |
| | | case when cc.isCross = 1 then '跨城出行,' else '' end, |
| | | case when cc.isCrossLogistics = 1 then '跨城小件物流,' else '' end, |
| | | case when cc.isSameLogistics = 1 then '同城小件物流,' else '' end, |
| | | case when cc.isCharter = 1 then '包车,' else '' end) as serverStr, |
| | | case when cc.isSameLogistics = 1 then '市内小件物流,' else '' end, |
| | | cc.* FROM t_company as cc |
| | | LEFT JOIN (SELECT * FROM sys_user where roleType = 2) as ui on ui.objectId = cc.id |
| | | LEFT JOIN (SELECT COUNT(id) as num,superiorId FROM t_company where type = 3 and flag != 3 GROUP BY superiorId) as ci on ci.superiorId = cc.id |
| | |
| | | |
| | | <!--根据公司ID获取公司经营区域--> |
| | | <select id="getCompanyScopeById" resultType="map"> |
| | | SELECT CONCAT(case when r1.`name` is not null then r1.`name` else '' end, |
| | | case when r2.`name` is not null then r2.`name` else '' end, |
| | | case when r3.`name` is not null then r3.`name` else '' end) as value,cc.* FROM t_company_city as cc |
| | | LEFT JOIN t_region as r1 on r1.code = cc.provinceCode |
| | | LEFT JOIN t_region as r2 on r2.code = cc.cityCode |
| | | LEFT JOIN t_region as r3 on r3.code = cc.areaCode |
| | | SELECT r1.chineseName as value,cc.* FROM t_company_city as cc |
| | | LEFT JOIN t_city as r1 on r1.id = cc.cityId |
| | | where cc.companyId = #{id} and cc.state = 1 order by id asc |
| | | </select> |
| | | |
| | |
| | | <select id="getFranchiseeList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT * FROM (SELECT ui.account,ci.`name` as companyName,IFNULL(ca.num,0) as carNumber,IFNULL(di.num,0) as driverNumber, |
| | | CONCAT(case when cc.isSpe = 1 then '专车,' else '' end, |
| | | case when cc.isTaxi = 1 then '出租车,' else '' end, |
| | | case when cc.isCross = 1 then '跨城出行,' else '' end, |
| | | case when cc.isCrossLogistics = 1 then '跨城小件物流,' else '' end, |
| | | case when cc.isSameLogistics = 1 then '同城小件物流,' else '' end, |
| | | case when cc.isCharter = 1 then '包车,' else '' end) as serverStr, |
| | | case when cc.isSameLogistics = 1 then '市内小件物流,' else '' end, |
| | | 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 |
| | |
| | | </if> |
| | | group by DATE_FORMAT(insertTime, '%Y-%m-%d') |
| | | union all |
| | | select DATE_FORMAT(a.insertTime, '%Y-%m-%d') as time, 0, count(a.id) as `online`, 0 as orderNum, 0 as cancelNum, 0 as onlinePay, 0 as offlinePay, 0 as money, 0 as complaint |
| | | select DATE_FORMAT(a.date, '%Y-%m-%d') as time, 0, count(a.id) as `online`, 0 as orderNum, 0 as cancelNum, 0 as onlinePay, 0 as offlinePay, 0 as money, 0 as complaint |
| | | from t_driver_online a |
| | | left join t_driver b on (a.driverId = b.id) |
| | | where 1 = 1 |
| | | where assessment = 0 |
| | | <if test="null != companyId"> |
| | | and if(b.franchiseeId is null or b.franchiseeId = 0, b.companyId = #{companyId}, b.franchiseeId = #{companyId}) |
| | | </if> |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(a.insertTime, '%Y-%m-%d') between #{start} and #{end} |
| | | and DATE_FORMAT(a.date, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | | group by DATE_FORMAT(a.insertTime, '%Y-%m-%d') |
| | | group by DATE_FORMAT(a.date, '%Y-%m-%d') |
| | | union all |
| | | <if test="1 == type"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, count(id), 0, 0, 0, 0, 0 from t_order_private_car where isDelete = 1 |