jiangqs
2023-07-06 1f9b64476716a6a1de3bcb886bf4e64b123f7523
ruoyi-modules/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml
@@ -472,7 +472,7 @@
        SELECT
            COUNT(order_id) orderTotal,
            IFNULL(SUM(order_money),0) orderMoneyTotal
        FROM t_order toc.create_time DESC
        FROM t_order ORDER BY create_time DESC
    </select>
    <select id="totalOrderSecond" resultType="com.ruoyi.order.domain.vo.MgtOrderTotal">
@@ -510,9 +510,9 @@
    <select id="totalOrderThird" resultType="com.ruoyi.order.domain.vo.MgtOrderTotal">
        SELECT
        COUNT(temp.order_id) shopOrderTotal,
        IFNULL(SUM(temp.order_money),0) shopOrderMoneyTotal,
        IFNULL(SUM(temp.pay_money),0) shopPayMoneyTotal FROM
        COUNT(temp.order_id) activityOrderTotal,
        IFNULL(SUM(temp.order_money),0) activityOrderMoneyTotal,
        IFNULL(SUM(temp.pay_money),0) activityPayMoneyTotal FROM
        (SELECT toc.order_id,toc.order_money,toc.pay_money
        FROM t_order toc
        INNER JOIN t_order_goods tog ON tog.order_id = toc.order_id
@@ -1093,7 +1093,7 @@
        COUNT(DISTINCT user_id) orderPerson
        FROM t_order WHERE del_flag = 0 AND order_from = 2
        <if test="param.shopIdList != null and param.shopIdList.size() > 0">
            AND toc.shop_id IN
            AND shop_id IN
            <foreach collection="param.shopIdList" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
@@ -1111,10 +1111,10 @@
        tog.goods_type mapKey,
        COUNT(DISTINCT toc.order_id) AS mapValueFirst,
        IFNULL(SUM(tog.goods_total_money),0) AS mapValueSecond,
        COUNT(DISTINCT toc.user_id) AS mapValueThird,
        COUNT(DISTINCT toc.user_id) AS mapValueThird
        FROM t_order toc
        INNER JOIN t_order_goods tog ON tog.order_id = toc.order_id
        WHERE toc.del_flag = 0 AND order_from = 2
        WHERE toc.del_flag = 0 AND toc.order_from = 2
        <if test="param.shopIdList != null and param.shopIdList.size() > 0">
            AND toc.shop_id IN
            <foreach collection="param.shopIdList" item="item" open="(" separator="," close=")">
@@ -1128,12 +1128,12 @@
        SELECT
        DATE_FORMAT(create_time, '%Y-%m-%d') AS mapKey,
        COUNT(DISTINCT order_id) AS mapValueFirst,
        IFNULL(SUM(toc.order_money),0) AS mapValueSecond,
        IFNULL(SUM(toc.order_money),0) AS mapValueSecond
        FROM t_order
        WHERE del_flag = 0 AND order_from = 2
        AND create_time >= DATE_SUB(CURDATE(), INTERVAL 6 DAY)
        <if test="param.shopIdList != null and param.shopIdList.size() > 0">
            AND toc.shop_id IN
            AND shop_id IN
            <foreach collection="param.shopIdList" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
@@ -1151,7 +1151,7 @@
        WHERE del_flag = 0 AND order_from = 2
        AND create_time >= DATE_SUB(CURDATE(), INTERVAL 6 DAY)
        <if test="param.shopIdList != null and param.shopIdList.size() > 0">
            AND toc.shop_id IN
            AND shop_id IN
            <foreach collection="param.shopIdList" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
@@ -1166,7 +1166,7 @@
        WHERE del_flag = 0 AND order_from = 2
        AND create_time >= DATE_SUB(CURDATE(), INTERVAL 6 DAY)
        <if test="param.shopIdList != null and param.shopIdList.size() > 0">
            AND toc.shop_id IN
            AND shop_id IN
            <foreach collection="param.shopIdList" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>