| 
														
															@@ -6,16 +6,16 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         de.cDepName, 
														 | 
														
														 | 
														
															         de.cDepName, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         cc.cCusAbbName as cVenAbbName, 
														 | 
														
														 | 
														
															         cc.cCusAbbName as cVenAbbName, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         convert(char(7),ssd.dPreDate,120) yearMonth, 
														 | 
														
														 | 
														
															         convert(char(7),ssd.dPreDate,120) yearMonth, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        ssd.iNatUnitPrice, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        ssd.iTaxUnitPrice*ss.iExchRate as iNatUnitPrice, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         sum(ssd.iQuantity) as iQuantity, 
														 | 
														
														 | 
														
															         sum(ssd.iQuantity) as iQuantity, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        sum(ssd.iNatUnitPrice*ssd.iQuantity) as iNatMoney 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        sum(ssd.iTaxUnitPrice*ss.iExchRate*ssd.iQuantity) as iNatMoney 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         FROM 
														 | 
														
														 | 
														
															         FROM 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         SO_SOMain ss 
														 | 
														
														 | 
														
															         SO_SOMain ss 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         LEFT JOIN ( 
														 | 
														
														 | 
														
															         LEFT JOIN ( 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         SELECT 
														 | 
														
														 | 
														
															         SELECT 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         case when cSCloser is null then iQuantity else foutquantity end as iQuantity, 
														 | 
														
														 | 
														
															         case when cSCloser is null then iQuantity else foutquantity end as iQuantity, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         iNatMoney, 
														 | 
														
														 | 
														
															         iNatMoney, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        iNatUnitPrice, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        iTaxUnitPrice, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         dPreDate, 
														 | 
														
														 | 
														
															         dPreDate, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         ID 
														 | 
														
														 | 
														
															         ID 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         FROM 
														 | 
														
														 | 
														
															         FROM 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -42,23 +42,23 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             and cc.cCusAbbName = #{map.customer} 
														 | 
														
														 | 
														
															             and cc.cCusAbbName = #{map.customer} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         </if> 
														 | 
														
														 | 
														
															         </if> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         </where> 
														 | 
														
														 | 
														
															         </where> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        GROUP BY de.cDepName,ss.cCusCode,convert(char(7),ssd.dPreDate,120),ssd.iNatUnitPrice,cc.cCusAbbName 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        GROUP BY de.cDepName,ss.cCusCode,convert(char(7),ssd.dPreDate,120),ssd.iTaxUnitPrice,cc.cCusAbbName 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         --ORDER BY 
														 | 
														
														 | 
														
															         --ORDER BY 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        --de.cDepName,ss.cCusCode,CONVERT ( CHAR ( 7 ), ssd.dPreDate, 120 ),ssd.iNatUnitPrice 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        --de.cDepName,ss.cCusCode,CONVERT ( CHAR ( 7 ), ssd.dPreDate, 120 ),ssd.iTaxUnitPrice 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     </select> 
														 | 
														
														 | 
														
															     </select> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     <select id="QuerySO_SOMainReportBydepartment" resultType="org.jeecg.modules.report.entity.SoSoDetails"> 
														 | 
														
														 | 
														
															     <select id="QuerySO_SOMainReportBydepartment" resultType="org.jeecg.modules.report.entity.SoSoDetails"> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         SELECT 
														 | 
														
														 | 
														
															         SELECT 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         cc.cCusAbbName  as cCusName, 
														 | 
														
														 | 
														
															         cc.cCusAbbName  as cCusName, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         sum(ssd.iQuantity) as iQuantity, 
														 | 
														
														 | 
														
															         sum(ssd.iQuantity) as iQuantity, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        sum(ssd.iNatUnitPrice*ssd.iQuantity) as iNatMoney 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        sum(ssd.iTaxUnitPrice*ss.iExchRate*ssd.iQuantity) as iNatMoney 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         FROM 
														 | 
														
														 | 
														
															         FROM 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         SO_SOMain ss 
														 | 
														
														 | 
														
															         SO_SOMain ss 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         LEFT JOIN ( 
														 | 
														
														 | 
														
															         LEFT JOIN ( 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         SELECT 
														 | 
														
														 | 
														
															         SELECT 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         case when cSCloser is null then iQuantity else foutquantity end as iQuantity, 
														 | 
														
														 | 
														
															         case when cSCloser is null then iQuantity else foutquantity end as iQuantity, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         iNatMoney, 
														 | 
														
														 | 
														
															         iNatMoney, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        iNatUnitPrice, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        iTaxUnitPrice, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         dPreDate, 
														 | 
														
														 | 
														
															         dPreDate, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         ID 
														 | 
														
														 | 
														
															         ID 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         FROM 
														 | 
														
														 | 
														
															         FROM 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -93,14 +93,14 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         SELECT 
														 | 
														
														 | 
														
															         SELECT 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         de.cDepName, 
														 | 
														
														 | 
														
															         de.cDepName, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         sum(ssd.iQuantity) as iQuantity, 
														 | 
														
														 | 
														
															         sum(ssd.iQuantity) as iQuantity, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        sum(ssd.iNatUnitPrice*ssd.iQuantity) as iNatMoney 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        sum(ssd.iTaxUnitPrice*ss.iExchRate*ssd.iQuantity) as iNatMoney 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         FROM 
														 | 
														
														 | 
														
															         FROM 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         SO_SOMain ss 
														 | 
														
														 | 
														
															         SO_SOMain ss 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         LEFT JOIN ( 
														 | 
														
														 | 
														
															         LEFT JOIN ( 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         SELECT 
														 | 
														
														 | 
														
															         SELECT 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         case when cSCloser is null then iQuantity else foutquantity end as iQuantity, 
														 | 
														
														 | 
														
															         case when cSCloser is null then iQuantity else foutquantity end as iQuantity, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         iNatMoney, 
														 | 
														
														 | 
														
															         iNatMoney, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        iNatUnitPrice, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        iTaxUnitPrice, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         dPreDate, 
														 | 
														
														 | 
														
															         dPreDate, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         ID 
														 | 
														
														 | 
														
															         ID 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         FROM 
														 | 
														
														 | 
														
															         FROM 
														 |