| | |
| | | <result column="account" property="account" /> |
| | | <result column="jobNumber" property="jobNumber" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="phoneOperator" property="phoneOperator"/> |
| | | <result column="password" property="password" /> |
| | | <result column="name" property="name" /> |
| | | <result column="lastName" property="lastName" /> |
| | | <result column="firstName" property="firstName" /> |
| | | <result column="sex" property="sex" /> |
| | | <result column="idCard" property="idCard" /> |
| | | <result column="companyId" property="companyId" /> |
| | |
| | | <result column="idCardImgUrl2" property="idCardImgUrl2" /> |
| | | <result column="placeOfEmployment" property="placeOfEmployment" /> |
| | | <result column="birthday" property="birthday" /> |
| | | <result column="email" property="email"/> |
| | | <result column="bankCardNumber" property="bankCardNumber" /> |
| | | <result column="driverNationality" property="driverNationality" /> |
| | | <result column="driverNation" property="driverNation" /> |
| | |
| | | <result column="driverContactAddress" property="driverContactAddress" /> |
| | | <result column="driverAge" property="driverAge" /> |
| | | <result column="driveCard" property="driveCard" /> |
| | | <result column="driveCardImgUrl" property="driveCardImgUrl" /> |
| | | <result column="driveCardImgUrl1" property="driveCardImgUrl1" /> |
| | | <result column="driveCardImgUrl2" property="driveCardImgUrl2" /> |
| | | <result column="driverType" property="driverType" /> |
| | | <result column="getDriverLicenseDate" property="getDriverLicenseDate" /> |
| | | <result column="driverLicenseOn" property="driverLicenseOn" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, account, jobNumber, phone, password, name, sex, idCard, companyId, headImgUrl, faceImgUrl, idCardImgUrl1, idCardImgUrl2, placeOfEmployment, birthday, bankCardNumber, driverNationality, driverNation, driverMaritalStatus, driverLanguageLevel, driverEducation, driverCensus, driverAddress, driverContactAddress, licenseCode, licenselImgUrl, driverAge, driveCard, driveCardImgUrl, driverType, getDriverLicenseDate, driverLicenseOn, driverLicenseOff, taxiDriver, taxiAptitudeCard, networkCarlssueImg, networkCarlssueOrganization, networkCarlssueDate, getNetworkCarProofDate, networkCarProofOn, networkCarProofOff, registerDate, fullTimeDriver, inDriverBlacklist, commercialType, contractCompany, contractOn, contractOff, emergencyContact, emergencyContactPhone, emergencyContactAddress, remark, isPlatCar, carId, authState, state, flag, insertTime, insertUser, updateTime, updateUser, addType,uid,teamId |
| | | id, account, jobNumber, phone, phoneOperator, password, lastName, firstName, sex, idCard, companyId, headImgUrl, faceImgUrl, idCardImgUrl1, idCardImgUrl2, placeOfEmployment, birthday, bankCardNumber, driverNationality, driverNation, driverMaritalStatus, driverLanguageLevel, driverEducation, driverCensus, driverAddress, driverContactAddress, licenseCode, licenselImgUrl, driverAge, driveCard, driveCardImgUrl, driverType, getDriverLicenseDate, driverLicenseOn, driverLicenseOff, taxiDriver, taxiAptitudeCard, networkCarlssueImg, networkCarlssueOrganization, networkCarlssueDate, getNetworkCarProofDate, networkCarProofOn, networkCarProofOff, registerDate, fullTimeDriver, inDriverBlacklist, commercialType, contractCompany, contractOn, contractOff, emergencyContact, emergencyContactPhone, emergencyContactAddress, remark, isPlatCar, carId, authState, state, flag, insertTime, insertUser, updateTime, updateUser, addType,uid,teamId |
| | | </sql> |
| | | |
| | | <!--根据条件查询待审核司机列表--> |
| | |
| | | LEFT JOIN ( |
| | | SELECT |
| | | GROUP_CONCAT(case when type = 1 then '专车' |
| | | when type = 2 then '出租车' |
| | | when type = 3 then '跨城出行' |
| | | when type = 4 then '小件物流-同城' |
| | | when type = 5 then '小件物流-跨城' |
| | | when type = 6 then '包车' |
| | | when type = 4 then '市内小件物流' |
| | | else '' end ) as serverStr,driverId from t_driver_service GROUP BY driverId) as ds on ds.driverId = dd.id |
| | | ) as o |
| | | <where> |
| | | FIND_IN_SET(o.authState,'1,4') and o.flag != 3 |
| | | FIND_IN_SET(o.authState,'1,4') and o.flag != 3 and o.lastName is not null |
| | | <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> |
| | | AND (o.insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | </if> |
| | |
| | | LEFT JOIN ( |
| | | SELECT |
| | | GROUP_CONCAT(case when type = 1 then '专车' |
| | | when type = 2 then '出租车' |
| | | when type = 3 then '跨城出行' |
| | | when type = 4 then '小件物流-同城' |
| | | when type = 5 then '小件物流-跨城' |
| | | when type = 6 then '包车' |
| | | when type = 4 then '市内小件物流' |
| | | else '' end SEPARATOR '、') as serverStr,driverId from t_driver_service GROUP BY driverId) as ds on ds.driverId = dd.id |
| | | where dd.id = #{driverId} |
| | | </select> |
| | | |
| | | <!--根据审核通过的司机列表--> |
| | | <select id="getDriverList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT * FROM (SELECT cc1.`name` as companyName,cc2.`name` as franchiseeName,ci.carLicensePlate,ds.serverStr,IFNULL(oe.evaluateNum,0) as evaluateNum, |
| | | (IFNULL(ot1.taxiNum, 0) + IFNULL(ot3.num, 0) + IFNULL(ot5.num, 0)) as historyNum,(IFNULL(ot2.taxiMoney, 0)+ IFNULL(ot4.money, 0) + IFNULL(ot6.money, 0)) as historyMoney,dd.*,tdt.teamName from t_driver as dd |
| | | SELECT * FROM ( |
| | | SELECT cc1.`name` as companyName, |
| | | cc2.`name` as franchiseeName, |
| | | ci.carLicensePlate, |
| | | ds.serverStr, |
| | | IFNULL(oe.evaluateNum,0) as evaluateNum, |
| | | (IFNULL(ot1.taxiNum, 0) + IFNULL(ot3.num, 0) + IFNULL(ot5.num, 0) + IFNULL(ot7.num, 0)) as historyNum, |
| | | (IFNULL(ot2.taxiMoney, 0)+ IFNULL(ot4.money, 0) + IFNULL(ot6.money, 0) + IFNULL(ot8.money, 0)) as historyMoney, |
| | | dd.*, |
| | | tdt.teamName |
| | | from t_driver as dd |
| | | LEFT JOIN t_driver_team tdt on dd.teamId=tdt.id and tdt.state!=3 |
| | | LEFT JOIN (select * from t_company where type = 2 and flag != 3) as cc1 on cc1.id = dd.companyId |
| | | LEFT JOIN (select * from t_company where type = 3 and flag != 3) as cc2 on cc2.id = dd.franchiseeId |
| | |
| | | LEFT JOIN ( |
| | | SELECT |
| | | GROUP_CONCAT(case when type = 1 then '专车' |
| | | when type = 2 then '出租车' |
| | | when type = 3 then '跨城出行' |
| | | when type = 4 then '小件物流-同城' |
| | | when type = 5 then '小件物流-跨城' |
| | | when type = 6 then '包车' |
| | | when type = 4 then '市内小件物流' |
| | | else '' end ) as serverStr,driverId from t_driver_service GROUP BY driverId) as ds on ds.driverId = dd.id |
| | | LEFT JOIN (SELECT IFNULL(SUM(fraction)/COUNT(id),0) as evaluateNum,driverId FROM t_order_evaluate GROUP BY driverId) as oe on oe.driverId = dd.id |
| | | LEFT JOIN (SELECT COUNT(id) as taxiNum,driverId FROM t_order_taxi where FIND_IN_SET(state,'7,8,9') GROUP BY driverId) as ot1 on ot1.driverId = dd.id |
| | |
| | | LEFT JOIN (SELECT COUNT(id) as num,driverId FROM t_order_private_car where FIND_IN_SET(state,'7,8,9') GROUP BY driverId) as ot3 on ot3.driverId = dd.id |
| | | LEFT JOIN (SELECT SUM(orderMoney) as money,driverId FROM t_order_private_car where FIND_IN_SET(state,'7,8,9') GROUP BY driverId) as ot4 on ot4.driverId = dd.id |
| | | LEFT JOIN (SELECT COUNT(id) as num,driverId FROM t_order_cross_city where FIND_IN_SET(state,'6,7,8') GROUP BY driverId) as ot5 on ot5.driverId = dd.id |
| | | LEFT JOIN (SELECT SUM(orderMoney) as money,driverId FROM t_order_cross_city where FIND_IN_SET(state,'6,7,8') GROUP BY driverId) as ot6 on ot6.driverId = dd.id) as o |
| | | LEFT JOIN (SELECT SUM(orderMoney) as money,driverId FROM t_order_cross_city where FIND_IN_SET(state,'6,7,8') GROUP BY driverId) as ot6 on ot6.driverId = dd.id |
| | | LEFT JOIN (SELECT COUNT(id) as num,driverId FROM t_order_logistics where FIND_IN_SET(state,'7,8,9') GROUP BY driverId) as ot7 on ot7.driverId = dd.id |
| | | LEFT JOIN (SELECT SUM(orderMoney) as money,driverId FROM t_order_logistics where FIND_IN_SET(state,'7,8,9') GROUP BY driverId) as ot8 on ot8.driverId = dd.id) as o |
| | | <where> |
| | | o.flag != 3 |
| | | <if test="roleType != null and roleType != '' and roleType == 1"> |
| | |
| | | <if test="phone != null and phone != ''"> |
| | | and o.phone LIKE CONCAT('%',#{phone},'%') |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | and o.name LIKE CONCAT('%',#{name},'%') |
| | | <if test="lastName != null and lastName != ''"> |
| | | and o.lastName LIKE CONCAT('%',#{lastName},'%') |
| | | </if> |
| | | <if test="firstName != null and firstName != ''"> |
| | | and o.firstName LIKE CONCAT('%',#{firstName},'%') |
| | | </if> |
| | | <if test="addType != null and addType != ''"> |
| | | and o.addType = #{addType} |
| | |
| | | LEFT JOIN ( |
| | | SELECT |
| | | GROUP_CONCAT(case when type = 1 then '专车' |
| | | when type = 2 then '出租车' |
| | | when type = 3 then '跨城出行' |
| | | when type = 4 then '小件物流-同城' |
| | | when type = 5 then '小件物流-跨城' |
| | | when type = 6 then '包车' |
| | | when type = 4 then '市内小件物流' |
| | | else '' end ) as serverStr,carId from t_car_service GROUP BY carId) as ds on ds.carId = ci.id) as o |
| | | <where> |
| | | o.state = 1 |
| | |
| | | LEFT JOIN ( |
| | | SELECT |
| | | GROUP_CONCAT(case when type = 1 then '专车' |
| | | when type = 2 then '出租车' |
| | | when type = 3 then '跨城出行' |
| | | when type = 4 then '小件物流-同城' |
| | | when type = 5 then '小件物流-跨城' |
| | | when type = 6 then '包车' |
| | | when type = 4 then '市内小件物流' |
| | | else '' end ) as serverStr,driverId from t_driver_service GROUP BY driverId) as ds on ds.driverId = dd.id |
| | | LEFT JOIN (SELECT IFNULL(SUM(fraction)/COUNT(id),0) as evaluateNum,driverId FROM t_order_evaluate GROUP BY driverId) as oe on oe.driverId = dd.id |
| | | LEFT JOIN (SELECT COUNT(id) as taxiNum,driverId FROM t_order_taxi where FIND_IN_SET(state,'7,8,9') GROUP BY driverId) as ot1 on ot1.driverId = dd.id |
| | |
| | | select |
| | | concat('user_',id) as id, |
| | | phone as phone, |
| | | IFNULL(name,nickName) as name, |
| | | IFNULL(CONCAT(firstName, ' ', lastName),nickName) as name, |
| | | 1 as uType, |
| | | insertTime as insertTime |
| | | from t_user |
| | |
| | | select |
| | | concat('driver_',id) as id, |
| | | phone as phone, |
| | | name as name, |
| | | CONCAT(firstName, " ", lastName) as name, |
| | | 2 as uType, |
| | | insertTime as insertTime |
| | | from |
| | |
| | | <select id="queryDriverIncomeData" parameterType="com.baomidou.mybatisplus.plugins.Page" resultType="map"> |
| | | SELECT |
| | | td.id as id, |
| | | td.`name` as driverName, |
| | | CONCAT(td.firstName, " ", td.lastName) as driverName, |
| | | tc1.name as companyName, |
| | | tc2.name as franchiseeName, |
| | | <if test="1 == type"> |
| | | topc1.num as privateCarTotalNum, |
| | | IFNULL(topc1.num, 0) as privateCarTotalNum, |
| | | IFNULL(topc2.num, 0) as privateCarNotPayNum, |
| | | IFNULL(topc3.num, 0) as privateCarcancelNum, |
| | | IFNULL(topc4.taxiMoney, 0) as privateCarTotalMoney, |
| | | IFNULL(topc5.taxiMoney, 0) as privateCarNotPayMoney, |
| | | IFNULL(topc4.taxiMoney, 0) + IFNULL(topc11.taxiMoney, 0) + IFNULL(topc13.taxiMoney, 0) as privateCarTotalMoney, |
| | | IFNULL(topc5.taxiMoney, 0) + IFNULL(topc13.taxiMoney, 0) as privateCarNotPayMoney, |
| | | </if> |
| | | <if test="4 == type"> |
| | | IFNULL(topc6.num, 0) as privateCarTotalNum, |
| | | IFNULL(topc7.num, 0) as privateCarNotPayNum, |
| | | IFNULL(topc8.num, 0) as privateCarcancelNum, |
| | | IFNULL(topc9.taxiMoney, 0) + IFNULL(topc12.taxiMoney, 0) + IFNULL(topc14.taxiMoney, 0) as privateCarTotalMoney, |
| | | IFNULL(topc10.taxiMoney, 0) + IFNULL(topc14.taxiMoney, 0) as privateCarNotPayMoney, |
| | | </if> |
| | | <if test="null == type"> |
| | | IFNULL(topc1.num, 0) + IFNULL(topc6.num, 0) as privateCarTotalNum, |
| | | IFNULL(topc2.num, 0) + IFNULL(topc7.num, 0) as privateCarNotPayNum, |
| | | IFNULL(topc3.num, 0) + IFNULL(topc8.num, 0) as privateCarcancelNum, |
| | | IFNULL(topc4.taxiMoney, 0) + IFNULL(topc9.taxiMoney, 0) + IFNULL(topc11.taxiMoney, 0) + IFNULL(topc12.taxiMoney, 0) + IFNULL(topc13.taxiMoney, 0) + IFNULL(topc14.taxiMoney, 0) as privateCarTotalMoney, |
| | | IFNULL(topc5.taxiMoney, 0) + IFNULL(topc10.taxiMoney, 0) + IFNULL(topc13.taxiMoney, 0) + IFNULL(topc14.taxiMoney, 0) as privateCarNotPayMoney, |
| | | </if> |
| | | td.state as driverState, |
| | | td.phone as driverPhone |
| | |
| | | t_driver td |
| | | LEFT JOIN (SELECT id,name FROM t_company WHERE FIND_IN_SET(type, '1,2') AND flag != 3 ) AS tc1 ON td.companyId=tc1.id |
| | | LEFT JOIN ( SELECT id,name FROM t_company WHERE type = 3 AND flag != 3 ) AS tc2 ON tc2.id = td.franchiseeId |
| | | <if test="1 == type"> |
| | | INNER JOIN ( SELECT COUNT(id) AS num, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '7,8,9,10,12') |
| | | <if test="null == type or 1 == type"> |
| | | LEFT JOIN ( SELECT COUNT(id) AS num, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '7,8,9,10,12') |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | |
| | | </if> |
| | | GROUP BY driverId |
| | | ) AS topc3 ON topc3.driverId = td.id |
| | | LEFT JOIN ( SELECT SUM(orderMoney) AS taxiMoney, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '7,8,9,12') |
| | | LEFT JOIN ( SELECT SUM(orderMoney) AS taxiMoney, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '8,9') |
| | | <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 driverId |
| | | ) AS topc4 ON topc4.driverId = td.id |
| | | LEFT JOIN ( SELECT SUM(orderMoney) AS taxiMoney, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '7,12') |
| | | LEFT JOIN ( SELECT SUM(orderMoney) AS taxiMoney, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '7') |
| | | <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 driverId |
| | | ) AS topc5 ON topc5.driverId = td.id |
| | | LEFT JOIN ( |
| | | SELECT SUM(a.money) AS taxiMoney, b.driverId FROM t_order_cancel a |
| | | left join t_order_private_car b on (a.orderId = b.id and a.orderType = 1) |
| | | where FIND_IN_SET(b.state, '10') |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(b.travelTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | | group by b.driverId |
| | | ) AS topc11 ON topc11.driverId = td.id |
| | | LEFT JOIN ( |
| | | SELECT SUM(a.money) AS taxiMoney, b.driverId FROM t_order_cancel a |
| | | left join t_order_private_car b on (a.orderId = b.id and a.orderType = 1) |
| | | where FIND_IN_SET(b.state, '12') |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(b.travelTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | | group by b.driverId |
| | | ) AS topc13 ON topc13.driverId = td.id |
| | | </if> |
| | | <if test="null == type or 4 == type"> |
| | | LEFT JOIN ( SELECT COUNT(id) AS num, driverId FROM t_order_logistics WHERE FIND_IN_SET(state, '7,8,9,10,12') |
| | | <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 driverId |
| | | ) AS topc6 ON topc6.driverId = td.id |
| | | LEFT JOIN ( SELECT COUNT(id) AS num, driverId FROM t_order_logistics WHERE FIND_IN_SET(state, '7,12') |
| | | <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 driverId |
| | | ) AS topc7 ON topc7.driverId = td.id |
| | | LEFT JOIN ( SELECT COUNT(id) AS num, driverId FROM t_order_logistics WHERE FIND_IN_SET(state, '10,12') |
| | | <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 driverId |
| | | ) AS topc8 ON topc8.driverId = td.id |
| | | LEFT JOIN ( SELECT SUM(orderMoney) AS taxiMoney, driverId FROM t_order_logistics WHERE FIND_IN_SET(state, '8,9') |
| | | <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 driverId |
| | | ) AS topc9 ON topc9.driverId = td.id |
| | | LEFT JOIN ( SELECT SUM(orderMoney) AS taxiMoney, driverId FROM t_order_logistics WHERE FIND_IN_SET(state, '7') |
| | | <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 driverId |
| | | ) AS topc10 ON topc10.driverId = td.id |
| | | LEFT JOIN ( |
| | | SELECT SUM(a.money) AS taxiMoney, b.driverId FROM t_order_cancel a |
| | | left join t_order_logistics b on (a.orderId = b.id and a.orderType = 4) |
| | | where FIND_IN_SET(b.state, '10') |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(b.travelTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | | group by b.driverId |
| | | ) AS topc12 ON topc12.driverId = td.id |
| | | LEFT JOIN ( |
| | | SELECT SUM(a.money) AS taxiMoney, b.driverId FROM t_order_cancel a |
| | | left join t_order_logistics b on (a.orderId = b.id and a.orderType = 4) |
| | | where FIND_IN_SET(b.state, '12') |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(b.travelTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | | group by b.driverId |
| | | ) AS topc14 ON topc14.driverId = td.id |
| | | </if> |
| | | <where> |
| | | <if test="null!= companyId and '' != companyId"> |
| | |
| | | <select id="queryDriverIncomeDataNoPage" resultType="map"> |
| | | SELECT |
| | | td.id as id, |
| | | td.`name` as driverName, |
| | | CONCAT(td.firstName, " ", td.lastName) as driverName, |
| | | tc1.name as companyName, |
| | | tc2.name as franchiseeName, |
| | | <if test="1 == type"> |