INNER JOIN rb_customer_balancedetail b on o.OrderId = b.OrderId
WHERE o.Group_Id ={groupId} and o.OrderState =1 and o.OrderSource =9 and o.PayState =1 and b.RebateType =1 and b.BalanceType =1 and b.BalanceState =2 and o.PayDate <='{dateStr} 23:59:59' ";
stringsql=$@"SELECT * FROM rb_order WHERE Group_Id ={groupId} and OrderState =1 and OrderSource =9 and IFNULL(PayState,0) <>1 and CreateTime <'{DateTime.Now.AddMinutes(-30).ToString("yyyy-MM-dd HH:mm:ss")}'";
INNER JOIN rb_customer_balancedetail b on o.OrderId = b.OrderId
WHERE o.Group_Id ={groupId} and o.OrderState =1 and o.OrderSource =9 and o.PayState =1 and b.RebateType =1 and b.BalanceType =1 and b.BalanceState =2 and o.PayDate <='{dateStr} 23:59:59'