| | |
| | | toc.order_status orderStatus, |
| | | toc.order_money orderGoodsMoney, |
| | | toc.coupon_money couponDiscount, |
| | | CASE toc.pay_type WHEN 1 THEN toc.order_money-toc.coupon_money WHEN 2 THEN toc.order_money-toc.coupon_money-toc.online_pay_money END receivableMoney, |
| | | CASE toc.pay_type WHEN 1 THEN toc.order_money-toc.coupon_money WHEN 2 THEN |
| | | toc.order_money-toc.coupon_money-toc.online_pay_money END receivableMoney, |
| | | toc.receivable_deposit receivableDeposit, |
| | | toc.pay_money payMoney, |
| | | (CASE WHEN null = toc.change_receivable_money or toc.change_receivable_money = 0 THEN toc.receivable_money ELSE toc.change_receivable_money END) relReceiveMoney, |
| | | (CASE WHEN null = toc.change_receivable_money or toc.change_receivable_money = 0 THEN toc.receivable_money ELSE |
| | | toc.change_receivable_money END) relReceiveMoney, |
| | | CASE toc.pay_type WHEN 1 THEN toc.pay_money WHEN 2 THEN IFNULL(toc.offline_pay_money,0) END receiveMoney, |
| | | (CASE WHEN null = toc.change_receivable_money or toc.change_receivable_money = 0 THEN toc.receivable_money ELSE toc.change_receivable_money END) - (CASE toc.pay_type WHEN 1 THEN toc.pay_money WHEN 2 THEN IFNULL(toc.offline_pay_money,0) END) unPaidMoney, |
| | | (CASE WHEN null = toc.change_receivable_money or toc.change_receivable_money = 0 THEN toc.receivable_money ELSE |
| | | toc.change_receivable_money END) - (CASE toc.pay_type WHEN 1 THEN toc.pay_money WHEN 2 THEN |
| | | IFNULL(toc.offline_pay_money,0) END) unPaidMoney, |
| | | toc.order_remark orderRemark, |
| | | toc.create_time createTime, |
| | | toc.order_from orderFrom, |
| | | CASE toc.order_from WHEN 1 THEN '商城订单' WHEN 2 THEN CONCAT('平台秒杀活动(',toc.activity_name,')') WHEN 3 THEN '线下创建' END orderFromDesc, |
| | | CASE toc.order_from WHEN 1 THEN '商城订单' WHEN 2 THEN CONCAT('平台秒杀活动(',toc.activity_name,')') WHEN 3 THEN |
| | | '线下创建' END orderFromDesc, |
| | | toc.activity_name activityName |
| | | FROM t_order toc |
| | | WHERE toc.del_flag = 0 AND toc.shop_id = #{param.shopId} and if(toc.order_from = 1, 1 = 1, toc.order_status = 3)<!--临时增加过滤--> |
| | | WHERE toc.del_flag = 0 AND toc.shop_id = #{param.shopId} |
| | | <if test="param.memberUserId != null and param.memberUserId != ''"> |
| | | AND toc.user_id = #{param.memberUserId} |
| | | </if> |
| | | <if test="param.type != null and param.type ==0 "> |
| | | AND toc.order_status = 0 |
| | | </if> |
| | | <if test="param.type != null and param.type ==1 "> |
| | | AND (toc.order_status = 2 OR toc.order_status = 3) |
| | | AND toc.order_status in(0, 2, 3) |
| | | </if> |
| | | <if test="param.type != null and param.type ==2 "> |
| | | AND toc.order_status = 2 |