19-06-2026 2nd commit
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
INSERT INTO mapping_storevisibility(Project_Id,StoreId,VisibilityDefinitionid,Fromdate,Todate,CreateDate,CreateBy)
|
||||
|
||||
|
||||
with mapping_storevisibility
|
||||
(Project_Id,StoreId,VisibilityDefinitionid,Fromdate,Todate,CreateDate,CreateBy)
|
||||
AS (
|
||||
select DISTINCT '40148' as Project_Id,StoreId,VisibilityDefinitionid,Fromdate,Todate,getdate(),'SP-Pius'
|
||||
FROM OneApp_KelloggsMT.dbo.mapping_storevisibility z WHERE
|
||||
convert(date,FROMDATE,101)<=convert(Date,getdate(),101) AND CONVERT(DATE,ToDate,101)>=convert(Date,getdate(),101)
|
||||
AND z.VisibilityDefinitionid IN
|
||||
(SELECT DISTINCT VisibilityDefinitionid FROM OneApp_KelloggsMT.dbo.MASTER_VISIBILITYDEFINITION WHERE MENUID=22 )
|
||||
AND z.StoreId NOT IN (
|
||||
SELECT distinct a.STOREID FROM Mapping_StoreVisibility a WHERE convert(date,a.FROMDATE,101)<=convert(Date,getdate(),101)
|
||||
AND CONVERT(DATE,a.ToDate,101)>=convert(Date,getdate(),101) AND a.Project_Id='40148'
|
||||
and a.StoreId=z.StoreId and a.VisibilityDefinitionid=z.VisibilityDefinitionId
|
||||
AND z.StoreId NOT IN ({store_id_list})
|
||||
)
|
||||
select * from mapping_storevisibility
|
||||
Reference in New Issue
Block a user