liujie
2025-07-18 e86d554ee5476d89845f86a49864d990180542b5
ruoyi-system/src/main/resources/mapper/system/OrderMapper.xml
@@ -126,6 +126,7 @@
            c.have_patent,
            c.have_soft_works,
            c.real_registered_capital as newRegisteredCapital,
            c.high_tech_enterprise_technology as highTechEnterpriseTechnology,
            info.need_rename,
            info.new_district,
            publish.user_name as publishName,
@@ -198,10 +199,10 @@
    </select>
    <select id="financeTop" resultType="com.ruoyi.system.pojo.vo.FinanceFlowsTopVO">
        SELECT
            SUM(price) AS totalIncome,
            SUM(price) AS total,
            SUM(commission_platform) AS totalProfit,
            SUM(commission_price) AS totalCommission,
            SUM(price - commission_platform - commission_price) AS sellerIncome
            SUM(commission_price) AS superior,
            SUM(price - commission_platform - commission_price) AS seller
        FROM tb_order
        WHERE status IN (4, 5, 6)
          AND is_refund = 0
@@ -226,7 +227,7 @@
        WHERE
            ((status IN (4, 5, 6))  -- 只查询已支付订单
            or
            (status=-1 and is_refund =1))  -- 已取消且已退款的订单
            (status!=-1 and is_refund =1))  -- 已取消且已退款的订单
            <if test="null != dto.orderNo and '' != dto.orderNo">
                and order_no LIKE CONCAT('%', #{dto.orderNo}, '%')
            </if>
@@ -271,17 +272,17 @@
            and pay_time between #{dto.operateTimeStart} and #{dto.operateTimeEnd}
        </if>
        AND ( #{dto.type} IS NULL OR 1 = #{dto.type} )
        UNION ALL
        select 1
        FROM tb_order
        WHERE is_refund = 1 -- 只查询已退款订单
        <if test="null != dto.orderNo and '' != dto.orderNo">
            and order_no LIKE CONCAT('%', #{dto.orderNo}, '%')
        </if>
        <if test="null != dto.operateTimeStart and null != dto.operateTimeEnd">
            and refund_time between #{dto.operateTimeStart} and #{dto.operateTimeEnd}
        </if>
        AND ( #{dto.type} IS NULL OR 2 = #{dto.type} )
<!--        UNION ALL-->
<!--        select 1-->
<!--        FROM tb_order-->
<!--        WHERE is_refund = 1 &#45;&#45; 只查询已退款订单-->
<!--        <if test="null != dto.orderNo and '' != dto.orderNo">-->
<!--            and order_no LIKE CONCAT('%', #{dto.orderNo}, '%')-->
<!--        </if>-->
<!--        <if test="null != dto.operateTimeStart and null != dto.operateTimeEnd">-->
<!--            and refund_time between #{dto.operateTimeStart} and #{dto.operateTimeEnd}-->
<!--        </if>-->
<!--        AND ( #{dto.type} IS NULL OR 2 = #{dto.type} )-->
        ) AS t
    </select>
</mapper>