陶杰
2024-10-21 ddca8e96ee1aa47ba33fcf3a9a1e7e964d63ad8b
src/main/resources/mapper/payment/OrderMapper.xml
@@ -366,9 +366,13 @@
    <select id="getOrderSaleAmount" resultType="java.math.BigDecimal">
        SELECT sum(o.payment_amount)
        FROM t_order o
        WHERE o.create_time &gt; #{startTime}
        and o.create_time &lt;= #{endTime}
        and o.payment_time is not null
        WHERE o.payment_time is not null
        and o.refund_time is null
        <if test="startTime != null">
            and o.create_time &gt; #{startTime}
        </if>
        <if test="endTime != null">
            and o.create_time &lt;= #{endTime}
        </if>
    </select>
</mapper>