feature #I5ROOR 整理 SQLParserVO 的属性

This commit is contained in:
tangkc 2022-09-19 21:44:48 +08:00
parent 59f694bb46
commit 55e3e33337
4 changed files with 34 additions and 52 deletions

View File

@ -77,8 +77,5 @@ public class SQLXmlELParser extends ClassXmlFlowELParser {
if (Objects.isNull(sqlParserVO.getPassword())) {
throw new ELSQLException(StrFormatter.format(ERROR_MSG_PATTERN, "password"));
}
if (Objects.isNull(sqlParserVO.getElTable())) {
sqlParserVO.setElTable(new SQLParserVO.ElTable());
}
}
}

View File

@ -73,9 +73,9 @@ public class JDBCHelper {
PreparedStatement stmt = null;
ResultSet rs = null;
String elDataField = sqlParserVO.getElTable().getElDataField();
String chainNameField = sqlParserVO.getElTable().getChainNameField();
String tableName = sqlParserVO.getElTable().getTableName();
String elDataField = sqlParserVO.getElDataField();
String chainNameField = sqlParserVO.getChainNameField();
String tableName = sqlParserVO.getTableName();
String sqlCmd = StrFormatter.format(SQL_PATTERN, chainNameField, elDataField, tableName);
List<String> result = new ArrayList<>();

View File

@ -29,50 +29,19 @@ public class SQLParserVO {
private String password;
/**
* EL 表相关配置
* 表名
*/
private ElTable elTable;
private String tableName = "el_table";
public static class ElTable {
/**
* 表名
*/
private String tableName = "el_table";
/**
* chainName
*/
private String chainNameField = "chain_name";
/**
* chainName
*/
private String chainNameField = "chain_name";
/**
* el 表达式相关数据
*/
private String elDataField = "el_data";
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public String getChainNameField() {
return chainNameField;
}
public void setChainNameField(String chainNameField) {
this.chainNameField = chainNameField;
}
public String getElDataField() {
return elDataField;
}
public void setElDataField(String elDataField) {
this.elDataField = elDataField;
}
}
/**
* el 表达式相关数据
*/
private String elDataField = "el_data";
public String getUrl() {
return url;
@ -106,11 +75,27 @@ public class SQLParserVO {
this.password = password;
}
public ElTable getElTable() {
return elTable;
public String getTableName() {
return tableName;
}
public void setElTable(ElTable elTable) {
this.elTable = elTable;
public void setTableName(String tableName) {
this.tableName = tableName;
}
public String getChainNameField() {
return chainNameField;
}
public void setChainNameField(String chainNameField) {
this.chainNameField = chainNameField;
}
public String getElDataField() {
return elDataField;
}
public void setElDataField(String elDataField) {
this.elDataField = elDataField;
}
}

View File

@ -1,4 +1,4 @@
liteflow.rule-source-ext-data={"url":"jdbc:h2:mem:test_db;MODE=MySQL","driverClassName":"org.h2.Driver","username":"root","password":"123456","elTable":{"tableName":"EL_TABLE","elDataField":"EL_DATA"}}
liteflow.rule-source-ext-data={"url":"jdbc:h2:mem:test_db;MODE=MySQL","driverClassName":"org.h2.Driver","username":"root","password":"123456","tableName":"EL_TABLE","chainNameField":"chain_name","elDataField":"EL_DATA"}
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.url=jdbc:h2:mem:test_db;MODE=MySQL