|
@@ -790,21 +790,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
<select id="getUserNumber" resultType="com.fs.store.vo.h5.UserListCountVO">
|
|
<select id="getUserNumber" resultType="com.fs.store.vo.h5.UserListCountVO">
|
|
|
SELECT
|
|
SELECT
|
|
|
- fs_user_company_user.`status` as status,
|
|
|
|
|
- count( DISTINCT fs_user.user_id ) AS num
|
|
|
|
|
- FROM
|
|
|
|
|
- fs_user
|
|
|
|
|
- LEFT JOIN fs_user_company_user ON fs_user_company_user.user_id = fs_user.user_id
|
|
|
|
|
- LEFT JOIN company_user ON company_user.user_id = fs_user_company_user.company_user_id
|
|
|
|
|
- WHERE fs_user.is_del = 0 and fs_user_company_user.is_repeat_fans is not null
|
|
|
|
|
- <if test="userId != null and userId != 0 ">
|
|
|
|
|
- and (fs_user_company_user.company_user_id = #{userId} OR company_user.parent_id = #{userId} )
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="companyId != null ">
|
|
|
|
|
- and fs_user_company_user.company_id = #{companyId}
|
|
|
|
|
- </if>
|
|
|
|
|
- GROUP BY
|
|
|
|
|
- fs_user_company_user.`status`,fs_user_company_user.project_id
|
|
|
|
|
|
|
+ t.status,
|
|
|
|
|
+ COUNT(DISTINCT t.user_id) AS num
|
|
|
|
|
+ FROM (
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ fcu.status,
|
|
|
|
|
+ fu.user_id
|
|
|
|
|
+ FROM fs_user fu
|
|
|
|
|
+ INNER JOIN fs_user_company_user fcu ON fcu.user_id = fu.user_id
|
|
|
|
|
+ WHERE fu.is_del = 0 AND fcu.is_repeat_fans IS NOT NULL
|
|
|
|
|
+ <if test="userId != null and userId != 0">
|
|
|
|
|
+ AND fcu.company_user_id = #{userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="companyId != null ">
|
|
|
|
|
+ and fcu.company_id = #{companyId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="userId != null and userId != 0 ">
|
|
|
|
|
+ UNION ALL
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ fcu.status,
|
|
|
|
|
+ fu.user_id
|
|
|
|
|
+ FROM fs_user fu
|
|
|
|
|
+ INNER JOIN fs_user_company_user fcu ON fcu.user_id = fu.user_id
|
|
|
|
|
+ INNER JOIN company_user cu ON cu.user_id = fcu.company_user_id
|
|
|
|
|
+ WHERE fu.is_del = 0 AND fcu.is_repeat_fans IS NOT NULL
|
|
|
|
|
+ AND cu.parent_id = #{userId}
|
|
|
|
|
+ <if test="companyId != null ">
|
|
|
|
|
+ and fcu.company_id = #{companyId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ ) t
|
|
|
|
|
+ GROUP BY t.status
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getRepeatUserNumber" resultType="int">
|
|
<select id="getRepeatUserNumber" resultType="int">
|
|
@@ -1943,7 +1960,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
u.user_id, u.nick_name, u.avatar, u.phone, u.integral, u.now_money,
|
|
u.user_id, u.nick_name, u.avatar, u.phone, u.integral, u.now_money,
|
|
|
ucu.project_id,ucu.company_user_id as companyUserId,ucu.update_time as bindTime,ucu.status,
|
|
ucu.project_id,ucu.company_user_id as companyUserId,ucu.update_time as bindTime,ucu.status,
|
|
|
company.company_name,
|
|
company.company_name,
|
|
|
- cu.nick_name companyUserNickName
|
|
|
|
|
|
|
+ cu.nick_name companyUserNickName,
|
|
|
|
|
+ ucu.id userCompanyUserId
|
|
|
FROM
|
|
FROM
|
|
|
fs_user_company_user ucu
|
|
fs_user_company_user ucu
|
|
|
left join
|
|
left join
|
|
@@ -1965,11 +1983,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND u.phone LIKE CONCAT("%",#{maps.phone},"%")
|
|
AND u.phone LIKE CONCAT("%",#{maps.phone},"%")
|
|
|
</if >
|
|
</if >
|
|
|
<if test = "maps.startCreateTime != null" >
|
|
<if test = "maps.startCreateTime != null" >
|
|
|
- AND ucu.update_time >= #{registerStartTime}
|
|
|
|
|
|
|
+ AND ucu.update_time >= #{maps.startCreateTime}
|
|
|
</if >
|
|
</if >
|
|
|
<if test = "maps.endCreateTime != null" >
|
|
<if test = "maps.endCreateTime != null" >
|
|
|
<![CDATA[
|
|
<![CDATA[
|
|
|
- AND ucu.update_time < date_add(#{endCreateTime}, interval 1 day)
|
|
|
|
|
|
|
+ AND ucu.update_time < date_add(#{maps.endCreateTime}, interval 1 day)
|
|
|
]]>
|
|
]]>
|
|
|
</if >
|
|
</if >
|
|
|
<if test = "maps.registerCode != null and maps.registerCode !='' " >
|
|
<if test = "maps.registerCode != null and maps.registerCode !='' " >
|