nginx
Plain text
code posted
created at 08 Jan 06:10, updated at 08 Jan 06:15
Edit
|
Back
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
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; |
1.6 KB in 2 ms with coderay