z-적립금-settle.sql 254 B

1234567
  1. select
  2. sum(reward_amt*cast((reward_status+1)/2 as int)) as in_reward,
  3. sum(reward_amt*cast(-1*(reward_status-1)/2 as int)) as out_reward
  4. from dbr_reward_bd
  5. where
  6. and branch_id = ? and buyer_id = ?
  7. and avail_date between '20240307' and '20240307';