Merge branch 'master' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management
This commit is contained in:
commit
6a6de252b5
@ -63,11 +63,12 @@ public class DataScopeInterceptor extends AbstractSqlParserHandler implements In
|
||||
String originalSql = boundSql.getSql();
|
||||
Object parameterObject = boundSql.getParameterObject();
|
||||
MappedStatement mappedStatement = (MappedStatement) metaObject.getValue("delegate.mappedStatement");
|
||||
String sqlCommandTypePre = "SELECT SQL = ";
|
||||
String mapperdId = getMapperId(mappedStatement);
|
||||
String sqlCommandTypePre = "SELECT SQL = " + mapperdId + " ";
|
||||
if(SqlCommandType.INSERT.equals(mappedStatement.getSqlCommandType())){
|
||||
sqlCommandTypePre = "INSERT SQL = ";
|
||||
sqlCommandTypePre = "INSERT SQL = " + mapperdId + " ";
|
||||
}else if (SqlCommandType.UPDATE.equals(mappedStatement.getSqlCommandType())){
|
||||
sqlCommandTypePre = "UPDATE SQL = ";
|
||||
sqlCommandTypePre = "UPDATE SQL = " + mapperdId + " ";
|
||||
}
|
||||
|
||||
Configuration configuration = mappedStatement.getConfiguration();
|
||||
@ -170,6 +171,26 @@ public class DataScopeInterceptor extends AbstractSqlParserHandler implements In
|
||||
|
||||
}
|
||||
|
||||
public static String getMapperId(MappedStatement mappedStatement) {
|
||||
try {
|
||||
String id = mappedStatement.getId();
|
||||
if(id.contains(".")){
|
||||
String ids []= id.split("\\.");
|
||||
return ids[ids.length -2 ] +"."+ ids[ids.length -1 ];
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查找参数是否包括DataScope对象
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user