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:
Trowbridge 2020-02-19 13:25:28 -05:00
parent 55257733b2
commit ff1304be3c
11 changed files with 1437 additions and 1408 deletions

View File

@ -213,6 +213,7 @@ SELECT
,o.majs_descr ,o.majs_descr
,o.mins_descr ,o.mins_descr
,o.segm ,o.segm
,o.substance
,o.fs_line ,o.fs_line
,o.r_currency ,o.r_currency
,o.r_rate ,o.r_rate
@ -265,6 +266,7 @@ SELECT
,o.majs_descr ,o.majs_descr
,o.mins_descr ,o.mins_descr
,o.segm ,o.segm
,o.substance
,o.fs_line ,o.fs_line
,o.r_currency ,o.r_currency
,o.r_rate ,o.r_rate
@ -308,6 +310,7 @@ SELECT
,b.majs_descr ,b.majs_descr
,b.mins_descr ,b.mins_descr
,b.segm ,b.segm
,b.substance
,b.fs_line ,b.fs_line
,b.r_currency ,b.r_currency
,b.r_rate ,b.r_rate
@ -397,6 +400,7 @@ SELECT
,b.majs_descr ,b.majs_descr
,b.mins_descr ,b.mins_descr
,b.segm ,b.segm
,b.substance
,b.fs_line ,b.fs_line
,b.r_currency ,b.r_currency
,b.r_rate ,b.r_rate
@ -444,6 +448,7 @@ FROM
,quota_rep_descr ,quota_rep_descr
,director ,director
,segm ,segm
,substance
,chan ,chan
,chansub ,chansub
---------product info------------------ ---------product info------------------
@ -487,6 +492,7 @@ FROM
,quota_rep_descr ,quota_rep_descr
,director ,director
,segm ,segm
,substance
,chan ,chan
,chansub ,chansub
---------product info------------------ ---------product info------------------

View File

@ -82,6 +82,7 @@ SELECT
,o.majs||' - '||i.majsd majs_descr ,o.majs||' - '||i.majsd majs_descr
,o.mins||' - '||i.minsd mins_descr ,o.mins||' - '||i.minsd mins_descr
,seg.segm ,seg.segm
,CASE WHEN o.majg = '610' THEN 'Fiber' ELSE 'Plastic' substance
,fs_line ,fs_line
,r_currency ,r_currency
,r_rate ,r_rate
@ -136,9 +137,9 @@ FROM
--LIMIT 100 --LIMIT 100
) WITH DATA; ) 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); 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_log TO api;
GRANT ALL ON TABLE rlarp.osm_pool TO api; GRANT ALL ON TABLE rlarp.osm_pool TO api;

View File

@ -8,6 +8,7 @@ SELECT
,quota_rep_descr ,quota_rep_descr
,director ,director
,segm ,segm
,substance
,chan ,chan
,chansub ,chansub
---------product info------------------ ---------product info------------------
@ -53,6 +54,7 @@ GROUP BY
,quota_rep_descr ,quota_rep_descr
,director ,director
,segm ,segm
,substance
,chan ,chan
,chansub ,chansub
---------product info------------------ ---------product info------------------
@ -79,6 +81,7 @@ GROUP BY
,logid ,logid
,tag ,tag
,comment ,comment
,substance
) )
SELECT SELECT
json_agg(row_to_json(rows)) x json_agg(row_to_json(rows)) x

View File

@ -308,6 +308,7 @@ SELECT
,i.majs||' - '||i.majsd majs_descr ,i.majs||' - '||i.majsd majs_descr
,i.mins||' - '||i.minsd mins_descr ,i.mins||' - '||i.minsd mins_descr
,seg.segm ,seg.segm
,CASE WHEN i.majg = '610' THEN 'Fiber' ELSE 'Plastic' END substance
,'41010' fs_line --master data ,'41010' fs_line --master data
,bc.bvcurr r_currency --history cust mix ,bc.bvcurr r_currency --history cust mix
,rx.rate r_rate --master data ,rx.rate r_rate --master data
@ -430,6 +431,7 @@ FROM
,quota_rep_descr ,quota_rep_descr
,director ,director
,segm ,segm
,substance
,chan ,chan
,chansub ,chansub
---------product info------------------ ---------product info------------------
@ -473,6 +475,7 @@ FROM
,quota_rep_descr ,quota_rep_descr
,director ,director
,segm ,segm
,substance
,chan ,chan
,chansub ,chansub
---------product info------------------ ---------product info------------------

View File

@ -25,6 +25,7 @@ target AS (select target_increment incr)
,majs_descr ,majs_descr
,mins_descr ,mins_descr
,segm ,segm
,substance
,fs_line --master data ,fs_line --master data
,r_currency --history cust mix ,r_currency --history cust mix
,r_rate --master data ,r_rate --master data
@ -78,6 +79,7 @@ target AS (select target_increment incr)
,majs_descr ,majs_descr
,mins_descr ,mins_descr
,segm ,segm
,substance
,fs_line --master data ,fs_line --master data
,r_currency --history cust mix ,r_currency --history cust mix
,r_rate --master data ,r_rate --master data
@ -143,6 +145,7 @@ target AS (select target_increment incr)
,majs_descr ,majs_descr
,mins_descr ,mins_descr
,segm ,segm
,substance
,fs_line --master data ,fs_line --master data
,r_currency --history cust mix ,r_currency --history cust mix
,r_rate --master data ,r_rate --master data
@ -191,6 +194,7 @@ target AS (select target_increment incr)
,quota_rep_descr ,quota_rep_descr
,director ,director
,segm ,segm
,substance
,chan ,chan
,chansub ,chansub
---------product info------------------ ---------product info------------------
@ -234,6 +238,7 @@ target AS (select target_increment incr)
,quota_rep_descr ,quota_rep_descr
,director ,director
,segm ,segm
,substance
,chan ,chan
,chansub ,chansub
---------product info------------------ ---------product info------------------

View File

@ -61,6 +61,7 @@ target AS (select incr_qty qincr)
,majs_descr ,majs_descr
,mins_descr ,mins_descr
,segm ,segm
,substance
,fs_line --master data ,fs_line --master data
,r_currency --history cust mix ,r_currency --history cust mix
,r_rate --master data ,r_rate --master data
@ -119,6 +120,7 @@ target AS (select incr_qty qincr)
,majs_descr ,majs_descr
,mins_descr ,mins_descr
,segm ,segm
,substance
,fs_line --master data ,fs_line --master data
,r_currency --history cust mix ,r_currency --history cust mix
,r_rate --master data ,r_rate --master data
@ -172,6 +174,7 @@ target AS (select incr_qty qincr)
,majs_descr ,majs_descr
,mins_descr ,mins_descr
,segm ,segm
,substance
,fs_line --master data ,fs_line --master data
,r_currency --history cust mix ,r_currency --history cust mix
,r_rate --master data ,r_rate --master data
@ -218,6 +221,7 @@ FROM
,quota_rep_descr ,quota_rep_descr
,director ,director
,segm ,segm
,substance
,chan ,chan
,chansub ,chansub
---------product info------------------ ---------product info------------------
@ -261,6 +265,7 @@ FROM
,quota_rep_descr ,quota_rep_descr
,director ,director
,segm ,segm
,substance
,chan ,chan
,chansub ,chansub
---------product info------------------ ---------product info------------------

View File

@ -61,6 +61,7 @@ target AS (select target_vol vincr, target_prc pincr)
,majs_descr ,majs_descr
,mins_descr ,mins_descr
,segm ,segm
,substance
,fs_line --master data ,fs_line --master data
,r_currency --history cust mix ,r_currency --history cust mix
,r_rate --master data ,r_rate --master data
@ -119,6 +120,7 @@ target AS (select target_vol vincr, target_prc pincr)
,majs_descr ,majs_descr
,mins_descr ,mins_descr
,segm ,segm
,substance
,fs_line --master data ,fs_line --master data
,r_currency --history cust mix ,r_currency --history cust mix
,r_rate --master data ,r_rate --master data
@ -171,6 +173,7 @@ target AS (select target_vol vincr, target_prc pincr)
,majs_descr ,majs_descr
,mins_descr ,mins_descr
,segm ,segm
,substance
,fs_line --master data ,fs_line --master data
,r_currency --history cust mix ,r_currency --history cust mix
,r_rate --master data ,r_rate --master data
@ -251,6 +254,7 @@ FROM
,majs_descr ,majs_descr
,mins_descr ,mins_descr
,segm ,segm
,substance
,fs_line --master data ,fs_line --master data
,r_currency --history cust mix ,r_currency --history cust mix
,r_rate --master data ,r_rate --master data
@ -299,6 +303,7 @@ FROM
,quota_rep_descr ,quota_rep_descr
,director ,director
,segm ,segm
,substance
,chan ,chan
,chansub ,chansub
---------product info------------------ ---------product info------------------
@ -342,6 +347,7 @@ FROM
,quota_rep_descr ,quota_rep_descr
,director ,director
,segm ,segm
,substance
,chan ,chan
,chansub ,chansub
---------product info------------------ ---------product info------------------