Browse Source

1.毛利润修改

heqinwei 7 years ago
parent
commit
25b225dd22

+ 14 - 1
applications/money/money-server/src/main/resources/mapper/ProfitdetailMapper.xml

@@ -77,6 +77,19 @@ prodinout.companyid= prodiodetail.companyid and prodiodetail.companyid = prodino
 
 
 	<select id="selectCalculateFields" resultType="string">
 	<select id="selectCalculateFields" resultType="string">
 		SELECT ${fields}
 		SELECT ${fields}
+		FROM
+		(
+		SELECT
+		a.pi_custcode,
+		a.pi_custname,
+		a.cu_type,
+		a.cu_sellername,
+		a.saamount,
+		a.netamount,
+		a.costamount,
+		SUM(a.netamount - a.costamount) as profit,
+		(SUM(a.netamount - a.costamount)/IFNULL(netamount,SUM(netamount - costamount))) as profitpresent
+
 		FROM
 		FROM
 		(
 		(
 		SELECT
 		SELECT
@@ -117,7 +130,7 @@ prodinout.companyid= prodiodetail.companyid and prodiodetail.companyid = prodino
 		a.pi_custcode,
 		a.pi_custcode,
 		a.pi_custname,
 		a.pi_custname,
 		a.cu_type,
 		a.cu_type,
-		a.cu_sellername
+		a.cu_sellername)b
 	</select>
 	</select>
 
 
 </mapper>
 </mapper>