| | |
| | | when ot.orderSource = 4 then '司机下单' |
| | | when ot.orderSource = 5 then '调度下单' else '' end orderSourceStr, |
| | | ui.nickName as userName,ui.phone as userPhone, |
| | | ot.payType, |
| | | case when ot.payType = 1 then '手机支付' |
| | | when ot.payType = 2 then '银行卡支付' |
| | | when ot.payType = 3 then '余额支付' else '现金支付' end as payTypeStr, |
| | | |
| | | |
| | | case when ot.isFree = 2 then ot.orderMoney |
| | | when ot.freeMoney > ot.orderMoney then ot.orderMoney else ot.freeMoney end as freeMoney1, |
| | | sc.chineseName as serverCarModel, |
| | | case when income1.type = 1 then income1.money else 0 end as platIncome, |
| | | case when income1.type = 2 then income1.money else 0 end as companyIncome, |
| | | case when income1.type = 3 then income1.money else 0 end as franchiseeIncome, |
| | | IFNULL(sd.price, 0) as settlementPrice, |
| | | IFNULL(income2.money,0) as driverIncome, |
| | | CONCAT(di.firstName, " ", di.lastName,'-',di.phone) as driver, |
| | | CONCAT(cb.`name`,'-',ci.carLicensePlate) as car, |
| | | cc.type as companyType, |
| | | cc.`name` as companyName,ot.*, |
| | | oc.money as cancelMoney, |
| | | case when oc.payType = 1 then '手机支付' |
| | |
| | | where ii.userType = 1 and ii.type != 1 and ii.orderType = 1 |
| | | ) as income1 on income1.incomeId = ot.id |
| | | LEFT JOIN (SELECT incomeId, money FROM t_income where userType = 2 and type != 1 and orderType = 1) as income2 on income2.incomeId = ot.id |
| | | LEFT JOIN t_settlement_detail sd on ot.id = sd.orderId and sd.orderType = 1 |
| | | where ot.id = #{orderId} |
| | | </select> |
| | | |