Zmiany pomiędzy wersją 9 and wersją 10 dla ChangeIssueDate

Pokaż
Ignoruj:
Data i czas:
2013-12-18 12:42:45 (11 years temu)
Autor:
alina (IP: 10.0.1.126)
Komentarz:

--

Legend:

Bez zmian
Dodane
Usunięte
Zmienione
  • ChangeIssueDate

    v9 v10  
    4444}}} 
    4545Krótkie wyjaśnienie: zamykamy wydanie w poniedziałek 1 marca o 17:00, klient zamieszcza ogłoszenie 2 marca na jedna emisje (wtorek) o 9:00 (to ogłoszenie wygaśnie 9 marca o 9:00), a powinno pojść do gazety 9 marca 17:00. 
     46 
     47DECLARE @regularIssueDate DATETIME 
     48SET @regularIssueDate = '2013-12-24 17:00' 
     49 
     50DECLARE @changeIssueDate DATETIME 
     51SET @changeIssueDate = '2013-12-20 16:00' 
     52 
     53declare @ads as table (adid integer) 
     54declare @ads2 as table (adid integer, orderitemId integer) 
     55 
     56/*Ogłoszenia które normalnie wygasną przed 17:00 we wtorek ale mają przedłużenia - one powinny pójść*/ 
     57insert into @ads 
     58select productid from orderitems i join orders o on o.id = i.orderid where productid in 
     59( 
     60  select id from ads where enddate > @changeIssueDate and enddate < @regularIssueDate and status = 1 
     61) and i.startdate >= @changeIssueDate and i.startdate < @regularIssueDate and i.magazinepromotion > 0 and o.status <> 4 
     62 
     63/*Ogłoszenia które maja start miedzy zmieniona data wydania a stara 17:00 we wtorek - one powinny pójść*/ 
     64insert into @ads2 
     65select productid, i.id from orderitems i join orders o on o.id = i.orderid  
     66where o.status <> 4 and i.startdate >= @changeIssueDate and startdate < @regularIssueDate 
     67and subscriptionpromotion is null and i.magazinepromotion > 0 
     68 
     69select * from @ads 
     70select * from @ads2 
     71 
     72/* ogloszenia ktore trzeba wstrzymac - do exportu */ 
     73/*Ogłoszenia które normalnie wygasną przed 17:00, we wtorek - one nie powinny iść do tego poniedziałkowego wydania*/ 
     74select currentorderitem as oi, customerid as cid , * from ads where enddate > @changeIssueDate and enddate < @regularIssueDate and status = 1 and magazinepromotion > 0 
     75and (id not in (select adid from @ads) or id not in (select adid from @ads2)) order by currentorderitem desc 
     76 
     77/* wstzrymanie przed 17 - aktywacja ogloszen po exporcie */ 
     78/*edycja ogloszen - wstrzymanie ogloszen ktore wygasna przed stara data wydania - wykluczajac przedluzenia i te rozpoczynajace sie miedzy pon a wtorkiem */ 
     79update ads set status=5 where enddate > @changeIssueDate and enddate < @regularIssueDate and status = 1 and magazinepromotion > 0 
     80and (id not in (select adid from @ads) or id not in (select adid from @ads2)) 
     81 
     82select * from ads where status=5 
     83 
     84update ads set status=1 where status=5