Commit 3fd2dbfd by liuyang

2024-10-16 添加生产驾驶舱接口

parent c62da236
...@@ -289,4 +289,49 @@ public class ServiceHGSC007 extends ServiceEPBase { ...@@ -289,4 +289,49 @@ public class ServiceHGSC007 extends ServiceEPBase {
} }
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "生产驾驶舱", operType = "工序日产量", operDesc = "工序日产量")
public EiInfo getByProcessWt(EiInfo inInfo) {
try {
EiBlock queryRow = inInfo.getBlock(EiConstant.queryBlock);
String depositDate = queryRow.getCellStr(ACConstants.ROW_CODE_0, "depositDate");
if (StringUtils.isEmpty(depositDate)) {
queryRow.setCell(ACConstants.ROW_CODE_0,"depositDate",depositDate);
}
inInfo = super.query(inInfo, "HGSC007.queryByWt");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "生产驾驶舱", operType = "工序累计产量", operDesc = "工序累计产量")
public EiInfo queryBySunWt(EiInfo inInfo) {
try {
EiBlock queryRow = inInfo.getBlock(EiConstant.queryBlock);
String depositDate = queryRow.getCellStr(ACConstants.ROW_CODE_0, "depositDate");
if (StringUtils.isEmpty(depositDate)) {
queryRow.setCell(ACConstants.ROW_CODE_0,"depositDate",depositDate);
}
inInfo = super.query(inInfo, "HGSC007.queryBySunWt");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "生产驾驶舱", operType = "7日综合产量", operDesc = "7日综合产量")
public EiInfo getByProcessDayWt(EiInfo inInfo) {
try {
EiBlock queryRow = inInfo.getBlock(EiConstant.queryBlock);
String depositDate = queryRow.getCellStr(ACConstants.ROW_CODE_0, "depositDate");
if (StringUtils.isEmpty(depositDate)) {
queryRow.setCell(ACConstants.ROW_CODE_0,"depositDate",depositDate);
}
inInfo = super.query(inInfo, "HGSC007.queryByDayWt");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
} }
...@@ -1043,4 +1043,168 @@ ...@@ -1043,4 +1043,168 @@
group by a.proj_code, a.proj_name, a.finish_date, a.updated_time group by a.proj_code, a.proj_name, a.finish_date, a.updated_time
order by a.updated_time desc order by a.updated_time desc
</select> </select>
<!--工序日产量-->
<select id="queryByWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
A.process_name as "processName",
ROUND(ifnull(SUM(B.INV_WEIGHT),0)/1000, 4) "totalWeight"
from ${hggpSchema}.HGGY001 A
join ${platSchema}.TXSOG01 C on A.FACTORY_CODE = C.COMPANY_CODE
left join (
select
h2.process_code ,
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include refid="appCondition"/>
<include refid="appOrderCondition"/>
<isNotEmpty prepend=" AND " property="depositDate">
h.DEPOSIT_DATE = #depositDate#
</isNotEmpty>
group by h2.process_code
) B on A.process_code = B.process_code
where 1=1
<isNotEmpty prepend=" AND " property="accountCode">
A.account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
C.factory_name = #factoryName#
</isNotEmpty>
group by
A.process_name
</select>
<!--工序累计产量-->
<select id="queryBySunWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
A.process_name as "processName",
ROUND(ifnull(SUM(B.INV_WEIGHT),0)/1000, 4) "totalWeight"
from ${hggpSchema}.HGGY001 A
join ${platSchema}.TXSOG01 C on A.FACTORY_CODE = C.COMPANY_CODE
left join (
select
h2.process_code ,
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include refid="appCondition"/>
<include refid="appOrderCondition"/>
<isNotEmpty prepend=" AND " property="depositDate">
left(h.DEPOSIT_DATE,6) = left(#depositDate#,6)
</isNotEmpty>
group by h2.process_code
) B on A.process_code = B.process_code
where 1=1
<isNotEmpty prepend=" AND " property="accountCode">
A.account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
C.factory_name = #factoryName#
</isNotEmpty>
group by
A.process_name
</select>
<!--日期到条件7天日产量-->
<select id="queryByDayWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
A.DEPOSIT_DATE as "depositDate",
ROUND(ifnull(SUM(A.INV_WEIGHT),0)/1000, 4) "totalWeight"
from (
select
replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 6 day), '-', '') as "DEPOSIT_DATE",
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include refid="appCondition"/>
<include refid="appOrderCondition"/>
<isNotEmpty prepend=" AND " property="depositDate">
h.DEPOSIT_DATE = replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 6 day), '-', '')
</isNotEmpty>
UNION ALL
select
replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 5 day), '-', '') as "DEPOSIT_DATE",
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include refid="appCondition"/>
<include refid="appOrderCondition"/>
<isNotEmpty prepend=" AND " property="depositDate">
h.DEPOSIT_DATE = replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 5 day), '-', '')
</isNotEmpty>
UNION ALL
select
replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 4 day), '-', '') as "DEPOSIT_DATE",
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include refid="appCondition"/>
<include refid="appOrderCondition"/>
<isNotEmpty prepend=" AND " property="depositDate">
h.DEPOSIT_DATE = replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 4 day), '-', '')
</isNotEmpty>
UNION ALL
select
replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 3 day), '-', '') as "DEPOSIT_DATE",
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include refid="appCondition"/>
<include refid="appOrderCondition"/>
<isNotEmpty prepend=" AND " property="depositDate">
h.DEPOSIT_DATE = replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 3 day), '-', '')
</isNotEmpty>
UNION ALL
select
replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 2 day), '-', '') as "DEPOSIT_DATE",
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include refid="appCondition"/>
<include refid="appOrderCondition"/>
<isNotEmpty prepend=" AND " property="depositDate">
h.DEPOSIT_DATE = replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 2 day), '-', '')
</isNotEmpty>
UNION ALL
select
replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 1 day), '-', '') as "DEPOSIT_DATE",
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include refid="appCondition"/>
<include refid="appOrderCondition"/>
<isNotEmpty prepend=" AND " property="depositDate">
h.DEPOSIT_DATE = replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 1 day), '-', '')
</isNotEmpty>
UNION ALL
select
#depositDate# as "DEPOSIT_DATE",
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include refid="appCondition"/>
<include refid="appOrderCondition"/>
<isNotEmpty prepend=" AND " property="depositDate">
h.DEPOSIT_DATE = #depositDate#
</isNotEmpty>
) A
group by A.DEPOSIT_DATE
</select>
</sqlMap> </sqlMap>
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