mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-30 01:38:43 +08:00 
			
		
		
		
	数据权限的逻辑处理,暂未测试
This commit is contained in:
		| @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.OrderItem; | ||||
| import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; | ||||
| import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import net.sf.jsqlparser.schema.Table; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.Collection; | ||||
| @@ -18,6 +19,8 @@ import java.util.stream.Collectors; | ||||
|  */ | ||||
| public class MyBatisUtils { | ||||
|  | ||||
|     private static final String MYSQL_ESCAPE_CHARACTER = "`"; | ||||
|  | ||||
|     public static <T> Page<T> buildPage(PageParam pageParam) { | ||||
|         return buildPage(pageParam, null); | ||||
|     } | ||||
| @@ -48,4 +51,20 @@ public class MyBatisUtils { | ||||
|         interceptor.setInterceptors(inners); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 获得 Table 对应的表名 | ||||
|      * | ||||
|      * 兼容 MySQL 转义表名 `t_xxx` | ||||
|      * | ||||
|      * @param table 表 | ||||
|      * @return 去除转移字符后的表名 | ||||
|      */ | ||||
|     public static String getTableName(Table table) { | ||||
|         String tableName = table.getName(); | ||||
|         if (tableName.startsWith(MYSQL_ESCAPE_CHARACTER) && tableName.endsWith(MYSQL_ESCAPE_CHARACTER)) { | ||||
|             tableName = tableName.substring(1, tableName.length() - 1); | ||||
|         } | ||||
|         return tableName; | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV