Title / Description
Code For cur in cols Begin Case cur.rstype When 0 then If (cduration%5=0)then Select * into nxt from pgm_chann_plasy where id=cur.nextid; Case nxt.rstype When 0 then <见伪代码二> Else //开始时间加上1秒 startDate=startate+1/24/60/60 //减去秒长: cdurtaion=cduration-1 //结束时间: enddate=startdate+cduration End case; Else //非5的倍数 //减去秒长: cdurtaion=cduration-1 //结束时间减去1秒 Enddate=enddate-1/24/60/60 End if; Else—1,2,3,4,5,6 //减去秒长: cdurtaion=cduration-1 //结束时间减去1秒 Enddate=enddate-1/24/60/60 End case; End. 伪代码二: //1. If(nxt.cdurtion%5!=0) //开始时间加上1秒 startDate=startate+1/24/60/60 //减去秒长: cdurtaion=cduration-1 //结束时间: enddate=startdate+cduration return; End if; //查找前节目 //a.查找广告口第一条广告 Select * into frst from pgm_chann_play where rnum =(select min(rnum)from pgm_chann_play where code=cur.code); If(frst.preid!=null)then //前节目时长减去1秒,结束日期减去1秒 Update pgm_chann_play set cduration=cduration-1,enddate=endate-1/24/60/60 where id=frst.preid; //当前广告口Rnum范围为(rp,rx]的广告开始时间和结束时间都减去1秒 Update pgm_chann_play set startdate=startdate-1/24/60/60,enddate=enddate-1/24/60/60 Where rnum>frst.rnum-1 and rnum<=cur.rnum; Return ; End if; //查找后节目 //查找广告口最后一条广告 Select * into frst from pgm_chann_play where rnum =(select max(rnum)from pgm_chann_play where code=cur.code); //后节目时长减去1秒 Update pgm_chann_play set cduration=cduration-1,startdate=startdate+1/24/60/60 where id=frst.nxtid; //当前串播单Rnum范围为(rx,rn)的开始时间和结束时间都加上1秒。 Update pgm_chann_play set startdate=startdate+1/24/60/60,enddate=enddate+1/24/60/60 Where rnum>cur.rnum and rnum<frst.rnum+1;
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code