mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-27 01:32:03 +08:00
初始化数据权限模块
This commit is contained in:
parent
814c2db65c
commit
c99115abe7
@ -24,7 +24,7 @@ public interface SysDeptMapper extends BaseMapperX<SysDeptDO> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default Integer selectCountByParentId(Long parentId) {
|
default Integer selectCountByParentId(Long parentId) {
|
||||||
return selectCount(new QueryWrapper<SysDeptDO>().eq("parent_id", parentId));
|
return selectCount("parent_id", parentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
default boolean selectExistsByUpdateTimeAfter(Date maxUpdateTime) {
|
default boolean selectExistsByUpdateTimeAfter(Date maxUpdateTime) {
|
||||||
|
@ -19,7 +19,7 @@ public interface SysMenuMapper extends BaseMapperX<SysMenuDO> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default Integer selectCountByParentId(Long parentId) {
|
default Integer selectCountByParentId(Long parentId) {
|
||||||
return selectCount(new QueryWrapper<SysMenuDO>().eq("parent_id", parentId));
|
return selectCount("parent_id", parentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<SysMenuDO> selectList(SysMenuListReqVO reqVO) {
|
default List<SysMenuDO> selectList(SysMenuListReqVO reqVO) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.datascope.core.interceptor;
|
package cn.iocoder.yudao.framework.datapermission.core.interceptor;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper;
|
import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
@ -0,0 +1 @@
|
|||||||
|
package cn.iocoder.yudao.framework.datapermission.core;
|
@ -1,4 +1,4 @@
|
|||||||
/**
|
/**
|
||||||
* 基于 JSqlParser 解析 SQL,增加数据权限的 WHERE 条件
|
* 基于 JSqlParser 解析 SQL,增加数据权限的 WHERE 条件
|
||||||
*/
|
*/
|
||||||
package cn.iocoder.yudao.framework.datascope;
|
package cn.iocoder.yudao.framework.datapermission;
|
@ -1 +0,0 @@
|
|||||||
package cn.iocoder.yudao.framework.datascope.core;
|
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.datascope.core.interceptor;
|
package cn.iocoder.yudao.framework.datapermission.core.interceptor;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
@ -9,7 +9,7 @@ public class DataPermissionInterceptorTest {
|
|||||||
private final DataPermissionInterceptor interceptor = new DataPermissionInterceptor();
|
private final DataPermissionInterceptor interceptor = new DataPermissionInterceptor();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void selectSingle() {
|
public void selectSingle() {
|
||||||
// 单表
|
// 单表
|
||||||
assertSql("select * from entity where id = ?",
|
assertSql("select * from entity where id = ?",
|
||||||
"SELECT * FROM entity WHERE id = ? AND tenant_id = 1");
|
"SELECT * FROM entity WHERE id = ? AND tenant_id = 1");
|
||||||
@ -29,4 +29,8 @@ public class DataPermissionInterceptorTest {
|
|||||||
assertThat(interceptor.parserSingle(sql, null)).isEqualTo(targetSql);
|
assertThat(interceptor.parserSingle(sql, null)).isEqualTo(targetSql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println("123");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user