Commit c798cd9b by liuyang

2024-10-23 委外制造加工表

parent ab598c48
package com.baosight.hggp.hg.sc.service;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
/**
......@@ -8,4 +9,14 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
* @description 委外制造加工表
*/
public class ServiceHGSC012 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
return super.query(inInfo, "HGSC012.query");
}
}
......@@ -2,4 +2,112 @@
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSC012">
<select id="query" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
h.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
h.COMPANY_NAME as "companyName", <!-- 公司名称 -->
h.CONTRACT_DATE as "contractDate", <!-- 委托日期 -->
h.CONTRACT_CODE as "contractCode", <!-- 委托单号 -->
h.SUP_CODE as "supCode", <!-- 供应商编码 -->
h.SUP_NAME as "supName", <!-- 供应商名称 -->
h.INVENT_CODE as "lcinventCode", <!-- 原料编码 -->
h.INVENT_NAME as "lcinventName", <!-- 原料名称 -->
h.SPEC_CL as "lcspec",
h.OUT_QTY as "jhckQty", <!-- 出库数量 -->
h.OUT_WEIGHT as "jhckWeight", <!-- 出库重量 -->
hd.OUT_DATE as "outDate", <!-- 出库日期 -->
hd.OUT_QTY as "sjckoutQty", <!-- 出库数量 -->
hd.OUT_WEIGHT as "sjckoutWeight", <!-- 出库重量 -->
h.PRODUCT_CODE as "productCode", <!-- 成品编码 -->
h.PRODUCT_NAME as "productName", <!-- 成品名称 -->
h.SPEC_CP as "rkspec", <!-- 规格 -->
h.DEPOSIT_QTY as "jhrkdepositQty", <!-- 计划入库数量 -->
h.DEPOSIT_WEIGHT as "jhrkdepositWeight", <!-- 计划入库重量 -->
hc.DEPOSIT_DATE as "depositDate", <!-- 入库日期 -->
hc.ACTUAL_QTY as "actualQty", <!-- 实际入库数量 -->
hc.DEPOSIT_WEIGHT as "depositWeight" <!-- 实际入库重量 -->
from (
select
h.COMPANY_CODE ,
h.COMPANY_NAME ,
h.CONTRACT_DATE ,
h.CONTRACT_CODE ,
h.SUP_CODE ,
h.SUP_NAME ,
h.SUB_STATUS,
hb.INVENT_CODE ,
hb.INVENT_NAME ,
hb.SPEC as "SPEC_CL",
hb.OUT_QTY ,
hb.OUT_WEIGHT ,
ha.PRODUCT_CODE ,
ha.PRODUCT_NAME ,
ha.SPEC as "SPEC_CP",
ha.DEPOSIT_QTY ,
ha.DEPOSIT_WEIGHT
from hggp.hgsc010 h
left join hggp.hgsc010a ha on h.ID = ha.PARENT_ID AND h.ACCOUNT_CODE = ha.ACCOUNT_CODE
left join hggp.hgsc010b hb on h.ID = hb.PARENT_ID AND h.ACCOUNT_CODE = ha.ACCOUNT_CODE and ha.INVENT_CODE = hb.INVENT_CODE
where h.SUB_STATUS = 1
<isNotEmpty prepend=" AND " property="accountCode">
h.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
h.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
h.COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractDate">
h.CONTRACT_DATE = #contractDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractCode">
h.CONTRACT_CODE like concat('%',#contractCode#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="supCode">
h.SUP_CODE = #supCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="supName">
h.SUP_NAME = #supName#
</isNotEmpty>
) h
left join (
select
h2.OUT_DATE,
ha2.CONTRACT_CODE ,
ha2.INVENT_CODE ,
ha2.INVENT_NAME ,
ha2.SPEC,
ha2.OUT_QTY ,
ha2.OUT_WEIGHT
from hggp.hgkc015 h2
inner join hggp.hgkc015a ha2 on h2.OUT_CODE = ha2.OUT_CODE
where STATUS = 1 and h2.DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="accountCode">
h2.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractCode">
h2.CONTRACT_CODE like concat('%',#contractCode#,'%')
</isNotEmpty>
) hd on h.CONTRACT_CODE = hd.CONTRACT_CODE and h.INVENT_CODE = hd.INVENT_CODE
left join (
select
h2.DEPOSIT_DATE,
ha2.CONTRACT_CODE,
ha2.PRODUCT_CODE,
ha2.PRODUCT_NAME,
ha2.SPEC,
ha2.ACTUAL_QTY,
ha2.ACTUAL_QTY*ha2.DEPOSIT_UNIT_WEIGHT as "DEPOSIT_WEIGHT"
from hggp.hgkc014 h2
inner join hggp.hgkc014a ha2 on h2.DEPOSIT_CODE = ha2.DEPOSIT_CODE
where h2.STATUS = 3 and h2.DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="accountCode">
h2.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractCode">
h2.CONTRACT_CODE like concat('%',#contractCode#,'%')
</isNotEmpty>
) hc on h.CONTRACT_CODE = hc.CONTRACT_CODE and h.PRODUCT_CODE = hc.PRODUCT_CODE
</select>
</sqlMap>
\ No newline at end of file
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