Kaynağa Gözat

会员关联项目 代码调整

Long 1 hafta önce
ebeveyn
işleme
b1a57a9fde

+ 5 - 7
fs-service-system/src/main/resources/mapper/store/FsUserMapper.xml

@@ -962,13 +962,12 @@
     <select id="countTag" resultType="FsUserSummaryCountTagVO">
         SELECT
             company_tag.tag AS tagName,
-            count( fs_user.user_id ) AS number
+            count( ucu.user_id ) AS number
         FROM
-            company_tag_user
-                LEFT JOIN fs_user ON fs_user.user_id = company_tag_user.user_id
-                LEFT JOIN company_tag ON FIND_IN_SET( company_tag.tag_id, company_tag_user.tag_ids ) > 0
-                left join fs_user_company_user ucu on ucu.user_id = fs_user.user_id
-                LEFT JOIN company_user ON ucu.company_user_id = company_user.user_id
+        fs_user_project_tag upt
+        inner join fs_user_company_user ucu on ucu.id = upt.user_company_user_id
+        inner join company_tag ON upt.tag_id = company_tag.tag_id
+        left join company_user on company_user.user_id = ucu.company_user_id
         <where>
         <if test="userId != null and userId != 0 ">
             and (ucu.company_user_id = #{userId} OR company_user.parent_id = #{userId} )
@@ -976,7 +975,6 @@
         <if test="companyId != null ">
             and ucu.company_id = #{companyId}
         </if>
-           and company_tag.tag_id is not null
         </where>
         GROUP BY
             company_tag.tag_id