统计篮球订单收益

This commit is contained in:
2024-01-30 20:50:43 +08:00
parent 6736a5c861
commit 73e1431f8f
4 changed files with 60 additions and 0 deletions

View File

@@ -336,4 +336,31 @@
order by t.order_start desc
</select>
<select id="orderPageSum" resultType="java.math.BigDecimal">
select
sum((select IFNULL(sum(ot.price),0) from sv_order ot
where ot.member_id = t.member_id and (ot.order_sn = t.order_sn or ot.order_sn = t.order_add_sn)
) - IFNULL(t.sum_pay_money,0)) orderSumMoney
from sv_barcode_order_time t
where 1=1
<if test="state != null and state == 2">
AND (t.status = 1 or t.paying = #{state})
</if>
<if test="state != null and state == 1">
AND t.paying = #{state}
</if>
<if test="state != null and state == 0">
AND t.paying = #{state} and t.status = 0
</if>
<if test="orderSn != ''">
AND t.order_sn = #{orderSn}
</if>
<if test="starTime != ''">
AND t.order_start &gt;= #{starTime}
</if>
<if test="endTime != ''">
AND t.order_start &lt;= #{endTime}
</if>
</select>
</mapper>