fix(库存明细报表/库存汇总报表):添加汇总数量
This commit is contained in:
parent
58050bbcbe
commit
c448cb5ea6
@ -262,5 +262,10 @@ public class DocumentDetailReportDto {
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime modifyDateTime2;
|
||||
|
||||
|
||||
/**
|
||||
* 总量
|
||||
*/
|
||||
@ExcelProperty("总量")
|
||||
private BigDecimal totalQty;
|
||||
}
|
||||
|
||||
@ -173,5 +173,11 @@ public class DocumentSummaryReportDto {
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime modifyDateTime2;
|
||||
|
||||
/**
|
||||
* 总量
|
||||
*/
|
||||
@ExcelProperty("总量")
|
||||
private BigDecimal totalQty;
|
||||
|
||||
}
|
||||
|
||||
@ -20,6 +20,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
@ -63,8 +64,46 @@ public class DocumentReportServiceImpl extends ServiceImpl<DocumentReportMapper,
|
||||
LocalDateTime createDateTime2 = dto.getCreateDateTime2();
|
||||
LocalDateTime modifyDateTime1 = dto.getModifyDateTime1();
|
||||
LocalDateTime modifyDateTime2 = dto.getModifyDateTime2();
|
||||
|
||||
return baseMapper.selectDocumentSummary(iPage, site, documentNoList, externalDocumentNoList, documentTypeList, stateList, createUserList, updateUserList, itemList, sourceWarehouseList, targetWarehouseList, salesBatchList, iqcResultsList, createDateTime1, createDateTime2, modifyDateTime1, modifyDateTime2);
|
||||
|
||||
IPage<DocumentSummaryReportDto> documentSummaryReportDtoIPage = baseMapper.selectDocumentSummary(iPage, site,
|
||||
documentNoList,
|
||||
externalDocumentNoList,
|
||||
documentTypeList,
|
||||
stateList,
|
||||
createUserList,
|
||||
updateUserList,
|
||||
itemList,
|
||||
sourceWarehouseList,
|
||||
targetWarehouseList,
|
||||
salesBatchList,
|
||||
iqcResultsList,
|
||||
createDateTime1,
|
||||
createDateTime2,
|
||||
modifyDateTime1,
|
||||
modifyDateTime2);
|
||||
|
||||
|
||||
if (CollectionUtil.isNotEmpty(documentSummaryReportDtoIPage.getRecords())) {
|
||||
BigDecimal totalQty = baseMapper.selectDocumentSummaryTotalQty(site,
|
||||
documentNoList,
|
||||
externalDocumentNoList,
|
||||
documentTypeList,
|
||||
stateList,
|
||||
createUserList,
|
||||
updateUserList,
|
||||
itemList,
|
||||
sourceWarehouseList,
|
||||
targetWarehouseList,
|
||||
salesBatchList,
|
||||
iqcResultsList,
|
||||
createDateTime1,
|
||||
createDateTime2,
|
||||
modifyDateTime1,
|
||||
modifyDateTime2);
|
||||
documentSummaryReportDtoIPage.getRecords().get(0).setTotalQty(totalQty);
|
||||
}
|
||||
|
||||
return documentSummaryReportDtoIPage;
|
||||
}
|
||||
|
||||
//导出
|
||||
@ -142,8 +181,65 @@ public class DocumentReportServiceImpl extends ServiceImpl<DocumentReportMapper,
|
||||
LocalDateTime modifyDateTime2 = dto.getModifyDateTime2();
|
||||
List<String> updateUserList = splitSearchField(dto.getUpdateUser());
|
||||
List<String> iqcResultsList = splitSearchField(dto.getIqcResults());
|
||||
|
||||
return baseMapper.selectDocumentDetail(iPage,site,documentNoList,externalDocumentNoList,documentTypeList,stateList,palletList,inventoryIdList,salesBatchList,itemList,inspectionOrderNoList,qualityInspectionStatusList,batchNumberList,vendorBatchList,sourceWarehouseList,sourceLocationList,storageBinList,targetWarehouseList,targetLocationList,targetBinList,createUserList,createDateTime1,createDateTime2,updateUserList,modifyDateTime1,modifyDateTime2, iqcResultsList);
|
||||
|
||||
IPage<DocumentDetailReportDto> documentDetailReportDtoIPage = baseMapper.selectDocumentDetail(iPage, site,
|
||||
documentNoList,
|
||||
externalDocumentNoList,
|
||||
documentTypeList,
|
||||
stateList,
|
||||
palletList,
|
||||
inventoryIdList,
|
||||
salesBatchList,
|
||||
itemList,
|
||||
inspectionOrderNoList,
|
||||
qualityInspectionStatusList,
|
||||
batchNumberList,
|
||||
vendorBatchList,
|
||||
sourceWarehouseList,
|
||||
sourceLocationList,
|
||||
storageBinList,
|
||||
targetWarehouseList,
|
||||
targetLocationList,
|
||||
targetBinList,
|
||||
createUserList,
|
||||
createDateTime1,
|
||||
createDateTime2,
|
||||
updateUserList,
|
||||
modifyDateTime1,
|
||||
modifyDateTime2,
|
||||
iqcResultsList);
|
||||
|
||||
if (CollectionUtil.isNotEmpty(documentDetailReportDtoIPage.getRecords())) {
|
||||
BigDecimal totalQty = baseMapper.retrieveTotalQty(site,
|
||||
documentNoList,
|
||||
externalDocumentNoList,
|
||||
documentTypeList,
|
||||
stateList,
|
||||
palletList,
|
||||
inventoryIdList,
|
||||
salesBatchList,
|
||||
itemList,
|
||||
inspectionOrderNoList,
|
||||
qualityInspectionStatusList,
|
||||
batchNumberList,
|
||||
vendorBatchList,
|
||||
sourceWarehouseList,
|
||||
sourceLocationList,
|
||||
storageBinList,
|
||||
targetWarehouseList,
|
||||
targetLocationList,
|
||||
targetBinList,
|
||||
createUserList,
|
||||
createDateTime1,
|
||||
createDateTime2,
|
||||
updateUserList,
|
||||
modifyDateTime1,
|
||||
modifyDateTime2,
|
||||
iqcResultsList);
|
||||
documentDetailReportDtoIPage.getRecords().get(0).setTotalQty(totalQty);
|
||||
}
|
||||
|
||||
return documentDetailReportDtoIPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -9,6 +9,7 @@ import com.foreverwin.mom.wms.entity.WareHouse;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@ -83,4 +84,35 @@ public interface DocumentReportMapper extends BaseMapper<DocumentDetailed> {
|
||||
, @Param("modifyDateTimeFrom") LocalDateTime modifyDateTimeFrom
|
||||
, @Param("modifyDateTimeTo") LocalDateTime modifyDateTimeTo
|
||||
, @Param("iqcResultsList") List<String> iqcResultsList);
|
||||
|
||||
|
||||
BigDecimal retrieveTotalQty(@Param("site") String site
|
||||
, @Param("documentNoList") List<String> documentNoList
|
||||
, @Param("externalDocumentNoList") List<String> externalDocumentNoList
|
||||
, @Param("documentTypeList") List<String> documentTypeList
|
||||
, @Param("stateList") List<String> stateList
|
||||
, @Param("palletList") List<String> palletList
|
||||
, @Param("inventoryIdList") List<String> inventoryIdList
|
||||
, @Param("salesBatchList") List<String> salesBatchList
|
||||
, @Param("itemList") List<String> itemList
|
||||
, @Param("inspectionOrderNoList") List<String> inspectionOrderNoList
|
||||
, @Param("qualityInspectionStatusList") List<String> qualityInspectionStatusList
|
||||
, @Param("batchNumberList") List<String> batchNumberList
|
||||
, @Param("vendorBatchList") List<String> vendorBatchList
|
||||
, @Param("sourceWarehouseList") List<String> sourceWarehouseList
|
||||
, @Param("sourceLocationList") List<String> sourceLocationList
|
||||
, @Param("storageBinList") List<String> storageBinList
|
||||
, @Param("targetWarehouseList") List<String> targetWarehouseList
|
||||
, @Param("targetLocationList") List<String> targetLocationList
|
||||
, @Param("targetBinList") List<String> targetBinList
|
||||
, @Param("createUserList") List<String> createUserList
|
||||
, @Param("createDateTimeFrom") LocalDateTime createDateTimeFrom
|
||||
, @Param("createDateTimeTo") LocalDateTime createDateTimeTo
|
||||
, @Param("updateUserList") List<String> updateUserList
|
||||
, @Param("modifyDateTimeFrom") LocalDateTime modifyDateTimeFrom
|
||||
, @Param("modifyDateTimeTo") LocalDateTime modifyDateTimeTo
|
||||
, @Param("iqcResultsList") List<String> iqcResultsList);
|
||||
|
||||
BigDecimal selectDocumentSummaryTotalQty(@Param("site") String site, @Param("documentNoList") List<String> documentNoList, @Param("externalDocumentNoList") List<String> externalDocumentNoList, @Param("documentTypeList") List<String> documentTypeList, @Param("stateList") List<String> stateList, @Param("createUserList") List<String> createUserList, @Param("updateUserList") List<String> updateUserList, @Param("itemList") List<String> itemList, @Param("sourceWarehouseList") List<String> sourceWarehouseList, @Param("targetWarehouseList") List<String> targetWarehouseList, @Param("salesBatchList") List<String> salesBatchList, @Param("iqcResultsList") List<String> iqcResultsList, @Param("createDateTime1") LocalDateTime createDateTime1, @Param("createDateTime2") LocalDateTime createDateTime3, @Param("modifyDateTime1") LocalDateTime modifyDateTime1, @Param("modifyDateTime2") LocalDateTime modifyDateTime2);
|
||||
|
||||
}
|
||||
|
||||
@ -418,4 +418,286 @@
|
||||
</where>
|
||||
ORDER BY WW.WAREHOUSE ASC
|
||||
</select>
|
||||
<select id="retrieveTotalQty" resultType="java.math.BigDecimal">
|
||||
SELECT SUM(ZDS.QTY)
|
||||
FROM Z_DOCUMENT ZD
|
||||
LEFT JOIN WMS_DN_ORDER WDO ON WDO.SITE =ZD.SITE AND WDO.DN_NUMBER = ZD.EXTERNAL_DOCUMENT_NO
|
||||
LEFT JOIN Z_DOCUMENT_DETAILED ZDD ON ZD.DOCUMENT_NO = ZDD.DOCUMENT_NO AND ZDD.SITE = ZD.SITE
|
||||
LEFT JOIN Z_DOCUMENT_SFC ZDS ON ZDD.DOCUMENT_NO = ZDS.DOCUMENT_NO AND ZDD.SEQ = ZDS.SEQ AND ZDS.SITE = ZDD.SITE
|
||||
LEFT JOIN MOMX.SYS_USER USR ON USR.USERNAME = ZD.CREATE_USER and USR.TENANT_ID = ZD.SITE
|
||||
LEFT JOIN MOMX.SYS_USER USR2 ON USR2.USERNAME = ZDD.UPDATE_USER and USR2.TENANT_ID = ZDD.SITE
|
||||
LEFT JOIN WMS_INVENTORY WI ON WI.SITE = ZDS.SITE AND WI.INVENTORY_ID = ZDS.SFC
|
||||
LEFT JOIN WIP.ITEM I ON I.SITE = ZDS.SITE AND I.ITEM = ZDS.ITEM AND I.CURRENT_REVISION = 'Y'
|
||||
WHERE ZD.SITE = #{site}
|
||||
<if test="documentNoList != null and documentNoList.size > 0">
|
||||
AND ZD.DOCUMENT_NO IN
|
||||
<foreach collection="documentNoList" item="documentNo" open="(" separator="," close=")">
|
||||
#{documentNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="externalDocumentNoList != null and externalDocumentNoList.size > 0">
|
||||
AND ZD.EXTERNAL_DOCUMENT_NO IN
|
||||
<foreach collection="externalDocumentNoList" item="externalDocumentNo" open="(" separator="," close=")">
|
||||
#{externalDocumentNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="documentTypeList != null and documentTypeList.size > 0">
|
||||
AND ZD.DOCUMENT_TYPE IN
|
||||
<foreach collection="documentTypeList" item="documentType" open="(" separator="," close=")">
|
||||
#{documentType}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="stateList != null and stateList.size > 0">
|
||||
AND ZD.STATE IN
|
||||
<foreach collection="stateList" item="state" open="(" separator="," close=")">
|
||||
#{state}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="palletList != null and palletList.size > 0">
|
||||
AND ZDS.GRADE_ONE_CARRIER IN
|
||||
<foreach collection="palletList" item="pallet" open="(" separator="," close=")">
|
||||
#{pallet}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="inventoryIdList != null and inventoryIdList.size > 0">
|
||||
AND ZDS.SFC IN
|
||||
<foreach collection="inventoryIdList" item="inventoryId" open="(" separator="," close=")">
|
||||
#{inventoryId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="salesBatchList != null and salesBatchList.size > 0">
|
||||
AND ZDD.SALES_BATCH IN
|
||||
<foreach collection="salesBatchList" item="salesBatch" open="(" separator="," close=")">
|
||||
#{salesBatch}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="itemList != null and itemList.size > 0">
|
||||
AND ZDS.ITEM IN
|
||||
<foreach collection="itemList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="inspectionOrderNoList != null and inspectionOrderNoList.size > 0">
|
||||
AND ZDD.INSPECTION_ORDER_NO IN
|
||||
<foreach collection="inspectionOrderNoList" item="inspectionOrderNo" open="(" separator="," close=")">
|
||||
#{inspectionOrderNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="qualityInspectionStatusList != null and qualityInspectionStatusList.size > 0">
|
||||
AND ZDS.QUALITY_INSPECTION_STATUS IN
|
||||
<foreach collection="qualityInspectionStatusList" item="qualityInspectionStatus" open="(" separator=","
|
||||
close=")">
|
||||
#{qualityInspectionStatus}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="batchNumberList != null and batchNumberList.size > 0">
|
||||
AND ZDS.BATCH_NUMBER IN
|
||||
<foreach collection="batchNumberList" item="batchNumber" open="(" separator="," close=")">
|
||||
#{batchNumber}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="vendorBatchList != null and vendorBatchList.size > 0">
|
||||
AND ZDS.VENDOR_BATCH IN
|
||||
<foreach collection="vendorBatchList" item="vendorBatch" open="(" separator="," close=")">
|
||||
#{vendorBatch}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sourceWarehouseList != null and sourceWarehouseList.size > 0">
|
||||
AND ZDS.SOURCE_WAREHOUSE IN
|
||||
<foreach collection="sourceWarehouseList" item="sourceWarehouse" open="(" separator="," close=")">
|
||||
#{sourceWarehouse}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sourceLocationList != null and sourceLocationList.size > 0">
|
||||
AND ZDS.SOURCE_LOCATION IN
|
||||
<foreach collection="sourceLocationList" item="sourceLocation" open="(" separator="," close=")">
|
||||
#{sourceLocation}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="storageBinList != null and storageBinList.size > 0">
|
||||
AND ZDS.STORAGE_BIN IN
|
||||
<foreach collection="storageBinList" item="storageBin" open="(" separator="," close=")">
|
||||
#{storageBin}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="targetWarehouseList != null and targetWarehouseList.size > 0">
|
||||
AND ZDS.TARGET_WAREHOUSE IN
|
||||
<foreach collection="targetWarehouseList" item="targetWarehouse" open="(" separator="," close=")">
|
||||
#{targetWarehouse}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="targetLocationList != null and targetLocationList.size > 0">
|
||||
AND ZDS.TARGET_LOCATION IN
|
||||
<foreach collection="targetLocationList" item="targetLocation" open="(" separator="," close=")">
|
||||
#{targetLocation}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="targetBinList != null and targetBinList.size > 0">
|
||||
AND ZDS.TARGET_BIN IN
|
||||
<foreach collection="targetBinList" item="targetBin" open="(" separator="," close=")">
|
||||
#{targetBin}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="createUserList != null and createUserList.size > 0">
|
||||
AND ZD.CREATE_USER IN
|
||||
<foreach collection="createUserList" item="createUser" open="(" separator="," close=")">
|
||||
#{createUser}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="updateUserList != null and updateUserList.size > 0">
|
||||
AND ZDD.UPDATE_USER IN
|
||||
<foreach collection="updateUserList" item="updateUser" open="(" separator="," close=")">
|
||||
#{updateUser}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="createDateTimeFrom!= null">
|
||||
AND ZD.CREATE_DATE >= #{createDateTimeFrom}
|
||||
</if>
|
||||
<if test="createDateTimeTo!= null">
|
||||
AND ZD.CREATE_DATE <= #{createDateTimeTo}
|
||||
</if>
|
||||
<if test="modifyDateTimeFrom!= null">
|
||||
AND ZDD.UPDATE_DATE >= #{modifyDateTimeFrom}
|
||||
</if>
|
||||
<if test="modifyDateTimeTo!= null">
|
||||
AND ZDD.UPDATE_DATE <= #{modifyDateTimeTo}
|
||||
</if>
|
||||
<if test="iqcResultsList != null and iqcResultsList.size > 0">
|
||||
AND ZDD.IQC_RESULTS IN
|
||||
<foreach collection="iqcResultsList" item="iqcResults" open="(" separator="," close=")">
|
||||
#{iqcResults}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectDocumentSummaryTotalQty" resultType="java.math.BigDecimal">
|
||||
WITH A AS (
|
||||
SELECT
|
||||
ZD.SITE ,-- 站点
|
||||
ZD.DOCUMENT_NO ,-- 单据号
|
||||
ZD.EXTERNAL_DOCUMENT_NO ,-- 外部单据号
|
||||
ZD.DOCUMENT_TYPE ,-- 单据类型
|
||||
ZD.STATE ,-- 单据状态
|
||||
ZD.CREATE_USER ,-- 创建人
|
||||
ZD.CREATE_DATE, -- 创建时间
|
||||
ZDD.SEQ ,-- 单据行号
|
||||
ZDD.STATE AS SEQ_STATE,-- 单据行状态
|
||||
ZDD.ITEM ,-- 物料
|
||||
I.DESCRIPTION AS ITEM_DESCRIPTION , -- 物料描述
|
||||
ZDD.BATCH ,-- 需求批次
|
||||
ZDD.UNIT_OF_MEASURE ,-- 单位
|
||||
ZDD.APPLICATIONS_QUANTITY ,-- 需求数量
|
||||
ZDD.ACTUAL_QUANTITY ,-- 实际数量
|
||||
ZDD.SOURCE_WAREHOUSE ,-- 来源仓
|
||||
ZDD.TARGET_WAREHOUSE ,-- 目标仓
|
||||
ZDD.SALES_BATCH ,-- 出货批次
|
||||
ZDD.REMARKS ,-- 备注
|
||||
ZDD.IQC_RESULTS ,-- IQC
|
||||
ZDD.OQC_RESULTS ,-- OQC
|
||||
ZDD.UPDATE_USER ,-- 更新人
|
||||
ZDD.UPDATE_DATE, -- 更新时间
|
||||
IFNULL(USR.NAME, ZD.CREATE_USER) AS CREATE_USER_NAME, -- 创建人名称
|
||||
IFNULL(USR2.NAME, ZD.UPDATE_USER) AS UPDATE_USER_NAME, -- 更新人名称
|
||||
ZDD.SALES_ORDER, -- 更新时间
|
||||
ZDD.SALES_ORDER_SEQ, -- 更新时间
|
||||
ZDD.TARGET_SALES_ORDER, -- 更新时间
|
||||
ZDD.TARGET_SALES_ORDER_SEQ, -- 更新时间
|
||||
ZDD.EXTERNAL_SEQ, -- 更新时间
|
||||
SUBSTRING_INDEX(ZDD.SHOP_ORDER_BO, ',', -1) AS SHOP_ORDER, -- 生产订单
|
||||
ZDD.INVENTORY_SPECIAL_MARKING -- 特殊库存标识
|
||||
FROM Z_DOCUMENT ZD
|
||||
INNER JOIN Z_DOCUMENT_DETAILED ZDD ON ZDD.DOCUMENT_BO = ZD.HANDLE
|
||||
INNER JOIN WIP.ITEM I ON I.SITE = ZDD.SITE AND I.ITEM = ZDD.ITEM AND I.CURRENT_REVISION = 'Y'
|
||||
LEFT JOIN MOMX.SYS_USER USR ON USR.USERNAME = ZD.CREATE_USER and USR.TENANT_ID = ZD.SITE
|
||||
LEFT JOIN MOMX.SYS_USER USR2 ON USR2.USERNAME = ZDD.UPDATE_USER and USR2.TENANT_ID = ZDD.SITE
|
||||
WHERE ZD.SITE = #{site}
|
||||
<if test="documentNoList != null and documentNoList.size > 0">
|
||||
AND zd.DOCUMENT_NO IN
|
||||
<foreach collection="documentNoList" item="documentNo" open="(" separator="," close=")">
|
||||
#{documentNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="externalDocumentNoList != null and externalDocumentNoList.size > 0">
|
||||
AND zd.EXTERNAL_DOCUMENT_NO IN
|
||||
<foreach collection="externalDocumentNoList" item="externalDocumentNo" open="(" separator="," close=")">
|
||||
#{externalDocumentNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="documentTypeList != null and documentTypeList.size > 0">
|
||||
AND zd.DOCUMENT_TYPE IN
|
||||
<foreach collection="documentTypeList" item="documentType" open="(" separator="," close=")">
|
||||
#{documentType}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="stateList != null and stateList.size > 0">
|
||||
AND zd.STATE IN
|
||||
<foreach collection="stateList" item="state" open="(" separator="," close=")">
|
||||
#{state}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="createUserList != null and createUserList.size > 0">
|
||||
AND zd.CREATE_USER IN
|
||||
<foreach collection="createUserList" item="createUser" open="(" separator="," close=")">
|
||||
#{createUser}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="updateUserList != null and updateUserList.size > 0">
|
||||
AND zdd.UPDATE_USER IN
|
||||
<foreach collection="updateUserList" item="updateUser" open="(" separator="," close=")">
|
||||
#{updateUser}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="itemList != null and itemList.size > 0">
|
||||
AND zdd.ITEM IN
|
||||
<foreach collection="itemList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sourceWarehouseList != null and sourceWarehouseList.size > 0">
|
||||
AND zdd.SOURCE_WAREHOUSE IN
|
||||
<foreach collection="sourceWarehouseList" item="sourceWarehouse" open="(" separator="," close=")">
|
||||
#{sourceWarehouse}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="targetWarehouseList != null and targetWarehouseList.size > 0">
|
||||
AND zdd.TARGET_WAREHOUSE IN
|
||||
<foreach collection="targetWarehouseList" item="targetWarehouse" open="(" separator="," close=")">
|
||||
#{targetWarehouse}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="salesBatchList != null and salesBatchList.size > 0">
|
||||
AND zdd.SALES_BATCH IN
|
||||
<foreach collection="salesBatchList" item="salesBatch" open="(" separator="," close=")">
|
||||
#{salesBatch}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="iqcResultsList != null and iqcResultsList.size > 0">
|
||||
AND ZDD.IQC_RESULTS IN
|
||||
<foreach collection="iqcResultsList" item="iqcResults" open="(" separator="," close=")">
|
||||
#{iqcResults}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="createDateTime1!= null">
|
||||
AND zd.CREATE_DATE >= #{createDateTime1}
|
||||
</if>
|
||||
<if test="createDateTime2!= null">
|
||||
AND zd.CREATE_DATE <= #{createDateTime2}
|
||||
</if>
|
||||
<if test="modifyDateTime1!= null">
|
||||
AND zdd.UPDATE_DATE >= #{modifyDateTime1}
|
||||
</if>
|
||||
<if test="modifyDateTime2!= null">
|
||||
AND zdd.UPDATE_DATE <= #{modifyDateTime2}
|
||||
</if>
|
||||
),
|
||||
B AS (
|
||||
SELECT ZDS.SITE, ZDS.DOCUMENT_NO
|
||||
FROM Z_DOCUMENT_SFC ZDS
|
||||
INNER JOIN A A ON A.SITE = ZDS.SITE AND A.DOCUMENT_NO = ZDS.DOCUMENT_NO AND A.SEQ = ZDS.SEQ
|
||||
GROUP BY ZDS.SITE, ZDS.DOCUMENT_NO
|
||||
)
|
||||
SELECT SUM(A.ACTUAL_QUANTITY)
|
||||
FROM A
|
||||
LEFT JOIN B B ON B.SITE = A.SITE AND B.DOCUMENT_NO = A.DOCUMENT_NO
|
||||
ORDER BY A.DOCUMENT_NO DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user