feat(shop): 添加管理员推荐关系查询功能

- 在 ShopDealerReferee 实体类中新增 isAdmin 字段
- 在 ShopDealerRefereeMapper.xml 中增加 is_admin 字段映射
- 修改 SQL 查询逻辑,支持根据 isAdmin 进行筛选
- 在 ShopDealerRefereeParam 参数类中新增 isAdmin 查询字段
- 使用 @QueryField 注解实现对 isAdmin 的精确查询支持
This commit is contained in:
2025-11-20 10:05:16 +08:00
parent a85f968492
commit 304a10bcff
3 changed files with 15 additions and 1 deletions

View File

@@ -60,6 +60,10 @@ public class ShopDealerReferee implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private String phone; private String phone;
@Schema(description = "是否管理员")
@TableField(exist = false)
private Boolean isAdmin;
@Schema(description = "推荐关系层级(1,2,3)") @Schema(description = "推荐关系层级(1,2,3)")
private Integer level; private Integer level;

View File

@@ -11,7 +11,8 @@
u.nickname, u.nickname,
u.avatar, u.avatar,
u.alias, u.alias,
u.phone u.phone,
u.is_admin as isAdmin
FROM shop_dealer_referee a FROM shop_dealer_referee a
INNER JOIN gxwebsoft_core.sys_user d ON a.dealer_id = d.user_id AND d.deleted = 0 INNER JOIN gxwebsoft_core.sys_user d ON a.dealer_id = d.user_id AND d.deleted = 0
INNER JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id AND u.deleted = 0 INNER JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id AND u.deleted = 0
@@ -28,6 +29,9 @@
<if test="param.level != null"> <if test="param.level != null">
AND a.level = #{param.level} AND a.level = #{param.level}
</if> </if>
<if test="param.isAdmin != null">
AND u.is_admin = 1
</if>
<if test="param.createTimeStart != null"> <if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart} AND a.create_time &gt;= #{param.createTimeStart}
</if> </if>

View File

@@ -1,6 +1,8 @@
package com.gxwebsoft.shop.param; package com.gxwebsoft.shop.param;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableField;
import com.gxwebsoft.common.core.annotation.QueryField; import com.gxwebsoft.common.core.annotation.QueryField;
import com.gxwebsoft.common.core.annotation.QueryType; import com.gxwebsoft.common.core.annotation.QueryType;
import com.gxwebsoft.common.core.web.BaseParam; import com.gxwebsoft.common.core.web.BaseParam;
@@ -38,4 +40,8 @@ public class ShopDealerRefereeParam extends BaseParam {
@QueryField(type = QueryType.EQ) @QueryField(type = QueryType.EQ)
private Integer level; private Integer level;
@Schema(description = "是否管理员")
@QueryField(type = QueryType.EQ)
private Boolean isAdmin;
} }