部门交易金额
This commit is contained in:
@@ -85,4 +85,37 @@
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="selectSumTotalMoneyByBuyerIdsAndTimeRange" resultType="java.math.BigDecimal">
|
||||
SELECT COALESCE(SUM(o.total_money), 0)
|
||||
FROM lb_order_row o
|
||||
WHERE o.tenant_id = #{tenantId}
|
||||
AND o.buyer_id IN
|
||||
<foreach collection="buyerIds" item="buyerId" open="(" separator="," close=")">
|
||||
#{buyerId}
|
||||
</foreach>
|
||||
<if test="buyStartTime != null and buyStartTime != ''">
|
||||
AND o.buy_time >= #{buyStartTime}
|
||||
</if>
|
||||
<if test="buyEndTime != null and buyEndTime != ''">
|
||||
AND o.buy_time <= #{buyEndTime}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectSumTotalMoneyGroupByBuyerIds" resultType="map">
|
||||
SELECT o.buyer_id AS buyerId, COALESCE(SUM(o.total_money), 0) AS totalMoney
|
||||
FROM lb_order_row o
|
||||
WHERE o.tenant_id = #{tenantId}
|
||||
AND o.buyer_id IN
|
||||
<foreach collection="buyerIds" item="buyerId" open="(" separator="," close=")">
|
||||
#{buyerId}
|
||||
</foreach>
|
||||
<if test="buyStartTime != null and buyStartTime != ''">
|
||||
AND o.buy_time >= #{buyStartTime}
|
||||
</if>
|
||||
<if test="buyEndTime != null and buyEndTime != ''">
|
||||
AND o.buy_time <= #{buyEndTime}
|
||||
</if>
|
||||
GROUP BY o.buyer_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user