Commit ed546bd4 by 周立明

sql修改

1 parent 3b161783
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
### 立明 -----------------start------------------- ### 立明 -----------------start-------------------
update dj_car_life_online_statement_account_trade_detail a,dj_car_life_order_division od set a.division_flag=if(od.id is null,'N','Y'),a.shop_division_money=IFNULL(od.shop_division_money,0),fws_division_money=ifnull(( update dj_car_life_online_statement_account_trade_detail a,dj_car_life_order_division od set a.division_flag=if(od.id is null,'N','Y'),a.shop_division_money=IFNULL(od.shop_division_money,0),fws_division_money=ifnull((
select sum(division_money) from dj_car_life_merchant_distribution md where md.deleted_flag='N' and rule_type=2 and division_order_code=od.division_order_code and target_merchant_type=2),0), select sum(division_money) from dj_car_life_merchant_distribution md where md.deleted_flag='N' and rule_type=2 and division_order_code=od.division_order_code and target_merchant_type=2),0),
a.gl_division_money=ifnull(od.gl_division_money,0) + ifnull(od.djzhy_sub_merchant_division_money,0),a.division_date=od.division_date a.gl_division_money=ifnull(od.gl_division_money,0) + ifnull(od.djzhy_sub_merchant_division_money,0) - a.service_charge,a.division_date=od.division_date
where a.division_flag='N' and a.deleted_flag='N' and od.pay_order_id=a.pay_order_id and od.division_status=3 and od.deleted_flag='N'; where a.division_flag='N' and a.deleted_flag='N' and od.pay_order_id=a.pay_order_id and od.division_status=3 and od.deleted_flag='N';
update dj_car_life_online_statement_account_trade_detail a ,dj_car_life_order_division b update dj_car_life_online_statement_account_trade_detail a ,dj_car_life_order_division b
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!