begin
SQL: begin; update g_vip set c_beiyzd2='AA' where m_jine- 80000>=0 and 999999999-m_jine>=0 and d_upid>coalesce(d_up1,'1900-1-1'); update g_vip set c_beiyzd2='A' where m_jine- 30000>=0 and 79999-m_jine>=0 and d_upid>coalesce(d_up1,'1900-1-1'); update g_vip set c_beiyzd2='B' where m_jine- 10000>=0 and 29999-m_jine>=0 and d_upid>coalesce(d_up1,'1900-1-1'); update g_vip set c_beiyzd2='C' where m_jine- 5000>=0 and 9999-m_jine>=0 and d_upid>coalesce(d_up1,'1900-1-1'); update g_vip set c_beiyzd2='D' where m_jine- -9999>=0 and 4999-m_jine>=0 and d_upid>coalesce(d_up1,'1900-1-1'); commit;
refresh vip level,use:75ms
SQL:update g_vip set c_beiyzd2='E' where d_zuihxfrq is not null and date_part('epoch',now())-date_part('epoch',d_zuihxfrq)>15552000;
refresh sleep vip,use:63ms
SQL begin; update g_vip set m_rfcaozje=coalesce(m_rfcaozje,0)+coalesce(a.sale,0) ,m_rfkaje=coalesce(m_rfkaje,0)+coalesce(a.amount,0) ,m_rfshangcye=coalesce(m_rfshangcye,0)+coalesce(a.orgamt,0) ,d_up1=a.iotime ,f_beiyzd6=coalesce(f_beiyzd6,0)+coalesce(a.xfcs,0) from ( select m.vipno,max(m.iotime) as iotime,sum(d.sale) as sale,sum(d.amount) as amount ,sum(d.amount*d.orgprice) as orgamt,sum(case when m.totalcount>0 then 1 else 0 end) as xfcs from g_inouttbl_zmd m,g_iodetail_zmd d where m.scripno=d.scripno and coalesce(m.vipno,'')<>'' and m.iotime>'2023-07-28 14:51:14.070475' group by m.vipno ) a where g_vip.c_vipbh=a.vipno; commit;
refresh vip total qty,total sale,total orgsale,use:87ms
SQL begin; update g_vip set c_zuangt='1' where coalesce(, '')<>'';update g_vip set c_zuangt='0' where coalesce(, '')=''; commit;
refresh vip maintain status,use:11ms
end