Commit 8bf5e8f4 by wancheng

生产驾驶舱代码更新

parent 255c0d5b
......@@ -149,6 +149,42 @@
from (
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 6 day),'-',''),5,2),'/',substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 6 day),'-',''),7,2)) as X,
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE
,replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 6 day),'-','') as date,
case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2
when right(a.GROUP_NAME,2) = '三组' then 3
else 4 end as SORT
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
from iplat.TXSOG01 a
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode#) a
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 6 day),'-','') and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,b.REGISTER_DATE
union all
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 5 day),'-',''),5,2),'/',substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 5 day),'-',''),7,2)) as X,
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE
,replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 5 day),'-','') as date,
case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2
when right(a.GROUP_NAME,2) = '三组' then 3
else 4 end as SORT
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
from iplat.TXSOG01 a
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode#) a
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 5 day),'-','') and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,b.REGISTER_DATE
union all
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-',''),5,2),'/',substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-',''),7,2)) as X,
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE
,replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-','') as date,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment