add substance column and move some files out of the route folder that aren't actually being used by routes
This commit is contained in:
parent
55257733b2
commit
ff1304be3c
@ -213,6 +213,7 @@ SELECT
|
||||
,o.majs_descr
|
||||
,o.mins_descr
|
||||
,o.segm
|
||||
,o.substance
|
||||
,o.fs_line
|
||||
,o.r_currency
|
||||
,o.r_rate
|
||||
@ -265,6 +266,7 @@ SELECT
|
||||
,o.majs_descr
|
||||
,o.mins_descr
|
||||
,o.segm
|
||||
,o.substance
|
||||
,o.fs_line
|
||||
,o.r_currency
|
||||
,o.r_rate
|
||||
@ -308,6 +310,7 @@ SELECT
|
||||
,b.majs_descr
|
||||
,b.mins_descr
|
||||
,b.segm
|
||||
,b.substance
|
||||
,b.fs_line
|
||||
,b.r_currency
|
||||
,b.r_rate
|
||||
@ -397,6 +400,7 @@ SELECT
|
||||
,b.majs_descr
|
||||
,b.mins_descr
|
||||
,b.segm
|
||||
,b.substance
|
||||
,b.fs_line
|
||||
,b.r_currency
|
||||
,b.r_rate
|
||||
@ -444,6 +448,7 @@ FROM
|
||||
,quota_rep_descr
|
||||
,director
|
||||
,segm
|
||||
,substance
|
||||
,chan
|
||||
,chansub
|
||||
---------product info------------------
|
||||
@ -487,6 +492,7 @@ FROM
|
||||
,quota_rep_descr
|
||||
,director
|
||||
,segm
|
||||
,substance
|
||||
,chan
|
||||
,chansub
|
||||
---------product info------------------
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -82,6 +82,7 @@ SELECT
|
||||
,o.majs||' - '||i.majsd majs_descr
|
||||
,o.mins||' - '||i.minsd mins_descr
|
||||
,seg.segm
|
||||
,CASE WHEN o.majg = '610' THEN 'Fiber' ELSE 'Plastic' substance
|
||||
,fs_line
|
||||
,r_currency
|
||||
,r_rate
|
||||
@ -136,9 +137,9 @@ FROM
|
||||
--LIMIT 100
|
||||
) WITH DATA;
|
||||
|
||||
CREATE INDEX osm_qr ON rlarp.osm_pool(quota_rep_descr);
|
||||
CREATE INDEX osm_qr ON rlarp.osm_pool(quota_rep_descr, bill_cust_descr, ship_cust_descr);
|
||||
ALTER TABLE rlarp.osm_pool ADD CONSTRAINT logfk FOREIGN KEY (logid) REFERENCES rlarp.osm_log(id);
|
||||
|
||||
CREATE INDEX osm_pool_logid ON rlarp.osm_pool(logid);
|
||||
GRANT ALL ON TABLE rlarp.osm_log TO api;
|
||||
GRANT ALL ON TABLE rlarp.osm_pool TO api;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,27 +1,27 @@
|
||||
WITH
|
||||
act As (
|
||||
SELECT DISTINCT
|
||||
v6part part
|
||||
FROM
|
||||
lgdat.stka
|
||||
WHERE
|
||||
(
|
||||
v6stat = 'A'
|
||||
OR v6part in ('TWA10203G18B027','TWA10203G18D050','MIH09000G18E001')
|
||||
)
|
||||
OR v6type = 'C'
|
||||
)
|
||||
,stkm AS (
|
||||
SELECT
|
||||
act.part || ' - ' ||rtrim(COALESCE(m.avdes1,p.awdes1)) part
|
||||
--,COALESCE(m.avgled, p.awgled) glec
|
||||
FROM
|
||||
act
|
||||
LEFT OUTER JOIN lgdat.stkmm m ON
|
||||
m.avpart = act.part
|
||||
LEFT OUTER JOIN lgdat.stkmp p ON
|
||||
p.awpart = act.part
|
||||
WHERE
|
||||
substr(COALESCE(m.avgled, p.awgled),1,1) <= '2'
|
||||
)
|
||||
WITH
|
||||
act As (
|
||||
SELECT DISTINCT
|
||||
v6part part
|
||||
FROM
|
||||
lgdat.stka
|
||||
WHERE
|
||||
(
|
||||
v6stat = 'A'
|
||||
OR v6part in ('TWA10203G18B027','TWA10203G18D050','MIH09000G18E001')
|
||||
)
|
||||
OR v6type = 'C'
|
||||
)
|
||||
,stkm AS (
|
||||
SELECT
|
||||
act.part || ' - ' ||rtrim(COALESCE(m.avdes1,p.awdes1)) part
|
||||
--,COALESCE(m.avgled, p.awgled) glec
|
||||
FROM
|
||||
act
|
||||
LEFT OUTER JOIN lgdat.stkmm m ON
|
||||
m.avpart = act.part
|
||||
LEFT OUTER JOIN lgdat.stkmp p ON
|
||||
p.awpart = act.part
|
||||
WHERE
|
||||
substr(COALESCE(m.avgled, p.awgled),1,1) <= '2'
|
||||
)
|
||||
select part from stkm
|
@ -8,6 +8,7 @@ SELECT
|
||||
,quota_rep_descr
|
||||
,director
|
||||
,segm
|
||||
,substance
|
||||
,chan
|
||||
,chansub
|
||||
---------product info------------------
|
||||
@ -53,6 +54,7 @@ GROUP BY
|
||||
,quota_rep_descr
|
||||
,director
|
||||
,segm
|
||||
,substance
|
||||
,chan
|
||||
,chansub
|
||||
---------product info------------------
|
||||
@ -79,6 +81,7 @@ GROUP BY
|
||||
,logid
|
||||
,tag
|
||||
,comment
|
||||
,substance
|
||||
)
|
||||
SELECT
|
||||
json_agg(row_to_json(rows)) x
|
||||
|
@ -308,6 +308,7 @@ SELECT
|
||||
,i.majs||' - '||i.majsd majs_descr
|
||||
,i.mins||' - '||i.minsd mins_descr
|
||||
,seg.segm
|
||||
,CASE WHEN i.majg = '610' THEN 'Fiber' ELSE 'Plastic' END substance
|
||||
,'41010' fs_line --master data
|
||||
,bc.bvcurr r_currency --history cust mix
|
||||
,rx.rate r_rate --master data
|
||||
@ -430,6 +431,7 @@ FROM
|
||||
,quota_rep_descr
|
||||
,director
|
||||
,segm
|
||||
,substance
|
||||
,chan
|
||||
,chansub
|
||||
---------product info------------------
|
||||
@ -473,6 +475,7 @@ FROM
|
||||
,quota_rep_descr
|
||||
,director
|
||||
,segm
|
||||
,substance
|
||||
,chan
|
||||
,chansub
|
||||
---------product info------------------
|
||||
|
@ -25,6 +25,7 @@ target AS (select target_increment incr)
|
||||
,majs_descr
|
||||
,mins_descr
|
||||
,segm
|
||||
,substance
|
||||
,fs_line --master data
|
||||
,r_currency --history cust mix
|
||||
,r_rate --master data
|
||||
@ -78,6 +79,7 @@ target AS (select target_increment incr)
|
||||
,majs_descr
|
||||
,mins_descr
|
||||
,segm
|
||||
,substance
|
||||
,fs_line --master data
|
||||
,r_currency --history cust mix
|
||||
,r_rate --master data
|
||||
@ -143,6 +145,7 @@ target AS (select target_increment incr)
|
||||
,majs_descr
|
||||
,mins_descr
|
||||
,segm
|
||||
,substance
|
||||
,fs_line --master data
|
||||
,r_currency --history cust mix
|
||||
,r_rate --master data
|
||||
@ -191,6 +194,7 @@ target AS (select target_increment incr)
|
||||
,quota_rep_descr
|
||||
,director
|
||||
,segm
|
||||
,substance
|
||||
,chan
|
||||
,chansub
|
||||
---------product info------------------
|
||||
@ -234,6 +238,7 @@ target AS (select target_increment incr)
|
||||
,quota_rep_descr
|
||||
,director
|
||||
,segm
|
||||
,substance
|
||||
,chan
|
||||
,chansub
|
||||
---------product info------------------
|
||||
|
@ -61,6 +61,7 @@ target AS (select incr_qty qincr)
|
||||
,majs_descr
|
||||
,mins_descr
|
||||
,segm
|
||||
,substance
|
||||
,fs_line --master data
|
||||
,r_currency --history cust mix
|
||||
,r_rate --master data
|
||||
@ -119,6 +120,7 @@ target AS (select incr_qty qincr)
|
||||
,majs_descr
|
||||
,mins_descr
|
||||
,segm
|
||||
,substance
|
||||
,fs_line --master data
|
||||
,r_currency --history cust mix
|
||||
,r_rate --master data
|
||||
@ -172,6 +174,7 @@ target AS (select incr_qty qincr)
|
||||
,majs_descr
|
||||
,mins_descr
|
||||
,segm
|
||||
,substance
|
||||
,fs_line --master data
|
||||
,r_currency --history cust mix
|
||||
,r_rate --master data
|
||||
@ -218,6 +221,7 @@ FROM
|
||||
,quota_rep_descr
|
||||
,director
|
||||
,segm
|
||||
,substance
|
||||
,chan
|
||||
,chansub
|
||||
---------product info------------------
|
||||
@ -261,6 +265,7 @@ FROM
|
||||
,quota_rep_descr
|
||||
,director
|
||||
,segm
|
||||
,substance
|
||||
,chan
|
||||
,chansub
|
||||
---------product info------------------
|
||||
|
@ -61,6 +61,7 @@ target AS (select target_vol vincr, target_prc pincr)
|
||||
,majs_descr
|
||||
,mins_descr
|
||||
,segm
|
||||
,substance
|
||||
,fs_line --master data
|
||||
,r_currency --history cust mix
|
||||
,r_rate --master data
|
||||
@ -119,6 +120,7 @@ target AS (select target_vol vincr, target_prc pincr)
|
||||
,majs_descr
|
||||
,mins_descr
|
||||
,segm
|
||||
,substance
|
||||
,fs_line --master data
|
||||
,r_currency --history cust mix
|
||||
,r_rate --master data
|
||||
@ -171,6 +173,7 @@ target AS (select target_vol vincr, target_prc pincr)
|
||||
,majs_descr
|
||||
,mins_descr
|
||||
,segm
|
||||
,substance
|
||||
,fs_line --master data
|
||||
,r_currency --history cust mix
|
||||
,r_rate --master data
|
||||
@ -251,6 +254,7 @@ FROM
|
||||
,majs_descr
|
||||
,mins_descr
|
||||
,segm
|
||||
,substance
|
||||
,fs_line --master data
|
||||
,r_currency --history cust mix
|
||||
,r_rate --master data
|
||||
@ -299,6 +303,7 @@ FROM
|
||||
,quota_rep_descr
|
||||
,director
|
||||
,segm
|
||||
,substance
|
||||
,chan
|
||||
,chansub
|
||||
---------product info------------------
|
||||
@ -342,6 +347,7 @@ FROM
|
||||
,quota_rep_descr
|
||||
,director
|
||||
,segm
|
||||
,substance
|
||||
,chan
|
||||
,chansub
|
||||
---------product info------------------
|
||||
|
Loading…
Reference in New Issue
Block a user