jyy
2021-03-11 3e5dc8c645b73e73fbeb5564c60a979d0557f5b4
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml
@@ -34,8 +34,27 @@
         <result property="companyId" column="company_id" />
   </resultMap>
    <select id="selectInvitationuserList" resultType="com.matrix.system.fenxiao.entity.ShopSalesmanApply">
   <select id="selectInvitationuserInPage" resultType="com.matrix.system.shopXcx.vo.SalesmanVo">
      SELECT
         a.nick_name,
         a.avatar_url,
         a.phone_number,
         (
            SELECT
               IFNULL(sum(IFNULL( b.amount, 0 )),0)
            FROM
               shop_salesman_order b
            WHERE
               b.user_id = a.open_id
              AND b.sales_user_id = #{openId}
         ) AS revenueAmount,
         ( SELECT count( * ) FROM shop_salesman_order c WHERE c.user_id = a.open_id AND c.sales_user_id = #{openId} ) AS orderCount
      FROM
         biz_user a
      WHERE
         a.parent_open_id = #{openId}
        AND a.is_sales = #{isSales}
   </select>
</mapper>