@@ -119,6 +119,10 @@ public class FsUserController extends AppBaseController {
param.setUserId(Long.parseLong(getUserId()));
PageHelper.startPage(param.getPageNum(), param.getPageSize());
List<CompanyUserTagListVO> tagList = companyTagUserService.getTagList(param);
+ CompanyUserTagListVO noTag = new CompanyUserTagListVO();
+ noTag.setTagId(0L);
+ noTag.setTagName("无标签");
+ tagList.add(0, noTag);
PageInfo<CompanyUserTagListVO> pageInfo = new PageInfo<>(tagList);
return ResponseResult.ok(pageInfo);
}
@@ -73,6 +73,10 @@ public class FsUserPageListParam implements Serializable {
private Long pcLoginUserId;
private Boolean isAdmin;
+ /**
+ * 判断是否选择了无标签
+ */
+ private Boolean isNullTag =false;
@@ -482,7 +482,13 @@ public class FsUserServiceImpl implements IFsUserService
-
+ if (param.getTagIds() != null && param.getTagIds().length > 0) {
+ boolean containsZero = Arrays.asList(param.getTagIds()).contains(0L);
+ // 如果包含 "0",则设置 isNullTag 为 true
+ if (containsZero) {
+ param.setIsNullTag(true);
+ }
List<FsUserPageListVO> fsUserPageListVOS = fsUserMapper.selectFsUserPageList(param);
// 获取当前销售所有重粉会员
@@ -563,7 +563,19 @@
<if test="registerEndTime != null and registerEndTime !='' ">
AND fs_user.create_time <= #{registerEndTime}
</if>
- <if test="tagIds != null and tagIds.length > 0">
+
+ <if test="isNullTag">
+ and (company_tag_user.tag_ids is null
+ <if test="tagIds != null and tagIds.length > 0">
+ or
+ <foreach collection="tagIds" item="item" index="index" open="(" separator="or" close=")">
+ CONCAT(',', company_tag_user.tag_ids, ',') LIKE CONCAT('%,', #{item}, ',%')
+ </foreach>
+ </if>
+ )
+ <if test="!isNullTag and tagIds != null and tagIds.length > 0">
AND
<foreach collection="tagIds" item="item" index="index" open="(" separator="or" close=")">
CONCAT(',', company_tag_user.tag_ids, ',') LIKE CONCAT('%,', #{item}, ',%')