| | |
| | | LEFT JOIN t_company as dd on dd.id = ci.companyId |
| | | LEFT JOIN t_order_cancel as oc on ot.id = oc.orderId and oc.orderType = 4 |
| | | LEFT JOIN ( |
| | | SELECT ii.money,ii.incomeId,cc.type FROM t_income as ii |
| | | SELECT sum(ii.money) as money,ii.incomeId,cc.type FROM t_income as ii |
| | | LEFT JOIN t_company as cc on ii.objectId = cc.id |
| | | where ii.userType = 1 and ii.type != 1 and ii.orderType = 4 |
| | | where ii.userType = 1 and ii.type != 1 and ii.orderType = 4 group by ii.incomeId, cc.type |
| | | ) 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 (SELECT incomeId, sum(money) as money FROM t_income where userType = 2 and type != 1 and orderType = 4 group by incomeId) 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> |