Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-smart
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
platform
hp-smart
Commits
c4ca7466
Commit
c4ca7466
authored
Feb 23, 2024
by
wancheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报屏获取公司代码优化
parent
caaee74d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
257 additions
and
263 deletions
+257
-263
ServiceHPBI001.java
.../java/com/baosight/hpjx/hp/bi/service/ServiceHPBI001.java
+23
-34
HPBI001.xml
src/main/java/com/baosight/hpjx/hp/bi/sql/HPBI001.xml
+234
-229
No files found.
src/main/java/com/baosight/hpjx/hp/bi/service/ServiceHPBI001.java
View file @
c4ca7466
...
...
@@ -80,23 +80,23 @@ public class ServiceHPBI001 extends ServiceBase {
//汇总数据
//if(!StringUtils.isEmpty(inInfo.getCellStr(EiConstant.queryBlock, 0, "date"))){
//每日数据
String
pro_
nam
e
=
"***"
;
String
pro_
cod
e
=
"***"
;
List
<
Map
>
mrsj
=
dao
.
query
(
"HPBI001.queryDay"
,
params
);
if
(
mrsj
!=
null
){
for
(
Map
obj:
mrsj
)
{
if
((
Long
)
obj
.
get
(
"SORT"
)
==
2
){
pro_
name
=
(
String
)
obj
.
get
(
"VALU
E"
);
pro_
code
=
(
String
)
obj
.
get
(
"PROJ_COD
E"
);
}
}
}
params
.
put
(
"pro_name"
,
pro_
nam
e
);
inInfo
.
setCell
(
EiConstant
.
queryBlock
,
0
,
"pro_name"
,
pro_
nam
e
);
params
.
put
(
"pro_name"
,
pro_
cod
e
);
inInfo
.
setCell
(
EiConstant
.
queryBlock
,
0
,
"pro_name"
,
pro_
cod
e
);
outInfo
=
super
.
query
(
inInfo
,
"HPBI001.querySum"
,
new
HPBI001
());
//生产月报
List
scyb
=
dao
.
query
(
"HPBI001.queryMon"
,
params
);
outInfo
.
set
(
"mrsj"
,
mrsj
);
outInfo
.
set
(
"scyb"
,
scyb
);
//生产月报
List
scyb
=
dao
.
query
(
"HPBI001.queryMon"
,
params
);
outInfo
.
set
(
"mrsj"
,
mrsj
);
outInfo
.
set
(
"scyb"
,
scyb
);
// }
}
catch
(
Exception
e
)
{
...
...
@@ -142,12 +142,9 @@ public class ServiceHPBI001 extends ServiceBase {
map
.
put
(
"offset"
,
0
);
map
.
put
(
"limit"
,
1000
);
//获取公司代码
Map
user_params
=
new
HashMap
();
user_params
.
put
(
"loginName"
,
UserSession
.
getUserId
());
List
<
Map
>
company_codes
=
super
.
dao
.
query
(
"HPBI001.queryCompanyCode"
,
user_params
);
String
company_code
=
"%"
;
if
(!
StringUtils
.
isEmpty
(
company_codes
.
get
(
0
).
get
(
"COMPANY_CODE"
).
toString
().
trim
())){
company_code
=
company_codes
.
get
(
0
).
get
(
"COMPANY_CODE"
).
toString
();
if
(!
StringUtils
.
isEmpty
(
UserSessionUtils
.
getCompanyCode
().
trim
())){
company_code
=
UserSessionUtils
.
getCompanyCode
();
}
//数据集入参
Map
params
=
new
HashMap
();
...
...
@@ -201,12 +198,16 @@ public class ServiceHPBI001 extends ServiceBase {
map
.
put
(
"offset"
,
0
);
map
.
put
(
"limit"
,
1000
);
//获取公司代码
Map
user_params
=
new
HashMap
();
/*
Map user_params =new HashMap();
user_params.put("loginName", UserSession.getUserId());
List<Map> company_codes = super.dao.query("HPBI001.queryCompanyCode",user_params);
String company_code = "%";
if(!StringUtils.isEmpty(company_codes.get(0).get("COMPANY_CODE").toString().trim())){
company_code = company_codes.get(0).get("COMPANY_CODE").toString();
}*/
String
company_code
=
"%"
;
if
(!
StringUtils
.
isEmpty
(
UserSessionUtils
.
getCompanyCode
().
trim
())){
company_code
=
UserSessionUtils
.
getCompanyCode
();
}
//数据集入参
Map
params
=
new
HashMap
();
...
...
@@ -262,12 +263,9 @@ public class ServiceHPBI001 extends ServiceBase {
map
.
put
(
"offset"
,
0
);
map
.
put
(
"limit"
,
1000
);
//获取公司代码
Map
user_params
=
new
HashMap
();
user_params
.
put
(
"loginName"
,
UserSession
.
getUserId
());
List
<
Map
>
company_codes
=
super
.
dao
.
query
(
"HPBI001.queryCompanyCode"
,
user_params
);
String
company_code
=
"%"
;
if
(!
StringUtils
.
isEmpty
(
company_codes
.
get
(
0
).
get
(
"COMPANY_CODE"
).
toString
().
trim
())){
company_code
=
company_codes
.
get
(
0
).
get
(
"COMPANY_CODE"
).
toString
();
if
(!
StringUtils
.
isEmpty
(
UserSessionUtils
.
getCompanyCode
().
trim
())){
company_code
=
UserSessionUtils
.
getCompanyCode
();
}
//数据集入参
Map
params
=
new
HashMap
();
...
...
@@ -321,12 +319,9 @@ public class ServiceHPBI001 extends ServiceBase {
map
.
put
(
"offset"
,
0
);
map
.
put
(
"limit"
,
1000
);
//获取公司代码
Map
user_params
=
new
HashMap
();
user_params
.
put
(
"loginName"
,
UserSession
.
getUserId
());
List
<
Map
>
company_codes
=
super
.
dao
.
query
(
"HPBI001.queryCompanyCode"
,
user_params
);
String
company_code
=
"%"
;
if
(!
StringUtils
.
isEmpty
(
company_codes
.
get
(
0
).
get
(
"COMPANY_CODE"
).
toString
().
trim
())){
company_code
=
company_codes
.
get
(
0
).
get
(
"COMPANY_CODE"
).
toString
();
if
(!
StringUtils
.
isEmpty
(
UserSessionUtils
.
getCompanyCode
().
trim
())){
company_code
=
UserSessionUtils
.
getCompanyCode
();
}
//数据集入参
Map
params
=
new
HashMap
();
...
...
@@ -385,12 +380,9 @@ public class ServiceHPBI001 extends ServiceBase {
map
.
put
(
"offset"
,
0
);
map
.
put
(
"limit"
,
1000
);
//获取公司代码
Map
user_params
=
new
HashMap
();
user_params
.
put
(
"loginName"
,
UserSession
.
getUserId
());
List
<
Map
>
company_codes
=
super
.
dao
.
query
(
"HPBI001.queryCompanyCode"
,
user_params
);
String
company_code
=
"%"
;
if
(!
StringUtils
.
isEmpty
(
company_codes
.
get
(
0
).
get
(
"COMPANY_CODE"
).
toString
().
trim
())){
company_code
=
company_codes
.
get
(
0
).
get
(
"COMPANY_CODE"
).
toString
();
if
(!
StringUtils
.
isEmpty
(
UserSessionUtils
.
getCompanyCode
().
trim
())){
company_code
=
UserSessionUtils
.
getCompanyCode
();
}
//数据集入参
Map
params
=
new
HashMap
();
...
...
@@ -453,12 +445,9 @@ public class ServiceHPBI001 extends ServiceBase {
map
.
put
(
"offset"
,
0
);
map
.
put
(
"limit"
,
1000
);
//获取公司代码
Map
user_params
=
new
HashMap
();
user_params
.
put
(
"loginName"
,
UserSession
.
getUserId
());
List
<
Map
>
company_codes
=
super
.
dao
.
query
(
"HPBI001.queryCompanyCode"
,
user_params
);
String
company_code
=
"%"
;
if
(!
StringUtils
.
isEmpty
(
company_codes
.
get
(
0
).
get
(
"COMPANY_CODE"
).
toString
().
trim
())){
company_code
=
company_codes
.
get
(
0
).
get
(
"COMPANY_CODE"
).
toString
();
if
(!
StringUtils
.
isEmpty
(
UserSessionUtils
.
getCompanyCode
().
trim
())){
company_code
=
UserSessionUtils
.
getCompanyCode
();
}
//数据集入参
Map
params
=
new
HashMap
();
...
...
src/main/java/com/baosight/hpjx/hp/bi/sql/HPBI001.xml
View file @
c4ca7466
...
...
@@ -15,6 +15,210 @@
</isNotEmpty>
</select>
<select
id=
"queryDay"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
SELECT '工厂' AS SERIES,FACTORY_NAME AS VALUE,PROJ_CODE, 1 AS SORT
FROM ( SELECT
A.COMPANY_CODE,
A.FACTORY_CODE,
A.PLAN_COMPLETION_DATE,
A.FACTORY_NAME,
A.PROJ_NAME,
A.PROJ_CODE,
TOTAL_WT,
WEIGHT,
B.NUM
FROM hpjx.t_hpsc005 A
JOIN (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
JOIN hpjx.t_hpkc003 C ON A.PRODUCTION_ORDER_NO = C.PROD_ORDER_NO
WHERE ifnull(C.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"date"
>
C.DOCUMENT_DATE = replace(#date#,'-','')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factory"
>
A.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"company_code"
>
A.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
LIMIT 1 ) A
UNION ALL
SELECT '生产项目' AS SERIES,PROJ_NAME AS VALUE,PROJ_CODE, 2 AS SORT FROM ( SELECT
A.COMPANY_CODE,
A.FACTORY_CODE,
A.PLAN_COMPLETION_DATE,
A.FACTORY_NAME,
A.PROJ_NAME,
A.PROJ_CODE,
TOTAL_WT,
WEIGHT,
B.NUM
FROM hpjx.t_hpsc005 A
JOIN (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
JOIN hpjx.t_hpkc003 C ON A.PRODUCTION_ORDER_NO = C.PROD_ORDER_NO
WHERE ifnull(C.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"date"
>
C.DOCUMENT_DATE = replace(#date#,'-','')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factory"
>
A.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"company_code"
>
A.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
LIMIT 1
) A
UNION ALL
SELECT
'生产产量' AS SERIES,
concat('计划产量:',TOTAL_WT,'吨 , 实际产量',WEIGHT,'吨') as VALUE,
PROJ_CODE, 3 AS SORT
FROM ( SELECT
A.COMPANY_CODE,
A.FACTORY_CODE,
A.PLAN_COMPLETION_DATE,
A.FACTORY_NAME,
A.PROJ_NAME,
A.PROJ_CODE,
TOTAL_WT,
WEIGHT,
B.NUM
FROM hpjx.t_hpsc005 A
JOIN (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
JOIN hpjx.t_hpkc003 C ON A.PRODUCTION_ORDER_NO = C.PROD_ORDER_NO
WHERE ifnull(C.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"date"
>
C.DOCUMENT_DATE = replace(#date#,'-','')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factory"
>
A.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"company_code"
>
A.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
LIMIT 1
) A
UNION ALL
SELECT
'生产人数' AS SERIES,
concat(NUM,'人') as VALUE,
PROJ_CODE, 4 AS SORT
FROM ( SELECT
A.COMPANY_CODE,
A.FACTORY_CODE,
A.PLAN_COMPLETION_DATE,
A.FACTORY_NAME,
A.PROJ_CODE,
A.PROJ_NAME,
TOTAL_WT,
WEIGHT,
B.NUM
FROM hpjx.t_hpsc005 A
JOIN (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
JOIN hpjx.t_hpkc003 C ON A.PRODUCTION_ORDER_NO = C.PROD_ORDER_NO
WHERE ifnull(C.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"date"
>
C.DOCUMENT_DATE = replace(#date#,'-','')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factory"
>
A.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"company_code"
>
A.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
LIMIT 1
) A
UNION ALL
SELECT
'人均日产' AS SERIES,
concat(ifnull(WEIGHT,0)/NUM,'吨') as VALUE,
PROJ_CODE, 5 AS SORT
FROM ( SELECT
A.COMPANY_CODE,
A.FACTORY_CODE,
A.PLAN_COMPLETION_DATE,
A.FACTORY_NAME,
A.PROJ_NAME,
A.PROJ_CODE,
TOTAL_WT,
WEIGHT,
B.NUM
FROM hpjx.t_hpsc005 A
JOIN (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
JOIN hpjx.t_hpkc003 C ON A.PRODUCTION_ORDER_NO = C.PROD_ORDER_NO
WHERE ifnull(C.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"date"
>
C.DOCUMENT_DATE = replace(#date#,'-','')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factory"
>
A.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"company_code"
>
A.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
LIMIT 1
) A
<dynamic
prepend=
"ORDER BY"
>
<isEmpty
property=
"orderBy"
>
SORT asc
</isEmpty>
</dynamic>
</select>
<select
id=
"querySum"
parameterClass=
"java.util.HashMap"
resultClass=
"com.baosight.hpjx.hp.bi.domain.HPBI001"
>
select
...
...
@@ -25,8 +229,8 @@
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PRODUCTION_ORDER_NO
where ifnull(A.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"pro_
nam
e"
>
A.PROJ_
NAME = #pro_nam
e#
<isNotEmpty
prepend=
" AND "
property=
"pro_
cod
e"
>
A.PROJ_
CODE = #pro_cod
e#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"date"
>
A.DOCUMENT_DATE = replace(#date#,'-','')
...
...
@@ -55,8 +259,8 @@
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PRODUCTION_ORDER_NO
where ifnull(A.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"pro_
nam
e"
>
A.PROJ_
NAME = #pro_nam
e#
<isNotEmpty
prepend=
" AND "
property=
"pro_
cod
e"
>
A.PROJ_
CODE = #pro_cod
e#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"date"
>
A.DOCUMENT_DATE
<![CDATA[<=]]>
replace(#date#,'-','')
...
...
@@ -86,8 +290,8 @@
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PRODUCTION_ORDER_NO
where ifnull(A.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"pro_
nam
e"
>
A.PROJ_
NAME = #pro_nam
e#
<isNotEmpty
prepend=
" AND "
property=
"pro_
cod
e"
>
A.PROJ_
CODE = #pro_cod
e#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"date"
>
A.DOCUMENT_DATE
<![CDATA[<=]]>
replace(#date#,'-','')
...
...
@@ -127,8 +331,8 @@
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PRODUCTION_ORDER_NO
where ifnull(A.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"pro_
nam
e"
>
A.PROJ_
NAME = #pro_nam
e#
<isNotEmpty
prepend=
" AND "
property=
"pro_
cod
e"
>
A.PROJ_
CODE = #pro_cod
e#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"date"
>
A.DOCUMENT_DATE
<![CDATA[<=]]>
replace(#date#,'-','')
...
...
@@ -163,8 +367,8 @@
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PRODUCTION_ORDER_NO
where ifnull(A.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"pro_
nam
e"
>
A.PROJ_
NAME = #pro_nam
e#
<isNotEmpty
prepend=
" AND "
property=
"pro_
cod
e"
>
A.PROJ_
CODE = #pro_cod
e#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"date"
>
A.DOCUMENT_DATE = replace(#date#,'-','')
...
...
@@ -193,8 +397,8 @@
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PRODUCTION_ORDER_NO
where ifnull(A.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"pro_
nam
e"
>
A.PROJ_
NAME = #pro_nam
e#
<isNotEmpty
prepend=
" AND "
property=
"pro_
cod
e"
>
A.PROJ_
CODE = #pro_cod
e#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"date"
>
A.DOCUMENT_DATE
<![CDATA[<=]]>
replace(#date#,'-','')
...
...
@@ -224,8 +428,8 @@
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PRODUCTION_ORDER_NO
where ifnull(A.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"pro_
nam
e"
>
A.PROJ_
NAME = #pro_nam
e#
<isNotEmpty
prepend=
" AND "
property=
"pro_
cod
e"
>
A.PROJ_
CODE = #pro_cod
e#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"date"
>
A.DOCUMENT_DATE
<![CDATA[<=]]>
replace(#date#,'-','')
...
...
@@ -265,8 +469,8 @@
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PRODUCTION_ORDER_NO
where ifnull(A.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"pro_
nam
e"
>
A.PROJ_
NAME = #pro_nam
e#
<isNotEmpty
prepend=
" AND "
property=
"pro_
cod
e"
>
A.PROJ_
CODE = #pro_cod
e#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"date"
>
A.DOCUMENT_DATE
<![CDATA[<=]]>
replace(#date#,'-','')
...
...
@@ -301,8 +505,8 @@
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PRODUCTION_ORDER_NO
where ifnull(A.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"pro_
nam
e"
>
A.PROJ_
NAME = #pro_nam
e#
<isNotEmpty
prepend=
" AND "
property=
"pro_
cod
e"
>
A.PROJ_
CODE = #pro_cod
e#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"date"
>
A.DOCUMENT_DATE = replace(#date#,'-','')
...
...
@@ -331,8 +535,8 @@
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PRODUCTION_ORDER_NO
where ifnull(A.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"pro_
nam
e"
>
A.PROJ_
NAME = #pro_nam
e#
<isNotEmpty
prepend=
" AND "
property=
"pro_
cod
e"
>
A.PROJ_
CODE = #pro_cod
e#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"date"
>
A.DOCUMENT_DATE
<![CDATA[<=]]>
replace(#date#,'-','')
...
...
@@ -362,8 +566,8 @@
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PRODUCTION_ORDER_NO
where ifnull(A.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"pro_
nam
e"
>
A.PROJ_
NAME = #pro_nam
e#
<isNotEmpty
prepend=
" AND "
property=
"pro_
cod
e"
>
A.PROJ_
CODE = #pro_cod
e#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"date"
>
A.DOCUMENT_DATE
<![CDATA[<=]]>
replace(#date#,'-','')
...
...
@@ -403,8 +607,8 @@
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PRODUCTION_ORDER_NO
where ifnull(A.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"pro_
nam
e"
>
A.PROJ_
NAME = #pro_nam
e#
<isNotEmpty
prepend=
" AND "
property=
"pro_
cod
e"
>
A.PROJ_
CODE = #pro_cod
e#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"date"
>
A.DOCUMENT_DATE
<![CDATA[<=]]>
replace(#date#,'-','')
...
...
@@ -434,206 +638,7 @@
</dynamic>
</select>
<select
id=
"queryDay"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
SELECT '工厂' AS SERIES,FACTORY_NAME AS VALUE,NULL AS FACTORY,NULL AS DATE, 1 AS SORT
FROM ( SELECT
A.COMPANY_CODE,
A.FACTORY_CODE,
A.PLAN_COMPLETION_DATE,
A.FACTORY_NAME,
A.PROJ_NAME,
TOTAL_WT,
WEIGHT,
B.NUM
FROM hpjx.t_hpsc005 A
JOIN (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
JOIN hpjx.t_hpkc003 C ON A.PRODUCTION_ORDER_NO = C.PROD_ORDER_NO
WHERE ifnull(C.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"date"
>
C.DOCUMENT_DATE = replace(#date#,'-','')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factory"
>
A.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"company_code"
>
A.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
LIMIT 1 ) A
UNION ALL
SELECT '生产项目' AS SERIES,PROJ_NAME AS VALUE,NULL AS FACTORY,NULL AS DATE, 2 AS SORT FROM ( SELECT
A.COMPANY_CODE,
A.FACTORY_CODE,
A.PLAN_COMPLETION_DATE,
A.FACTORY_NAME,
A.PROJ_NAME,
TOTAL_WT,
WEIGHT,
B.NUM
FROM hpjx.t_hpsc005 A
JOIN (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
JOIN hpjx.t_hpkc003 C ON A.PRODUCTION_ORDER_NO = C.PROD_ORDER_NO
WHERE ifnull(C.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"date"
>
C.DOCUMENT_DATE = replace(#date#,'-','')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factory"
>
A.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"company_code"
>
A.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
LIMIT 1
) A
UNION ALL
SELECT
'生产产量' AS SERIES,
concat('计划产量:',TOTAL_WT,'吨 , 实际产量',WEIGHT,'吨') as VALUE,
NULL AS FACTORY,NULL AS DATE, 3 AS SORT
FROM ( SELECT
A.COMPANY_CODE,
A.FACTORY_CODE,
A.PLAN_COMPLETION_DATE,
A.FACTORY_NAME,
A.PROJ_NAME,
TOTAL_WT,
WEIGHT,
B.NUM
FROM hpjx.t_hpsc005 A
JOIN (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
JOIN hpjx.t_hpkc003 C ON A.PRODUCTION_ORDER_NO = C.PROD_ORDER_NO
WHERE ifnull(C.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"date"
>
C.DOCUMENT_DATE = replace(#date#,'-','')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factory"
>
A.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"company_code"
>
A.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
LIMIT 1
) A
UNION ALL
SELECT
'生产人数' AS SERIES,
concat(NUM,'人') as VALUE,
NULL AS FACTORY,NULL AS DATE, 4 AS SORT
FROM ( SELECT
A.COMPANY_CODE,
A.FACTORY_CODE,
A.PLAN_COMPLETION_DATE,
A.FACTORY_NAME,
A.PROJ_NAME,
TOTAL_WT,
WEIGHT,
B.NUM
FROM hpjx.t_hpsc005 A
JOIN (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
JOIN hpjx.t_hpkc003 C ON A.PRODUCTION_ORDER_NO = C.PROD_ORDER_NO
WHERE ifnull(C.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"date"
>
C.DOCUMENT_DATE = replace(#date#,'-','')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factory"
>
A.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"company_code"
>
A.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
LIMIT 1
) A
UNION ALL
SELECT
'人均日产' AS SERIES,
concat(ifnull(WEIGHT,0)/NUM,'吨') as VALUE,
NULL AS FACTORY,NULL AS DATE, 5 AS SORT
FROM ( SELECT
A.COMPANY_CODE,
A.FACTORY_CODE,
A.PLAN_COMPLETION_DATE,
A.FACTORY_NAME,
A.PROJ_NAME,
TOTAL_WT,
WEIGHT,
B.NUM
FROM hpjx.t_hpsc005 A
JOIN (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
JOIN hpjx.t_hpkc003 C ON A.PRODUCTION_ORDER_NO = C.PROD_ORDER_NO
WHERE ifnull(C.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"date"
>
C.DOCUMENT_DATE = replace(#date#,'-','')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factory"
>
A.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"company_code"
>
A.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
LIMIT 1
) A
<dynamic
prepend=
"ORDER BY"
>
<isEmpty
property=
"orderBy"
>
SORT asc
</isEmpty>
</dynamic>
</select>
<select
id=
"queryMon"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
...
...
@@ -649,8 +654,8 @@
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PRODUCTION_ORDER_NO
where ifnull(A.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"pro_
nam
e"
>
A.PROJ_
NAME = #pro_nam
e#
<isNotEmpty
prepend=
" AND "
property=
"pro_
cod
e"
>
A.PROJ_
CODE = #pro_cod
e#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"date"
>
A.DOCUMENT_DATE = replace(#date#,'-','')
...
...
@@ -687,8 +692,8 @@
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PRODUCTION_ORDER_NO
where ifnull(A.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"pro_
nam
e"
>
A.PROJ_
NAME = #pro_nam
e#
<isNotEmpty
prepend=
" AND "
property=
"pro_
cod
e"
>
A.PROJ_
CODE = #pro_cod
e#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"date"
>
A.DOCUMENT_DATE = replace(#date#,'-','')
...
...
@@ -725,8 +730,8 @@
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PRODUCTION_ORDER_NO
where ifnull(A.DOCUMENT_DATE,'')
<![CDATA[<>]]>
''
<isNotEmpty
prepend=
" AND "
property=
"pro_
nam
e"
>
A.PROJ_
NAME = #pro_nam
e#
<isNotEmpty
prepend=
" AND "
property=
"pro_
cod
e"
>
A.PROJ_
CODE = #pro_cod
e#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"date"
>
A.DOCUMENT_DATE = replace(#date#,'-','')
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment