|
|
@@ -763,24 +763,41 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+<!-- <select id="getUserNumber" resultType="com.fs.hisStore.vo.h5.UserListCountVO">-->
|
|
|
+<!-- 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} )-->
|
|
|
+<!-- and fs_user_company_user.company_user_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-->
|
|
|
+<!-- </select>-->
|
|
|
+
|
|
|
<select id="getUserNumber" resultType="com.fs.hisStore.vo.h5.UserListCountVO">
|
|
|
SELECT
|
|
|
fs_user_company_user.`status` as status,
|
|
|
- count( DISTINCT fs_user.user_id ) AS num
|
|
|
+ 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
|
|
|
+ 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} )
|
|
|
and fs_user_company_user.company_user_id = #{userId}
|
|
|
</if>
|
|
|
- AND fs_user_company_user.company_id =
|
|
|
- CASE
|
|
|
- WHEN #{companyId} IS NOT NULL THEN #{companyId}
|
|
|
- ELSE fs_user_company_user.company_id
|
|
|
- END
|
|
|
+ <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
|
|
|
</select>
|