| 
					
				 | 
			
			
				@@ -3,6 +3,56 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <mapper namespace="org.jeecg.modules.productionScheduleReport.mapper.ProductionScheduleMapper"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="selectByPage" resultType="org.jeecg.modules.productionScheduleReport.entity.ProductionSchedule"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        select -- top 100 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              c.cDepName -- 部门 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,d.cPersonName -- 业务员 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,a.cSOCode -- 销售订单号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,p.PlanCode planCode-- 计划单号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,e.cCusName -- 客户 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,a.cDefine12 -- 成衣加工厂 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.cInvCode -- 存货编码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,f.cInvName -- 存货名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.cDefine22 itemNumber -- 款号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.cFree1 color-- 颜色 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,min(a.dPreDateBT) dPreDateBT -- 交期 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,sum(b.iQuantity) iQuantity --订单数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,sum(b.iTaxUnitPrice) iTaxUnitPrice -- 原币含税单价 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,sum(b.iSum) total_sum -- 总额(原币) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,sum(b.iNatSum/b.iQuantity) bb_price -- 单价(本币) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,sum(b.iNatSum) iNatSum -- 总额(本币) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,sum(b.icostsum) icostsum -- 实际发票成本 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,sum(b.foutquantity) foutquantity --已出库数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,sum(b.iKPQuantity) iKPQuantity --累计开票数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,sum(b.iKPMoney) iKPMoney -- 累计开票金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,f.pictureGUid pictureId -- 图片id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,min(a.dDate) dDate -- 单据日期 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        from SO_SOMain a 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 left join SO_SODetails b on a.id = b.id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 left join mps_netdemand m on a.cSOCode = m.SoCode and m.OrgDemSeq = b.iRowNo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 left join mps_plancode p on m.ProjectId = p.plancodeid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 left join Department c on c.cDepCode = a.cDepCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 left join person d on d.cPersonCode = a.cPersonCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 left join Customer e on e.cCusCode = a.cCusCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 left join Inventory f on f.cInvCode = b.cInvCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ${ew.customSqlSegment} and p.plancode is not null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        group by 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            c.cDepName -- 部门 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               ,d.cPersonName -- 业务员 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               ,a.cSOCode -- 销售订单号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               ,e.cCusName -- 客户 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               ,a.cDefine12 -- 成衣加工厂 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               ,b.cInvCode -- 存货编码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               ,f.cInvName -- 存货名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               ,b.cDefine22 -- 款号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               ,b.cFree1-- 颜色 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               ,f.pictureGUid -- 图片id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                ,p.PlanCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   <select id="selectByPageXXXXX" resultType="org.jeecg.modules.productionScheduleReport.entity.ProductionSchedule"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         select --top 100 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             c.cDepName -- 部门 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -40,4 +90,65 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="selectPicture" resultType="org.jeecg.modules.productionScheduleReport.entity.ProductionSchedule"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         select picture,cPicturetype from aa_picture where cGUid = #{pictureId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <select id="selectCaiGou" resultType="org.jeecg.modules.productionScheduleReport.entity.ProductionScheduleCaiGou"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        select 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             '903' accId -- 账套信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,a.cPOID -- 采购订单号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			 ,c.cVenName -- 供应商名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.cInvCode -- 存货编码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iNatUnitPrice -- 本币单价 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,d.cInvName -- 存货名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iQuantity iQuantityLrp -- 计划数量(lrp) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iQuantity -- 数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iReceivedQTY -- 累计入库数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iInvQTY -- 累计开票数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iInvMoney -- 累计开票金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.csocode -- 下游订单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iReceivedQTY  -- 使用数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iQuantity - b.iReceivedQTY as surplusQty -- 余料 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        from PO_Pomain a 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 left join PO_Podetails b on a.POID = b.POID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 left join Vendor c on a.cVenCode = c.cVenCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 left join Inventory d on d.cInvCode = b.cInvCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        where b.planlotnumber = #{planNumber} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <select id="selectWeiWai" resultType="org.jeecg.modules.productionScheduleReport.entity.ProductionScheduleWeiWai"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        select 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               '903' accId -- 账套信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,a.cCode -- 委外订单号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			 ,c.cVenName -- 供应商名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.cInvCode -- 物料编码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,d.cInvName -- 存货名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.cFree1 color -- 颜色 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.cFree4 -- 门幅 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iUnitPrice -- 原币单价 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iNatUnitPrice -- 本币单价 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iQuantity iQuantityLrp -- 计划数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iQuantity -- 数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iReceivedQTY -- 累计入库数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iInvQTY -- 累计开票数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iInvMoney -- 累计开票金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.csocode -- 下游订单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iMaterialSendQty   -- 使用数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,b.iQuantity - b.iMaterialSendQty as surplusQty -- 余料 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,e.cInvCode cInvCodeZi --子件编码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,f.cInvName cInvNameZi -- 子件名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,e.iQuantity iQuantityZi -- 子件应领数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,e.iSendQTY -- 子件已领数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,0 costZi -- 成本 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             ,0 purchaseCode -- 采购订单号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        from OM_MOMain a 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 left join OM_MODetails b on a.MOID = b.MOID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 left join Vendor c on a.cVenCode = c.cVenCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 left join Inventory d on d.cInvCode = b.cInvCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 left join OM_MOMaterials e on e.MoDetailsID = b.MoDetailsID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 left join Inventory f on f.cInvCode = e.cInvCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        where b.cPlanLotNumber = #{planNumber} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </mapper> 
			 |