mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-21 18:06:52 +08:00
v1.2.0
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package net.lab1024.smartadmin.common.anno;
|
||||
|
||||
import net.lab1024.smartadmin.module.system.datascope.constant.DataScopeTypeEnum;
|
||||
import net.lab1024.smartadmin.module.system.datascope.constant.DataScopeWhereInTypeEnum;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
@@ -23,6 +24,8 @@ public @interface DataScope {
|
||||
|
||||
DataScopeTypeEnum dataScopeType() default DataScopeTypeEnum.DEFAULT;
|
||||
|
||||
DataScopeWhereInTypeEnum whereInType() default DataScopeWhereInTypeEnum.EMPLOYEE;
|
||||
|
||||
/**
|
||||
* 第几个where 条件 从0开始
|
||||
* @return
|
||||
|
||||
@@ -4,7 +4,7 @@ import net.lab1024.smartadmin.module.system.department.DepartmentResponseCodeCon
|
||||
import net.lab1024.smartadmin.module.system.employee.constant.EmployeeResponseCodeConst;
|
||||
import net.lab1024.smartadmin.module.support.file.constant.FileResponseCodeConst;
|
||||
import net.lab1024.smartadmin.module.business.log.orderoperatelog.constant.OrderOperateLogOperateTypeConst;
|
||||
import net.lab1024.smartadmin.module.business.login.LoginResponseCodeConst;
|
||||
import net.lab1024.smartadmin.module.system.login.LoginResponseCodeConst;
|
||||
import net.lab1024.smartadmin.module.system.position.PositionResponseCodeConst;
|
||||
import net.lab1024.smartadmin.module.system.privilege.constant.PrivilegeResponseCodeConst;
|
||||
import net.lab1024.smartadmin.module.system.role.basic.RoleResponseCodeConst;
|
||||
|
||||
@@ -22,7 +22,7 @@ public class PageParamDTO {
|
||||
|
||||
@NotNull(message = "每页数量不能为空")
|
||||
@ApiModelProperty(value = "每页数量(不能为空)", example = "10")
|
||||
@Max(value = 200, message = "每页最大为200")
|
||||
@Max(value = 500, message = "每页最大为500")
|
||||
protected Integer pageSize;
|
||||
|
||||
@ApiModelProperty("是否查询总条数")
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
package net.lab1024.smartadmin.common.mybatis;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.mapping.BoundSql;
|
||||
import org.apache.ibatis.mapping.MappedStatement;
|
||||
import org.apache.ibatis.plugin.*;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* [ mybaits sql 拦截 ]
|
||||
*
|
||||
* @author zhuoda
|
||||
* @version 1.0
|
||||
* @company 1024lab.net
|
||||
* @copyright (c) 2019 1024lab.netInc. All rights reserved.
|
||||
* @date
|
||||
* @since JDK1.8
|
||||
*/
|
||||
@Intercepts({@Signature(type = org.apache.ibatis.executor.Executor.class, method = "query", args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class})})
|
||||
@Slf4j
|
||||
public class MyBatisSqlQuerySqlDebugPlugin implements Interceptor {
|
||||
|
||||
@Override
|
||||
public Object intercept(Invocation invocation) throws Throwable {
|
||||
MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0];
|
||||
Object parameter = invocation.getArgs()[1];
|
||||
BoundSql boundSql = mappedStatement.getBoundSql(parameter);
|
||||
log.info(boundSql.getSql()+"\r\n"+boundSql.getParameterMappings().toString());
|
||||
Object obj = invocation.proceed();
|
||||
return obj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object plugin(Object arg0) {
|
||||
return Plugin.wrap(arg0,this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProperties(Properties arg0) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package net.lab1024.smartadmin.common.mybatis;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.mapping.BoundSql;
|
||||
import org.apache.ibatis.mapping.MappedStatement;
|
||||
import org.apache.ibatis.plugin.*;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* [ mybaits sql 拦截 ]
|
||||
*
|
||||
* @author zhuoda
|
||||
* @version 1.0
|
||||
* @company 1024lab.net
|
||||
* @copyright (c) 2019 1024lab.netInc. All rights reserved.
|
||||
* @date
|
||||
* @since JDK1.8
|
||||
*/
|
||||
@Intercepts({@Signature(type = org.apache.ibatis.executor.Executor.class, method = "update", args = {MappedStatement.class, Object.class})})
|
||||
@Slf4j
|
||||
public class MyBatisSqlUpdateSqlDebugPlugin implements Interceptor {
|
||||
|
||||
@Override
|
||||
public Object intercept(Invocation invocation) throws Throwable {
|
||||
MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0];
|
||||
Object parameter = invocation.getArgs()[1];
|
||||
BoundSql boundSql = mappedStatement.getBoundSql(parameter);
|
||||
log.info(boundSql.getSql()+"\r\n"+boundSql.getParameterMappings().toString());
|
||||
Object obj = invocation.proceed();
|
||||
return obj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object plugin(Object arg0) {
|
||||
return Plugin.wrap(arg0,this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProperties(Properties arg0) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user