| | |
| | | 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, |
| | | '市内小件物流' as typeStr, |
| | | cc.type as companyType, |
| | | dd.name as companyName, |
| | | ot.*, |
| | | oc.money as cancelMoney, |
| | |
| | | where ii.userType = 1 and ii.type != 1 and ii.orderType = 4 |
| | | ) as income1 on income1.incomeId = ot.id |
| | | LEFT JOIN (SELECT incomeId, money FROM t_income where userType = 2 and type != 1 and orderType = 4) as income2 on income2.incomeId = ot.id |
| | | LEFT JOIN t_settlement_detail sd on ot.id = sd.orderId and sd.orderType = 4 |
| | | where ot.id = #{orderId} |
| | | </select> |
| | | |