he2802 %!s(int64=2) %!d(string=hai) anos
pai
achega
07bc236028

+ 23 - 11
zhongzheng-system/src/main/resources/mapper/modules/distribution/DistributionSellerMapper.xml

@@ -34,6 +34,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="cash" column="cash"/>
         <result property="usedCash" column="used_cash"/>
         <result property="freezeCash" column="freeze_cash"/>
+        <result property="parentName" column="parent_name"/>
+        <result property="parentAccount" column="parent_account"/>
+        <result property="promotionNum" column="promotion_num"/>
     </resultMap>
 
 
@@ -57,17 +60,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="findList" parameterType="com.zhongzheng.modules.top.distribution.bo.DistributionSellerQuery" resultMap="DistributionSellerVoResult">
         SELECT
-            s.realname,
-            s.seller_id,
-            s.user_account,
-            s.share_code,
-            s.gzh_open_id,
-            u.id_card,
-            u.phonenumber,
-            u.`status`
+        s.realname,
+        s.seller_id,
+        s.user_account,
+        s.share_code,
+        s.gzh_open_id,
+        u.id_card,
+        u.phonenumber,
+        u.`status`,
+        ds.realname as parent_name,
+        ds.user_account as parent_account,
+        (SELECT count(*) from distribution_seller d where d.parent_id = s.seller_id) as promotion_num
         FROM
-            distribution_seller s
-                LEFT JOIN sys_user u ON s.seller_id = u.seller_id
+        distribution_seller s
+        LEFT JOIN sys_user u ON s.seller_id = u.seller_id
+        LEFT JOIN distribution_seller ds on s.parent_id = ds.seller_id
         WHERE
         1=1
         <if test="realname != null and realname != ''">
@@ -79,9 +86,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="findDetail" parameterType="Long" resultMap="DistributionSellerVoResult">
         SELECT
-            s.*,
+            s.realname,
+            s.seller_id,
+            s.user_account,
+            s.share_code,
+            s.gzh_open_id,
             u.id_card,
             u.phonenumber,
+            u.`status`,
             u.avatar
         FROM
             distribution_seller s