feat():引擎版本,资产接入连接,引擎版本初始化
parent
86dd8a7060
commit
8750b7d1cb
|
@ -89,6 +89,11 @@
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>muyu-common-swagger</artifactId>
|
<artifactId>muyu-common-swagger</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.github.classgraph</groupId>
|
||||||
|
<artifactId>classgraph</artifactId>
|
||||||
|
<version>4.1.7</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -100,4 +100,29 @@ public class RuleEngineVersionController extends BaseController
|
||||||
{
|
{
|
||||||
return toAjax(ruleEngineVersionService.deleteRuleEngineVersionByIds(ids));
|
return toAjax(ruleEngineVersionService.deleteRuleEngineVersionByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除规则版本
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("engine:version:update")
|
||||||
|
@Log(title = "规则版本", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/saveCoding")
|
||||||
|
public Result saveCoding(@RequestBody RuleEngineVersion ruleEngineVersion)
|
||||||
|
{
|
||||||
|
return toAjax(ruleEngineVersionService.saveCoding(ruleEngineVersion));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试引擎版本
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("engine:version:update")
|
||||||
|
@Log(title = "规则版本", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/testEngine")
|
||||||
|
public Result testEngine(@RequestBody String codeIng) throws Exception {
|
||||||
|
return toAjax(ruleEngineVersionService.testEngine(codeIng));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,4 +60,18 @@ public interface RuleEngineVersionService extends IService<RuleEngineVersion>
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteRuleEngineVersionById(Long id);
|
public int deleteRuleEngineVersionById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化保存规则版本
|
||||||
|
* @param ruleEngineVersion
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean saveCoding(RuleEngineVersion ruleEngineVersion);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试引擎版本
|
||||||
|
* @param codeIng
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean testEngine(String codeIng) throws Exception;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
package com.muyu.engine.service.impl;
|
package com.muyu.engine.service.impl;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.alibaba.nacos.shaded.com.google.common.base.Supplier;
|
import com.alibaba.nacos.shaded.com.google.common.base.Supplier;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.utils.DateUtils;
|
import com.muyu.common.core.utils.DateUtils;
|
||||||
import com.muyu.engine.domain.RuleEngine;
|
import com.muyu.engine.domain.RuleEngine;
|
||||||
import com.muyu.engine.service.RuleEngineService;
|
import com.muyu.engine.service.RuleEngineService;
|
||||||
|
import io.lettuce.core.dynamic.support.ReflectionUtils;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -26,8 +30,7 @@ import javax.servlet.ServletException;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Log4j2
|
@Log4j2
|
||||||
public class RuleEngineVersionServiceImpl extends ServiceImpl<RuleEngineVersionMapper,RuleEngineVersion> implements RuleEngineVersionService
|
public class RuleEngineVersionServiceImpl extends ServiceImpl<RuleEngineVersionMapper, RuleEngineVersion> implements RuleEngineVersionService {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RuleEngineVersionMapper ruleEngineVersionMapper;
|
private RuleEngineVersionMapper ruleEngineVersionMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -40,8 +43,7 @@ public class RuleEngineVersionServiceImpl extends ServiceImpl<RuleEngineVersionM
|
||||||
* @return 规则版本
|
* @return 规则版本
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public RuleEngineVersion selectRuleEngineVersionById(Long id)
|
public RuleEngineVersion selectRuleEngineVersionById(Long id) {
|
||||||
{
|
|
||||||
return ruleEngineVersionMapper.selectRuleEngineVersionById(id);
|
return ruleEngineVersionMapper.selectRuleEngineVersionById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,10 +54,9 @@ public class RuleEngineVersionServiceImpl extends ServiceImpl<RuleEngineVersionM
|
||||||
* @return 规则版本
|
* @return 规则版本
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<RuleEngineVersion> selectRuleEngineVersionList(Long ruleEngineId)
|
public List<RuleEngineVersion> selectRuleEngineVersionList(Long ruleEngineId) {
|
||||||
{
|
return list(new LambdaQueryWrapper<RuleEngineVersion>() {{
|
||||||
return list(new LambdaQueryWrapper<RuleEngineVersion>(){{
|
eq(RuleEngineVersion::getRuleEngineId, ruleEngineId);
|
||||||
eq(RuleEngineVersion::getRuleEngineId,ruleEngineId);
|
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,8 +67,7 @@ public class RuleEngineVersionServiceImpl extends ServiceImpl<RuleEngineVersionM
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertRuleEngineVersion(RuleEngineVersion ruleEngineVersion)
|
public int insertRuleEngineVersion(RuleEngineVersion ruleEngineVersion) {
|
||||||
{
|
|
||||||
ruleEngineVersion.setCreateTime(DateUtils.getNowDate());
|
ruleEngineVersion.setCreateTime(DateUtils.getNowDate());
|
||||||
return ruleEngineVersionMapper.insertRuleEngineVersion(ruleEngineVersion);
|
return ruleEngineVersionMapper.insertRuleEngineVersion(ruleEngineVersion);
|
||||||
}
|
}
|
||||||
|
@ -79,8 +79,7 @@ public class RuleEngineVersionServiceImpl extends ServiceImpl<RuleEngineVersionM
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateRuleEngineVersion(RuleEngineVersion ruleEngineVersion)
|
public int updateRuleEngineVersion(RuleEngineVersion ruleEngineVersion) {
|
||||||
{
|
|
||||||
ruleEngineVersion.setUpdateTime(DateUtils.getNowDate());
|
ruleEngineVersion.setUpdateTime(DateUtils.getNowDate());
|
||||||
return ruleEngineVersionMapper.updateRuleEngineVersion(ruleEngineVersion);
|
return ruleEngineVersionMapper.updateRuleEngineVersion(ruleEngineVersion);
|
||||||
}
|
}
|
||||||
|
@ -92,8 +91,7 @@ public class RuleEngineVersionServiceImpl extends ServiceImpl<RuleEngineVersionM
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteRuleEngineVersionByIds(Long[] ids)
|
public int deleteRuleEngineVersionByIds(Long[] ids) {
|
||||||
{
|
|
||||||
return ruleEngineVersionMapper.deleteRuleEngineVersionByIds(ids);
|
return ruleEngineVersionMapper.deleteRuleEngineVersionByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,99 +102,93 @@ public class RuleEngineVersionServiceImpl extends ServiceImpl<RuleEngineVersionM
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteRuleEngineVersionById(Long id)
|
public int deleteRuleEngineVersionById(Long id) {
|
||||||
{
|
|
||||||
return ruleEngineVersionMapper.deleteRuleEngineVersionById(id);
|
return ruleEngineVersionMapper.deleteRuleEngineVersionById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
public boolean testEngine(Long id) throws Exception {
|
|
||||||
// RuleEngine ruleEngine = ruleEngineService.getById(id);
|
|
||||||
// if (ruleEngine.getIsActivate().contains("no")) throw new ServletException("未激活");
|
|
||||||
// if (ruleEngine.getStatus().contains("1")) throw new ServletException("已停用");
|
|
||||||
// Scope scope = this.getOne(new LambdaQueryWrapper<Scope>() {{
|
|
||||||
// eq(Scope::getRuleEngineId, ruleEngine.getId());
|
|
||||||
// eq(Scope::getValue, "taskContext");
|
|
||||||
// }});
|
|
||||||
// String code = scope.getCode();
|
|
||||||
// String path = code.substring(code.indexOf("com"), code.indexOf(";")).replaceAll("/.", "/").trim();
|
|
||||||
// String fileName = code.substring(code.indexOf("class") + 6, code.indexOf("{")).trim();
|
|
||||||
// String name = path+"."+fileName;
|
|
||||||
// String javaPackageName = name.replace(".", File.separator)+".java";
|
|
||||||
// String javaAbsolutePath = "D:/ruoyi/FinallyTest/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/src/main/java/" +javaPackageName;
|
|
||||||
// String jarAbsolutePath = "D:/ruoyi/FinallyTest/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/target/classes/com/muyu/engine/controller";
|
|
||||||
// Process process = Runtime.getRuntime().exec("javac -classpath "+ jarAbsolutePath+ " " + javaAbsolutePath);
|
|
||||||
// try {
|
|
||||||
// int exitVal = process.waitFor();
|
|
||||||
// System.out.println("Process exitValue: " + exitVal);
|
|
||||||
// ClassLoader classLoader = ReflectionUtils.class.getClassLoader();
|
|
||||||
// Class aClass = classLoader.loadClass(name);
|
|
||||||
// Object o = aClass.newInstance();
|
|
||||||
// Method[] methods = aClass.getMethods();
|
|
||||||
// for (Method method : methods) {
|
|
||||||
// method.invoke(o,null);
|
|
||||||
// }
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// log.error(e.getMessage());
|
|
||||||
// }
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 引擎流程并执行测试
|
* @param ruleEngineVersion
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
// @Override
|
@Override
|
||||||
public boolean init(Long id) throws ServletException {
|
public boolean saveCoding(RuleEngineVersion ruleEngineVersion) {
|
||||||
RuleEngine ruleEngine = ruleEngineService.getById(id);
|
String codeIng = ruleEngineVersion.getCodeIng();
|
||||||
if (ruleEngine.getIsActivate().contains("no")) throw new ServletException("未激活");
|
try {
|
||||||
if (ruleEngine.getStatus().contains("1")) throw new ServletException("已停用");
|
String path = codeIng.substring(codeIng.indexOf("com"), codeIng.indexOf(";")).replaceAll("\\.", "/").trim();
|
||||||
Supplier<Boolean> booleanSupplier = () -> {
|
String fileName = codeIng.substring(codeIng.indexOf("class") + 6, codeIng.indexOf("{")).trim();
|
||||||
try {
|
//去除父级
|
||||||
return testEngine(ruleEngine);
|
if (fileName.contains("extends")) {
|
||||||
} catch (Exception e) {
|
fileName = fileName.substring(0, fileName.indexOf("extends")).trim();
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
}
|
||||||
};
|
//去除实现接口
|
||||||
return booleanSupplier.get();
|
if (fileName.contains("implements")) {
|
||||||
|
fileName = fileName.substring(0, fileName.indexOf("implements")).trim();
|
||||||
|
}
|
||||||
|
//代码编译
|
||||||
|
File file = new File("D:/ruoyi/FinallyTest/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/src/main/java/" + path + "/" + fileName + ".java");
|
||||||
|
if (!file.exists()) {
|
||||||
|
//不存在创建
|
||||||
|
file.createNewFile();
|
||||||
|
} else {
|
||||||
|
//存在测重新创建
|
||||||
|
file.delete();
|
||||||
|
file.createNewFile();
|
||||||
|
}
|
||||||
|
String[] split = codeIng.split("/n");
|
||||||
|
//OutputStreamWriter对象将字符转换为字节流,指定了文件输出流和编码方式。
|
||||||
|
OutputStreamWriter outputStreamWriter =
|
||||||
|
new OutputStreamWriter(new FileOutputStream(file, true), "UTF-8");
|
||||||
|
//BufferedWriter对象,用于缓冲写入数据,提高写入效率。
|
||||||
|
BufferedWriter bw = new BufferedWriter(outputStreamWriter);
|
||||||
|
for (String str : split) {
|
||||||
|
bw.write(str);
|
||||||
|
bw.newLine();
|
||||||
|
}
|
||||||
|
bw.close();
|
||||||
|
outputStreamWriter.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
log.info("初始化成功");
|
||||||
|
ruleEngineVersion.setStatus("1");
|
||||||
|
boolean update = this.update(ruleEngineVersion, new LambdaUpdateWrapper<RuleEngineVersion>() {{
|
||||||
|
eq(RuleEngineVersion::getId, ruleEngineVersion.getId());
|
||||||
|
}});
|
||||||
|
return update;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Boolean testEngine(RuleEngine ruleEngine) throws ServletException, IOException {
|
|
||||||
System.out.println("初始化");
|
/**
|
||||||
System.out.println(ruleEngine);
|
* 测试引擎版本
|
||||||
RuleEngineVersion ruleEngineVersion = this.getOne(new LambdaQueryWrapper<RuleEngineVersion>() {{
|
*
|
||||||
eq(RuleEngineVersion::getRuleEngineId, ruleEngine.getId());
|
* @param
|
||||||
}});
|
* @return
|
||||||
String code = ruleEngineVersion.getCodeIng();
|
* @throws Exception
|
||||||
String path = code.substring(code.indexOf("com"), code.indexOf(";")).replaceAll("\\.", "/").trim();
|
*/
|
||||||
String fileName = code.substring(code.indexOf("class") + 6, code.indexOf("{")).trim();
|
@Override
|
||||||
//代码编译
|
public boolean testEngine(String codeIng) throws Exception {
|
||||||
File file = new File("D:/ruoyi/FinallyTest/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/src/main/java/" + path + "/" + fileName + ".java");
|
String path = codeIng.substring(codeIng.indexOf("com"), codeIng.indexOf(";")).replaceAll("/.", "/").trim();
|
||||||
if (!file.exists()) {
|
String fileName = codeIng.substring(codeIng.indexOf("class") + 6, codeIng.indexOf("{")).trim();
|
||||||
//不存在创建
|
String name = path + "." + fileName;
|
||||||
file.createNewFile();
|
String javaPackageName = name.replace(".", File.separator) + ".java";
|
||||||
}else {
|
String javaAbsolutePath = "D:/ruoyi/FinallyTest/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/src/main/java/" + javaPackageName;
|
||||||
//存在测重新创建
|
String jarAbsolutePath = "D:/ruoyi/FinallyTest/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/target/classes/com/muyu/engine/domain/test";
|
||||||
file.delete();
|
Process process = Runtime.getRuntime().exec("javac -classpath " + jarAbsolutePath + " " + javaAbsolutePath);
|
||||||
file.createNewFile();
|
try {
|
||||||
|
int exitVal = process.waitFor();
|
||||||
|
System.out.println("Process exitValue: " + exitVal);
|
||||||
|
ClassLoader classLoader = ReflectionUtils.class.getClassLoader();
|
||||||
|
Class aClass = classLoader.loadClass(name);
|
||||||
|
Object o = aClass.newInstance();
|
||||||
|
Method[] methods = aClass.getMethods();
|
||||||
|
for (Method method : methods) {
|
||||||
|
method.invoke(o, null);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
}
|
}
|
||||||
String[] split = code.split("/n");
|
|
||||||
//OutputStreamWriter对象将字符转换为字节流,指定了文件输出流和编码方式。
|
|
||||||
OutputStreamWriter outputStreamWriter =
|
|
||||||
new OutputStreamWriter(new FileOutputStream(file, true), "UTF-8");
|
|
||||||
//BufferedWriter对象,用于缓冲写入数据,提高写入效率。
|
|
||||||
BufferedWriter bw = new BufferedWriter(outputStreamWriter);
|
|
||||||
for (String str : split) {
|
|
||||||
bw.write(str);
|
|
||||||
bw.newLine();
|
|
||||||
}
|
|
||||||
bw.close();
|
|
||||||
outputStreamWriter.close();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,10 @@ public class BasicConfigInfo extends BaseEntity
|
||||||
@Excel(name = "数据接入类型")
|
@Excel(name = "数据接入类型")
|
||||||
private String databaseType;
|
private String databaseType;
|
||||||
|
|
||||||
|
/** 是否已测试 */
|
||||||
|
@Excel(name = "数据接入类型")
|
||||||
|
private String isTest;
|
||||||
|
|
||||||
/** 数据库名称 */
|
/** 数据库名称 */
|
||||||
@Excel(name = "数据库名称")
|
@Excel(name = "数据库名称")
|
||||||
private String databaseName;
|
private String databaseName;
|
||||||
|
|
|
@ -136,6 +136,10 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMappe
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
try {
|
try {
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
|
basicConfigInfo.setIsTest("1");
|
||||||
|
this.update(basicConfigInfo, new LambdaUpdateWrapper<BasicConfigInfo>() {{
|
||||||
|
eq(BasicConfigInfo::getId, basicConfigInfo.getId());
|
||||||
|
}});
|
||||||
System.out.println("Connected to the MySQL server successfully.");
|
System.out.println("Connected to the MySQL server successfully.");
|
||||||
//同步数据库信息
|
//同步数据库信息
|
||||||
//树级结构,库,表
|
//树级结构,库,表
|
||||||
|
@ -385,7 +389,7 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMappe
|
||||||
conn = DriverManager.getConnection(url, user, password);
|
conn = DriverManager.getConnection(url, user, password);
|
||||||
PreparedStatement ps = conn.prepareStatement("select Count(0) from " + tableInfo.getTableName());
|
PreparedStatement ps = conn.prepareStatement("select Count(0) from " + tableInfo.getTableName());
|
||||||
ResultSet resultSet = ps.executeQuery();
|
ResultSet resultSet = ps.executeQuery();
|
||||||
while (resultSet.next()){
|
while (resultSet.next()) {
|
||||||
String a = String.valueOf(resultSet.getObject(1));
|
String a = String.valueOf(resultSet.getObject(1));
|
||||||
totalNum = resultSet.getLong(1);
|
totalNum = resultSet.getLong(1);
|
||||||
}
|
}
|
||||||
|
@ -407,4 +411,4 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMappe
|
||||||
return basicTableInfoResp;
|
return basicTableInfoResp;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<result property="dataSourcesSystemName" column="data_sources_system_name" />
|
<result property="dataSourcesSystemName" column="data_sources_system_name" />
|
||||||
<result property="host" column="host" />
|
<result property="host" column="host" />
|
||||||
<result property="port" column="port" />
|
<result property="port" column="port" />
|
||||||
|
<result property="isTest" column="is_test" />
|
||||||
<result property="databaseType" column="database_type" />
|
<result property="databaseType" column="database_type" />
|
||||||
<result property="databaseName" column="database_name" />
|
<result property="databaseName" column="database_name" />
|
||||||
<result property="initLinkNum" column="init_link_num" />
|
<result property="initLinkNum" column="init_link_num" />
|
||||||
|
@ -21,7 +22,7 @@
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectBasicConfigInfoVo">
|
<sql id="selectBasicConfigInfoVo">
|
||||||
select id, data_resource_name,username,password, data_sources_system_name, host, port, database_type, database_name, init_link_num, max_link_num, max_wait_time, max_wait_times,connection_params, remark from basic_config_info
|
select id, data_resource_name,username,password, data_sources_system_name, host, port,is_test, database_type, database_name, init_link_num, max_link_num, max_wait_time, max_wait_times,connection_params, remark from basic_config_info
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectBasicConfigInfoList" parameterType="com.muyu.etl.domain.BasicConfigInfo" resultMap="BasicConfigInfoResult">
|
<select id="selectBasicConfigInfoList" parameterType="com.muyu.etl.domain.BasicConfigInfo" resultMap="BasicConfigInfoResult">
|
||||||
|
@ -31,6 +32,7 @@
|
||||||
<if test="dataSourcesSystemName != null and dataSourcesSystemName != ''"> and data_sources_system_name like concat('%', #{dataSourcesSystemName}, '%')</if>
|
<if test="dataSourcesSystemName != null and dataSourcesSystemName != ''"> and data_sources_system_name like concat('%', #{dataSourcesSystemName}, '%')</if>
|
||||||
<if test="host != null and host != ''"> and host = #{host}</if>
|
<if test="host != null and host != ''"> and host = #{host}</if>
|
||||||
<if test="port != null and port != ''"> and port = #{port}</if>
|
<if test="port != null and port != ''"> and port = #{port}</if>
|
||||||
|
<if test="isTest != null and isTest != ''"> and is_test = #{isTest}</if>
|
||||||
<if test="databaseType != null and databaseType != ''"> and database_type = #{databaseType}</if>
|
<if test="databaseType != null and databaseType != ''"> and database_type = #{databaseType}</if>
|
||||||
<if test="databaseName != null and databaseName != ''"> and database_name like concat('%', #{databaseName}, '%')</if>
|
<if test="databaseName != null and databaseName != ''"> and database_name like concat('%', #{databaseName}, '%')</if>
|
||||||
<if test="username != null "> and username = #{username}</if>
|
<if test="username != null "> and username = #{username}</if>
|
||||||
|
@ -55,6 +57,7 @@
|
||||||
<if test="dataSourcesSystemName != null">data_sources_system_name,</if>
|
<if test="dataSourcesSystemName != null">data_sources_system_name,</if>
|
||||||
<if test="host != null">host,</if>
|
<if test="host != null">host,</if>
|
||||||
<if test="port != null">port,</if>
|
<if test="port != null">port,</if>
|
||||||
|
<if test="isTest != null">is_test,</if>
|
||||||
<if test="databaseType != null">database_type,</if>
|
<if test="databaseType != null">database_type,</if>
|
||||||
<if test="databaseName != null">database_name,</if>
|
<if test="databaseName != null">database_name,</if>
|
||||||
<if test="username != null">username,</if>
|
<if test="username != null">username,</if>
|
||||||
|
@ -72,6 +75,7 @@
|
||||||
<if test="dataSourcesSystemName != null">#{dataSourcesSystemName},</if>
|
<if test="dataSourcesSystemName != null">#{dataSourcesSystemName},</if>
|
||||||
<if test="host != null">#{host},</if>
|
<if test="host != null">#{host},</if>
|
||||||
<if test="port != null">#{port},</if>
|
<if test="port != null">#{port},</if>
|
||||||
|
<if test="isTest != null">#{is_test},</if>
|
||||||
<if test="databaseType != null">#{databaseType},</if>
|
<if test="databaseType != null">#{databaseType},</if>
|
||||||
<if test="databaseName != null">#{databaseName},</if>
|
<if test="databaseName != null">#{databaseName},</if>
|
||||||
<if test="username != null">#{username},</if>
|
<if test="username != null">#{username},</if>
|
||||||
|
@ -92,6 +96,7 @@
|
||||||
<if test="dataSourcesSystemName != null">data_sources_system_name = #{dataSourcesSystemName},</if>
|
<if test="dataSourcesSystemName != null">data_sources_system_name = #{dataSourcesSystemName},</if>
|
||||||
<if test="host != null">host = #{host},</if>
|
<if test="host != null">host = #{host},</if>
|
||||||
<if test="port != null">port = #{port},</if>
|
<if test="port != null">port = #{port},</if>
|
||||||
|
<if test="isTest != null">is_test = #{isTest},</if>
|
||||||
<if test="databaseType != null">database_type = #{databaseType},</if>
|
<if test="databaseType != null">database_type = #{databaseType},</if>
|
||||||
<if test="databaseName != null">database_name = #{databaseName},</if>
|
<if test="databaseName != null">database_name = #{databaseName},</if>
|
||||||
<if test="username != null">username = #{username},</if>
|
<if test="username != null">username = #{username},</if>
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
<select id="selectTableInfoByName" parameterType="com.muyu.etl.domain.TableInfo" resultMap="TableInfoResult">
|
<select id="selectTableInfoByName" parameterType="com.muyu.etl.domain.TableInfo" resultMap="TableInfoResult">
|
||||||
select * from table_info
|
select * from table_info
|
||||||
where basic_id = #{basicId} and (table_name = #{tableName} or parent_id = #{parentId})
|
where basic_id = #{basicId} and table_name = #{tableName}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue