|
|
@@ -1415,12 +1415,13 @@ ORDER BY
|
|
|
|
|
|
<select id="corpStatisticsItem" resultType="org.springblade.purchase.sales.vo.OrderStatisticsVo">
|
|
|
SELECT
|
|
|
- BO.create_time as createTime,
|
|
|
+ BO.id as id,
|
|
|
+ BO.receipt_time as createTime,
|
|
|
BO.order_no as orderNo,
|
|
|
BOI.quantity AS quantity,
|
|
|
BO.debit_amount AS amount,
|
|
|
BOI.actualQuantity AS actualQuantity,
|
|
|
- BOI.arrivalAmount AS arrivalAmount
|
|
|
+ Round(BOI.arrivalAmount,2) AS arrivalAmount
|
|
|
FROM
|
|
|
business_order BO
|
|
|
LEFT JOIN (
|
|
|
@@ -1462,11 +1463,11 @@ ORDER BY
|
|
|
<if test="statisticsVo.corpName != null and statisticsVo.corpName != ''">
|
|
|
AND BCD.cname = #{statisticsVo.corpName}
|
|
|
</if>
|
|
|
- <if test="statisticsVo.beginTime !=null and statisticsVo.beginTime != ''">
|
|
|
- and BO.receipt_time >= #{statisticsVo.beginTime}
|
|
|
+ <if test="statisticsVo.date != null and statisticsVo.date[0] !=null and statisticsVo.date[0] != ''">
|
|
|
+ and BO.receipt_time >= #{statisticsVo.date[0]}
|
|
|
</if>
|
|
|
- <if test="statisticsVo.endTime !=null and statisticsVo.endTime != ''">
|
|
|
- and BO.receipt_time <= #{statisticsVo.endTime}
|
|
|
+ <if test="statisticsVo.date != null and statisticsVo.date[1] !=null and statisticsVo.date[1] != ''">
|
|
|
+ and BO.receipt_time <= #{statisticsVo.date[1]}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
@@ -1579,13 +1580,14 @@ ORDER BY
|
|
|
|
|
|
<select id="salesmanStatisticsItem" resultType="org.springblade.purchase.sales.vo.OrderStatisticsVo">
|
|
|
SELECT
|
|
|
- BO.create_time as createTime,
|
|
|
+ BO.id as id,
|
|
|
+ BO.receipt_time as createTime,
|
|
|
BO.order_no as orderNo,
|
|
|
BOI.quantity AS quantity,
|
|
|
BO.debit_amount AS amount,
|
|
|
BOI.actualQuantity AS actualQuantity,
|
|
|
- BOI.arrivalAmount AS arrivalAmount,
|
|
|
- BO.debit_amount - BOI.purchaseAmount AS grossProfit
|
|
|
+ Round(BOI.arrivalAmount,2) AS arrivalAmount,
|
|
|
+ BO.debit_amount - Round(BOI.purchaseAmount,2) AS grossProfit
|
|
|
FROM
|
|
|
business_order BO
|
|
|
LEFT JOIN (
|
|
|
@@ -1621,11 +1623,11 @@ ORDER BY
|
|
|
'${member}'
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="statisticsVo.beginTime !=null and statisticsVo.beginTime != ''">
|
|
|
- and BO.receipt_time >= #{statisticsVo.beginTime}
|
|
|
+ <if test="statisticsVo.date != null and statisticsVo.date[0] !=null and statisticsVo.date[0] != ''">
|
|
|
+ and BO.receipt_time >= #{statisticsVo.date[0]}
|
|
|
</if>
|
|
|
- <if test="statisticsVo.endTime !=null and statisticsVo.endTime != ''">
|
|
|
- and BO.receipt_time <= #{statisticsVo.endTime}
|
|
|
+ <if test="statisticsVo.date != null and statisticsVo.date[1] !=null and statisticsVo.date[1] != ''">
|
|
|
+ and BO.receipt_time <= #{statisticsVo.date[1]}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
@@ -1735,12 +1737,13 @@ ORDER BY
|
|
|
|
|
|
<select id="salesmanProfitItem" resultType="org.springblade.purchase.sales.vo.OrderStatisticsVo">
|
|
|
SELECT
|
|
|
- BO.create_time as createTime,
|
|
|
+ BO.id as id,
|
|
|
+ BO.receipt_time as createTime,
|
|
|
BO.order_no as orderNo,
|
|
|
BOI.quantity AS quantity,
|
|
|
BO.debit_amount AS amount,
|
|
|
BOI.actualQuantity AS actualQuantity,
|
|
|
- BOI.arrivalAmount AS arrivalAmount,
|
|
|
+ Round(BOI.arrivalAmount,2) AS arrivalAmount,
|
|
|
BO.this_used_profit AS thisUsedProfit,
|
|
|
BO.gross_profit AS netGrossProfit,
|
|
|
BO.predict_ocean_freight AS predictOceanFreight
|
|
|
@@ -1778,11 +1781,11 @@ ORDER BY
|
|
|
'${member}'
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="statisticsVo.beginTime !=null and statisticsVo.beginTime != ''">
|
|
|
- and BO.receipt_time >= #{statisticsVo.beginTime}
|
|
|
+ <if test="statisticsVo.date != null and statisticsVo.date[0] !=null and statisticsVo.date[0] != ''">
|
|
|
+ and BO.receipt_time >= #{statisticsVo.date[0]}
|
|
|
</if>
|
|
|
- <if test="statisticsVo.endTime !=null and statisticsVo.endTime != ''">
|
|
|
- and BO.receipt_time <= #{statisticsVo.endTime}
|
|
|
+ <if test="statisticsVo.date != null and statisticsVo.date[1] !=null and statisticsVo.date[1] != ''">
|
|
|
+ and BO.receipt_time <= #{statisticsVo.date[1]}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
@@ -1895,12 +1898,13 @@ ORDER BY
|
|
|
|
|
|
<select id="customerProfitItem" resultType="org.springblade.purchase.sales.vo.OrderStatisticsVo">
|
|
|
SELECT
|
|
|
- BO.create_time as createTime,
|
|
|
+ BO.id as id,
|
|
|
+ BO.receipt_time as createTime,
|
|
|
BO.order_no as orderNo,
|
|
|
BOI.quantity AS quantity,
|
|
|
BO.debit_amount AS amount,
|
|
|
BOI.actualQuantity AS actualQuantity,
|
|
|
- BOI.arrivalAmount AS arrivalAmount,
|
|
|
+ Round(BOI.arrivalAmount,2) AS arrivalAmount,
|
|
|
BO.this_used_profit AS thisUsedProfit,
|
|
|
BO.gross_profit AS netGrossProfit,
|
|
|
BO.predict_ocean_freight AS predictOceanFreight
|
|
|
@@ -1936,11 +1940,11 @@ ORDER BY
|
|
|
<if test="statisticsVo.corpName != null and statisticsVo.corpName != ''">
|
|
|
AND BCD.cname like concat('%', #{statisticsVo.corpName}, '%')
|
|
|
</if>
|
|
|
- <if test="statisticsVo.beginTime !=null and statisticsVo.beginTime != ''">
|
|
|
- and BO.receipt_time >= #{statisticsVo.beginTime}
|
|
|
+ <if test="statisticsVo.date != null and statisticsVo.date[0] !=null and statisticsVo.date[0] != ''">
|
|
|
+ and BO.receipt_time >= #{statisticsVo.date[0]}
|
|
|
</if>
|
|
|
- <if test="statisticsVo.endTime !=null and statisticsVo.endTime != ''">
|
|
|
- and BO.receipt_time <= #{statisticsVo.endTime}
|
|
|
+ <if test="statisticsVo.date != null and statisticsVo.date[1] !=null and statisticsVo.date[1] != ''">
|
|
|
+ and BO.receipt_time <= #{statisticsVo.date[1]}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
@@ -2051,12 +2055,13 @@ ORDER BY
|
|
|
|
|
|
<select id="brandProfitItem" resultType="org.springblade.purchase.sales.vo.OrderStatisticsVo">
|
|
|
SELECT
|
|
|
- BO.create_time as createTime,
|
|
|
+ BO.id as id,
|
|
|
+ BO.receipt_time as createTime,
|
|
|
BO.order_no as orderNo,
|
|
|
BOI.quantity AS quantity,
|
|
|
BO.debit_amount AS amount,
|
|
|
BOI.actualQuantity AS actualQuantity,
|
|
|
- BOI.arrivalAmount AS arrivalAmount,
|
|
|
+ Round(BOI.arrivalAmount,2) AS arrivalAmount,
|
|
|
BO.this_used_profit AS thisUsedProfit,
|
|
|
BO.gross_profit AS netGrossProfit,
|
|
|
BO.predict_ocean_freight AS predictOceanFreight
|
|
|
@@ -2088,11 +2093,11 @@ ORDER BY
|
|
|
'${item}'
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="statisticsVo.beginTime !=null and statisticsVo.beginTime != ''">
|
|
|
- and BO.receipt_time >= #{statisticsVo.beginTime}
|
|
|
+ <if test="statisticsVo.date != null and statisticsVo.date[0] !=null and statisticsVo.date[0] != ''">
|
|
|
+ and BO.receipt_time >= #{statisticsVo.date[0]}
|
|
|
</if>
|
|
|
- <if test="statisticsVo.endTime !=null and statisticsVo.endTime != ''">
|
|
|
- and BO.receipt_time <= #{statisticsVo.endTime}
|
|
|
+ <if test="statisticsVo.date != null and statisticsVo.date[1] !=null and statisticsVo.date[1] != ''">
|
|
|
+ and BO.receipt_time <= #{statisticsVo.date[1]}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
@@ -2223,12 +2228,13 @@ ORDER BY
|
|
|
|
|
|
<select id="specificationsProfitItem" resultType="org.springblade.purchase.sales.vo.OrderStatisticsVo">
|
|
|
SELECT
|
|
|
- BO.create_time as createTime,
|
|
|
+ BO.id as id,
|
|
|
+ BO.receipt_time as createTime,
|
|
|
BO.order_no as orderNo,
|
|
|
BOI.quantity AS quantity,
|
|
|
- BOI.amount AS amount,
|
|
|
+ ROUND(BOI.amount,2) AS amount,
|
|
|
BOI.actualQuantity AS actualQuantity,
|
|
|
- BOI.arrivalAmount AS arrivalAmount
|
|
|
+ Round(BOI.arrivalAmount,2) AS arrivalAmount
|
|
|
FROM
|
|
|
business_order BO
|
|
|
LEFT JOIN (
|
|
|
@@ -2275,11 +2281,11 @@ ORDER BY
|
|
|
<if test="statisticsVo.typeNo != null and statisticsVo.typeNo != ''">
|
|
|
AND BGD.Typeno like concat('%', #{statisticsVo.typeNo}, '%')
|
|
|
</if>
|
|
|
- <if test="statisticsVo.beginTime !=null and statisticsVo.beginTime != ''">
|
|
|
- and BO.receipt_time >= #{statisticsVo.beginTime}
|
|
|
+ <if test="statisticsVo.date != null and statisticsVo.date[0] !=null and statisticsVo.date[0] != ''">
|
|
|
+ and BO.receipt_time >= #{statisticsVo.date[0]}
|
|
|
</if>
|
|
|
- <if test="statisticsVo.endTime !=null and statisticsVo.endTime != ''">
|
|
|
- and BO.receipt_time <= #{statisticsVo.endTime}
|
|
|
+ <if test="statisticsVo.date != null and statisticsVo.date[1] !=null and statisticsVo.date[1] != ''">
|
|
|
+ and BO.receipt_time <= #{statisticsVo.date[1]}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
@@ -2745,12 +2751,13 @@ ORDER BY
|
|
|
|
|
|
<select id="totalSummaryItem" resultType="org.springblade.purchase.sales.vo.OrderStatisticsVo">
|
|
|
SELECT
|
|
|
- BO.create_time as createTime,
|
|
|
+ BO.id as id,
|
|
|
+ BO.receipt_time as createTime,
|
|
|
BO.order_no as orderNo,
|
|
|
BOI.quantity AS quantity,
|
|
|
BO.debit_amount AS amount,
|
|
|
BOI.actualQuantity AS actualQuantity,
|
|
|
- BOI.arrivalAmount AS arrivalAmount
|
|
|
+ Round(BOI.arrivalAmount,2) AS arrivalAmount
|
|
|
FROM
|
|
|
business_order BO
|
|
|
LEFT JOIN (
|