From ccf8413a33e85589d0ed219bd1a0aff88e6a1e39 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Wed, 15 Dec 2021 14:48:58 +0800
Subject: [PATCH] Merge branch 'score-shop' into xc-prd

---
 gc-user/src/main/resources/mapper/user/OrderMapper.xml |  128 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 124 insertions(+), 4 deletions(-)

diff --git a/gc-user/src/main/resources/mapper/user/OrderMapper.xml b/gc-user/src/main/resources/mapper/user/OrderMapper.xml
index b0b9877..3427663 100644
--- a/gc-user/src/main/resources/mapper/user/OrderMapper.xml
+++ b/gc-user/src/main/resources/mapper/user/OrderMapper.xml
@@ -401,9 +401,9 @@
                         '1' type,
                         ifnull(sum(d.money), 0) money,
                         '0' score,
-                        a.address address,
+                        CONCAT(a.address_area, a.address) address,
                         ifnull(sum(d.weight), 0) weight,
-                        e.NAME NAME,
+                        e.NAME name,
                         a.create_time createTime
                     FROM
                         xzx_order_info a
@@ -423,13 +423,14 @@
                         '2' type,
                         '0' money,
                         ifnull(sum(d.score), 0) score,
-                        a.address address,
+                        CONCAT(a.area, a.address) address,
                         ifnull(sum(d.weight), 0) weight,
-                        a.username NAME,
+                        e.username name,
                         a.CREATED_TIME createTime
                     FROM
                         xzx_jhy_order a
                             LEFT JOIN xzx_jhy_order_items d ON a.id = d.order_id
+                            LEFT JOIN xzx_jhy_info e ON a.jhy_id = e.user_id
                     WHERE
                         a.user_id = #{userId}
                     and a.status = 3
@@ -608,4 +609,123 @@
             xzx_jhy_order_items a
         WHERE  a.order_id = (select b.id from xzx_jhy_order b where b.order_no = #{orderId})
     </select>
+
+
+    <select id="selectTGRMobileByPhone" resultType="java.lang.String">
+
+        SELECT
+            a.mobile_phone tgrPhone
+        FROM
+            xzx_user_share_info a
+        WHERE  a.register_mobile_phone = #{mobilePhone}
+    </select>
+
+
+
+    <select id="queryCuserOrderByUserIdOrderIng" resultType="java.util.Map">
+
+        SELECT
+            COUNT(*) as count
+        FROM
+            (
+            (
+            SELECT
+            a.order_id orderId,
+            a.order_status STATUS,
+            '1' type,
+            ifnull(sum(d.money), 0) money,
+            '0' score,
+            a.address address,
+            ifnull(sum(d.weight), 0) weight,
+            e. NAME NAME,
+            a.create_time createTime
+            FROM
+            xzx_order_info a
+            LEFT JOIN xzx_order_item_info d ON a.order_id = d.order_id
+            LEFT JOIN xzx_user_info e ON e.user_id = a.receiver
+            WHERE
+            a.create_user_id=#{userId}
+            and a.order_status in (1,2,3)
+            GROUP BY
+            a.order_id
+            )
+            UNION
+            (
+            SELECT
+            a.id orderId,
+            a. STATUS STATUS,
+            '2' type,
+            '0' money,
+            ifnull(sum(d.score), 0) score,
+            a.address address,
+            ifnull(sum(d.weight), 0) weight,
+            a.username NAME,
+            a.CREATED_TIME createTime
+            FROM
+            xzx_jhy_order a
+            LEFT JOIN xzx_jhy_order_items d ON a.id = d.order_id
+            WHERE
+            a.user_id = #{userId}
+            and a.status in (1,2)
+            GROUP BY
+            a.id
+            )
+            ) v
+        ORDER BY
+            createTime DESC
+    </select>
+
+    <select id="queryCuserOrderByUserIdOrderDone" resultType="java.util.Map">
+
+        SELECT
+            COUNT(*) as count
+        FROM
+            (
+            (
+            SELECT
+            a.order_id orderId,
+            a.order_status STATUS,
+            '1' type,
+            ifnull(sum(d.money), 0) money,
+            '0' score,
+            a.address address,
+            ifnull(sum(d.weight), 0) weight,
+            e. NAME NAME,
+            a.create_time createTime
+            FROM
+            xzx_order_info a
+            LEFT JOIN xzx_order_item_info d ON a.order_id = d.order_id
+            LEFT JOIN xzx_user_info e ON e.user_id = a.receiver
+            WHERE
+            a.create_user_id=#{userId}
+            and a.order_status in (4,5,7)
+            GROUP BY
+            a.order_id
+            )
+            UNION
+            (
+            SELECT
+            a.id orderId,
+            a. STATUS STATUS,
+            '2' type,
+            '0' money,
+            ifnull(sum(d.score), 0) score,
+            a.address address,
+            ifnull(sum(d.weight), 0) weight,
+            a.username NAME,
+            a.CREATED_TIME createTime
+            FROM
+            xzx_jhy_order a
+            LEFT JOIN xzx_jhy_order_items d ON a.id = d.order_id
+            WHERE
+            a.user_id = #{userId}
+            and a.status = 3
+            GROUP BY
+            a.id
+            )
+            ) v
+        ORDER BY
+            createTime DESC
+    </select>
+
 </mapper>

--
Gitblit v1.9.1