Commit 661921db by wancheng

生产日报页面优化

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