From cebd0bf5dcd808efae268d088f3cb1879cccac9d Mon Sep 17 00:00:00 2001 From: "ZHOUZ\\Noble'lift" <1014987728@qq.com> Date: Wed, 16 Nov 2022 15:43:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/nl/wms/st/outbill/wql/ST_OUTIVT01.wql | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT01.wql b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT01.wql index 1b7b91496..0148fd1fc 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT01.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT01.wql @@ -92,15 +92,16 @@ IF 输入.flag = "2" QUERY - SELECT + SELECT * from (SELECT attr.storagevehicle_code, - attr.struct_id, - sum(ivt.canuse_qty) AS canuse_qty, - ivt.material_id + MAX( attr.struct_id ) AS struct_id, + sum( ivt.canuse_qty ) AS canuse_qty, + MAX( ivt.material_id ) AS material_id, + MAX(ivt.instorage_time ) AS instorage_time FROM ST_IVT_StructIvt ivt LEFT JOIN ST_IVT_StructAttr attr ON attr.struct_id = ivt.struct_id - LEFT JOIN PDM_BI_SubPackageRelation sub ON attr.storagevehicle_code = sub.package_box_SN + LEFT JOIN PDM_BI_SubPackageRelation sub ON attr.storagevehicle_code = sub.package_box_SN AND ivt.pcsn = sub.container_name WHERE ivt.quality_scode = '01' AND attr.lock_type = '1' @@ -126,9 +127,9 @@ attr.block_num = 输入.block_num ENDOPTION - group by attr.storagevehicle_code + group by attr.storagevehicle_code) a - order by ivt.instorage_time ASC + order by a.instorage_time ASC ENDSELECT ENDQUERY