|
@@ -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>
|