Commit 661921db by wancheng

生产日报页面优化

parent 4eada0c5
......@@ -62,7 +62,7 @@ public class HPBI001 extends DaoEPBase {
private String yearValue = " "; /* 供应商编码*/
private String janValue = " "; /* 供应商名称*/
private String febValue = " "; /* 地址*/
private Integer marValue = 1; /* 状态 0禁用 1启用*/
private String marValue = " "; /* 状态 0禁用 1启用*/
private String aprValue = " "; /* 创建人*/
private String mayValue = " "; /* 创建人名称*/
private String junValue = " "; /* 创建时间*/
......@@ -252,7 +252,7 @@ public class HPBI001 extends DaoEPBase {
* get the marValue - 状态 0禁用 1启用.
* @return the marValue
*/
public Integer getmarValue() {
public String getmarValue() {
return this.marValue;
}
......@@ -261,7 +261,7 @@ public class HPBI001 extends DaoEPBase {
*
* @param marValue - 状态 0禁用 1启用
*/
public void setmarValue(Integer marValue) {
public void setmarValue(String marValue) {
this.marValue = marValue;
}
/**
......@@ -427,7 +427,7 @@ public class HPBI001 extends DaoEPBase {
setyearValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(YEARVALUE)), yearValue));
setjanValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(JANVALUE)), janValue));
setfebValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FEBVALUE)), febValue));
setmarValue(NumberUtils.toInteger(StringUtils.toString(map.get(MARVLAUE)), marValue));
setmarValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(MARVLAUE)), marValue));
setaprValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(APRVALUE)), aprValue));
setmayValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(MAYVALUE)), mayValue));
setjunValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(JUNVALUE)), junValue));
......
......@@ -8,6 +8,7 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.bi.domain.HPBI001;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC001;
......@@ -70,16 +71,34 @@ public class ServiceHPBI001 extends ServiceBase {
EiInfo outInfo = new EiInfo();
try {
Map params = new HashMap();
params.put("factory", inInfo.getCellStr(EiConstant.queryBlock, 0, "factory"));
params.put("date", inInfo.getCellStr(EiConstant.queryBlock, 0, "date"));
params.put("factory", inInfo.get("factory")==null?"xxxx":inInfo.get("factory"));
params.put("date", inInfo.get("date")==null?"xxxx":inInfo.get("date"));
params.put("company_code", UserSessionUtils.getCompanyCode());
inInfo.setCell(EiConstant.queryBlock, 0, "company_code",UserSessionUtils.getCompanyCode());
inInfo.setCell(EiConstant.queryBlock, 0, "factory",inInfo.get("factory")==null?"xxxx":inInfo.get("factory"));
inInfo.setCell(EiConstant.queryBlock, 0, "date",inInfo.get("date")==null?"xxxx":inInfo.get("date"));
//汇总数据
outInfo = super.query(inInfo,"HPBI001.querySum",new HPBI001());
//if(!StringUtils.isEmpty(inInfo.getCellStr(EiConstant.queryBlock, 0, "date"))){
//每日数据
List mrsj= super.dao.query("HPBI001.queryDay", params);
String pro_name = "***";
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("VALUE");
}
}
}
params.put("pro_name", pro_name);
inInfo.setCell(EiConstant.queryBlock, 0, "pro_name",pro_name);
outInfo = super.query(inInfo,"HPBI001.querySum",new HPBI001());
//生产月报
List scyb= super.dao.query("HPBI001.queryMon", params);
List scyb= dao.query("HPBI001.queryMon", params);
outInfo.set("mrsj",mrsj);
outInfo.set("scyb",scyb);
// }
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......@@ -96,6 +115,7 @@ public class ServiceHPBI001 extends ServiceBase {
EiInfo outInfo = new EiInfo();
try {
Map params = new HashMap();
params.put("loginName", UserSession.getUserId());
//params.put("loginName", "QY000019");
//汇总数据
......
......@@ -17,97 +17,617 @@
<select id="querySum" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.bi.domain.HPBI001">
SELECT
INDNAME AS "indNmae",
DAYVALUE AS "dayValue",
MONVALUE AS "monValue",
YEARVALUE AS "yearValue",
JANVALUE AS "janValue",
FEBVALUE AS "febValue",
MARVLAUE AS "marValue",
APRVALUE AS "aprValue",
MAYVALUE AS "mayValue",
JUNVALUE AS "junValue",
JULVALUE AS "julValue",
AUGVALUE AS "augValue",
SEPVALUE AS "sepValue",
OCTVALUE AS "octValue",
NOVVALUE AS "novValue",
DECVALUE AS "decValue"
FROM (
SELECT '生产产量(吨)' AS INDNAME,121 AS DAYVALUE,
12 AS MONVALUE, 12 AS YEARVALUE,
12 AS JANVALUE, 12 AS FEBVALUE,
12 AS MARVLAUE, 12 AS APRVALUE,
12 AS MAYVALUE, 12 AS JUNVALUE,
12 AS JULVALUE, 12 AS AUGVALUE,
12 AS SEPVALUE, 12 AS OCTVALUE,
12 AS NOVVALUE, 12 AS DECVALUE,
'黄陂' AS FACTORY,
'' AS DATE
FROM DUAL
select
'生产人数(人)' AS indNmae,
(select
NUM as VALUE
FROM (select FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
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_name">
A.PROJ_NAME = #pro_name#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
A.DOCUMENT_DATE = replace(#date#,'-','')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factory">
B.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY DOCUMENT_DATE,FACTORY_CODE) 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
) AS dayValue,
(select
NUM as VALUE
FROM (select FACTORY_CODE,sum(ifnull(WEIGHT,0)) as VAULE
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_name">
A.PROJ_NAME = #pro_name#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
A.DOCUMENT_DATE <![CDATA[<=]]> replace(#date#,'-','')
AND left(DOCUMENT_DATE,6) = left(replace(#date#,'-',''),6)
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factory">
B.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),FACTORY_CODE) 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
) AS monValue,
(select
NUM as VALUE
FROM (select FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
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_name">
A.PROJ_NAME = #pro_name#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
A.DOCUMENT_DATE <![CDATA[<=]]> replace(#date#,'-','')
AND left(DOCUMENT_DATE,4) = left(replace(#date#,'-',''),4)
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factory">
B.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),FACTORY_CODE) 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
) AS yearValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '01' THEN NUM ELSE 0 END) as janValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '02' THEN NUM ELSE 0 END) as febValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '03' THEN NUM ELSE 0 END) as marValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '04' THEN NUM ELSE 0 END) as aprValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '05' THEN NUM ELSE 0 END) as mayValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '06' THEN NUM ELSE 0 END) as junValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '07' THEN NUM ELSE 0 END) as julValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '08' THEN NUM ELSE 0 END) as augValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '09' THEN NUM ELSE 0 END) as sepValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '10' THEN NUM ELSE 0 END) as octValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '11' THEN NUM ELSE 0 END) as novValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '12' THEN NUM ELSE 0 END) as decValue
FROM (select FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
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_name">
A.PROJ_NAME = #pro_name#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
A.DOCUMENT_DATE <![CDATA[<=]]> replace(#date#,'-','')
AND left(DOCUMENT_DATE,4) = left(replace(#date#,'-',''),4)
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factory">
B.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),FACTORY_CODE) 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
UNION ALL
SELECT '生产人数(人)' AS INDNAME,123 AS DAYVALUE,
13 AS MONVALUE, 13 AS YEARVALUE,
13 AS JANVALUE, 13 AS FEBVALUE,
13 AS MARVLAUE, 13 AS APRVALUE,
13 AS MAYVALUE, 13 AS JUNVALUE,
13 AS JULVALUE, 13 AS AUGVALUE,
13 AS SEPVALUE, 13 AS OCTVALUE,
13 AS NOVVALUE, 13 AS DECVALUE,
'黄陂' AS FACTORY,
'' AS DATE
FROM DUAL
select
'生产产量(吨)' AS indNmae,
(select
VALUE
FROM (select FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
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_name">
A.PROJ_NAME = #pro_name#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
A.DOCUMENT_DATE = replace(#date#,'-','')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factory">
B.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),FACTORY_CODE) 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
) AS dayValue,
(select
VALUE
FROM (select FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
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_name">
A.PROJ_NAME = #pro_name#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
A.DOCUMENT_DATE <![CDATA[<=]]> replace(#date#,'-','')
AND left(DOCUMENT_DATE,6) = left(replace(#date#,'-',''),6)
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factory">
B.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),FACTORY_CODE) 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
) AS monValue,
(select
VALUE
FROM (select FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
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_name">
A.PROJ_NAME = #pro_name#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
A.DOCUMENT_DATE <![CDATA[<=]]> replace(#date#,'-','')
AND left(DOCUMENT_DATE,4) = left(replace(#date#,'-',''),4)
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factory">
B.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),FACTORY_CODE) 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
) AS yearValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '01' THEN VALUE ELSE 0 END) as janValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '02' THEN VALUE ELSE 0 END) as febValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '03' THEN VALUE ELSE 0 END) as marValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '04' THEN VALUE ELSE 0 END) as aprValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '05' THEN VALUE ELSE 0 END) as mayValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '06' THEN VALUE ELSE 0 END) as junValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '07' THEN VALUE ELSE 0 END) as julValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '08' THEN VALUE ELSE 0 END) as augValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '09' THEN VALUE ELSE 0 END) as sepValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '10' THEN VALUE ELSE 0 END) as octValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '11' THEN VALUE ELSE 0 END) as novValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '12' THEN VALUE ELSE 0 END) as decValue
FROM (select FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
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_name">
A.PROJ_NAME = #pro_name#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
A.DOCUMENT_DATE <![CDATA[<=]]> replace(#date#,'-','')
AND left(DOCUMENT_DATE,4) = left(replace(#date#,'-',''),4)
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factory">
B.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),FACTORY_CODE) 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
UNION ALL
SELECT '人均产量(kg)' AS INDNAME,111 AS DAYVALUE,
14 AS MONVALUE, 14 AS YEARVALUE,
14 AS JANVALUE, 14 AS FEBVALUE,
14 AS MARVLAUE, 14 AS APRVALUE,
14 AS MAYVALUE, 14 AS JUNVALUE,
14 AS JULVALUE, 14 AS AUGVALUE,
14 AS SEPVALUE, 14 AS OCTVALUE,
14 AS NOVVALUE, 14 AS DECVALUE,
'黄陂' AS FACTORY,
'' AS DATE
FROM DUAL
) A
WHERE 1=1
<!-- <isNotEmpty prepend=" AND " property="factory">
FACTORY LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>-->
<!-- <isNotEmpty prepend=" AND " property="date">
DATE = #date#
</isNotEmpty>-->
select
'人均产量(kg)' AS indNmae,
(select
VALUE/NUM AS VALUE
FROM (select FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
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_name">
A.PROJ_NAME = #pro_name#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
A.DOCUMENT_DATE = replace(#date#,'-','')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factory">
B.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),FACTORY_CODE) 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
) AS dayValue,
(select
VALUE/NUM AS VALUE
FROM (select FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
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_name">
A.PROJ_NAME = #pro_name#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
A.DOCUMENT_DATE <![CDATA[<=]]> replace(#date#,'-','')
AND left(DOCUMENT_DATE,6) = left(replace(#date#,'-',''),6)
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factory">
B.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),FACTORY_CODE) 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
) AS monValue,
(select
VALUE/NUM AS VALUE
FROM (select FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
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_name">
A.PROJ_NAME = #pro_name#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
A.DOCUMENT_DATE <![CDATA[<=]]> replace(#date#,'-','')
AND left(DOCUMENT_DATE,4) = left(replace(#date#,'-',''),4)
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factory">
B.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),FACTORY_CODE) 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
) AS yearValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '01' THEN VALUE/NUM ELSE 0 END) as janValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '02' THEN VALUE/NUM ELSE 0 END) as febValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '03' THEN VALUE/NUM ELSE 0 END) as marValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '04' THEN VALUE/NUM ELSE 0 END) as aprValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '05' THEN VALUE/NUM ELSE 0 END) as mayValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '06' THEN VALUE/NUM ELSE 0 END) as junValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '07' THEN VALUE/NUM ELSE 0 END) as julValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '08' THEN VALUE/NUM ELSE 0 END) as augValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '09' THEN VALUE/NUM ELSE 0 END) as sepValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '10' THEN VALUE/NUM ELSE 0 END) as octValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '11' THEN VALUE/NUM ELSE 0 END) as novValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '12' THEN VALUE/NUM ELSE 0 END) as decValue
FROM (select FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
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_name">
A.PROJ_NAME = #pro_name#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
A.DOCUMENT_DATE <![CDATA[<=]]> replace(#date#,'-','')
AND left(DOCUMENT_DATE,4) = left(replace(#date#,'-',''),4)
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factory">
B.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),FACTORY_CODE) 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
<dynamic prepend="ORDER BY">
<isEmpty property="orderBy">
INDNAME desc
indNmae desc
</isEmpty>
</dynamic>
</select>
<select id="queryDay" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT
SERIES,
VALUE
FROM (
SELECT '工厂' AS SERIES,'黄陂' AS VALUE,NULL AS FACTORY,NULL AS DATE, 1 AS SORT FROM DUAL
UNION ALL
SELECT '生产项目' AS SERIES,CONCAT('横沥10墩底模、沪宁合空心墩') AS VALUE,NULL AS FACTORY,NULL AS DATE, 2 AS SORT FROM DUAL
UNION ALL
SELECT '生产产量' AS SERIES,'组拼 :14.730吨 综合 :15.220吨 加焊 :15.710吨' AS VALUE,NULL AS FACTORY,NULL AS DATE, 3 AS SORT FROM DUAL
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,'26人' AS VALUE,NULL AS FACTORY,NULL AS DATE, 4 AS SORT FROM DUAL
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,'585kg' AS VALUE,NULL AS FACTORY,NULL AS DATE, 5 AS SORT FROM DUAL
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
WHERE 1=1
<!-- <isNotEmpty prepend=" AND " property="factory">
FACTORY LIKE CONCAT('%',CONCAT( #factory#,'%'))
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">
DATE = #date#
</isNotEmpty>-->
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
......@@ -117,56 +637,118 @@
<select id="queryMon" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT
INDCODE,
SERIES,
X,
VAULE
FROM (
select 'sccl' as INDCODE, '生产产量(吨)' as SERIES,'1月' as X,100 as VAULE from dual
union all
select 'scrs' as INDCODE, '生产人数(个)' as SERIES,'1月' as X,100 as VAULE from dual
union all
select 'rjcl' as INDCODE, '人均产量(kg)' as SERIES,'1月' as X,100 as VAULE from dual
union all
select 'sccl' as INDCODE, '生产产量(吨)' as SERIES,'2月' as X,110 as VAULE from dual
union all
select 'scrs' as INDCODE, '生产人数(个)' as SERIES,'2月' as X,110 as VAULE from dual
union all
select 'rjcl' as INDCODE, '人均产量(kg)' as SERIES,'2月' as X,110 as VAULE from dual
union all
select 'sccl' as INDCODE, '生产产量(吨)' as SERIES,'3月' as X,120 as VAULE from dual
union all
select 'scrs' as INDCODE, '生产人数(个)' as SERIES,'3月' as X,120 as VAULE from dual
union all
select 'rjcl' as INDCODE, '人均产量(kg)' as SERIES,'3月' as X,120 as VAULE from dual
union all
select 'sccl' as INDCODE, '生产产量(吨)' as SERIES,'4月' as X,130 as VAULE from dual
union all
select 'scrs' as INDCODE, '生产人数(个)' as SERIES,'4月' as X,130 as VAULE from dual
union all
select 'rjcl' as INDCODE, '人均产量(kg)' as SERIES,'4月' as X,130 as VAULE from dual
union all
select 'sccl' as INDCODE, '生产产量(吨)' as SERIES,'5月' as X,140 as VAULE from dual
union all
select 'scrs' as INDCODE, '生产人数(个)' as SERIES,'5月' as X,140 as VAULE from dual
union all
select 'rjcl' as INDCODE, '人均产量(kg)' as SERIES,'5月' as X,140 as VAULE from dual
union all
select 'sccl' as INDCODE, '生产产量(吨)' as SERIES,'6月' as X,150 as VAULE from dual
union all
select 'scrs' as INDCODE, '生产人数(个)' as SERIES,'6月' as X,150 as VAULE from dual
union all
select 'rjcl' as INDCODE, '人均产量(kg)' as SERIES,'6月' as X,150 as VAULE from dual
) A
WHERE 1=1
<!-- <isNotEmpty prepend=" AND " property="factory">
FACTORY LIKE CONCAT('%',CONCAT( #factory#,'%'))
select
'sccl' as INDCODE,
'生产产量(吨)' as SERIES,
case when substring(DOCUMENT_DATE,5,1) = 0
then concat(substring(DOCUMENT_DATE,6,1),'月')
else concat(substring(DOCUMENT_DATE,5,2),'月')
end as X,
VAULE as VALUE
FROM (select FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
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_name">
A.PROJ_NAME = #pro_name#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
DATE = #date#
</isNotEmpty>-->
A.DOCUMENT_DATE = replace(#date#,'-','')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factory">
B.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),FACTORY_CODE) 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
UNION ALL
select
'scrs' as INDCODE,
'生产人数(个)' as SERIES,
case when substring(DOCUMENT_DATE,5,1) = 0
then concat(substring(DOCUMENT_DATE,6,1),'月')
else concat(substring(DOCUMENT_DATE,5,2),'月')
end as X,
NUM as VALUE
FROM (select FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
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_name">
A.PROJ_NAME = #pro_name#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
A.DOCUMENT_DATE = replace(#date#,'-','')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factory">
B.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),FACTORY_CODE) 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
UNION ALL
select
'rjcl' as INDCODE,
'人均产量(kg)' as SERIES,
case when substring(DOCUMENT_DATE,5,1) = 0
then concat(substring(DOCUMENT_DATE,6,1),'月')
else concat(substring(DOCUMENT_DATE,5,2),'月')
end as X,
VAULE/NUM as VALUE
FROM (select FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
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_name">
A.PROJ_NAME = #pro_name#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
A.DOCUMENT_DATE = replace(#date#,'-','')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factory">
B.FACTORY_CODE LIKE CONCAT('%',CONCAT( #factory#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),FACTORY_CODE) 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
<dynamic prepend="ORDER BY">
<isEmpty property="orderBy">
X asc
......
$(function () {
var myChart ='';
$(function () {
$(document).ready(function() {
$("#inqu_status-0-date").data("kendoDatePicker").value(new Date());
});
//$("#inqu_status-date").data("kendoDatePicker").value(new Date());
//$(element) .data("kendoDatePicker").value(Date)
$("#QUERY").click();
//$("#QUERY").click();
/* $("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
buildOption("scrb");
......@@ -12,12 +13,15 @@ $(function () {
$("#QUERY").on("click", function (e) {
//resultGrid.dataSource.page(1);
var inInfo = new EiInfo();
inInfo.set("date",$("#inqu_status-0-date").val());
inInfo.set("factory",$("#inqu_status-0-factory").val());
EiCommunicator.send("HPBI001","query", inInfo, {
// 服务调用成功后的回调函数 onSuccess
onSuccess: function(response){
$('#mrsj').empty();
var mrsj = response.get('mrsj');
var scyb = response.get('scyb');
if(mrsj.length>0){
$.each(mrsj, function(index, item) {
str =
'<tr>' +
......@@ -26,8 +30,15 @@ $(function () {
'</tr>';
$('#mrsj').append(str);
})
buildOption("scrb",scyb);
resultGrid.dataSource.page(1);
}
if(scyb.length>0) {
buildOption("scrb", scyb);
}else{
if (myChart != null && myChart.dispose) {
myChart.dispose();
}
}
resultGrid.setEiInfo(response);
},
// 服务调用失败后的回调函数 onFail
onFail: function(errorMsg, status, e) {
......@@ -76,14 +87,15 @@ function buildOption(vid,data){
$.each(data, function(index, item) {
if(item.INDCODE == 'sccl'){
x_data.push(item.X);
y_data1.push(item.VAULE);
y_data1.push(item.VALUE);
}else if(item.INDCODE == 'scrs'){
y_data2.push(item.VAULE);
y_data2.push(item.VALUE);
}else if(item.INDCODE == 'rjcl'){
y_data3.push(item.VAULE);
y_data3.push(item.VALUE);
}
})
var myChart = echarts.init(document.getElementById(vid));
myChart = echarts.init(document.getElementById(vid));
var colors = ['#5470C6', '#91CC75', '#EE6666'];
var option = {
title: {
......@@ -145,5 +157,5 @@ function buildOption(vid,data){
}
]
};
myChart.setOption(option, true);
myChart.setOption(option, false);
}
......@@ -13,23 +13,12 @@
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<%-- <EF:EFSelect cname="工厂" defaultValue="0" ename="inqu_status-0-factory" colWidth="3">
<EF:EFOption label="黄陂" value="黄陂"/>
<EF:EFOption label="红安" value="红安"/>
</EF:EFSelect>--%>
<EF:EFSelect cname="工厂" ename="inqu_status-0-factory" colWidth="3" filter="contains">
<%--<EF:EFOption label="全部" value=""/>--%>
<EF:EFSelect cname="工厂" ename="factory" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<%-- <EF:EFSelect cname="仓库名称" ename="inqu_status-0-whCode" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>--%>
<EF:EFDatePicker ename="inqu_status-0-date" colWidth="3" cname="日期:"
<EF:EFDatePicker ename="date" blockId="inqu_status" row="0" colWidth="3" cname="日期:"
format="yyyy-MM-dd"/>
</div>
<%-- <EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>--%>
</EF:EFRegion>
<EF:EFRegion id="result1" title="每日数据">
......
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