Commit 37a1ef42 by wancheng

app驾驶舱优化

parent 5b8f0e2c
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
from (select from (select
(select sum(USER_COUNT) (select sum(USER_COUNT)
FROM hpjx.t_hpsc008 FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# ) as YGL, where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# ) as YGL,
0 as JHCL, 0 as JHCL,
(select sum(WEIGHT) (select sum(WEIGHT)
FROM hpjx.t_hpsc008 FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# ) as SJCL where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# ) as SJCL
from dual) a from dual) a
</select> </select>
...@@ -29,10 +29,10 @@ ...@@ -29,10 +29,10 @@
else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as LJRJCL else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as LJRJCL
from (select from (select
(select sum(USER_COUNT) FROM hpjx.t_hpsc008 (select sum(USER_COUNT) FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as YGL, where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as YGL,
0 as JHCL, 0 as JHCL,
(select sum(WEIGHT) FROM hpjx.t_hpsc008 (select sum(WEIGHT) FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as SJCL where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as SJCL
from dual) a from dual) a
</select> </select>
...@@ -47,12 +47,12 @@ ...@@ -47,12 +47,12 @@
(select (select
sum(USER_COUNT) sum(USER_COUNT)
FROM hpjx.t_hpsc008 FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as YGL, where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as YGL,
0 as JHCL, 0 as JHCL,
(select (select
sum(WEIGHT) sum(WEIGHT)
FROM hpjx.t_hpsc008 FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as SJCL where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as SJCL
from dual) a from dual) a
</select> </select>
...@@ -63,13 +63,13 @@ ...@@ -63,13 +63,13 @@
concat(format(ifnull(ZH,0),2),'T') as ZH concat(format(ifnull(ZH,0),2),'T') as ZH
from (select from (select
(select sum(WEIGHT) FROM hpjx.T_HPXS001 (select sum(WEIGHT) FROM hpjx.T_HPXS001
where GROUP_TYPE = '2' and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE) as ZP, group by FACTORY_CODE) as ZP,
(select sum(WEIGHT) FROM hpjx.T_HPXS001 (select sum(WEIGHT_JH) FROM hpjx.T_HPXS001
where GROUP_TYPE = '1' and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE) as JH, group by FACTORY_CODE) as JH,
(select sum(WEIGHT)/2 FROM hpjx.T_HPXS001 (select sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 FROM hpjx.T_HPXS001
where COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE) as ZH group by FACTORY_CODE) as ZH
from dual) a from dual) a
</select> </select>
...@@ -91,13 +91,13 @@ ...@@ -91,13 +91,13 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.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) a 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) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.GROUP_TYPE = '2' left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
group by a.GROUP_NAME,b.GROUP_TYPE group by a.GROUP_NAME,b.GROUP_TYPE
union all union all
select select
'加焊' as SERIES, '加焊' as SERIES,
a.GROUP_NAME as X, a.GROUP_NAME as X,
ifnull(sum(WEIGHT),0) as VALUE, ifnull(sum(WEIGHT_JH),0) as VALUE,
case when right(a.GROUP_NAME,2) = '一组' then 1 case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2 when right(a.GROUP_NAME,2) = '二组' then 2
when right(a.GROUP_NAME,2) = '三组' then 3 when right(a.GROUP_NAME,2) = '三组' then 3
...@@ -108,13 +108,13 @@ ...@@ -108,13 +108,13 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.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) a 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) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.GROUP_TYPE = '1' left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
group by a.GROUP_NAME,b.GROUP_TYPE group by a.GROUP_NAME,b.GROUP_TYPE
union all union all
select select
'综合' as SERIES, '综合' as SERIES,
a.GROUP_NAME as X, a.GROUP_NAME as X,
ifnull(sum(WEIGHT),0)/2 as VALUE, sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE,
case when right(a.GROUP_NAME,2) = '一组' then 1 case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2 when right(a.GROUP_NAME,2) = '二组' then 2
when right(a.GROUP_NAME,2) = '三组' then 3 when right(a.GROUP_NAME,2) = '三组' then 3
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.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) a 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) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
group by a.GROUP_NAME) a group by a.GROUP_NAME) a
order by SORT,SORT1 asc order by SORT,SORT1 asc
</select> </select>
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.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) a 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) a
left join hpjx.T_HPXS001 b on a.GROUP_CODE = b.GROUP_CODE and b.REGISTER_DATE = #date# left join hpjx.T_HPXS001 b on a.GROUP_CODE = b.GROUP_CODE and b.REGISTER_DATE = #date# and b.DELETE_FLAG = 0
where a.COMPANY_CODE = #companyCode# and a.FACTORY_CODE = #factorycode# where a.COMPANY_CODE = #companyCode# and a.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,a.GROUP_CODE group by a.GROUP_NAME,a.GROUP_CODE
order by a.GROUP_CODE order by a.GROUP_CODE
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.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) a 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) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# left join hpjx.T_HPXS001 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 4 day),'-','') and b.FACTORY_CODE = #factorycode# and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-','') and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,b.REGISTER_DATE group by a.GROUP_NAME,b.REGISTER_DATE
union all union all
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.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) a 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) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# left join hpjx.T_HPXS001 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 3 day),'-','') and b.FACTORY_CODE = #factorycode# and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 3 day),'-','') and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,b.REGISTER_DATE group by a.GROUP_NAME,b.REGISTER_DATE
union all union all
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.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) a 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) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# left join hpjx.T_HPXS001 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 2 day),'-','') and b.FACTORY_CODE = #factorycode# and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 2 day),'-','') and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,b.REGISTER_DATE group by a.GROUP_NAME,b.REGISTER_DATE
union all union all
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.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) a 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) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# left join hpjx.T_HPXS001 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 1 day),'-','') and b.FACTORY_CODE = #factorycode# and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 1 day),'-','') and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,b.REGISTER_DATE group by a.GROUP_NAME,b.REGISTER_DATE
union all union all
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.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) a 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) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# left join hpjx.T_HPXS001 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 = #date# and b.FACTORY_CODE = #factorycode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME group by a.GROUP_NAME
) a ) a
......
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