| | |
| | | <where> |
| | | a.company_id = #{record.companyId} |
| | | and a.is_sales != 1 |
| | | |
| | | <if test="record.nickName != null and record.nickName != ''"> |
| | | and a.nick_name like concat('%',#{record.nickName},'%') |
| | | </if> |
| | |
| | | |
| | | ( SELECT count( * ) FROM shop_salesman_order c WHERE c.sales_user_id = #{openId} and revenue_type =1 ) AS salesorderCount, |
| | | ( SELECT count( * ) FROM shop_salesman_order c WHERE c.sales_user_id = #{openId} and revenue_type =2 ) AS invitationOrderCount, |
| | | (select count(*) from sys_vip_info where recommend_id=#{openId} and is_sales=1) as invitationCount, |
| | | (select count(*) from sys_vip_info where recommend_id=#{openId} and is_sales=2) as customerCount |
| | | (select count(*) from sys_vip_info where recommend_id=#{openId} and is_sales=1 |
| | | ) as invitationCount, |
| | | (select count(*) from sys_vip_info where recommend_id=#{openId} and is_sales=2 |
| | | ) as customerCount |
| | | from sys_vip_info a where |
| | | a.id=#{id} |
| | | |
| | |
| | | (SELECT s.nick_name FROM sys_vip_info s |
| | | WHERE s.id = a.parent_user_id ) parentUser, |
| | | ( SELECT COUNT(*) FROM sys_vip_info |
| | | WHERE recommend_id = a.user_id AND is_sales != 1 ) lowerLevelNum, |
| | | WHERE recommend_id = a.user_id AND is_sales != 1 |
| | | ) lowerLevelNum, |
| | | ( SELECT COUNT(*) FROM sys_vip_info |
| | | WHERE recommend_id = a.user_id AND is_sales = 1 ) invitedNum, |
| | | WHERE recommend_id = a.user_id AND is_sales = 1 |
| | | ) invitedNum, |
| | | ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order |
| | | WHERE order_status = 2 AND sales_user_id = a.user_id ) totalRevenue, |
| | | ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order |
| | |
| | | a.company_id = #{record.companyId} |
| | | AND b.is_sales = 1 |
| | | and b.recommend_id = #{record.userId} |
| | | |
| | | and a.apply_status = 2 |
| | | <if test="record.userName != null and record.userName != ''"> |
| | | and b.nick_name like concat('%',#{record.userName},'%') |