|
|
@@ -60,4 +60,19 @@
|
|
|
inner join user u on u.id = cu.user_id
|
|
|
group by cu.id, cu.unionid)s order by s.tagTime desc, s.userId asc
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="countTagUser" resultType="java.lang.Integer">
|
|
|
+ select count(distinct ca.corp_user_id)
|
|
|
+ from (select relation_id
|
|
|
+ from `corp_user_tag` ct
|
|
|
+ where tag_id = #{tagIdStr}
|
|
|
+ <if test="startTime != null">
|
|
|
+ and ct.created_time >= #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null">
|
|
|
+ and ct.created_time < #{endTime}
|
|
|
+ </if>) s
|
|
|
+ left join corp_user_follow_relation cufr on cufr.id = s.relation_id
|
|
|
+ left join corp_user_auth ca on ca.external_userid = cufr.corp_user_id
|
|
|
+ </select>
|
|
|
</mapper>
|