| | |
| | | <!--根据条件查询分公司列表--> |
| | | <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.isSpe = 1 then '专车,' else '' end, |
| | | 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 |
| | |
| | | <!--根据条件查询加盟商列表--> |
| | | <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.isSpe = 1 then '专车,' else '' end, |
| | | 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 |
| | |
| | | sum(aa.cancelNum) as cancelNum, |
| | | sum(aa.onlinePay) as onlinePay, |
| | | sum(aa.offlinePay) as offlinePay, |
| | | sum(aa.money) as money, |
| | | ROUND(sum(aa.money), 2) as money, |
| | | sum(aa.complaint) as complaint |
| | | from ( |
| | | select DATE_FORMAT(insertTime, '%Y-%m-%d') as time, count(id) as register, 0 as `online`, 0 as orderNum, 0 as cancelNum, 0 as onlinePay, 0 as offlinePay, 0 as money, 0 as complaint |
| | |
| | | </if> |
| | | group by DATE_FORMAT(a.startTime, '%Y-%m-%d') |
| | | union all |
| | | <if test="1 == type"> |
| | | <if test="null == type or 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 |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | </if> |
| | | <if test="2 == type"> |
| | | <if test="null == type or 2 == type"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, count(id), 0, 0, 0, 0, 0 from t_order_taxi where isDelete = 1 |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | </if> |
| | | <if test="3 == type"> |
| | | <if test="null == type or 3 == type"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, count(id), 0, 0, 0, 0, 0 from t_order_cross_city where isDelete = 1 |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | </if> |
| | | <if test="4 == type"> |
| | | <if test="null == type or 4 == type"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, count(id), 0, 0, 0, 0, 0 from t_order_logistics where isDelete = 1 |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | </if> |
| | | <if test="type == 1"> |
| | | <if test="null == type or type == 1"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, count(id), 0, 0, 0, 0 from t_order_private_car where isDelete = 1 and state in (10, 12) |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | </if> |
| | | <if test="type == 2"> |
| | | <if test="null == type or type == 2"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, count(id), 0, 0, 0, 0 from t_order_taxi where isDelete = 1 and state in (10, 12) |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | </if> |
| | | <if test="type == 3"> |
| | | <if test="null == type or type == 3"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, count(id), 0, 0, 0, 0 from t_order_cross_city where isDelete = 1 and state in (10, 12) |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | </if> |
| | | <if test="type == 4"> |
| | | <if test="null == type or type == 4"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, count(id), 0, 0, 0, 0 from t_order_logistics where isDelete = 1 and state in (10, 12) |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | </if> |
| | | <if test="type == 1"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(payMoney), 0 from t_order_private_car where isDelete = 1 and payManner = 1 |
| | | <if test="null == type or type == 1"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(payMoney), 0 from t_order_private_car where isDelete = 1 and payType in (1, 2, 3) |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | | </if> |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | |
| | | select DATE_FORMAT(insertTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(money), 0 from t_income where orderType = 1 and userType = 1 and type = 3 |
| | | <if test="null != companyId"> |
| | | and incomeId = #{companyId} |
| | | </if> |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(insertTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | | group by DATE_FORMAT(insertTime, '%Y-%m-%d') |
| | | union all |
| | | |
| | | </if> |
| | | <if test="null == type or type == 2"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(payMoney), 0 from t_order_taxi where isDelete = 1 and payType in (1, 2, 3) |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | | </if> |
| | |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | </if> |
| | | <if test="type == 2"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(payMoney), 0 from t_order_taxi where isDelete = 1 and payManner = 1 |
| | | <if test="null == type or type == 3"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(payMoney), 0 from t_order_cross_city where isDelete = 1 and payType in (1, 2, 3) |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | | </if> |
| | |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | </if> |
| | | <if test="type == 3"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(payMoney), 0 from t_order_cross_city where isDelete = 1 and payManner = 1 |
| | | <if test="null == type or type == 4"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(payMoney), 0 from t_order_logistics where isDelete = 1 and payType in (1, 2, 3) |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | | </if> |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | select DATE_FORMAT(insertTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(money), 0 from t_income where orderType = 4 and userType = 1 and type = 3 |
| | | <if test="null != companyId"> |
| | | and objectId = #{companyId} |
| | | </if> |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(insertTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | | group by DATE_FORMAT(insertTime, '%Y-%m-%d') |
| | | union all |
| | | </if> |
| | | <if test="null == type or type == 1"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, 0, count(id), sum(payMoney), 0 from t_order_private_car where isDelete = 1 and payType in (4) |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | | </if> |
| | |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | </if> |
| | | <if test="type == 4"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(payMoney), 0 from t_order_logistics where isDelete = 1 and payManner = 1 |
| | | <if test="null == type or type == 2"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, 0, count(id), sum(payMoney), 0 from t_order_taxi where isDelete = 1 and payType in (4) |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | | </if> |
| | |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | </if> |
| | | <if test="type == 1"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, 0, count(id), 0, 0 from t_order_private_car where isDelete = 1 and payManner = 2 |
| | | <if test="null == type or type == 3"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, 0, count(id), sum(payMoney), 0 from t_order_cross_city where isDelete = 1 and payType in (4) |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | | </if> |
| | |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | </if> |
| | | <if test="type == 2"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, 0, count(id), 0, 0 from t_order_taxi where isDelete = 1 and payManner = 2 |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | | </if> |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | </if> |
| | | <if test="type == 3"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, 0, count(id), 0, 0 from t_order_cross_city where isDelete = 1 and payManner = 2 |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | | </if> |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | | group by DATE_FORMAT(travelTime, '%Y-%m-%d') |
| | | union all |
| | | </if> |
| | | <if test="type == 4"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, 0, count(id), 0, 0 from t_order_logistics where isDelete = 1 and payManner = 2 |
| | | <if test="null == type or type == 4"> |
| | | select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, 0, count(id), sum(payMoney), 0 from t_order_logistics where isDelete = 1 and payType in (4) |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | | </if> |