( SELECT * FROM `app_user_selling_water` WHERE STATUS = 0 AND `user_id`=#{userId} <if test="wating!=null">
SELECT
AND `waiting`=#{wating} <!–AND `status`=0–>
a.*,
</if>) AS `ausw`
b.incommission
LEFT JOIN ( SELECT * FROM `app_user_selling_water` WHERE STATUS = 1 AND `user_id`=#{userId} <if
FROM
test="wating!=null">
( SELECT * FROM `app_user_selling_water` WHERE STATUS = 0 and user_id=313 ) AS `a`
AND `waiting`=#{wating} <!–AND `status`=0–>
INNER JOIN ( SELECT order_no, IFNULL( SUM( commission ), 0 ) AS `incommission` FROM `app_user_selling_water` WHERE `status` = 0 and user_id=313 GROUP BY `order_no` ) AS `b` ON a.order_no = b.order_no
</if>) AS `auswt` ON auswt.order_no = ausw.order_no
) AS `e`
) AS `auswres`
LEFT JOIN (
ORDER BY crt_time DESC-->
SELECT
c.order_no,
d.outcommission,
1 AS `sellerStatus`,
c.crt_time AS `cancelTime`
FROM
( SELECT * FROM `app_user_selling_water` WHERE STATUS = 1 and user_id=313 ) AS `c`
INNER JOIN ( SELECT order_no,IFNULL( SUM( commission ), 0 ) AS `outcommission` FROM `app_user_selling_water` WHERE `status` = 1 and user_id=313 GROUP BY `order_no` ) AS `d` ON c.order_no = d.order_no
) AS `f` ON e.order_no = f.order_no
-->
SELECT w.*,o.commission as commission ,o.type AS `sellerStatus` FROM (
SELECT w.*,o.commission as commission ,o.type AS `sellerStatus` FROM (