From a2a4dd75b0c0e51b325c4fbe89da80dfa4a5d24f Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Mon, 20 Feb 2023 17:13:57 +0800
Subject: [PATCH] 滑动条

---
 src/main/resources/mapper/modules/MallSalesmanMapper.xml |  144 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 144 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/modules/MallSalesmanMapper.xml b/src/main/resources/mapper/modules/MallSalesmanMapper.xml
index 202cbfc..c9c0038 100644
--- a/src/main/resources/mapper/modules/MallSalesmanMapper.xml
+++ b/src/main/resources/mapper/modules/MallSalesmanMapper.xml
@@ -9,4 +9,148 @@
         GROUP BY a.id order by a.CREATED_TIME desc
     </select>
 
+    <select id="selectTreeByState" resultType="cc.mrbird.febs.mall.vo.AdminMallSalesmansTreeVo">
+        SELECT
+            a.id,
+               a.name
+        FROM mall_salesman a
+        where a.state = #{state}
+        GROUP BY a.id order by a.CREATED_TIME desc
+    </select>
+
+    <select id="agentSelect" resultType="cc.mrbird.febs.mall.vo.AdminAgentSelectVo">
+        SELECT
+            a.id,
+               a.salesmans_id salesmansId
+        FROM mall_member a
+        where a.id = #{memberId}
+    </select>
+
+    <select id="selectAddressAmountListInPage" resultType="cc.mrbird.febs.mall.vo.AdminMallAddressInfoVo">
+        SELECT
+            a.province,
+            a.city
+        FROM mall_address_info a
+        <where>
+            <if test="record != null" >
+                <if test="record.province != null and record.province != ''">
+                    and a.province = #{record.province}
+                </if>
+                <if test="record.city != null and record.city != ''">
+                    and a.city = #{record.city}
+                </if>
+            </if>
+        </where>
+        group by a.city
+    </select>
+
+    <select id="selectSumOrderAmountByProvinceAndCity" resultType="java.math.BigDecimal">
+        select
+               IFNULL(sum(IFNULL(amount,0)),0)
+        from
+             mall_order_info
+        where
+              status in (2, 3, 4)
+          and order_type = 1
+          and address_id in (
+              select
+                     a.id
+              from mall_address_info a
+                <where>
+                    <if test="province != null and province != ''">
+                        and a.province = #{province}
+                    </if>
+                    <if test="city != null and city != ''">
+                        and a.city = #{city}
+                    </if>
+                </where>
+         )
+    </select>
+
+    <select id="selectSumOrderCntByProvinceAndCity" resultType="java.lang.Integer">
+        select
+               count(id)
+        from
+             mall_order_info
+        where
+              status in (2, 3, 4)
+          and order_type = 1
+          and address_id in (
+              select
+                     a.id
+              from mall_address_info a
+                <where>
+                    <if test="province != null and province != ''">
+                        and a.province = #{province}
+                    </if>
+                    <if test="city != null and city != ''">
+                        and a.city = #{city}
+                    </if>
+                </where>
+         )
+    </select>
+
+    <select id="selectProvince" resultType="cc.mrbird.febs.mall.vo.AdminMallAddressInfoVo">
+        SELECT
+        a.province
+        FROM mall_address_info a
+        group by a.province
+    </select>
+
+    <select id="selectSalesmanAchieveListInPage" resultType="cc.mrbird.febs.mall.vo.AdminSalesmanAchieveVo">
+        SELECT
+        a.province,
+        a.city,
+        a.name salesmanName,
+        a.id salesmanId,
+        (select count(b.id) from mall_member b where b.salesmans_id = a.id) memberCnt
+        FROM mall_salesman a
+        <where>
+            <if test="record != null" >
+                <if test="record.province != null and record.province != ''">
+                    and a.province = #{record.province}
+                </if>
+                <if test="record.city != null and record.city != ''">
+                    and a.city = #{record.city}
+                </if>
+                <if test="record.name != null and record.name != ''">
+                    and a.name like concat('%',  #{record.name},'%')
+                </if>
+            </if>
+        </where>
+        ORDER BY
+        memberCnt DESC, a.province ASC
+    </select>
+
+    <select id="selectSalesmanAchieveProvince" resultType="cc.mrbird.febs.mall.vo.AdminSalesmanAchieveVo">
+        SELECT
+            a.province
+        FROM mall_salesman a
+        group by a.province
+    </select>
+
+    <select id="selectAdminMemberOrderVoBySalesmanId" resultType="cc.mrbird.febs.mall.vo.AdminMemberOrderVo">
+        select
+            c.name memberName,
+            c.phone memberPhone,
+            a.address memberAddress,
+            a.id orderId,
+            a.order_no orderNo,
+            a.CREATED_TIME createdTime,
+            a.amount orderAmount
+        from
+            mall_order_info a
+        left join mall_member c on a.member_id = c.id
+        where
+            a.status in (2, 3, 4)
+            and  a.order_type = 1
+            and  a.member_id in (
+                select
+                    b.id
+                from mall_member b
+                where
+                    b.salesmans_id = #{salesmanId}
+            )
+    </select>
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1