Pārlūkot izejas kodu

面料损耗更新

fenghaifu 2 gadi atpakaļ
vecāks
revīzija
6e6189858d

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/mapper/FabricLossMapper.java

@@ -117,6 +117,7 @@ public interface FabricLossMapper extends BaseMapper<FabricLoss> {
 
 	// 获取形态转换物料的原始入库单
 	@DS("multi-three")
+	@InterceptorIgnore(tenantLine = "1")
 	List<FabricAssemVouchsOrgIn> getAssemVouchsOrgInList(@Param("invIdList")List<String> invIdList);
 	// 根据入库单子表id获取采购入库价格
 	@DS("multi-three")

+ 38 - 38
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/mapper/xml/FabricLossMapper.xml

@@ -342,44 +342,44 @@
 	</select>
 	<!-- 获取形态转换物料的原始入库单 -->
 	<select id="getAssemVouchsOrgInList" resultType="org.jeecg.modules.report.entity.FabricAssemVouchsOrgIn">
-
-		(
-		select  'rdrecords01' as cTableName,b.AutoId,a.cBusType,
-		b.cInvCode+isnull(b.cFree1,'')+isnull(b.cBatch,'') as cInvIdBefore,
-		c.cInvCode2+c.cColor2+c.cAVBatch2 as cInvIdAfter,c.iAVQuantity/c.iAVQuantity2 as iRate
-		from VIEW_FabricLoss_AssemVouchs c,rdrecords01 b,rdrecord01 a,Vendor d, VendorClass e
-		where a.id=b.id and d.cVenCode=a.cVenCode and d.cVCCode =e.cVCCode
-		and c.cinvcode+ccolor+cavbatch=b.cinvcode +isnull(b.cFree1,'')+isnull(b.cBatch,'') and b.iQuantity &lt;&gt; 0
-		and c.cInvCode2+c.cColor2+c.cAVBatch2 in
-		<foreach  item="item" collection="invIdList" index="index"  open="(" separator="," close=")">
-			#{item}
-		</foreach>
-		) union all (
-		select  'rdrecords08' as cTableName,b.AutoId,a.cBusType,
-		b.cInvCode+isnull(b.cFree1,'')+isnull(b.cBatch,'') as cInvIdBefore,
-		c.cInvCode2+c.cColor2+c.cAVBatch2 as cInvIdAfter,c.iAVQuantity/c.iAVQuantity2 as iRate
-		from VIEW_FabricLoss_AssemVouchs c,rdrecords08 b,rdrecord08 a
-		where a.id=b.id
-		and c.cinvcode+ccolor+cavbatch=b.cinvcode +isnull(b.cFree1,'')+isnull(b.cBatch,'') and a.cbustype= '其他入库'
-		and b.iQuantity &lt;&gt; 0
-		and c.cInvCode2+c.cColor2+c.cAVBatch2 in
-		<foreach  item="item" collection="invIdList" index="index"  open="(" separator="," close=")">
-			#{item}
-		</foreach>
-		) union all (
-		select  'rdrecords08' as cTableName,b.AutoId,a.cBusType,
-		b.cInvCode+isnull(b.cFree1,'')+isnull(b.cBatch,'') as cInvIdBefore,
-		c.cInvCode2+c.cColor2+c.cAVBatch2 as cInvIdAfter,c.iAVQuantity/c.iAVQuantity2 as iRate
-		from VIEW_FabricLoss_AssemVouchs c,rdrecords08 b,rdrecord08 a
-		where a.id=b.id
-		and c.cinvcode+ccolor+cavbatch=b.cinvcode +isnull(b.cFree1,'')+isnull(b.cBatch,'') and a.cbustype = '转换入库'
-		and b.iQuantity &lt;&gt; 0
-		and c.cInvCode2+c.cColor2+c.cAVBatch2 in
-		<foreach  item="item" collection="invIdList" index="index"  open="(" separator="," close=")">
-			#{item}
-		</foreach>
-		)
-
+		select * from (
+			(
+			select 'rdrecords01' as cTableName,b.AutoId,a.cBusType,
+			b.cInvCode+isnull(b.cFree1,'')+isnull(b.cBatch,'') as cInvIdBefore,
+			c.cInvCode2+c.cColor2+c.cAVBatch2 as cInvIdAfter,c.iAVQuantity/c.iAVQuantity2 as iRate
+			from VIEW_FabricLoss_AssemVouchs c,rdrecords01 b,rdrecord01 a,Vendor d, VendorClass e
+			where a.id=b.id and d.cVenCode=a.cVenCode and d.cVCCode =e.cVCCode
+			and c.cinvcode+ccolor+cavbatch=b.cinvcode +isnull(b.cFree1,'')+isnull(b.cBatch,'') and b.iQuantity &lt;&gt; 0
+			and c.cInvCode2+c.cColor2+c.cAVBatch2 in
+			<foreach item="item" collection="invIdList" index="index" open="(" separator="," close=")">
+				#{item}
+			</foreach>
+			) union all (
+			select 'rdrecords08' as cTableName,b.AutoId,a.cBusType,
+			b.cInvCode+isnull(b.cFree1,'')+isnull(b.cBatch,'') as cInvIdBefore,
+			c.cInvCode2+c.cColor2+c.cAVBatch2 as cInvIdAfter,c.iAVQuantity/c.iAVQuantity2 as iRate
+			from VIEW_FabricLoss_AssemVouchs c,rdrecords08 b,rdrecord08 a
+			where a.id=b.id
+			and c.cinvcode+ccolor+cavbatch=b.cinvcode +isnull(b.cFree1,'')+isnull(b.cBatch,'') and a.cbustype= '其他入库'
+			and b.iQuantity &lt;&gt; 0
+			and c.cInvCode2+c.cColor2+c.cAVBatch2 in
+			<foreach item="item" collection="invIdList" index="index" open="(" separator="," close=")">
+				#{item}
+			</foreach>
+			) union all (
+			select 'rdrecords08' as cTableName,b.AutoId,a.cBusType,
+			b.cInvCode+isnull(b.cFree1,'')+isnull(b.cBatch,'') as cInvIdBefore,
+			c.cInvCode2+c.cColor2+c.cAVBatch2 as cInvIdAfter,c.iAVQuantity/c.iAVQuantity2 as iRate
+			from VIEW_FabricLoss_AssemVouchs c,rdrecords08 b,rdrecord08 a
+			where a.id=b.id
+			and c.cinvcode+ccolor+cavbatch=b.cinvcode +isnull(b.cFree1,'')+isnull(b.cBatch,'') and a.cbustype = '转换入库'
+			and b.iQuantity &lt;&gt; 0
+			and c.cInvCode2+c.cColor2+c.cAVBatch2 in
+			<foreach item="item" collection="invIdList" index="index" open="(" separator="," close=")">
+				#{item}
+			</foreach>
+			)
+		) as t1 order by ctablename,autoid,cbustype,cinvidbefore
 
 	</select>
 	<!-- 根据入库单子表id获取采购入库价格 -->