@@ -42,9 +42,9 @@
from corp_tag_group cg
left join corp_tag ct on ct.group_id = cg.group_id
left join corp_user_tag cut on cut.tag_id = ct.tag_id
- left join corp_user_follow_relation cufr on cufr.id = cut.relation_id
- left join corp_user_auth cua on cua.external_userid = cufr.corp_user_id
- left join corp_user cu on cu.id = cua.corp_user_id
+ left join corp_user_follow_relation cufr on cufr.id = cut.relation_id and cufr.wx_corp_id = #{wxCorpId}
+ left join corp_user_auth cua on cua.external_userid = cufr.corp_user_id and cua.wx_corp_id = #{wxCorpId}
+ left join corp_user cu on cu.id = cua.corp_user_id and cu.unionid != ''
<where>
<if test="groupIds != null and groupIds.length >0">
cg.group_id in
@@ -52,9 +52,6 @@
#{item}
</foreach>
</if>
- and cufr.wx_corp_id = #{wxCorpId}
- and cua.wx_corp_id = #{wxCorpId}
- and cu.unionid != ''
</where>
group by cg.id,cg.group_id,cg.group_name order by cg.id desc)s
<if test="sort != null">
@@ -22,9 +22,9 @@
ct.rule_name_list_str
from `corp_tag` ct
<if test="tagIds != null and tagIds.length > 0">
ct.id in
@@ -32,9 +32,6 @@
group by ct.id, ct.group_name, ct.name, ct.tag_id,ct.group_id,ct.rule_name_list_str order by ct.id desc) s