mirror of
https://gitee.com/zhijiantianya/ruoyi-vue-pro.git
synced 2026-03-22 05:07:17 +08:00
fix(crm): 修复客户限制配置查询逻辑,将用户和部门的 AND 条件改为 OR
This commit is contained in:
@@ -27,10 +27,12 @@ public interface CrmCustomerLimitConfigMapper extends BaseMapperX<CrmCustomerLim
|
||||
Integer type, Long userId, Long deptId) {
|
||||
LambdaQueryWrapperX<CrmCustomerLimitConfigDO> query = new LambdaQueryWrapperX<CrmCustomerLimitConfigDO>()
|
||||
.eq(CrmCustomerLimitConfigDO::getType, type);
|
||||
query.apply("FIND_IN_SET({0}, user_ids) > 0", userId);
|
||||
if (deptId != null) {
|
||||
query.apply("FIND_IN_SET({0}, dept_ids) > 0", deptId);
|
||||
}
|
||||
query.and(w -> {
|
||||
w.apply("FIND_IN_SET({0}, user_ids) > 0", userId);
|
||||
if (deptId != null) {
|
||||
w.or().apply("FIND_IN_SET({0}, dept_ids) > 0", deptId);
|
||||
}
|
||||
});
|
||||
return selectList(query);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user