mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 20:22:07 +08:00
feature #I5ROOR 整理 SQLParserVO 的属性
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<>();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user