| 
					
				 | 
			
			
				@@ -5,10 +5,10 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="selectByPage" resultType="org.jeecg.modules.productionScheduleReport.entity.ProductionSchedule"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 select t.* from ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-SELECT  max(o.omCode) as planCode,max(c.PictureGUID) as pictureId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+SELECT  max(o.omCode) as planCode,max(c.PictureGUID) as pictureId,'901' as account,sum(s.finquantity) as finquantity, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         max(ss.csocode) as cSOCode,max(de.cDepName) as cDepName,max(pe.cPersonName) as cPersonName,max(s.icostsum) as icostsum, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         max(v.cVenName) as cDefine12,max(s.cInvCode) as cInvCode,max(s.cInvName) as cInvName,max(s.cdefine22) as itemNumber, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        max(s.cFree1) as color,max(s.dPreDate) as dPreDateBT,sum(s.iQuantity) as iQuantity,max(s.iTaxUnitPrice) as iTaxUnitPrice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        max(s.cFree1) as color,min(s.dPreDate) as dPreDateBT,sum(s.iQuantity) as iQuantity,max(round(s.iTaxUnitPrice,4)) as iTaxUnitPrice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         sum(s.iSum) as totalSum,max(s.iNatUnitPrice) as bbPrice,max(s.iNatSum) as iNatSum,sum(s.foutquantity) as foutquantity,sum(s.iKPQuantity) as iKPQuantity 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            FROM  UFDATA_901_2021.dbo.SO_SODetails s 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         inner JOIN UFDATA_901_2021.dbo.SO_SOMain ss on ss.ID= s.ID 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -30,13 +30,13 @@ SELECT  max(o.omCode) as planCode,max(c.PictureGUID) as pictureId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         inner JOIN UFDATA_901_2021.dbo.Department de ON ss.cDepCode = de.cDepCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         inner JOIN UFDATA_901_2021.dbo.Customer cc ON ss.cCusCode = cc.cCusCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ${ew.customSqlSegment} and c.cInvCcode like '19%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         GROUP BY v.cVenName 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         GROUP BY ss.csocode,o.omCode,s.cInvCode,s.cFree1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         union all 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        SELECT max(o.omCode) as planCode,max(c.PictureGUID) as pictureId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT max(o.omCode) as planCode,max(c.PictureGUID) as pictureId,'902' as account,sum(s.finquantity) as finquantity, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         max(ss.csocode) as cSOCode,max(de.cDepName) as cDepName,max(pe.cPersonName) as cPersonName,max(s.icostsum) as icostsum, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         max(v.cVenName) as cDefine12,max(s.cInvCode) as cInvCode,max(s.cInvName) as cInvName,max(s.cdefine22) as itemNumber, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        max(s.cFree1) as color,max(s.dPreDate) as dPreDateBT,sum(s.iQuantity) as iQuantity,max(s.iTaxUnitPrice) as iTaxUnitPrice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        max(s.cFree1) as color,min(s.dPreDate) as dPreDateBT,sum(s.iQuantity) as iQuantity,max(round(s.iTaxUnitPrice,4)) as iTaxUnitPrice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         sum(s.iSum) as totalSum,max(s.iNatUnitPrice) as bbPrice,max(s.iNatSum) as iNatSum,sum(s.foutquantity) as foutquantity,sum(s.iKPQuantity) as iKPQuantity 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         FROM  UFDATA_903_2021.dbo.SO_SODetails a 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         inner JOIN UFDATA_903_2021.dbo.SO_SOMain b on b.ID= a.ID 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -64,14 +64,14 @@ SELECT  max(o.omCode) as planCode,max(c.PictureGUID) as pictureId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         inner JOIN UFDATA_902_2021.dbo.Customer cu ON ss.cCusCode = cu.cCusCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ${ew.customSqlSegment} and  cc.cCusCode in ('T020001','0001') and ss.cCusCode not in ('T020001','0001') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         and c.cInvCcode like '19%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        GROUP BY v.cVenName 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           GROUP BY ss.csocode,o.omCode,s.cInvCode,s.cFree1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         union all 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        SELECT max(o.omCode) as planCode,max(c.PictureGUID) as pictureId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT max(o.omCode) as planCode,max(c.PictureGUID) as pictureId,'903' as account,sum(s.finquantity) as finquantity, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         max(ss.csocode) as cSOCode,max(de.cDepName) as cDepName,max(pe.cPersonName) as cPersonName,max(s.icostsum) as icostsum, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         max(v.cVenName) as cDefine12,max(s.cInvCode) as cInvCode,max(s.cInvName) as cInvName,max(s.cdefine22) as itemNumber, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        max(s.cFree1) as color,max(s.dPreDate) as dPreDateBT,sum(s.iQuantity) as iQuantity,max(s.iTaxUnitPrice) as iTaxUnitPrice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        max(s.cFree1) as color,min(s.dPreDate) as dPreDateBT,sum(s.iQuantity) as iQuantity,max(round(s.iTaxUnitPrice,4)) as iTaxUnitPrice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         sum(s.iSum) as totalSum,max(s.iNatUnitPrice) as bbPrice,max(s.iNatSum) as iNatSum,sum(s.foutquantity) as foutquantity,sum(s.iKPQuantity) as iKPQuantity 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         FROM  UFDATA_903_2021.dbo.SO_SODetails a 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         inner JOIN UFDATA_903_2021.dbo.SO_SOMain b on b.ID= a.ID 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -99,7 +99,7 @@ SELECT  max(o.omCode) as planCode,max(c.PictureGUID) as pictureId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         inner JOIN UFDATA_901_2021.dbo.Customer cu ON ss.cCusCode = cu.cCusCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           ${ew.customSqlSegment} and cc.cCusCode in ('T020001','0001') and ss.cCusCode not in ('T020001','0001')  and c.cInvCcode like '19%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        GROUP BY v.cVenName ) t 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            GROUP BY ss.csocode,o.omCode,s.cInvCode,s.cFree1) t 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    <select id="selectByPageXXXXX" resultType="org.jeecg.modules.productionScheduleReport.entity.ProductionSchedule"> 
			 |