Compare commits

..

2 Commits

Author SHA1 Message Date
xiang2lin ff53786a53 劳务费模块 2025-05-13 11:50:51 +08:00
lvleigang 0fbc2b3679 fw-grpU8分支结构上传 2024-09-14 09:49:03 +08:00
354 changed files with 39531 additions and 11574 deletions

3
.gitignore vendored
View File

@ -63,6 +63,3 @@ $RECYCLE.BIN/
/base-buildpackage/target/
/base-common/target/
/base-core/target/
/base-webapp/target/classes/com/hzya/frame/
/fw-weixin/target/
/E:/yongansystem/log/2024-10-15/

View File

@ -38,18 +38,6 @@
<profile.active>llg</profile.active>
</properties>
</profile>
<profile>
<id>xel</id> <!--xel-->
<properties>
<profile.active>xel</profile.active>
</properties>
</profile>
<profile>
<id>zqtlocal</id> <!--曾庆拓-->
<properties>
<profile.active>zqtlocal</profile.active>
</properties>
</profile>
</profiles>
<build>

View File

@ -1,386 +0,0 @@
package com.hzya.frame.plugin.BackUpDatabase.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.SftpATTRS;
import com.jcraft.jsch.SftpException;
import org.apache.commons.net.ftp.FTPClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.nio.file.Files;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Properties;
/**
* 主数据模版(MdmModule)表服务接口
*
* @author makejava
* @since 2024-06-18 10:33:32
*/
public class BackUpDatabaseInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(BackUpDatabaseInitializer.class);
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
@Override
public String getPluginId() {
return "BackUpDatabasePlugin";
}
@Override
public String getPluginName() {
return "数据库备份下发";
}
@Override
public String getPluginLabel() {
return "BackUpDatabasePlugin";
}
@Override
public String getPluginType() {
return "1";
}
@Value("${database.filePase:}")
private String filePase;//文件保存路径
@Value("${database.fileName:data.sql}")
private String fileName;//文件保存名称
@Value("${database.databaseName:}")
private String databaseName;//库名
@Value("${database.host:}")
private String host;//地址
@Value("${database.port:}")
private String port;//端口
@Value("${database.username:}")
private String username;//用户名
@Value("${database.password:}")
private String password;//密码
@Value("${sftp.host:}")
private String sftpHost;
@Value("${sftp.port:}")
private Integer sftpPort;
@Value("${sftp.username:}")
private String sftpUsername;
@Value("${sftp.password:}")
private String sftpPassword;
@Value("${sftp.filePase:}")
private String sftpFilePase;
private ChannelSftp sftp = null;
private Session sshSession = null;
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) {
try {
if(filePase == null || "".equals(filePase)
|| databaseName == null || "".equals(databaseName)
|| fileName == null || "".equals(fileName)
|| host == null || "".equals(host)
|| port == null || "".equals(port)
|| username == null || "".equals(username)
|| password == null || "".equals(password)
){
return BaseResult.getSuccessMessageEntity("系统参数未配置不执行,数据库备份");
}
//查找是否存在当天数据库
//格式化日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String data = sdf.format(new Date());
//当天路径
String nowDatabasePase = filePase + File.separator + data;
//不判断文件是否存在直接执行
if(!backFile(nowDatabasePase)){
return BaseResult.getFailureMessageEntity("备份失败");
}
//判断是否有sftp配置有的备份没有的不备份
if(sftpHost != null && !"".equals(sftpHost)
&& sftpPort != null && !"".equals(sftpPort)
&& sftpUsername != null && !"".equals(sftpUsername)
&& sftpPassword != null && !"".equals(sftpPassword)
&& sftpFilePase != null && !"".equals(sftpFilePase)
){
String sftpnowDatabasePase = sftpFilePase + File.separator + data;
if(!sendFile(nowDatabasePase,sftpnowDatabasePase)){
return BaseResult.getFailureMessageEntity("备份失败");
}
}
logger.info("执行成功");
return BaseResult.getSuccessMessageEntity("执行成功");
} catch (Exception e) {
logger.error("执行失败{}", e.getMessage());
return BaseResult.getFailureMessageEntity("备份失败");
}
}
private boolean backFile(String nowDatabasePase) {
try {
// 构建 mysqldump 命令
ProcessBuilder processBuilder = new ProcessBuilder(
"mysqldump",
"--ssl-mode=DISABLED",
"-h", host,
"-u", username,
"-p" + password,
"-P" + port,
databaseName);
// 启动进程并获取输入流
Process process = processBuilder.start();
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
File f = creatFile(nowDatabasePase,fileName);
// 将备份内容写入文件
FileWriter writer = new FileWriter(f);
String line;
while ((line = reader.readLine())!= null) {
writer.write(line + "\n");
}
// 关闭资源
reader.close();
writer.close();
process.waitFor();
logger.info("文件备份成功路径:"+nowDatabasePase+ File.separator +fileName);
return true;
} catch (IOException | InterruptedException e) {
logger.info("文件备份失败:"+e.getMessage());
return false;
}
}
/**
* @Author lvleigang
* @Description 创建目录及文件
* @Date 8:59 上午 2024/10/22
* @param filePath
* @param fileName
* @return java.io.File
**/
public File creatFile(String filePath, String fileName) {
File folder = new File(filePath);
//文件夹路径不存在
if (!folder.exists()) {
boolean mkdirs = folder.mkdirs();
}
// 如果文件不存在就创建
File file = new File(filePath + File.separator + fileName);
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
logger.error("创建备份文件失败:"+e.getMessage());
}
}
return file;
}
private boolean sendFile(String localFilePath,String remoteFileName) {
try {
connect();
uploadFile(remoteFileName,fileName,localFilePath,fileName);
disconnect();
return true;
} catch (Exception e) {
logger.error("sftp文件上传失败:"+e.getMessage());
return false;
}
}
public void connect() {
try {
JSch jsch = new JSch();
jsch.getSession(sftpUsername, sftpHost, sftpPort);
sshSession = jsch.getSession(sftpUsername, sftpHost, sftpPort);
if (logger.isInfoEnabled()) {
logger.info("Session created.");
}
sshSession.setPassword(sftpPassword);
Properties sshConfig = new Properties();
sshConfig.put("StrictHostKeyChecking", "no");
sshSession.setConfig(sshConfig);
sshSession.connect();
if (logger.isInfoEnabled()) {
logger.info("Session connected.");
}
Channel channel = sshSession.openChannel("sftp");
channel.connect();
if (logger.isInfoEnabled()) {
logger.info("Opening Channel.");
}
sftp = (ChannelSftp) channel;
if (logger.isInfoEnabled()) {
logger.info("Connected to " + host + ".");
}
} catch (Exception e) {
}
}
/**
* 关闭连接
*/
public void disconnect() {
if (this.sftp != null) {
if (this.sftp.isConnected()) {
this.sftp.disconnect();
if (logger.isInfoEnabled()) {
logger.info("sftp is closed already");
}
}
}
if (this.sshSession != null) {
if (this.sshSession.isConnected()) {
this.sshSession.disconnect();
if (logger.isInfoEnabled()) {
logger.info("sshSession is closed already");
}
}
}
}
/**
* 上传单个文件
*
* @param remotePath远程保存目录
* @param remoteFileName保存文件名
* @param localPath本地上传目录(以路径符号结束)
* @param localFileName上传的文件名
* @return
*/
public boolean uploadFile(String remotePath, String remoteFileName, String localPath, String localFileName) {
FileInputStream in = null;
try {
createDir(remotePath);
File file = new File(localPath + File.separator + localFileName);
in = new FileInputStream(file);
sftp.put(in, remoteFileName, 65536);
return true;
} catch (FileNotFoundException e) {
} catch (SftpException e) {
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
}
}
}
return false;
}
/**
* 创建目录
*
* @param createpath
* @return
*/
public boolean createDir(String createpath) {
try {
if (isDirExist(createpath)) {
this.sftp.cd(createpath);
return true;
}
String pathArry[] = createpath.split("/");
StringBuffer filePath = new StringBuffer("/");
for (String path : pathArry) {
if (path.equals("")) {
continue;
}
filePath.append(path + "/");
if (isDirExist(filePath.toString())) {
sftp.cd(filePath.toString());
} else {
// 建立目录
sftp.mkdir(filePath.toString());
// 进入并设置为当前目录
sftp.cd(filePath.toString());
}
}
this.sftp.cd(createpath);
return true;
} catch (SftpException e) {
}
return false;
}
/**
* 判断目录是否存在
*
* @param directory
* @return
*/
public boolean isDirExist(String directory) {
boolean isDirExistFlag = false;
try {
SftpATTRS sftpATTRS = sftp.lstat(directory);
isDirExistFlag = true;
return sftpATTRS.isDir();
} catch (Exception e) {
if (e.getMessage().toLowerCase().equals("no such file")) {
isDirExistFlag = false;
}
}
return isDirExistFlag;
}
/**
* 如果目录不存在就创建目录
*
* @param path
*/
public void mkdirs(String path) {
File f = new File(path);
String fs = f.getParent();
f = new File(fs);
if (!f.exists()) {
f.mkdirs();
}
}
}

View File

@ -452,7 +452,6 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
}
}
} catch (Exception e) {
logger.info("执行异常错误原因:"+e);
logger.error("新增返回脚本解析保存三方id错误"+jsonResultEntity.getAttribute());
taskDetailEntity.setResult("新增返回脚本解析保存三方id错误");
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
@ -544,7 +543,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
map1.put("tableName",mainDb);
map1.put("dataStatus", "N");
map1.put("deleteStatus", "0");
map1.put("size", 50);
map1.put("size", 10);
objects = mdmModuleDao.queryMdmSTs(map1);
objects = toLowerCaseKeys(objects);
@ -739,7 +738,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
map1.put("tableName",mainDb);
//map1.put("dataStatus", "F");
map1.put("updateStatus", "0");
map1.put("size", 50);
map1.put("size", 10);
objects = mdmModuleDao.queryMdmSTs(map1);
objects = toLowerCaseKeys(objects);
@ -927,7 +926,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
map1.put("tableName",mainDb);
//map1.put("dataStatus", "Y");
map1.put("addStatus", "0");
map1.put("size", 50);
map1.put("size", 100);
objects = mdmModuleDao.queryMdmSTs(map1);
objects = toLowerCaseKeys(objects);
@ -992,7 +991,6 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
mdmModuleSendLogEntity.setTableName(mainDb+"_send_log");
mdmModuleSendLogEntity.setFormmainId(doObjects.get(i).getString("id"));
mdmModuleSendLogEntity.setSts("Y");
mdmModuleSendLogEntity.setDataType("1");
mdmModuleSendLogEntity.setAppId(sysApplicationEntity.getId());
mdmModuleSendLogEntity.setApiId(apiEntity.getId());
//mdmModuleSendLogEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId());
@ -1123,12 +1121,10 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
}
//保存日志
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1");
objects.get(i).put("sendsanfzt123",true);
continue;
}else {
//保存日志
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1");
objects.get(i).put("sendsanfzt123",false);
continue;
}
}
@ -1136,14 +1132,12 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
//所有下发发送完成修改数据状态
for (int i = 0; i < objects.size(); i++) {
if(objects.get(i).getBoolean("sendsanfzt123")){
Map<String, Object> updateMap = new HashMap<>();
updateMap.put("tableName",mainDb);
//updateMap.put("dataStatus", "Y");
updateMap.put("addStatus", "1");
updateMap.put("id", objects.get(i).getString("id"));
mdmModuleDao.updateMdmSTs(updateMap);
}
Map<String, Object> updateMap = new HashMap<>();
updateMap.put("tableName",mainDb);
//updateMap.put("dataStatus", "Y");
updateMap.put("addStatus", "1");
updateMap.put("id", objects.get(i).getString("id"));
mdmModuleDao.updateMdmSTs(updateMap);
}
}

View File

@ -62,7 +62,6 @@ public class PushMessagePluginInitializer extends PluginBaseEntity {
public JsonResultEntity executeBusiness(JSONObject requestJson) {
try {
logger.info("======开始执行定时消息推送========");
//目前只查询一周内的异常日志进行消息推送
List<SysPushMessageEntity> list = sysPushMessageDao.getAll();
for(SysPushMessageEntity entity : list){

View File

@ -45,7 +45,7 @@ savefile:
tomcatpath: /Users/apple/Desktop/log/local
pluginpath: /Users/apple/Desktop/log/local
zt:
url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
cbs8:
appId: 1P4AGrpz
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
@ -59,24 +59,4 @@ cbs8:
#电子回单下载临时存放位置
elec_path: /Users/xiangerlin/Downloads/
OA:
data_source_code: yc_oa
server:
port: 10086
# mysqldump -d mylm -hhzya.ufyct.com -p9096 -uroot -phzya1314 >%dirName%\table_view.sql
database:
databaseName: businesscenter
host: 192.168.2.237
port: 3306
username: root
password: hzya@1314
filePase: /Users/apple/Desktop/log
fileName: data.sql
#sftp:
# host: 192.168.2.237
# port: 9091
# username: cs237
# password: hzya@1314
# filePase: /databaseBack
data_source_code: yc_oa

View File

@ -14,10 +14,22 @@ spring:
master:
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
username: root
password: bd993088e8a7c3dc5f44441617f9b4bf
password: 62e4295b615a30dbf3b8ee96f41c820b
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
savefile:
# 文件保存路径
path: /Users/xiangerlin/work/app/file/dev
pluginpath: /Users/xiangerlin/work/app/file/dev
tomcatpath: /Users/xiangerlin/work/app/file/dev
cbs8:
appId: 1P4AGrpz
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
url: https://cbs8-openapi-reprd.csuat.cmburl.cn
# 测试用这个 这个是银行给的,和下面的公钥不是一对密钥
ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44
# 这个私钥到时候上传到cbs和下面到是同一对
#ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46
ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde
cbs_public_key: 0469146F06BF3B01236E84632441E826F3067A6B93BC3839C836A06007869CD351FBBE388B51F742859388BBC1DE089923AAFBC69E448F15141DDF30EE6CE90185
#电子回单下载临时存放位置
elec_path: /Users/xiangerlin/Downloads/
OA:
data_source_code: yc-test

View File

@ -36,4 +36,4 @@ cbs8:
OA:
data_source_code: yc_oa
zt:
url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface
url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface

View File

@ -1,5 +1,5 @@
server:
port: 10086
port: 9999
servlet:
context-path: /kangarooDataCenterV3
localIP: 127.0.0.1
@ -93,7 +93,7 @@ mybatis-plus:
db-config:
id-type: auto # 主键策略
zt:
url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
#JimuReport[minidao配置]
minidao :
base-package: org.jeecg.modules.jmreport.desreport.dao*
@ -126,17 +126,3 @@ jeecg :
bucketName: ??
data:
use: true
database:
databaseName:
host:
port:
username:
password:
filePase:
fileName:
sftp:
host:
port:
username:
password:
filePase:

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<id>BackUpDatabasePlugin</id>
<name>BackUpDatabasePlugin插件</name>
<category>20241021</category>
</plugin>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
<bean name="backUpDatabaseInitializer" class="com.hzya.frame.plugin.BackUpDatabase.plugin.BackUpDatabaseInitializer" />
</beans>

View File

@ -1,37 +1,19 @@
package com.hzya.frame;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.util.AESUtil;
import org.apache.http.HttpEntity;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @ClassName dsasas
* @Description
* @Author llg
* Date 2023/7/16 8:18 上午
*/
//@RunWith(SpringRunner.class)
//@SpringBootTest(classes = {WebappApplication.class})
@RunWith(SpringRunner.class)
@SpringBootTest(classes = {WebappApplication.class})
public class temButtom {
@Test
@ -43,104 +25,6 @@ public class temButtom {
}
@Test
public void test02() {
// 1056162015172640840 -7858803986346327947 3178176833471791293 合同评审-待办测试(bdmanager 2024-10-22 16:45) 7743552636545550897 bdmanager 18058147870 pending start success 新增成功!
// success 更新待办为已办成功
// task7803207f54ff047d6008dcce31c2628f 新增成功!
// 2024-10-24 2024-10-24
String phone ="19357235324";
String taskid ="task8b0c7ca72439bc9b0c1c89e8866c8275";
//token
Map<String, String> headers = new HashMap<>();
String token ="https://oapi.dingtalk.com/gettoken?appkey=dingxewtjaserj292ggu&appsecret=DuRw6EEEvhGXfr6Q8wN_x4025qKjrffIGCXF9KeCKKIID-LVSsR6_8KWMei6sug1";
String body = sendGet(token,headers);
JSONObject tokenobject = JSONObject.parseObject(body);
//钉钉id
headers = new HashMap<>();
//https://oapi.dingtalk.com/user/get_by_mobile?access_token=9abd3996cb103ba48dd8c69fea5473e7&mobile=15700100840
String ddid ="https://oapi.dingtalk.com/user/get_by_mobile?access_token="+tokenobject.get("access_token")+"&mobile="+phone;
String ddidbody = sendGet(ddid,headers);
JSONObject ddidobject = JSONObject.parseObject(ddidbody);
//人员id
headers = new HashMap<>();
//https://oapi.dingtalk.com/user/get?userid=111336474727636213&access_token=3d21a6614fb037a98542a537336e8149
String userid ="https://oapi.dingtalk.com/user/get?userid="+ddidobject.get("userid")+"&access_token="+tokenobject.get("access_token");
String useridbody = sendGet(userid,headers);
JSONObject useridobject = JSONObject.parseObject(useridbody);
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPut httpPut = new HttpPut("https://api.dingtalk.com/v1.0/todo/users/"+useridobject.get("unionid")+"/tasks/"+taskid);
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000).setConnectionRequestTimeout(35000).setSocketTimeout(60000).build();
httpPut.setConfig(requestConfig);
httpPut.setHeader("Content-type", "application/json");
httpPut.setHeader("x-acs-dingtalk-access-token", tokenobject.getString("access_token"));
Map<String, Object> dataMap = new HashMap();
dataMap.put("done", true);
CloseableHttpResponse httpResponse = null;
try {
httpPut.setEntity(new StringEntity("{\"done\": true}"));
httpResponse = httpClient.execute(httpPut);
HttpEntity entity = httpResponse.getEntity();
String results = EntityUtils.toString(entity);
System.out.println(results);
} catch (Exception var15) {
} finally {
try {
httpResponse.close();
httpClient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
private String sendGet(String url, Map<String, String> headers) {
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
// HttpClient
CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build();
HttpGet get = new HttpGet(url.toString());
CloseableHttpResponse response = null;
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(60000).build();
get.setConfig(requestConfig);//设置请求参数超时时间
if (headers != null && headers.size() > 0) {
for (String key : headers.keySet()) {
get.setHeader(key, headers.get(key));
}
}
StringBuilder body = new StringBuilder();
try {
response = closeableHttpClient.execute(get);
HttpEntity entity = response.getEntity();
body.append(EntityUtils.toString(entity,"UTF-8"));
} catch (Exception e) {
body.append(e.getMessage());
} finally {
try {
// 关闭响应对象
if (response != null) {
response.close();
}
// 关闭响应对象
if (closeableHttpClient != null) {
closeableHttpClient.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return body.toString();
}
}

View File

@ -5,8 +5,6 @@ import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
import cn.hutool.crypto.symmetric.SymmetricCrypto;
import static cn.hutool.crypto.CipherMode.encrypt;
/**
* @Description AES加密解密
* @Author xiang2lin
@ -79,9 +77,4 @@ public class AESUtil {
return null;
}
public static void main(String[] args) {
String data = "U8C241231";
String encrypt1 = encrypt(data);
System.out.println(encrypt1);
}
}

View File

@ -7,6 +7,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.context.support.ApplicationObjectSupport;
/**
* @author 郭军辉
* <p>
@ -25,7 +26,7 @@ public class DefaultController extends ApplicationObjectSupport {
* @return
*/
public JsonResultEntity getFailureMessageEntity(String message) {
return new JsonResultEntity(message, false, "500");
return new JsonResultEntity(message, false);
}
/**
@ -34,8 +35,8 @@ public class DefaultController extends ApplicationObjectSupport {
* @param message 提示信息
* @return
*/
public JsonResultEntity getFailureMessageEntity(String message, Object mo) {
return new JsonResultEntity(message, false, "500", mo);
public JsonResultEntity getFailureMessageEntity(String message, Object mo) {
return new JsonResultEntity(message, false, mo);
}
/**
@ -45,8 +46,8 @@ public class DefaultController extends ApplicationObjectSupport {
* @param mo 返回对象
* @return
*/
public JsonResultEntity getSuccessMessageEntity(String message, Object mo) {
return new JsonResultEntity(message, true, "200", mo);
public JsonResultEntity getSuccessMessageEntity(String message, Object mo) {
return new JsonResultEntity(message, true, mo);
}
/**
@ -55,11 +56,18 @@ public class DefaultController extends ApplicationObjectSupport {
* @param message 提示消息
* @return
*/
public JsonResultEntity getSuccessMessageEntity(String message) {
return new JsonResultEntity(message, true, "200");
public JsonResultEntity getSuccessMessageEntity(String message ) {
return new JsonResultEntity(message, true);
}
/**
* //绑定org_id
*

View File

@ -1,48 +0,0 @@
package com.hzya.frame.dingtalk.enums;
/**
* @Description 通讯录事件类型
* @Author xiangerlin
* @Date 2024/8/27 15:58
**/
public enum OrgEventEnum {
USER_ADD_ORG("user_add_org","通讯录用户新增"),
USER_MODIFY_ORG("user_modify_org","通讯录用户更改"),
USER_LEAVE_ORG("user_leave_org","通讯录用户离职"),
USER_ACTIVE_ORG("user_active_org","加入企业后用户激活"),
ORG_DEPT_CREATE("org_dept_create","通讯录企业部门创建"),
ORG_DEPT_MODIFY("org_dept_modify","通讯录企业部门更改"),
ORG_DEPT_REMOVE("org_dept_remove","通讯录企业部门删除"),
;
private String code;
private String explain;
OrgEventEnum(String code, String explain) {
this.code = code;
this.explain = explain;
}
public String getCode() {
return code;
}
public String getExplain() {
return explain;
}
/**
* 根据code获取事件类型
* @param code
* @return
*/
public static OrgEventEnum getByCode(String code){
for (OrgEventEnum org : OrgEventEnum.values()) {
if (org.getCode().equals(code)){
return org;
}
}
return null;
}
}

View File

@ -1,32 +0,0 @@
package com.hzya.frame.dingtalk.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sysnew.application.entity.SysApplicationEntity;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
/**
* @Description 钉钉集成扩展类
* @Author xiangerlin
* @Date 2024/8/28 14:25
**/
public interface IDingTalkExtService {
/**
* 调用这个方法初始化钉钉参数
* @param entity
* @return
*/
SysExtensionApiEntity init(SysExtensionApiEntity entity);
/**
* 查询配置在应用上的钉钉参数
* @param sysApplication
* @return
*/
JSONObject getDingTalkConfig(SysApplicationEntity sysApplication);
/**
* 清空配置缓存
*/
void clearDingTalkConfigCatch();
}

View File

@ -1,66 +0,0 @@
package com.hzya.frame.dingtalk.service;
import com.dingtalk.api.request.OapiV2UserListRequest;
import com.dingtalk.api.response.OapiV2DepartmentGetResponse;
import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
import com.dingtalk.api.response.OapiV2UserGetResponse;
import com.dingtalk.api.response.OapiV2UserListResponse;
import java.util.List;
/**
* @Description 钉钉service
* @Author xiangerlin
* @Date 2024/8/27 16:17
**/
public interface IDingTalkService {
/**
* 根据userid获取用户详情
* @param userId 钉钉userid
* @param appKey
* @param appSecret
* @return
*/
OapiV2UserGetResponse.UserGetResponse getUserById(String userId, String appKey, String appSecret);
/**
* 根据userid获取用户详情
* @param userId
* @return
*/
OapiV2UserGetResponse.UserGetResponse getUserById(String userId);
/**
* 获取部门用户列表
* @param req 请求参数
* @param appKey
* @param appSecret
* @return
*/
OapiV2UserListResponse.PageResult getUserListByDeptId(OapiV2UserListRequest req, String appKey, String appSecret);
/**
* 根据部门id获取部门详情
* @param deptId 钉钉部门id
* @param appKey
* @param appSecret
* @return
*/
OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId, String appKey, String appSecret);
/**
* 根据部门id获取部门详情
* @param deptId
* @return
*/
OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId);
/**
* 获取部门列表此接口只会返回下一级部门信息
* @param deptId 部门id如果不传则查询一级部门
* @param appKey
* @param appSecret
* @return
*/
List<OapiV2DepartmentListsubResponse.DeptBaseResponse> getDeptList(Long deptId, String appKey, String appSecret);
}

View File

@ -1,100 +0,0 @@
package com.hzya.frame.dingtalk.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.dingtalk.service.IDingTalkExtService;
import com.hzya.frame.dingtalk.util.DingTalkAccessToken;
import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity;
import com.hzya.frame.sysnew.application.apiPara.dao.ISysApplicationApiParaDao;
import com.hzya.frame.sysnew.application.apiPara.entity.SysApplicationApiParaEntity;
import com.hzya.frame.sysnew.application.apiPara.service.ISysApplicationApiParaService;
import com.hzya.frame.sysnew.application.entity.SysApplicationEntity;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @Description 钉钉集成扩展类
* @Author xiangerlin
* @Date 2024/8/28 14:25
**/
@Service(value = "dingTalkExtService")
public class DingTalkExtServiceImpl implements IDingTalkExtService {
@Resource
private ISysApplicationApiParaDao sysApplicationApiParaDao;
private final ConcurrentHashMap<String, JSONObject> dingTalkMap = new ConcurrentHashMap<>();
/**
* 调用这个方法初始化钉钉参数
*
* @param entity
* @return
*/
@Override
public SysExtensionApiEntity init(SysExtensionApiEntity entity) {
Map<String, String> headers = entity.getHeaders();
if (null == headers){
headers = new HashMap<>();
}
SysApplicationEntity receiveApp = entity.getReceiveApp();
//查询应用上配置的参数
JSONObject dingTalkConfig = getDingTalkConfig(receiveApp);
//给token赋值
entity.setQuerys("access_token="+DingTalkAccessToken.getAccessToken(dingTalkConfig.getString("appKey"),dingTalkConfig.getString("appSecret")));
return entity;
}
/**
* 查询配置在应用上的钉钉参数
*
* @param sysApplication
* @return
*/
@Override
public JSONObject getDingTalkConfig(SysApplicationEntity sysApplication) {
if (null != sysApplication && StrUtil.isNotEmpty(sysApplication.getId()) && null != sysApplication.getAppId()){
JSONObject jsonObject = new JSONObject();
String key = sysApplication.getAppId()+"dingTalk";
if (null != dingTalkMap.get(key)){
return dingTalkMap.get(key);
}else {
//查询应用上配置的参数
SysApplicationApiParaEntity paraEntity = new SysApplicationApiParaEntity();
paraEntity.setAppId(sysApplication.getId());
List<SysApplicationApiParaEntity> paraList = sysApplicationApiParaDao.query(paraEntity);
if (CollectionUtils.isNotEmpty(paraList)) {
List<SysApplicationApiParaEntity> appKeyList = paraList.stream().filter(p -> p.getInterfaceKey().equals("appKey")).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(appKeyList)) {
jsonObject.put("appKey", appKeyList.get(0).getInterfaceValue());
}
List<SysApplicationApiParaEntity> appSecretList = paraList.stream().filter(p -> p.getInterfaceKey().equals("appSecret")).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(appSecretList)) {
jsonObject.put("appSecret", appSecretList.get(0).getInterfaceValue());
}
dingTalkMap.put(key,jsonObject);
return dingTalkMap.get(key);
}
}
}
return null;
}
/**
* 清空配置缓存
*/
@Override
public void clearDingTalkConfigCatch() {
dingTalkMap.clear();
}
}

View File

@ -1,164 +0,0 @@
package com.hzya.frame.dingtalk.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.dingtalk.api.DefaultDingTalkClient;
import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiV2DepartmentGetRequest;
import com.dingtalk.api.request.OapiV2DepartmentListsubRequest;
import com.dingtalk.api.request.OapiV2UserGetRequest;
import com.dingtalk.api.request.OapiV2UserListRequest;
import com.dingtalk.api.response.OapiV2DepartmentGetResponse;
import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
import com.dingtalk.api.response.OapiV2UserGetResponse;
import com.dingtalk.api.response.OapiV2UserListResponse;
import com.hzya.frame.dingtalk.service.IDingTalkService;
import com.hzya.frame.dingtalk.util.DingTalkAccessToken;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description 钉钉service
* @Author xiangerlin
* @Date 2024/8/27 16:17
**/
@Service(value = "dingTalkService")
public class DingTalkServiceImpl implements IDingTalkService {
Logger logger = LoggerFactory.getLogger(getClass());
@Value("${dingtalk.appKey:}")
private String dAppKey;
@Value("${dingtalk.appSecret:}")
private String dAppSecret;
/**
* 根据userid获取用户详情
*
* @param userId 钉钉userid
* @param appKey
* @param appSecret
* @return
*/
@Override
public OapiV2UserGetResponse.UserGetResponse getUserById(String userId, String appKey, String appSecret) {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/get");
OapiV2UserGetRequest req = new OapiV2UserGetRequest();
req.setUserid(userId);
req.setLanguage("zh_CN");
try {
OapiV2UserGetResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret));
if (rsp.isSuccess()){
OapiV2UserGetResponse.UserGetResponse result = rsp.getResult();
String s = JSONObject.toJSONString(result);
logger.info("人员详情信息:{}",s);
return result;
}
}catch (Exception e){
logger.error("根据部门id获取钉钉用户详情出错{}",e);
}
return null;
}
/**
* 根据userid获取用户详情
*
* @param userId
* @return
*/
@Override
public OapiV2UserGetResponse.UserGetResponse getUserById(String userId) {
return getUserById(userId,dAppKey,dAppSecret);
}
/**
* 获取部门用户列表
*
* @param req 请求参数
* @param appKey
* @param appSecret
* @return
*/
@Override
public OapiV2UserListResponse.PageResult getUserListByDeptId(OapiV2UserListRequest req, String appKey, String appSecret) {
try {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/list");
req.setSize(100L);//每页最大只能查100条
req.setOrderField("modify_desc");
req.setContainAccessLimit(false);
req.setLanguage("zh_CN");
OapiV2UserListResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret));
OapiV2UserListResponse.PageResult result = rsp.getResult();
return result;
}catch (Exception e){
e.printStackTrace();
}
return null;
}
/**
* 根据部门id获取部门详情
*
* @param deptId 钉钉部门id
* @param appKey
* @param appSecret
* @return
*/
@Override
public OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId, String appKey, String appSecret) {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/get");
OapiV2DepartmentGetRequest req = new OapiV2DepartmentGetRequest();
req.setDeptId(deptId);
req.setLanguage("zh_CN");
try {
OapiV2DepartmentGetResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret));
if (rsp.isSuccess()){
OapiV2DepartmentGetResponse.DeptGetResponse result = rsp.getResult();
String s = JSONObject.toJSONString(result);
logger.info("部门详情信息:{}",s);
return result;
}
}catch(Exception e){
logger.error("根据部门id获取钉钉部门出错{}",e);
}
return null;
}
/**
* 根据部门id获取部门详情
*
* @param deptId
* @return
*/
@Override
public OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId) {
return getDeptById(deptId,dAppKey,dAppSecret);
}
/**
* 获取部门列表此接口只会返回下一级部门信息
* @param deptId 部门id如果不传则查询一级部门
* @param appKey
* @param appSecret
* @return
*/
@Override
public List<OapiV2DepartmentListsubResponse.DeptBaseResponse> getDeptList(Long deptId,String appKey,String appSecret) {
try {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/listsub");
OapiV2DepartmentListsubRequest req = new OapiV2DepartmentListsubRequest();
req.setDeptId(deptId);
req.setLanguage("zh_CN");
OapiV2DepartmentListsubResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret));
if (rsp.isSuccess()){
List<OapiV2DepartmentListsubResponse.DeptBaseResponse> result = rsp.getResult();
return result;
}
}catch (Exception e){
logger.error("获取部门列表接口出错:{}",e);
}
return null;
}
}

View File

@ -1,103 +0,0 @@
package com.hzya.frame.dingtalk.util;
import cn.hutool.core.util.StrUtil;
import com.aliyun.dingtalkoauth2_1_0.models.GetAccessTokenResponse;
import com.aliyun.tea.TeaException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import java.time.Instant;
/**
* @Description 钉钉获取accessToken
* @Author xiangerlin
* @Date 2024/8/27 14:05
**/
public class DingTalkAccessToken {
static Logger logger = LoggerFactory.getLogger(DingTalkAccessToken.class);
//token
private static String accessToken;
//过期时间
private static Instant expireTime;
private static final Long CACHE_EXPIRY_TIME = 7000L; // 缓存有效时间
//应用key
private static String appKey;
//应用密钥
private static String appSecret;
@Value("${dingtalk.appKey:}")
public static void setAppKey(String appKey) {
DingTalkAccessToken.appKey = appKey;
}
@Value("${dingtalk.appSecret:}")
public static void setAppSecret(String appSecret) {
DingTalkAccessToken.appSecret = appSecret;
}
/**
* 获取token
* @return
*/
public static String getAccessToken(){
return getAccessToken(appKey,appSecret);
}
/**
* 获取accessToken
*
* @param appKey
* @param appSecret
* @return
*/
public static String getAccessToken(String appKey,String appSecret) {
//判断是否过期 如果没过期直接返回
if (null != accessToken && expireTime != null && Instant.now().isBefore(expireTime)) {
return accessToken;
}
//获取新的accessToken
accessToken = fetchNewAccessToken(appKey,appSecret);
//过期时间设置成当前事件+7000s预留200s的时间
expireTime = Instant.now().plusSeconds(CACHE_EXPIRY_TIME);
return accessToken;
}
/**
* 获取新的accessToken
*
* @return
*/
private static String fetchNewAccessToken(String appKey,String appSecret) {
try {
//查询应用上配置的钉钉信息
if (StrUtil.isNotEmpty(appKey) && StrUtil.isNotEmpty(appSecret)) {
//查询应用上的信息
com.aliyun.dingtalkoauth2_1_0.Client client = DingTalkAccessToken.createClient();
com.aliyun.dingtalkoauth2_1_0.models.GetAccessTokenRequest getAccessTokenRequest = new com.aliyun.dingtalkoauth2_1_0.models.GetAccessTokenRequest()
.setAppKey(appKey)
.setAppSecret(appSecret);
GetAccessTokenResponse accessToken = client.getAccessToken(getAccessTokenRequest);
String accessToken1 = accessToken.getBody().getAccessToken();
return accessToken1;
}
} catch (Exception _err) {
TeaException err = new TeaException(_err.getMessage(), _err);
if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
// err 中含有 code message 属性可帮助开发定位问题
}
logger.error("获取钉钉token出错:{}", _err);
}
return null;
}
/**
* 使用 Token 初始化账号Client
*
* @return Client
* @throws Exception
*/
private static com.aliyun.dingtalkoauth2_1_0.Client createClient() throws Exception {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
config.protocol = "https";
config.regionId = "central";
return new com.aliyun.dingtalkoauth2_1_0.Client(config);
}
}

View File

@ -50,7 +50,6 @@ public class HomeServiceImpl extends BaseService<HomeEntity, String> implements
for (int a = 0; a < sysApplicationEntities.size(); a++) {
if(homeEntities.get(i).getAppId()!= null && sysApplicationEntities.get(a).getId().equals(homeEntities.get(i).getAppId())){
homeEntities.get(i).setPath(sysApplicationEntities.get(a).getAppLogo());
homeEntities.get(i).setName(sysApplicationEntities.get(a).getName());
continue;
}
}

View File

@ -1,77 +0,0 @@
package com.hzya.frame.mdm.entity;
public class MdmFiledsRuleDto {
/** 主数据模版ID */
private String mdmId;
/** 模版数据库id */
private String dbId;
/** 模版数据库字段id */
private String filedId;
/** 字段类型 1、select 2、treeselect */
private String filedType;
/** 字段服务 */
private String typeFiled;
/** 字段服务 */
private String id;
/** 字段服务 */
private String dataId;
public String getMdmId() {
return mdmId;
}
public void setMdmId(String mdmId) {
this.mdmId = mdmId;
}
public String getDbId() {
return dbId;
}
public void setDbId(String dbId) {
this.dbId = dbId;
}
public String getFiledId() {
return filedId;
}
public void setFiledId(String filedId) {
this.filedId = filedId;
}
public String getFiledType() {
return filedType;
}
public void setFiledType(String filedType) {
this.filedType = filedType;
}
public String getTypeFiled() {
return typeFiled;
}
public void setTypeFiled(String typeFiled) {
this.typeFiled = typeFiled;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getDataId() {
return dataId;
}
public void setDataId(String dataId) {
this.dataId = dataId;
}
}

View File

@ -1,48 +0,0 @@
package com.hzya.frame.mdm.mdmModule;
import com.alibaba.excel.EasyExcel;
import com.hzya.frame.mdm.mdmModule.service.IMdmModuleService;
import com.hzya.frame.mdm.mdmModule.vo.ExcelTemplateVO;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
public class WriteTest {
@Autowired
private IMdmModuleService mdmModuleService;
@Test
public void testGenerateExcelTemplate() throws IOException {
// 文件夹路径
String folderPath = "D:/test/";
// 完整文件路径文件夹 + 文件名
String localFilePath = folderPath + "表字段定义模版.xlsx";
File dir = new File(folderPath);
if (!dir.exists()) {
dir.mkdirs(); // 创建文件夹如果不存在
}
// 准备模板的示例数据
List<ExcelTemplateVO> demoData = new ArrayList<>();
// 生成Excel并保存到本地文件
try (OutputStream outputStream = new FileOutputStream(localFilePath)) {
EasyExcel.write(outputStream, ExcelTemplateVO.class)
.sheet("表字段定义模版")
.doWrite(demoData);
}
System.out.println("Excel模板已成功生成保存路径" + localFilePath);
}
}

View File

@ -1,34 +0,0 @@
package com.hzya.frame.mdm.mdmModule.config;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Arrays;
import java.util.List;
@Configuration
@EnableCaching
public class CacheConfig extends CachingConfigurerSupport {
@Override
@Bean
public ConcurrentMapCacheManager cacheManager() {
// 整合所有需要的缓存名称原有的mdm相关缓存 + 新的业务缓存
List<String> cacheNames = Arrays.asList(
// 原有缓存来自SimpleCacheManager的配置
"mdmModuleDb",
"mdmModuleDbFileds",
"mdmModule",
// 新添加的业务缓存来自之前的ConcurrentMapCacheManager配置
"sysApplicationPlugin",
"IntegrationTask",
"IntegrationTaskLiving"
);
ConcurrentMapCacheManager cacheManager = new ConcurrentMapCacheManager();
cacheManager.setCacheNames(cacheNames); // 注册所有缓存名称
return cacheManager;
}
}

View File

@ -1,48 +0,0 @@
package com.hzya.frame.mdm.mdmModule.controller;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.mdm.mdmModule.service.IMdmModuleService;
import com.hzya.frame.mdm.mdmModule.vo.ImportExcelVO;
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
import jline.internal.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping(value = "/excel")
public class ImportExcelController {
@Autowired
private IMdmModuleService iMdmModuleService;
/**
* 导入模版
*/
@RequestMapping(value = "/importTemplateFile" ,method = RequestMethod.POST)
public JsonResultEntity importTemplateFile(@RequestParam("file") MultipartFile file,
@ModelAttribute ImportExcelVO importExcelVO){
List<MdmModuleDbFiledsEntity> entities = iMdmModuleService.importTemplateFile(file,importExcelVO);
// 新增字段
for (MdmModuleDbFiledsEntity entity : entities) {
// JSONObject object = (JSONObject) JSONObject.toJSON(entity);
String str = JSONObject.toJSONString(entity);
Map<String,String> jsonStr=new HashMap<>();
jsonStr.put("jsonStr",str);
String jsonS = JSON.toJSONString(jsonStr);
JSONObject jsonObject = JSONObject.parseObject(jsonS);
iMdmModuleService.saveMdmDbField(jsonObject);
}
return new JsonResultEntity("导入模版成功",true,200);
}
}

View File

@ -3,7 +3,6 @@ package com.hzya.frame.mdm.mdmModule.dao;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.mdm.entity.MdmDataDto;
import com.hzya.frame.mdm.entity.MdmDto;
import com.hzya.frame.mdm.entity.MdmFiledsRuleDto;
import com.hzya.frame.mdm.entity.MdmQuery;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
@ -69,7 +68,5 @@ public interface IMdmModuleDao extends IBaseDao<MdmModuleEntity, String> {
void updataTreeUpData(Map<String, String> updateMaps);
void updataTreeUpDataDetail(Map<String, String> updateMaps);
MdmFiledsRuleDto queryDataId(MdmFiledsRuleDto mdmFiledsRuleDto);
}

View File

@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.mdm.entity.MdmDataDto;
import com.hzya.frame.mdm.entity.MdmDto;
import com.hzya.frame.mdm.entity.MdmFiledsRuleDto;
import com.hzya.frame.mdm.entity.MdmQuery;
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
@ -182,12 +181,6 @@ public class MdmModuleDaoImpl extends MybatisGenericDao<MdmModuleEntity, String>
super.update(getSqlIdPrifx() + "updataTreeUpDataDetail", maps);
}
@Override
public MdmFiledsRuleDto queryDataId(MdmFiledsRuleDto mdmFiledsRuleDto) {
MdmFiledsRuleDto o = (MdmFiledsRuleDto) super.selectOne(getSqlIdPrifx() + "queryDataId", mdmFiledsRuleDto);
return o;
}
@Override
public List<String> queryMdMFields(Map<String, Object> maps) {
List<String> o = (List<String>) super.selectList(getSqlIdPrifx() + "queryMdMFields", maps);

View File

@ -26,45 +26,8 @@ public class MdmModuleEntity extends BaseEntity {
private String createUser;
//修改人
private String modifyUser;
/** 0预制 1手工 */
private String tag;
private String u8cDbPk;
private String nccDbPk;
private String ysDbPk;
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public String getU8cDbPk() {
return u8cDbPk;
}
public void setU8cDbPk(String u8cDbPk) {
this.u8cDbPk = u8cDbPk;
}
public String getNccDbPk() {
return nccDbPk;
}
public void setNccDbPk(String nccDbPk) {
this.nccDbPk = nccDbPk;
}
public String getYsDbPk() {
return ysDbPk;
}
public void setYsDbPk(String ysDbPk) {
this.ysDbPk = ysDbPk;
}
public String getMdmName() {
return mdmName;
}

View File

@ -19,10 +19,6 @@
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
<result property="tag" column="tag" jdbcType="VARCHAR"/>
<result property="u8cDbPk" column="u8c_db_pk" jdbcType="VARCHAR"/>
<result property="nccDbPk" column="ncc_db_pk" jdbcType="VARCHAR"/>
<result property="ysDbPk" column="ys_db_pk" jdbcType="VARCHAR"/>
</resultMap>
@ -43,10 +39,6 @@
,sts
,org_id
,company_id
,tag
,u8c_db_pk
,ncc_db_pk
,ys_db_pk
</sql>
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-MdmModuleEntity-result">
@ -75,10 +67,6 @@
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="tag != null and tag != ''">and tag = #{tag}</if>
<if test="u8cDbPk != null and u8cDbPk != ''">and u8c_db_pk = #{u8cDbPk}</if>
<if test="nccDbPk != null and nccDbPk != ''">and ncc_db_pk = #{nccDbPk}</if>
<if test="ysDbPk != null and ysDbPk != ''">and ys_db_pk = #{ysDbPk}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
@ -103,10 +91,6 @@
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="tag != null and tag != ''">and tag = #{tag}</if>
<if test="u8cDbPk != null and u8cDbPk != ''">and u8c_db_pk = #{u8cDbPk}</if>
<if test="nccDbPk != null and nccDbPk != ''">and ncc_db_pk = #{nccDbPk}</if>
<if test="ysDbPk != null and ysDbPk != ''">and ys_db_pk = #{ysDbPk}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
@ -138,7 +122,6 @@
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
<if test="tag != null and tag != ''">and tag like concat('%',#{tag},'%')</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
@ -166,7 +149,6 @@
<if test="sts != null and sts != ''">or sts = #{sts}</if>
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
<if test="tag != null and tag != ''">or tag = #{tag}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
@ -193,10 +175,6 @@
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="companyId != null and companyId != ''">company_id ,</if>
<if test="sts == null ">sts,</if>
<if test="tag == null ">tag ,</if>
<if test="u8cDbPk != null and u8cDbPk != ''">u8c_db_pk,</if>
<if test="nccDbPk != null and nccDbPk != ''">ncc_db_pk,</if>
<if test="ysDbPk != null and ysDbPk != ''">ys_db_pk,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
@ -216,10 +194,6 @@
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
<if test="sts == null ">'Y',</if>
<if test="tag == null ">'1',</if>
<if test="u8cDbPk != null and u8cDbPk != ''">#{u8cDbPk},</if>
<if test="nccDbPk != null and nccDbPk != ''">#{nccDbPk},</if>
<if test="ysDbPk != null and ysDbPk != ''">#{ysDbPk},</if>
</trim>
)
</insert>
@ -307,9 +281,6 @@ where id = #{id}
<select id="queryMdm" resultMap="get-MdmModuleEntity-result"
parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
select
a.u8c_db_pk as u8c_db_pk,
a.ncc_db_pk as ncc_db_pk,
a.ys_db_pk as ys_db_pk,
a.id as id,
a.mdm_name as mdm_name,
a.mdm_logo as mdm_logo,
@ -1115,14 +1086,5 @@ where id = #{id}
AND b.sts = 'Y'
AND b.data_status != 'N'
</update>
<!-- 分页查询列表 采用like格式 -->
<select id="queryDataId" resultType="com.hzya.frame.mdm.entity.MdmFiledsRuleDto"
parameterType="com.hzya.frame.mdm.entity.MdmFiledsRuleDto">
select
data_id as dataId
from ${typeFiled} where sts='Y' and id = #{id}
</select>
</mapper>

View File

@ -3,14 +3,7 @@ package com.hzya.frame.mdm.mdmModule.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.mdm.mdmModule.vo.ImportExcelVO;
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* 主数据模版(MdmModule)表服务接口
@ -404,16 +397,4 @@ public interface IMdmModuleService extends IBaseService<MdmModuleEntity, String>
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmDistributeByMdmCode(JSONObject jsonObject);
/**
* 下载导入模版
* @return
*/
void generateExcelTemplate(HttpServletResponse response) throws IOException;
/**
* 导入模版
* @param file
*/
List<MdmModuleDbFiledsEntity> importTemplateFile(MultipartFile file, ImportExcelVO importExcelVO);
}

View File

@ -1,17 +1,8 @@
package com.hzya.frame.mdm.mdmModule.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.util.StringUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.beanutil.BeanUtil;
import com.hzya.frame.mdm.entity.MdmDbFiledVo;
import com.hzya.frame.mdm.entity.MdmDto;
import com.hzya.frame.mdm.entity.MdmModuleViewVo;
@ -19,8 +10,6 @@ import com.hzya.frame.mdm.entity.MdmQuery;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
import com.hzya.frame.mdm.mdmModule.service.IMdmModuleService;
import com.hzya.frame.mdm.mdmModule.vo.ExcelTemplateVO;
import com.hzya.frame.mdm.mdmModule.vo.ImportExcelVO;
import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao;
import com.hzya.frame.mdm.mdmModuleDb.dao.impl.MdmModuleDbDaoImpl;
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
@ -61,24 +50,17 @@ import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.hzya.frame.web.exception.BaseSystemException;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.hzya.frame.basedao.service.impl.BaseService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 主数据模版(MdmModule)表服务实现类
@ -461,22 +443,6 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
for (int i = 0; i < mdmModuleDbEntities.size(); i++) {
if ("1".equals(mdmModuleDbEntities.get(i).getDbType()) || "2".equals(mdmModuleDbEntities.get(i).getDbType())) {
dbEntities.add(mdmModuleDbEntities.get(i));
//查询合并规则add by zyd 20250707
List<String> filedNames=new ArrayList<>();
if (mdmModuleDbEntities.get(i).getMergeRules() != null && !"".equals(mdmModuleDbEntities.get(i).getMergeRules())) {
String mergeRulesIds = mdmModuleDbEntities.get(i).getMergeRules();
String[] split = mergeRulesIds.split(",");
for (String filedId : split) {
MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity();
mdmModuleDbFiledsEntity.setId(filedId);
List<MdmModuleDbFiledsEntity> fileds = mdmModuleDbFiledsDao.query(mdmModuleDbFiledsEntity);
if(fileds.size()!=0){
filedNames.add(fileds.get(0).getChName());
}
}
}
mdmModuleDbEntities.get(i).setMergeRulesStr(String.join(",",filedNames));
}
}
}
@ -1437,8 +1403,7 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity();
mdmModuleDbFiledsEntity.setMdmId(entity.getMdmId());
mdmModuleDbFiledsEntity.setSts("Y");
// List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity);
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.query(mdmModuleDbFiledsEntity);
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity);
if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) {
for (int i = 0; i < mdmModuleDbFiledsEntityList.size(); i++) {
if (entity.getDbId().equals(mdmModuleDbFiledsEntityList.get(i).getDbId()) && entity.getEnName().equals(mdmModuleDbFiledsEntityList.get(i).getEnName())) {
@ -1446,42 +1411,6 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
}
}
}
//新增时查询sysPk,sysCode,sysName段是否存在 add by zyd 2025-06-09
boolean isSysPk = false;
boolean isSysCode = false;
boolean isSysName = false;
boolean isSysDate = false;
for (MdmModuleDbFiledsEntity dbFiledsEntity : mdmModuleDbFiledsEntityList) {
if (entity.getDbId().equals(dbFiledsEntity.getDbId())) {
if (entity.getDbId().equals(dbFiledsEntity.getDbId())) {
if ("Y".equals(dbFiledsEntity.getIsSysPk())) {
isSysPk = true;
}
if ("Y".equals(dbFiledsEntity.getIsSysCode())) {
isSysCode = true;
}
if ("Y".equals(dbFiledsEntity.getIsSysName())) {
isSysName = true;
}
if ("Y".equals(dbFiledsEntity.getIsSysDate())) {
isSysDate = true;
}
}
}
}
//判端该字段是不是sysPk,sysCode,sysName=true
if ("Y".equals(entity.getIsSysPk()) && isSysPk) {
return BaseResult.getFailureMessageEntity("系统主键字段已存在,请修改");
}
if ("Y".equals(entity.getIsSysCode()) && isSysCode) {
return BaseResult.getFailureMessageEntity("系统code字段已存在请修改");
}
if ("Y".equals(entity.getIsSysName()) && isSysName) {
return BaseResult.getFailureMessageEntity("系统name字段已存在请修改");
}
if ("Y".equals(entity.getIsSysDate()) && isSysDate) {
return BaseResult.getFailureMessageEntity("系统date字段已存在请修改");
}
entity.setCreate();
if ("1".equals(entity.getDbType())) {
entity.setAddType("1");
@ -1559,49 +1488,6 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
} catch (Exception e) {
throw new BaseSystemException("表字段类型,修改失败,请联系管理员");
}
//更新时查询sysPk,sysCode,sysName段是否存在 add by zyd 2025-06-09
MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity();
mdmModuleDbFiledsEntity.setDbId(entity.getDbId());
mdmModuleDbFiledsEntity.setMdmId(entity.getMdmId());
mdmModuleDbFiledsEntity.setSts("Y");
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.query(mdmModuleDbFiledsEntity);
boolean isSysPk = false;
boolean isSysCode = false;
boolean isSysName = false;
boolean isSysDate = false;
for (MdmModuleDbFiledsEntity dbFiledsEntity : mdmModuleDbFiledsEntityList) {
if (entity.getDbId().equals(dbFiledsEntity.getDbId())) {
if (entity.getDbId().equals(dbFiledsEntity.getDbId())) {
if ("Y".equals(dbFiledsEntity.getIsSysPk())) {
isSysPk = true;
}
if ("Y".equals(dbFiledsEntity.getIsSysCode())) {
isSysCode = true;
}
if ("Y".equals(dbFiledsEntity.getIsSysName())) {
isSysName = true;
}
if ("Y".equals(dbFiledsEntity.getIsSysDate())) {
isSysDate = true;
}
}
}
}
//判端该字段是不是sysPk,sysCode,sysName=true
if ("Y".equals(entity.getIsSysPk()) && isSysPk) {
return BaseResult.getFailureMessageEntity("系统主键字段已存在,请修改");
}
if ("Y".equals(entity.getIsSysCode()) && isSysCode) {
return BaseResult.getFailureMessageEntity("系统code字段已存在请修改");
}
if ("Y".equals(entity.getIsSysName()) && isSysName) {
return BaseResult.getFailureMessageEntity("系统name字段已存在请修改");
}
if ("Y".equals(entity.getIsSysDate()) && isSysDate) {
return BaseResult.getFailureMessageEntity("系统date字段已存在请修改");
}
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities = new ArrayList<>();
mdmModuleDbFiledsEntities.add(entity);
mdmServiceCache.saveOrUpdateMdmModuleDbFileds(entity.getMdmId(), mdmModuleDbFiledsEntities);
@ -1665,7 +1551,6 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
return BaseResult.getFailureMessageEntity("系统错误");
}
MdmModuleDbFiledsRuleEntity queryCount = new MdmModuleDbFiledsRuleEntity();
queryCount.setMdmId(entity.getMdmId());
queryCount.setDbId(entity.getDbId());
queryCount.setRuleCode("label");
queryCount.setRuleValue(entity.getEnName());
@ -2455,20 +2340,7 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
xf.setCreate();
sysButtonConfigDao.save(xf);
}
if ("viewData".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) {
SysButtonConfigEntity xf = new SysButtonConfigEntity();
xf.setCode("viewData");
xf.setNameCh("查看数据格式");
xf.setNameEn("viewData");
xf.setMenuId(module.getId());
xf.setIconName("");
xf.setStyles("");
xf.setBtnFunction("viewData");
xf.setRemark("查看数据格式");
xf.setSorts(i + 1L);
xf.setCreate();
sysButtonConfigDao.save(xf);
}
}
}
@ -2979,290 +2851,4 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
List<MdmModuleDistributeEntity> list = mdmModuleDistributeDao.queryBase(entity);
return BaseResult.getSuccessMessageEntity("获取分发设置成功", list);
}
/**
* 生成导入模版
*/
@Override
public void generateExcelTemplate(HttpServletResponse response) throws IOException {
// 设置响应内容类型
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
// 设置文件名注意中文需要URLEncoder编码
String fileName = URLEncoder.encode("表字段定义模版", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
// 准备模板的示例数据
List<ExcelTemplateVO> demoData = new ArrayList<>(); //createTemplateDemoData()
// 使用EasyExcel直接写入响应输出流
EasyExcel.write(response.getOutputStream(), ExcelTemplateVO.class)
.sheet("表字段定义模版")
.doWrite(demoData);
}
/*private List<ExcelTemplateVO> createTemplateDemoData() {
List<ExcelTemplateVO> demoData = new ArrayList<>();
ExcelTemplateVO demo = new ExcelTemplateVO();
demo.setChName("用户ID");
demo.setEnName("userId");
demo.setFiledType("1"); // 对应BIGINT类型
demo.setFiledLength("20");
demo.setIsSysPk("Y");
demo.setIsSysCode("Y");
demo.setIsSysName("N");
demo.setIsSysDate("N");
demo.setTitle("用户ID");
demo.setRow("6");
demo.setWidth("100");
demo.setType("input");
demo.setRequired("true");
demo.setDisabled("true");
demoData.add(demo);
return demoData;
}
*/
/**
* 导入模版
*/
@Transactional
@Override
public List<MdmModuleDbFiledsEntity> importTemplateFile(MultipartFile file , ImportExcelVO importExcelVO) {
// 校验文件合法性
if (file == null || file.isEmpty()) {
throw new IllegalArgumentException("导入文件不能为空");
}
// 校验文件格式
String fileName = file.getOriginalFilename();
if (fileName == null || (!fileName.endsWith(".xlsx") && !fileName.endsWith(".xls"))) {
throw new IllegalArgumentException("请上传Excel格式文件");
}
// 表头数据
List<List<String>> headerList = new ArrayList<>();
// 用于存储内容数据
List<ExcelTemplateVO> dataList = new ArrayList<>();
List<MdmModuleDbFiledsEntity> resultEntities = new ArrayList<>();
try (InputStream inputStream = file.getInputStream()) {
// 使用EasyExcel读取文件
EasyExcel.read(inputStream)
.head(ExcelTemplateVO.class) // 指定映射的实体类
.sheet(0) // 指定第一个sheet页
.headRowNumber(1) // 表头行数从1开始
.autoTrim(true)
.registerReadListener(new AnalysisEventListener<ExcelTemplateVO>() {
/**
* 获取表头行数据
*/
@Override
public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
// 1. 转换表头为有序列表
List<String> header = new ArrayList<>();
// 获取最大列索引确保顺序正确
int maxColIndex = headMap.keySet().stream().mapToInt(Integer::intValue).max().orElse(-1);
for (int i = 0; i <= maxColIndex; i++) {
header.add(headMap.getOrDefault(i, "")); // 无数据的列填空
}
headerList.add(header);
}
/**
* 每解析一行数据触发
*/
@Override
public void invoke(ExcelTemplateVO data, AnalysisContext context) {
// 空行直接跳过
if (isRowEmpty(data)) {
return;
}
// 数据校验
validateData(data, context.readRowHolder().getRowIndex() + 1);
dataList.add(data);
}
/**
* 所有数据解析完成后触发
*/
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
// 解析完成后的数据处理
List<MdmModuleDbFiledsEntity> entities = processImportData(headerList, dataList, importExcelVO);
if (entities != null) {
resultEntities.addAll(entities);
}
}
})
.doRead(); // 执行读取操作
} catch (IOException e) {
throw new RuntimeException("文件读取失败:" + e.getMessage(), e);
}
return resultEntities;
}
private boolean isRowEmpty(ExcelTemplateVO data) {
if(data == null) {
return true;
}
return StringUtils.isEmpty(data.getChName() ) &&
StringUtils.isEmpty(data.getFiledType()) &&
StringUtils.isEmpty(data.getEnName()) ;
}
/**
* 导入数据新增字段
* @param headerList
* @param dataList
*/
private List<MdmModuleDbFiledsEntity> processImportData(List<List<String>> headerList, List<ExcelTemplateVO> dataList,ImportExcelVO importExcelVO) {
// 获取表头列名
List<String> headers = headerList.get(0);
// 数据库字段数据
List<MdmModuleDbFiledsEntity> entities = new ArrayList<>();
for (ExcelTemplateVO data : dataList) {
MdmModuleDbFiledsEntity entity = new MdmModuleDbFiledsEntity();
BeanUtils.copyProperties(data, entity);
// 字段规则数据集合
List<MdmModuleDbFiledsRuleEntity> rules = new ArrayList<>();
for (String header : headers) {
// 字段规则数据
MdmModuleDbFiledsRuleEntity rule = new MdmModuleDbFiledsRuleEntity();
rule.setRuleType("2");
rule.setFormName("optionRuleForm");
switch (header) {
case "显示名":
rule.setRuleName("显示名");
rule.setRuleCode("title");
rule.setRuleValue(data.getChName());
break;
case "宽度":
rule.setRuleName("宽度");
rule.setRuleCode("row");
rule.setRuleValue(data.getRow());
break;
case "单元格宽度":
rule.setRuleName("单元格宽度");
rule.setRuleCode("width");
rule.setRuleValue(data.getWidth());
break;
case "数据类型":
rule.setRuleName("数据类型");
rule.setRuleCode("type");
rule.setRuleValue(data.getType());
break;
case "必填":
rule.setRuleName("必填");
rule.setRuleCode("required");
rule.setRuleValue(data.getRequired() != null ? "true" : "false");
break;
case "禁止修改":
rule.setRuleName("禁止修改");
rule.setRuleCode("disabled");
rule.setRuleValue(data.getDisabled() != null ? "true" : "false");
break;
default:
continue;
}
rules.add(rule);
}
entity.setMdmModuleDbFiledsRules(rules);
entity.setDbName(importExcelVO.getDbName());
entity.setDbId(importExcelVO.getDbId());
entity.setDbType(importExcelVO.getDbType());
entity.setMdmId(importExcelVO.getMdmId());
entities.add(entity);
}
return entities;
}
/**
* 数据校验方法验证Excel导入的数据合法性
* @param data 导入的Excel数据对象
* @param rowNum 行号
*/
private void validateData(ExcelTemplateVO data, int rowNum) {
List<String> errors = new ArrayList<>();
// 1. 校验中文名称必填
if (StringUtils.isBlank(data.getChName())) {
errors.add("" + rowNum + "行:中文名称不能为空");
}
// 2. 校验字段类型合法性
if (StringUtils.isBlank(data.getFiledType())) {
errors.add("" + rowNum + "行:字段类型不能为空");
} else {
Set<String> validTypes = new HashSet<>(Arrays.asList("1", "2", "3", "4"));
if (!validTypes.contains(data.getFiledType())) {
errors.add("" + rowNum + "字段类型无效允许值为1(BIGINT)、2(DECIMAL)、3(VARCHAR)、4(DATETIME)");
}
}
// 3. 校验长度数字类型且当字段类型为123时必填
if (StringUtils.isNotBlank(data.getFiledType()) &&
(data.getFiledType().equals("1") || data.getFiledType().equals("2") || data.getFiledType().equals("3"))) {
if (StringUtils.isBlank(data.getFiledLength())) {
errors.add("" + rowNum + "行:字段长度不能为空");
} else if (!StringUtils.isNumeric(data.getFiledLength())) {
errors.add("" + rowNum + "行:字段长度必须为数字");
} else {
int length = Integer.parseInt(data.getFiledLength());
if (length <= 0) {
errors.add("" + rowNum + "字段长度必须大于0");
}
}
}
// 4. 校验系统主键标识合法性
if (StringUtils.isNotBlank(data.getIsSysPk()) &&
!"Y".equals(data.getIsSysPk()) && !"N".equals(data.getIsSysPk())) {
errors.add("" + rowNum + "是否系统主键只能为Y或N");
}
// 5. 校验系统数据编码标识合法性
if (StringUtils.isNotBlank(data.getIsSysCode()) &&
!"Y".equals(data.getIsSysCode()) && !"N".equals(data.getIsSysCode())) {
errors.add("" + rowNum + "是否系统数据编码只能为Y或N");
}
// 6. 校验系统数据名称标识合法性
if (StringUtils.isNotBlank(data.getIsSysName()) &&
!"Y".equals(data.getIsSysName()) && !"N".equals(data.getIsSysName())) {
errors.add("" + rowNum + "是否系统数据名称只能为Y或N");
}
// 7. 校验系统日期标识合法性
if (StringUtils.isNotBlank(data.getIsSysDate()) &&
!"Y".equals(data.getIsSysDate()) && !"N".equals(data.getIsSysDate())) {
errors.add("" + rowNum + "是否系统日期只能为Y或N");
}
// 8. 校验是否必填标识合法性
if (data.getRequired() != null && !data.getRequired().trim().isEmpty()) {
String required = data.getRequired().trim();
if (!"TRUE".equalsIgnoreCase(required) && !"FALSE".equalsIgnoreCase(required)) {
errors.add("" + rowNum + "是否必填只能为true或false");
}
}
// 9. 校验禁止修改标识合法性
if (data.getDisabled() != null && !data.getDisabled().trim().isEmpty()) {
String disabled = data.getDisabled().trim();
if (!"TRUE".equalsIgnoreCase(disabled) && !"FALSE".equalsIgnoreCase(disabled)) {
errors.add("" + rowNum + "禁止修改只能为true或false");
}
}
// 如果有错误抛出异常中断导入
if (!errors.isEmpty()) {
throw new ExcelDataValidateException(String.join("", errors));
}
}
// 自定义异常类
public class ExcelDataValidateException extends RuntimeException {
public ExcelDataValidateException(String message) {
super(message);
}
}
}

View File

@ -1,56 +0,0 @@
package com.hzya.frame.mdm.mdmModule.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ExcelTemplateVO {
@ExcelProperty(value = "中文名称", index = 0)
private String chName;
@ExcelProperty(value = "英文名称", index = 1)
private String enName;
/** 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME */
@ExcelProperty(value = "字段类型", index = 2)
private String filedType;
@ExcelProperty(value = "长度", index = 3)
private String filedLength;
@ExcelProperty(value = "是否系统主键", index = 4)
private String isSysPk;// Y N
@ExcelProperty(value = "系统数据编码", index = 5)
private String isSysCode;// Y N
@ExcelProperty(value = "系统数据名称", index = 6)
private String isSysName;// Y N
@ExcelProperty(value = "系统日期", index = 7)
private String isSysDate; // Y N
@ExcelProperty(value = "显示名", index = 8)
private String title;
@ExcelProperty(value = "宽度", index = 9)
private String row;
@ExcelProperty(value = "单元格宽度", index = 10)
private String width;
@ExcelProperty(value = "数据类型",index = 11)
private String type;
@ExcelProperty(value= "必填",index = 12)
private String required; // true false
@ExcelProperty(value= "禁止修改",index = 13)
private String disabled; // true false
}

View File

@ -1,23 +0,0 @@
package com.hzya.frame.mdm.mdmModule.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.checkerframework.checker.units.qual.A;
import org.springframework.web.multipart.MultipartFile;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ImportExcelVO {
/** 主数据模版ID */
private String dbName;
/** 主数据模版ID */
private String mdmId;
/** 模版数据库id */
private String dbId;
/** 类型 1、主表 2、明细 3、操作日志 4、下发日志 */
private String dbType;
// MultipartFile file;
}

View File

@ -27,25 +27,7 @@ public class MdmModuleDbEntity extends BaseEntity {
/** 数据类型 1、新增 2、修改 */
private String dataType;
private List<MdmModuleDbFiledsEntity> sublistMdmModuleDbFileds;
/** 合并规则字段id使用逗号隔开 */
private String mergeRules;
private String mergeRulesStr;
public String getMergeRules() {
return mergeRules;
}
public void setMergeRules(String mergeRules) {
this.mergeRules = mergeRules;
}
public String getMergeRulesStr() {
return mergeRulesStr;
}
public void setMergeRulesStr(String mergeRulesStr) {
this.mergeRulesStr = mergeRulesStr;
}
public String getMdmId() {
return mdmId;

View File

@ -16,7 +16,6 @@
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
<result property="mergeRules" column="merge_rules" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="MdmModuleDbEntity_Base_Column_List">
@ -33,7 +32,6 @@
,sts
,org_id
,company_id
,merge_rules
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmModuleDbEntity-result"
@ -55,7 +53,6 @@
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="mergeRules != null and mergeRules != ''">and merge_rules = #{mergeRules}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
@ -80,7 +77,6 @@
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="mergeRules != null and mergeRules != ''">and merge_rules = #{mergeRules}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
@ -111,7 +107,6 @@
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
<if test="mergeRules != null and mergeRules != ''">and merge_rules like concat('%',#{mergeRules},'%')</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
@ -138,7 +133,6 @@
<if test="sts != null and sts != ''">or sts = #{sts}</if>
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
<if test="mergeRules != null and mergeRules != ''">or merge_rules = #{mergeRules}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
@ -162,7 +156,6 @@
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="companyId != null and companyId != ''">company_id ,</if>
<if test="mergeRules != null and mergeRules != ''">merge_rules ,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -180,7 +173,6 @@
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
<if test="mergeRules != null and mergeRules != ''">#{mergeRules} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
@ -188,10 +180,10 @@
<!-- 批量新增 -->
<insert id="entityInsertBatch">
insert into mdm_module_db(mdm_id, db_name, db_type, remark, create_user_id, create_time, modify_user_id,
modify_time, sts, org_id, company_id, merge_rules, sts)
modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.mergeRules},
(#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
'Y')
</foreach>
</insert>
@ -231,7 +223,6 @@
<if test="sts != null and sts != ''">sts = #{sts},</if>
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
<if test="mergeRules != null and mergeRules != ''">merge_rules = #{mergeRules},</if>
</trim>
where id = #{id}
</update>
@ -253,7 +244,6 @@ where id = #{id}
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="mergeRules != null and mergeRules != ''">and merge_rules = #{mergeRules}</if>
and sts='Y'
</trim>
</update>

View File

@ -1,10 +1,7 @@
package com.hzya.frame.mdm.mdmModuleDbFileds.entity;
import java.util.ArrayList;
import java.util.List;
import com.alibaba.excel.annotation.ExcelProperty;
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
import com.hzya.frame.web.entity.BaseEntity;
@ -23,14 +20,11 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
/** 模版数据库id */
private String dbId;
/** 中文名 */
@ExcelProperty(value = "中文名称", index = 0)
private String chName;
/** 英文名 */
@ExcelProperty(value = "英文名称", index = 1)
private String enName;
private String enName;
/** 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME */
@ExcelProperty(value = "字段类型", index = 2)
private String filedType;
private String filedType;
/** 显示类型:新增 */
private String addType;
/** 显示类型:修改 */
@ -39,14 +33,12 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
private String showType;
/** 显示类型:查询 */
private String queryType;
/** 显示类型:列表 */
private String listType;
/** 显示类型:显示 */
private String viewType;
/** 长度 */
@ExcelProperty(value = "长度", index = 3)
private String filedLength;
private String filedLength;
/** 公司id */
private String companyId;
/** 数据类型 1、新增 2、修改 */
@ -61,30 +53,10 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
* roletype
*/
private String roleValue;
private List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRules;
private List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRules;
//1查询2列表3新增4修改 5查看
private String fieldType;
/**
* 是否sys主键 系统主键三方系统主键同步中台之后该字段作为主键Y/N
*/
@ExcelProperty(value = "是否系统主键", index = 4)
private String isSysPk;
/**
* 是否sys编码 系统code三方系统code同步中台之后该字段作为codeY/N
*/
@ExcelProperty(value = "是否系统数据编码", index = 5)
private String isSysCode;
/**
* 是否sys名称 系统name三方系统name同步中台之后该字段作为nameY/N
*/
@ExcelProperty(value = "是否系统数据名称", index = 6)
private String isSysName;
/**
* 是否sys日期 系统date三方系统name同步中台之后该字段作为nameY/N
*/
@ExcelProperty(value = "是否系统日期", index = 7)
private String isSysDate;
public String getMdmId() {
return mdmId;
}
@ -244,67 +216,5 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
public void setDbType(String dbType) {
this.dbType = dbType;
}
public String getIsSysPk() {
return isSysPk;
}
public void setIsSysPk(String isSysPk) {
this.isSysPk = isSysPk;
}
public String getIsSysCode() {
return isSysCode;
}
public void setIsSysCode(String isSysCode) {
this.isSysCode = isSysCode;
}
public String getIsSysName() {
return isSysName;
}
public void setIsSysName(String isSysName) {
this.isSysName = isSysName;
}
public String getIsSysDate() {
return isSysDate;
}
public void setIsSysDate(String isSysDate) {
this.isSysDate = isSysDate;
}
/**
* 关联的表
*/
private MdmModuleDbEntity mdmModuleDbEntity;
public MdmModuleDbEntity getMdmModuleDbEntity() {
return mdmModuleDbEntity;
}
public void setMdmModuleDbEntity(MdmModuleDbEntity mdmModuleDbEntity) {
this.mdmModuleDbEntity = mdmModuleDbEntity;
}
/**
* 关联字段
*/
private List<MdmModuleDbFiledsEntity> sublistMdmModuleDbFileds;
public List<MdmModuleDbFiledsEntity> getSublistMdmModuleDbFileds() {
return sublistMdmModuleDbFileds;
}
public void setSublistMdmModuleDbFileds(List<MdmModuleDbFiledsEntity> sublistMdmModuleDbFileds) {
this.sublistMdmModuleDbFileds = sublistMdmModuleDbFileds;
}
}

View File

@ -2,38 +2,33 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.mdm.mdmModuleDbFileds.dao.impl.MdmModuleDbFiledsDaoImpl">
<resultMap id="get-MdmModuleDbFiledsEntity-result"
type="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
<result property="dbId" column="db_id" jdbcType="VARCHAR"/>
<result property="chName" column="ch_name" jdbcType="VARCHAR"/>
<result property="enName" column="en_name" jdbcType="VARCHAR"/>
<result property="filedType" column="filed_type" jdbcType="VARCHAR"/>
<result property="addType" column="add_type" jdbcType="VARCHAR"/>
<result property="updateType" column="update_type" jdbcType="VARCHAR"/>
<result property="showType" column="show_type" jdbcType="VARCHAR"/>
<result property="queryType" column="query_type" jdbcType="VARCHAR"/>
<result property="listType" column="list_type" jdbcType="VARCHAR"/>
<result property="viewType" column="view_type" jdbcType="VARCHAR"/>
<result property="filedLength" column="filed_length" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
<result property="isSysPk" column="sys_pk" jdbcType="VARCHAR"/>
<result property="isSysCode" column="sys_code" jdbcType="VARCHAR"/>
<result property="isSysName" column="sys_name" jdbcType="VARCHAR"/>
<result property="isSysDate" column="sys_date" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="get-MdmModuleDbFiledsEntity-result" type="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
<result property="dbId" column="db_id" jdbcType="VARCHAR"/>
<result property="chName" column="ch_name" jdbcType="VARCHAR"/>
<result property="enName" column="en_name" jdbcType="VARCHAR"/>
<result property="filedType" column="filed_type" jdbcType="VARCHAR"/>
<result property="addType" column="add_type" jdbcType="VARCHAR"/>
<result property="updateType" column="update_type" jdbcType="VARCHAR"/>
<result property="showType" column="show_type" jdbcType="VARCHAR"/>
<result property="queryType" column="query_type" jdbcType="VARCHAR"/>
<result property="listType" column="list_type" jdbcType="VARCHAR"/>
<result property="viewType" column="view_type" jdbcType="VARCHAR"/>
<result property="filedLength" column="filed_length" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="MdmModuleDbFiledsEntity_Base_Column_List">
<sql id = "MdmModuleDbFiledsEntity_Base_Column_List">
id
,mdm_id
,mdm_id
,db_id
,ch_name
,en_name
@ -53,357 +48,295 @@
,sts
,org_id
,company_id
,sys_pk
,sys_code
,sys_name
,sys_date
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmModuleDbFiledsEntity-result"
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
select
<include refid="MdmModuleDbFiledsEntity_Base_Column_List"/>
from mdm_module_db_fileds
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
<if test="chName != null and chName != ''">and ch_name = #{chName}</if>
<if test="enName != null and enName != ''">and en_name = #{enName}</if>
<if test="filedType != null and filedType != ''">and filed_type = #{filedType}</if>
<if test="addType != null and addType != ''">and add_type = #{addType}</if>
<if test="updateType != null and updateType != ''">and update_type = #{updateType}</if>
<if test="showType != null and showType != ''">and show_type = #{showType}</if>
<if test="queryType != null and queryType != ''">and query_type = #{queryType}</if>
<if test="listType != null and listType != ''">and list_type = #{listType}</if>
<if test="viewType != null and viewType != ''">and view_type = #{viewType}</if>
<if test="filedLength != null and filedLength != ''">and filed_length = #{filedLength}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="isSysPk != null and isSysPk != ''">and sys_pk = #{isSysPk}</if>
<if test="isSysCode != null and isSysCode != ''">and sys_code = #{isSysCode}</if>
<if test="isSysName != null and isSysName != ''">and sys_name = #{isSysName}</if>
<if test="isSysDate != null and isSysDate != ''">and sys_date = #{isSysDate}</if>
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmModuleDbFiledsEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
select
<include refid="MdmModuleDbFiledsEntity_Base_Column_List" />
from mdm_module_db_fileds
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
<if test="chName != null and chName != ''"> and ch_name = #{chName} </if>
<if test="enName != null and enName != ''"> and en_name = #{enName} </if>
<if test="filedType != null and filedType != ''"> and filed_type = #{filedType} </if>
<if test="addType != null and addType != ''"> and add_type = #{addType} </if>
<if test="updateType != null and updateType != ''"> and update_type = #{updateType} </if>
<if test="showType != null and showType != ''"> and show_type = #{showType} </if>
<if test="queryType != null and queryType != ''"> and query_type = #{queryType} </if>
<if test="listType != null and listType != ''"> and list_type = #{listType} </if>
<if test="viewType != null and viewType != ''"> and view_type = #{viewType} </if>
<if test="filedLength != null and filedLength != ''"> and filed_length = #{filedLength} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
<if test="roletype != null and roletype != ''">
and id in (
select
filed_id
from mdm_module_db_fileds_rule
where sts='Y' and rule_code = #{roletype} and rule_value = #{roleValue}
where sts='Y' and rule_code = #{roletype} and rule_value = #{roleValue}
)
</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer"
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
select count(1) from mdm_module_db_fileds
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
<if test="chName != null and chName != ''">and ch_name = #{chName}</if>
<if test="enName != null and enName != ''">and en_name = #{enName}</if>
<if test="filedType != null and filedType != ''">and filed_type = #{filedType}</if>
<if test="addType != null and addType != ''">and add_type = #{addType}</if>
<if test="updateType != null and updateType != ''">and update_type = #{updateType}</if>
<if test="showType != null and showType != ''">and show_type = #{showType}</if>
<if test="queryType != null and queryType != ''">and query_type = #{queryType}</if>
<if test="listType != null and listType != ''">and list_type = #{listType}</if>
<if test="viewType != null and viewType != ''">and view_type = #{viewType}</if>
<if test="filedLength != null and filedLength != ''">and filed_length = #{filedLength}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="isSysPk != null and isSysPk != ''">and sys_pk = #{isSysPk}</if>
<if test="isSysCode != null and isSysCode != ''">and sys_code = #{isSysCode}</if>
<if test="isSysName != null and isSysName != ''">and sys_name = #{isSysName}</if>
<if test="isSysDate != null and isSysDate != ''">and sys_date = #{isSysDate}</if>
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
select count(1) from mdm_module_db_fileds
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
<if test="chName != null and chName != ''"> and ch_name = #{chName} </if>
<if test="enName != null and enName != ''"> and en_name = #{enName} </if>
<if test="filedType != null and filedType != ''"> and filed_type = #{filedType} </if>
<if test="addType != null and addType != ''"> and add_type = #{addType} </if>
<if test="updateType != null and updateType != ''"> and update_type = #{updateType} </if>
<if test="showType != null and showType != ''"> and show_type = #{showType} </if>
<if test="queryType != null and queryType != ''"> and query_type = #{queryType} </if>
<if test="listType != null and listType != ''"> and list_type = #{listType} </if>
<if test="viewType != null and viewType != ''"> and view_type = #{viewType} </if>
<if test="filedLength != null and filedLength != ''"> and filed_length = #{filedLength} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-MdmModuleDbFiledsEntity-result"
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
select
<include refid="MdmModuleDbFiledsEntity_Base_Column_List"/>
from mdm_module_db_fileds
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
<if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
<if test="dbId != null and dbId != ''">and db_id like concat('%',#{dbId},'%')</if>
<if test="chName != null and chName != ''">and ch_name like concat('%',#{chName},'%')</if>
<if test="enName != null and enName != ''">and en_name like concat('%',#{enName},'%')</if>
<if test="filedType != null and filedType != ''">and filed_type like concat('%',#{filedType},'%')</if>
<if test="addType != null and addType != ''">and add_type like concat('%',#{addType},'%')</if>
<if test="updateType != null and updateType != ''">and update_type like concat('%',#{updateType},'%')</if>
<if test="showType != null and showType != ''">and show_type like concat('%',#{showType},'%')</if>
<if test="queryType != null and queryType != ''">and query_type like concat('%',#{queryType},'%')</if>
<if test="listType != null and listType != ''">and list_type like concat('%',#{listType},'%')</if>
<if test="viewType != null and viewType != ''">and view_type like concat('%',#{viewType},'%')</if>
<if test="filedLength != null and filedLength != ''">and filed_length like concat('%',#{filedLength},'%')
</if>
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
concat('%',#{create_user_id},'%')
</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
concat('%',#{modify_user_id},'%')
</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
<if test="isSysPk != null and isSysPk != ''">and sys_pk like concat('%',#{isSysPk},'%')</if>
<if test="isSysCode != null and isSysCode != ''">and sys_code like concat('%',#{isSysCode},'%')</if>
<if test="isSysName != null and isSysName != ''">and sys_name like concat('%',#{isSysName},'%')</if>
<if test="isSysDate != null and isSysDate != ''">and sys_date like concat('%',#{isSysDate},'%')</if>
<select id="entity_list_like" resultMap="get-MdmModuleDbFiledsEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
select
<include refid="MdmModuleDbFiledsEntity_Base_Column_List" />
from mdm_module_db_fileds
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id like concat('%',#{mdmId},'%') </if>
<if test="dbId != null and dbId != ''"> and db_id like concat('%',#{dbId},'%') </if>
<if test="chName != null and chName != ''"> and ch_name like concat('%',#{chName},'%') </if>
<if test="enName != null and enName != ''"> and en_name like concat('%',#{enName},'%') </if>
<if test="filedType != null and filedType != ''"> and filed_type like concat('%',#{filedType},'%') </if>
<if test="addType != null and addType != ''"> and add_type like concat('%',#{addType},'%') </if>
<if test="updateType != null and updateType != ''"> and update_type like concat('%',#{updateType},'%') </if>
<if test="showType != null and showType != ''"> and show_type like concat('%',#{showType},'%') </if>
<if test="queryType != null and queryType != ''"> and query_type like concat('%',#{queryType},'%') </if>
<if test="listType != null and listType != ''"> and list_type like concat('%',#{listType},'%') </if>
<if test="viewType != null and viewType != ''"> and view_type like concat('%',#{viewType},'%') </if>
<if test="filedLength != null and filedLength != ''"> and filed_length like concat('%',#{filedLength},'%') </if>
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
<if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%') </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="MdmModuleDbFiledsentity_list_or" resultMap="get-MdmModuleDbFiledsEntity-result"
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
select
<include refid="MdmModuleDbFiledsEntity_Base_Column_List"/>
from mdm_module_db_fileds
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">or id = #{id}</if>
<if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
<if test="dbId != null and dbId != ''">or db_id = #{dbId}</if>
<if test="chName != null and chName != ''">or ch_name = #{chName}</if>
<if test="enName != null and enName != ''">or en_name = #{enName}</if>
<if test="filedType != null and filedType != ''">or filed_type = #{filedType}</if>
<if test="addType != null and addType != ''">or add_type = #{addType}</if>
<if test="updateType != null and updateType != ''">or update_type = #{updateType}</if>
<if test="showType != null and showType != ''">or show_type = #{showType}</if>
<if test="queryType != null and queryType != ''">or query_type = #{queryType}</if>
<if test="listType != null and listType != ''">or list_type = #{listType}</if>
<if test="viewType != null and viewType != ''">or view_type = #{viewType}</if>
<if test="filedLength != null and filedLength != ''">or filed_length = #{filedLength}</if>
<if test="sorts != null">or sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
<if test="isSysPk != null and isSysPk != ''">or sys_pk = #{isSysPk}</if>
<if test="isSysCode != null and isSysCode != ''">or sys_code = #{isSysCode}</if>
<if test="isSysName != null and isSysName != ''">or sys_name = #{isSysName}</if>
<if test="isSysDate != null and isSysDate != ''">or sys_date = #{isSysDate}</if>
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="MdmModuleDbFiledsentity_list_or" resultMap="get-MdmModuleDbFiledsEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
select
<include refid="MdmModuleDbFiledsEntity_Base_Column_List" />
from mdm_module_db_fileds
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="mdmId != null and mdmId != ''"> or mdm_id = #{mdmId} </if>
<if test="dbId != null and dbId != ''"> or db_id = #{dbId} </if>
<if test="chName != null and chName != ''"> or ch_name = #{chName} </if>
<if test="enName != null and enName != ''"> or en_name = #{enName} </if>
<if test="filedType != null and filedType != ''"> or filed_type = #{filedType} </if>
<if test="addType != null and addType != ''"> or add_type = #{addType} </if>
<if test="updateType != null and updateType != ''"> or update_type = #{updateType} </if>
<if test="showType != null and showType != ''"> or show_type = #{showType} </if>
<if test="queryType != null and queryType != ''"> or query_type = #{queryType} </if>
<if test="listType != null and listType != ''"> or list_type = #{listType} </if>
<if test="viewType != null and viewType != ''"> or view_type = #{viewType} </if>
<if test="filedLength != null and filedLength != ''"> or filed_length = #{filedLength} </if>
<if test="sorts != null"> or sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> or company_id = #{companyId} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
insert into mdm_module_db_fileds(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</if>
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
<if test="dbId != null and dbId != ''">db_id ,</if>
<if test="chName != null and chName != ''">ch_name ,</if>
<if test="enName != null and enName != ''">en_name ,</if>
<if test="filedType != null and filedType != ''">filed_type ,</if>
<if test="addType != null and addType != ''">add_type ,</if>
<if test="updateType != null and updateType != ''">update_type ,</if>
<if test="showType != null and showType != ''">show_type ,</if>
<if test="queryType != null and queryType != ''">query_type ,</if>
<if test="listType != null and listType != ''">list_type ,</if>
<if test="viewType != null and viewType != ''">view_type ,</if>
<if test="filedLength != null and filedLength != ''">filed_length ,</if>
<if test="sorts != null">sorts ,</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
<if test="create_time != null">create_time ,</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="companyId != null and companyId != ''">company_id ,</if>
<if test="isSysPk != null and isSysPk != ''">sys_pk ,</if>
<if test="isSysCode != null and isSysCode != ''">sys_code ,</if>
<if test="isSysName != null and isSysName != ''">sys_name ,</if>
<if test="isSysDate != null and isSysDate != ''">sys_date ,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id} ,</if>
<if test="mdmId != null and mdmId != ''">#{mdmId} ,</if>
<if test="dbId != null and dbId != ''">#{dbId} ,</if>
<if test="chName != null and chName != ''">#{chName} ,</if>
<if test="enName != null and enName != ''">#{enName} ,</if>
<if test="filedType != null and filedType != ''">#{filedType} ,</if>
<if test="addType != null and addType != ''">#{addType} ,</if>
<if test="updateType != null and updateType != ''">#{updateType} ,</if>
<if test="showType != null and showType != ''">#{showType} ,</if>
<if test="queryType != null and queryType != ''">#{queryType} ,</if>
<if test="listType != null and listType != ''">#{listType} ,</if>
<if test="viewType != null and viewType != ''">#{viewType} ,</if>
<if test="filedLength != null and filedLength != ''">#{filedLength} ,</if>
<if test="sorts != null">#{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
<if test="isSysPk != null and isSysPk != ''">#{isSysPk} ,</if>
<if test="isSysCode != null and isSysCode != ''">#{isSysCode} ,</if>
<if test="isSysName != null and isSysName != ''">#{isSysName} ,</if>
<if test="isSysDate != null and isSysDate != ''">#{isSysDate} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch">
insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type,
query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts,
org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch">
insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type,
query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts,
org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
</foreach>
on duplicate key update
mdm_id = values(mdm_id),
db_id = values(db_id),
ch_name = values(ch_name),
en_name = values(en_name),
filed_type = values(filed_type),
add_type = values(add_type),
update_type = values(update_type),
show_type = values(show_type),
query_type = values(query_type),
list_type = values(list_type),
view_type = values(view_type),
filed_length = values(filed_length),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
org_id = values(org_id),
company_id = values(company_id)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
update mdm_module_db_fileds set
<trim suffix="" suffixOverrides=",">
<if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
<if test="dbId != null and dbId != ''">db_id = #{dbId},</if>
<if test="chName != null and chName != ''">ch_name = #{chName},</if>
<if test="enName != null and enName != ''">en_name = #{enName},</if>
<if test="filedType != null and filedType != ''">filed_type = #{filedType},</if>
<if test="addType != null and addType != ''">add_type = #{addType},</if>
<if test="updateType != null and updateType != ''">update_type = #{updateType},</if>
<if test="showType != null and showType != ''">show_type = #{showType},</if>
<if test="queryType != null and queryType != ''">query_type = #{queryType},</if>
<if test="listType != null and listType != ''">list_type = #{listType},</if>
<if test="viewType != null and viewType != ''">view_type = #{viewType},</if>
filed_length = #{filedLength},
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
<if test="create_time != null">create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
<if test="isSysPk != null and isSysPk != ''">sys_pk = #{isSysPk},</if>
<if test="isSysPk == null ">sys_pk = null,</if>
<if test="isSysCode != null and isSysCode != ''">sys_code = #{isSysCode},</if>
<if test="isSysCode == null ">sys_code = null,</if>
<if test="isSysName != null and isSysName != ''">sys_name = #{isSysName},</if>
<if test="isSysName == null ">sys_name = null,</if>
<if test="isSysDate != null and isSysDate != ''">sys_date = #{isSysDate},</if>
<if test="isSysDate == null ">sys_date = null,</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
update mdm_module_db_fileds
set sts= 'N',
modify_time = #{modify_time},
modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition"
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
update mdm_module_db_fileds set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
<if test="chName != null and chName != ''">and ch_name = #{chName}</if>
<if test="enName != null and enName != ''">and en_name = #{enName}</if>
<if test="filedType != null and filedType != ''">and filed_type = #{filedType}</if>
<if test="addType != null and addType != ''">and add_type = #{addType}</if>
<if test="updateType != null and updateType != ''">and update_type = #{updateType}</if>
<if test="showType != null and showType != ''">and show_type = #{showType}</if>
<if test="queryType != null and queryType != ''">and query_type = #{queryType}</if>
<if test="listType != null and listType != ''">and list_type = #{listType}</if>
<if test="viewType != null and viewType != ''">and view_type = #{viewType}</if>
<if test="filedLength != null and filedLength != ''">and filed_length = #{filedLength}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" >
insert into mdm_module_db_fileds(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
<if test="mdmId != null and mdmId != ''"> mdm_id , </if>
<if test="dbId != null and dbId != ''"> db_id , </if>
<if test="chName != null and chName != ''"> ch_name , </if>
<if test="enName != null and enName != ''"> en_name , </if>
<if test="filedType != null and filedType != ''"> filed_type , </if>
<if test="addType != null and addType != ''"> add_type , </if>
<if test="updateType != null and updateType != ''"> update_type , </if>
<if test="showType != null and showType != ''"> show_type , </if>
<if test="queryType != null and queryType != ''"> query_type , </if>
<if test="listType != null and listType != ''"> list_type , </if>
<if test="viewType != null and viewType != ''"> view_type , </if>
<if test="filedLength != null and filedLength != ''"> filed_length , </if>
<if test="sorts != null"> sorts , </if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
<if test="create_time != null"> create_time , </if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
<if test="modify_time != null"> modify_time , </if>
<if test="sts != null and sts != ''"> sts , </if>
<if test="org_id != null and org_id != ''"> org_id , </if>
<if test="companyId != null and companyId != ''"> company_id , </if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if>
<if test="mdmId != null and mdmId != ''"> #{mdmId} ,</if>
<if test="dbId != null and dbId != ''"> #{dbId} ,</if>
<if test="chName != null and chName != ''"> #{chName} ,</if>
<if test="enName != null and enName != ''"> #{enName} ,</if>
<if test="filedType != null and filedType != ''"> #{filedType} ,</if>
<if test="addType != null and addType != ''"> #{addType} ,</if>
<if test="updateType != null and updateType != ''"> #{updateType} ,</if>
<if test="showType != null and showType != ''"> #{showType} ,</if>
<if test="queryType != null and queryType != ''"> #{queryType} ,</if>
<if test="listType != null and listType != ''"> #{listType} ,</if>
<if test="viewType != null and viewType != ''"> #{viewType} ,</if>
<if test="filedLength != null and filedLength != ''"> #{filedLength} ,</if>
<if test="sorts != null"> #{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
<if test="modify_time != null"> #{modify_time} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" >
insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type, query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" >
insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type, query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
</foreach>
on duplicate key update
mdm_id = values(mdm_id),
db_id = values(db_id),
ch_name = values(ch_name),
en_name = values(en_name),
filed_type = values(filed_type),
add_type = values(add_type),
update_type = values(update_type),
show_type = values(show_type),
query_type = values(query_type),
list_type = values(list_type),
view_type = values(view_type),
filed_length = values(filed_length),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
org_id = values(org_id),
company_id = values(company_id)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" >
update mdm_module_db_fileds set
<trim suffix="" suffixOverrides=",">
<if test="mdmId != null and mdmId != ''"> mdm_id = #{mdmId},</if>
<if test="dbId != null and dbId != ''"> db_id = #{dbId},</if>
<if test="chName != null and chName != ''"> ch_name = #{chName},</if>
<if test="enName != null and enName != ''"> en_name = #{enName},</if>
<if test="filedType != null and filedType != ''"> filed_type = #{filedType},</if>
<if test="addType != null and addType != ''"> add_type = #{addType},</if>
<if test="updateType != null and updateType != ''"> update_type = #{updateType},</if>
<if test="showType != null and showType != ''"> show_type = #{showType},</if>
<if test="queryType != null and queryType != ''"> query_type = #{queryType},</if>
<if test="listType != null and listType != ''"> list_type = #{listType},</if>
<if test="viewType != null and viewType != ''"> view_type = #{viewType},</if>
filed_length = #{filedLength},
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" >
update mdm_module_db_fileds set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" >
update mdm_module_db_fileds set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
<if test="chName != null and chName != ''"> and ch_name = #{chName} </if>
<if test="enName != null and enName != ''"> and en_name = #{enName} </if>
<if test="filedType != null and filedType != ''"> and filed_type = #{filedType} </if>
<if test="addType != null and addType != ''"> and add_type = #{addType} </if>
<if test="updateType != null and updateType != ''"> and update_type = #{updateType} </if>
<if test="showType != null and showType != ''"> and show_type = #{showType} </if>
<if test="queryType != null and queryType != ''"> and query_type = #{queryType} </if>
<if test="listType != null and listType != ''"> and list_type = #{listType} </if>
<if test="viewType != null and viewType != ''"> and view_type = #{viewType} </if>
<if test="filedLength != null and filedLength != ''"> and filed_length = #{filedLength} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete
from mdm_module_db_fileds
where id = #{id}
</delete>
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from mdm_module_db_fileds where id = #{id}
</delete>
<!--通过mdmCode删除-->
<delete id="deleteMdmModuleDbFileds" parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
delete
from mdm_module_db_fileds
where mdm_id = #{mdmId}
</delete>
delete from mdm_module_db_fileds where mdm_id = #{mdmId}
</delete>
</mapper>

View File

@ -3,8 +3,7 @@ package com.hzya.frame.mdm.mdmModuleDbFileds.service.impl;
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
import com.hzya.frame.mdm.mdmModuleDbFileds.dao.IMdmModuleDbFiledsDao;
import com.hzya.frame.mdm.mdmModuleDbFileds.service.IMdmModuleDbFiledsService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;

View File

@ -310,12 +310,7 @@
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
select count(1) from mdm_module_db_fileds_rule
<trim prefix="where" prefixOverrides="and">
<!-- <if test="mdmId != null and mdmId != ''">and mdm_id != #{mdmId}</if>-->
<!-- <if test="ruleCode != null and ruleCode != ''">and rule_code = #{ruleCode}</if>-->
<!-- <if test="ruleValue != null and ruleValue != ''">and rule_value = #{ruleValue}</if>-->
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id != #{mdmId}</if>
<if test="ruleCode != null and ruleCode != ''">and rule_code = #{ruleCode}</if>
<if test="ruleValue != null and ruleValue != ''">and rule_value = #{ruleValue}</if>
and sts='Y'

View File

@ -87,15 +87,6 @@ public interface IMdmService {
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity queryMdmShowDetailsData(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据详情数据字典
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity queryMdmShowDetailsDictionary(JSONObject jsonObject);
//
/**
* @param jsonObject

View File

@ -101,6 +101,12 @@ public class MdmServiceImpl implements IMdmService {
@Resource
private IMdmServiceCache mdmServiceCache;
@Resource
private ISysMenuConfigDao sysMenuConfigDao;
@Resource
private ISysButtonConfigDao sysButtonConfigDao;
@Resource
private ISysPopedomOperateDao sysPopedomOperateDao;
@Resource
private IMdmModuleDbDao mdmModuleDbDao;
@Resource
private ISysUserDao sysUserDao;
@ -1375,188 +1381,15 @@ public class MdmServiceImpl implements IMdmService {
}
}
//if (tablename != null && !"".equals(tablename)) {
// Map<String, Object> queryData = new HashMap<>();
// queryData.put("tableName", tablename);//表名
// queryData.put("id", entity.getId());//字段
// List<HashMap<String, Object>> datas = mdmModuleDbDao.getServiceByDistributeId(queryData);
// jsonObject.put(tablename, datas);
//}
return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject);
}
/**
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据详情数据字典
* @Date 9:40 上午 2023/10/18
**/
@Override
public JsonResultEntity queryMdmShowDetailsDictionary(JSONObject object) {
MdmDto entity = getData("jsonStr", object, MdmDto.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
//查询模版
MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode());
if (mdmModuleEntity == null) {
return BaseResult.getFailureMessageEntity("系统错误");
}
//查询数据源主表
MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity();
mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId());
mdmModuleDbEntity.setSts("Y");
List<MdmModuleDbEntity> mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity);
if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) {
return BaseResult.getFailureMessageEntity("系统错误");
}
MdmModuleDbFiledsEntity queryFild = new MdmModuleDbFiledsEntity();
queryFild.setMdmId(mdmModuleEntity.getId());
queryFild.setSts("Y");
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(queryFild);
MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity();
mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntity.getId());
mdmModuleDbFiledsRuleEntity.setSts("Y");
List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(mdmModuleDbFiledsRuleEntity);
List<MdmFiledsRuleDto> mdmFiledsRuleDtos = new ArrayList<>();
if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){
for (int i = 0; i < mdmModuleDbFiledsRuleEntities.size(); i++) {
if("treeselect".equals(mdmModuleDbFiledsRuleEntities.get(i).getRuleValue()) || "select".equals(mdmModuleDbFiledsRuleEntities.get(i).getRuleValue())){
MdmFiledsRuleDto mdmFiledsRuleDto = new MdmFiledsRuleDto();
mdmFiledsRuleDto.setDbId(mdmModuleDbFiledsRuleEntities.get(i).getDbId());
mdmFiledsRuleDto.setFiledId(mdmModuleDbFiledsRuleEntities.get(i).getFiledId());
mdmFiledsRuleDto.setMdmId(mdmModuleDbFiledsRuleEntities.get(i).getMdmId());
mdmFiledsRuleDto.setFiledType(mdmModuleDbFiledsRuleEntities.get(i).getRuleValue());
mdmFiledsRuleDtos.add(mdmFiledsRuleDto);
}
}
}
if(mdmFiledsRuleDtos != null && mdmFiledsRuleDtos.size() > 0){
for (int i = 0; i < mdmFiledsRuleDtos.size(); i++) {
for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) {
if(mdmFiledsRuleDtos.get(i).getFiledId().equals(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId())
&& "service".equals(mdmModuleDbFiledsRuleEntities.get(i1).getRuleCode())){
mdmFiledsRuleDtos.get(i).setTypeFiled(mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue());
}
}
}
}
//String tablename = null;
JSONObject jsonObject = new JSONObject();
jsonObject.put("appName","数智中台");
jsonObject.put("appCode","800004");
jsonObject.put("mdmCode",entity.getMdmCode());
jsonObject.put("optionName","admin");
for (int i = 0; i < mdmModuleDbEntityList.size(); i++) {
if ("1".equals(mdmModuleDbEntityList.get(i).getDbType()) || "2".equals(mdmModuleDbEntityList.get(i).getDbType())) {
//查询数据
Map<String, Object> queryData = new HashMap<>();
queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名
if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) {
queryData.put("detailFlag", false);//是否明细
queryData.put("id", entity.getId());//字段
HashMap<String, Object> datas = mdmModuleDbDao.getServiceDataById(queryData);
convertKeysToLowerCase(datas);
JSONObject zbdata = new JSONObject();
if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){
for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) {
if(mdmModuleDbFiledsEntities.get(i2).getDbId().equals(mdmModuleDbEntityList.get(i).getId())){
if("1".equals(mdmModuleDbFiledsEntities.get(i2).getViewType())){
//判断是否是下拉类型
Object data = datas.get(mdmModuleDbFiledsEntities.get(i2).getEnName());
if(mdmFiledsRuleDtos != null && mdmFiledsRuleDtos.size() > 0){
for (int i1 = 0; i1 < mdmFiledsRuleDtos.size(); i1++) {
if(mdmModuleDbFiledsEntities.get(i2).getId().equals(mdmFiledsRuleDtos.get(i1).getFiledId())){
//查询对应的data_id
String strData = String.valueOf(data);
int index = strData.lastIndexOf(',');
if (index!= -1) {
strData = strData.substring(index + 1);
}
mdmFiledsRuleDtos.get(i1).setId(strData);
MdmFiledsRuleDto mdmFiledsRuleDto = mdmModuleDao.queryDataId(mdmFiledsRuleDtos.get(i1));
if(mdmFiledsRuleDto != null && mdmFiledsRuleDto.getDataId() != null && !"".equals(mdmFiledsRuleDto.getDataId())){
data = mdmFiledsRuleDto.getDataId();
}else {
data = null;
}
}
}
}
zbdata.put(mdmModuleDbFiledsEntities.get(i2).getEnName(),data);
}
}
}
}
jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), zbdata);
} else {
queryData.put("detailFlag", true);//是否明细
queryData.put("id", entity.getId());//字段
List<HashMap<String, Object>> datas = mdmModuleDbDao.getServiceByFormmainId(queryData);
convertKeysToLowerCase(datas);
List<JSONObject> mxDataList = new ArrayList<>();
if(datas != null && datas.size() > 0){
for (int i1 = 0; i1 < datas.size(); i1++) {
JSONObject mxData = new JSONObject();
if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){
for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) {
if(mdmModuleDbFiledsEntities.get(i2).getDbId().equals(mdmModuleDbEntityList.get(i).getId())){
if("1".equals(mdmModuleDbFiledsEntities.get(i2).getViewType())){
//判断是否是下拉类型
Object data = datas.get(i1).get(mdmModuleDbFiledsEntities.get(i2).getEnName());
if(mdmFiledsRuleDtos != null && mdmFiledsRuleDtos.size() > 0){
for (int b = 0; b < mdmFiledsRuleDtos.size(); b++) {
if(mdmModuleDbFiledsEntities.get(i2).getId().equals(mdmFiledsRuleDtos.get(b).getFiledId())){
//查询对应的data_id
String strData = String.valueOf(data);
int index = strData.lastIndexOf(',');
if (index!= -1) {
strData = strData.substring(index + 1);
}
mdmFiledsRuleDtos.get(b).setId(strData);
MdmFiledsRuleDto mdmFiledsRuleDto = mdmModuleDao.queryDataId(mdmFiledsRuleDtos.get(b));
if(mdmFiledsRuleDto != null && mdmFiledsRuleDto.getDataId() != null && !"".equals(mdmFiledsRuleDto.getDataId())){
data = mdmFiledsRuleDto.getDataId();
}else {
data = null;
}
}
}
}
mxData.put(mdmModuleDbFiledsEntities.get(i2).getEnName(),data);
}
}
}
}
mxDataList.add(mxData);
}
}else {
JSONObject mxData = new JSONObject();
if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){
for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) {
if(mdmModuleDbFiledsEntities.get(i2).getDbId().equals(mdmModuleDbEntityList.get(i).getId())){
if("1".equals(mdmModuleDbFiledsEntities.get(i2).getViewType())){
mxData.put(mdmModuleDbFiledsEntities.get(i2).getEnName(),null);
}
}
}
}
mxDataList.add(mxData);
}
jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), mxDataList);
}
}
}
return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject);
}
@ -2111,8 +1944,7 @@ public class MdmServiceImpl implements IMdmService {
return BaseResult.getSuccessMessageEntity("发送成功");
} else {
saveMdmModuleSendLogEntity(mdmModuleEntity.getMdmCode(), mdmModuleDistributeEntity.getId(), "2", "转发失败:"+jsonResultEntity.getAttribute(), dbname, object.getString("id"), sysApplicationEntity.getName(), sysApplicationEntity.getId(), apiEntity.getApiName(), apiEntity.getId(), object.toJSONString(), type);
JSONObject object1 = JSONObject.parseObject(jsonResultEntity.getAttribute().toString());
return BaseResult.getFailureMessageEntity("发送错误:" +object1.getString("msg"));
return BaseResult.getFailureMessageEntity("发送错误:" + jsonResultEntity.getAttribute());
}
}

View File

@ -13,20 +13,4 @@ import com.hzya.frame.sys.dictionaryshopNew.entity.SysDictionaryshopNew;
public interface ISysDictionaryshopNewService {
JsonResultEntity test(SysDictionaryshopNew object);
/**
* 查询数据字典
* @param tabName 表名
* @param columnName 字段名
* @param columnValue 字典值
* @return
*/
SysDictionaryshopNew getDictionaryshopByValue(String tabName, String columnName, String columnValue);
/**
* 查询列表
* @param object
* @return
*/
JsonResultEntity queryDictionaryList(JSONObject object);
}

View File

@ -1,6 +1,5 @@
package com.hzya.frame.sys.dictionaryshopNew.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.web.entity.BaseResult;
import org.springframework.stereotype.Service;
import com.hzya.frame.serviceUtil.ServiceUtil;
@ -12,7 +11,7 @@ import org.slf4j.LoggerFactory;
import com.hzya.frame.web.entity.JsonResultEntity;
import javax.annotation.Resource;
import java.util.List;
/**
@ -34,33 +33,4 @@ public class SysDictionaryshopNewServiceImpl extends ServiceUtil implements ISy
return BaseResult.getSuccessMessageEntity("获取应用成功");
}
/**
* 查询数据字典
*
* @param tabName 表名
* @param columnName 字段名
* @param columnValue 字典值
* @return
*/
@Override
public SysDictionaryshopNew getDictionaryshopByValue(String tabName, String columnName, String columnValue) {
SysDictionaryshopNew sysDictionaryshopNew = new SysDictionaryshopNew();
sysDictionaryshopNew.setTabName(tabName);
sysDictionaryshopNew.setColumnName(columnName);
sysDictionaryshopNew.setColumnValue(columnValue);
return sysdictionaryshopnewMapper.entity_get_by_value(sysDictionaryshopNew);
}
/**
* 查询列表
*
* @param object
* @return
*/
@Override
public JsonResultEntity queryDictionaryList(JSONObject object) {
SysDictionaryshopNew dictionary = getData("jsonStr", object, SysDictionaryshopNew.class);
List<SysDictionaryshopNew> dictionaryList = sysdictionaryshopnewMapper.entity_list_base(dictionary);
return BaseResult.getSuccessMessageEntity("查询列表成功", dictionaryList);
}
}

View File

@ -1,15 +0,0 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowClassEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 流程分类;对应数环通项目分类(sys_flow_class: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public interface ISysFlowClassDao extends IBaseDao<SysFlowClassEntity, String> {
}

View File

@ -1,15 +0,0 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 流程分类权限表(sys_flow_class_rule: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public interface ISysFlowClassRuleDao extends IBaseDao<SysFlowClassRuleEntity, String> {
}

View File

@ -1,15 +0,0 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 流程主表;流程就是数环通的Linkup(sys_flow: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:19
*/
public interface ISysFlowDao extends IBaseDao<SysFlowEntity, String> {
}

View File

@ -1,15 +0,0 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* nifi常量(sys_flow_nifi_constant: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public interface ISysFlowNifiConstantDao extends IBaseDao<SysFlowNifiConstantEntity, String> {
}

View File

@ -1,15 +0,0 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 流程步骤账户表(sys_flow_step_account: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public interface ISysFlowStepAccountDao extends IBaseDao<SysFlowStepAccountEntity, String> {
}

View File

@ -1,15 +0,0 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 映射信息表体(sys_flow_step_config_b: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
public interface ISysFlowStepConfigBDao extends IBaseDao<SysFlowStepConfigBEntity, String> {
}

View File

@ -1,15 +0,0 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 映射信息主表(sys_flow_step_config: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
public interface ISysFlowStepConfigDao extends IBaseDao<SysFlowStepConfigEntity, String> {
}

View File

@ -1,15 +0,0 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowStepEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 流程步骤信息(sys_flow_step: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public interface ISysFlowStepDao extends IBaseDao<SysFlowStepEntity, String> {
}

View File

@ -1,15 +0,0 @@
package com.hzya.frame.sys.flow.dao;
import com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 步骤关联关系表(sys_flow_step_relation: table)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
public interface ISysFlowStepRelationDao extends IBaseDao<SysFlowStepRelationEntity, String> {
}

View File

@ -1,17 +0,0 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowClassEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowClassDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 流程分类;对应数环通项目分类(SysFlowClass)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
@Repository(value = "SysFlowClassDaoImpl")
public class SysFlowClassDaoImpl extends MybatisGenericDao<SysFlowClassEntity, String> implements ISysFlowClassDao{
}

View File

@ -1,17 +0,0 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowClassRuleDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 流程分类权限表(SysFlowClassRule)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
@Repository(value = "SysFlowClassRuleDaoImpl")
public class SysFlowClassRuleDaoImpl extends MybatisGenericDao<SysFlowClassRuleEntity, String> implements ISysFlowClassRuleDao{
}

View File

@ -1,17 +0,0 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 流程主表;流程就是数环通的Linkup(SysFlow)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:21
*/
@Repository(value = "SysFlowDaoImpl")
public class SysFlowDaoImpl extends MybatisGenericDao<SysFlowEntity, String> implements ISysFlowDao{
}

View File

@ -1,17 +0,0 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowNifiConstantDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* nifi常量(SysFlowNifiConstant)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
@Repository(value = "SysFlowNifiConstantDaoImpl")
public class SysFlowNifiConstantDaoImpl extends MybatisGenericDao<SysFlowNifiConstantEntity, String> implements ISysFlowNifiConstantDao{
}

View File

@ -1,17 +0,0 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepAccountDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 流程步骤账户表(SysFlowStepAccount)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
@Repository(value = "SysFlowStepAccountDaoImpl")
public class SysFlowStepAccountDaoImpl extends MybatisGenericDao<SysFlowStepAccountEntity, String> implements ISysFlowStepAccountDao{
}

View File

@ -1,17 +0,0 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepConfigBDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 映射信息表体(SysFlowStepConfigB)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
@Repository(value = "SysFlowStepConfigBDaoImpl")
public class SysFlowStepConfigBDaoImpl extends MybatisGenericDao<SysFlowStepConfigBEntity, String> implements ISysFlowStepConfigBDao{
}

View File

@ -1,17 +0,0 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepConfigDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 映射信息主表(SysFlowStepConfig)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
@Repository(value = "SysFlowStepConfigDaoImpl")
public class SysFlowStepConfigDaoImpl extends MybatisGenericDao<SysFlowStepConfigEntity, String> implements ISysFlowStepConfigDao{
}

View File

@ -1,17 +0,0 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowStepEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 流程步骤信息(SysFlowStep)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
@Repository(value = "SysFlowStepDaoImpl")
public class SysFlowStepDaoImpl extends MybatisGenericDao<SysFlowStepEntity, String> implements ISysFlowStepDao{
}

View File

@ -1,17 +0,0 @@
package com.hzya.frame.sys.flow.dao.impl;
import com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepRelationDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 步骤关联关系表(SysFlowStepRelation)表数据库访问层
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
@Repository(value = "SysFlowStepRelationDaoImpl")
public class SysFlowStepRelationDaoImpl extends MybatisGenericDao<SysFlowStepRelationEntity, String> implements ISysFlowStepRelationDao{
}

View File

@ -1,36 +0,0 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 流程分类;对应数环通项目分类(SysFlowClass)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public class SysFlowClassEntity extends BaseEntity {
/** 分类名称 */
private String name;
/** 上级id */
private String parentId;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
}

View File

@ -1,195 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.sys.flow.dao.impl.SysFlowClassDaoImpl">
<resultMap id="get-SysFlowClassEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowClassEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysFlowClassEntity_Base_Column_List">
id
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,name
,parent_id
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowClassEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowClassEntity">
select
<include refid="SysFlowClassEntity_Base_Column_List" />
from sys_flow_class
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowClassEntity">
select count(1) from sys_flow_class
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-SysFlowClassEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowClassEntity">
select
<include refid="SysFlowClassEntity_Base_Column_List" />
from sys_flow_class
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
<if test="name != null and name != ''"> and name like concat('%',#{name},'%') </if>
<if test="parentId != null and parentId != ''"> and parent_id like concat('%',#{parentId},'%') </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="SysFlowClassentity_list_or" resultMap="get-SysFlowClassEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowClassEntity">
select
<include refid="SysFlowClassEntity_Base_Column_List" />
from sys_flow_class
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
<if test="name != null and name != ''"> or name = #{name} </if>
<if test="parentId != null and parentId != ''"> or parent_id = #{parentId} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowClassEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_class(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
<if test="create_time != null">create_time ,</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="name != null and name != ''">name ,</if>
<if test="parentId != null and parentId != ''">parent_id ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id} ,</if>
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="name != null and name != ''">#{name} ,</if>
<if test="parentId != null and parentId != ''">#{parentId} ,</if>
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_class a WHERE
a.sts = 'Y' ),1),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_class(create_user_id, create_time, modify_user_id, modify_time, sts, name, parent_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.parentId}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_class(create_user_id, create_time, modify_user_id, modify_time, sts, name, parent_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.parentId})
</foreach>
on duplicate key update
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
name = values(name),
parent_id = values(parent_id)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowClassEntity" >
update sys_flow_class set
<trim suffix="" suffixOverrides=",">
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="name != null and name != ''"> name = #{name},</if>
<if test="parentId != null and parentId != ''"> parent_id = #{parentId},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowClassEntity" >
update sys_flow_class set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowClassEntity" >
update sys_flow_class set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_flow_class where id = #{id}
</delete>
</mapper>

View File

@ -1,75 +0,0 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import java.util.List;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 流程分类权限表(SysFlowClassRule)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public class SysFlowClassRuleEntity extends BaseEntity {
/** 流程分类id */
private String flowClassId;
/** 用户id */
private String userId;
/** 用户名 */
private String userName;
/** 用户编码 */
private String userCode;
/** 头像 */
private String profileIcon;
//权限列表
List<SysFlowClassRuleEntity> ruleList;
public String getFlowClassId() {
return flowClassId;
}
public void setFlowClassId(String flowClassId) {
this.flowClassId = flowClassId;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserCode() {
return userCode;
}
public void setUserCode(String userCode) {
this.userCode = userCode;
}
public String getProfileIcon() {
return profileIcon;
}
public void setProfileIcon(String profileIcon) {
this.profileIcon = profileIcon;
}
public List<SysFlowClassRuleEntity> getRuleList() {
return ruleList;
}
public void setRuleList(List<SysFlowClassRuleEntity> ruleList) {
this.ruleList = ruleList;
}
}

View File

@ -1,247 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.sys.flow.dao.impl.SysFlowClassRuleDaoImpl">
<resultMap id="get-SysFlowClassRuleEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="flowClassId" column="flow_class_id" jdbcType="VARCHAR"/>
<result property="userId" column="user_id" jdbcType="VARCHAR"/>
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
<result property="userCode" column="user_code" jdbcType="VARCHAR"/>
<result property="profileIcon" column="profile_icon" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="SysFlowClassRuleEntity_Base_Column_List">
id
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,flow_class_id
,user_id
,user_name
,user_code
,profile_icon
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowClassRuleEntity-result"
parameterType="com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity">
select
<include refid="SysFlowClassRuleEntity_Base_Column_List"/>
from sys_flow_class_rule
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="flowClassId != null and flowClassId != ''">and flow_class_id = #{flowClassId}</if>
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
<if test="userName != null and userName != ''">and user_name = #{userName}</if>
<if test="userCode != null and userCode != ''">and user_code = #{userCode}</if>
<if test="profileIcon != null and profileIcon != ''">and profile_icon = #{profileIcon}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer"
parameterType="com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity">
select count(1) from sys_flow_class_rule
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="flowClassId != null and flowClassId != ''">and flow_class_id = #{flowClassId}</if>
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
<if test="userName != null and userName != ''">and user_name = #{userName}</if>
<if test="userCode != null and userCode != ''">and user_code = #{userCode}</if>
<if test="profileIcon != null and profileIcon != ''">and profile_icon = #{profileIcon}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-SysFlowClassRuleEntity-result"
parameterType="com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity">
select
<include refid="SysFlowClassRuleEntity_Base_Column_List"/>
from sys_flow_class_rule
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
concat('%',#{create_user_id},'%')
</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
concat('%',#{modify_user_id},'%')
</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="flowClassId != null and flowClassId != ''">and flow_class_id like concat('%',#{flowClassId},'%')
</if>
<if test="userId != null and userId != ''">and user_id like concat('%',#{userId},'%')</if>
<if test="userName != null and userName != ''">and user_name like concat('%',#{userName},'%')</if>
<if test="userCode != null and userCode != ''">and user_code like concat('%',#{userCode},'%')</if>
<if test="profileIcon != null and profileIcon != ''">and profile_icon like concat('%',#{profileIcon},'%')
</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="SysFlowClassRuleentity_list_or" resultMap="get-SysFlowClassRuleEntity-result"
parameterType="com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity">
select
<include refid="SysFlowClassRuleEntity_Base_Column_List"/>
from sys_flow_class_rule
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">or id = #{id}</if>
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
<if test="flowClassId != null and flowClassId != ''">or flow_class_id = #{flowClassId}</if>
<if test="userId != null and userId != ''">or user_id = #{userId}</if>
<if test="userName != null and userName != ''">or user_name = #{userName}</if>
<if test="userCode != null and userCode != ''">or user_code = #{userCode}</if>
<if test="profileIcon != null and profileIcon != ''">or profile_icon = #{profileIcon}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity" keyProperty="id"
useGeneratedKeys="true">
insert into sys_flow_class_rule(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
<if test="create_time != null">create_time ,</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="flowClassId != null and flowClassId != ''">flow_class_id ,</if>
<if test="userId != null and userId != ''">user_id ,</if>
<if test="userName != null and userName != ''">user_name ,</if>
<if test="userCode != null and userCode != ''">user_code ,</if>
<if test="profileIcon != null and profileIcon != ''">profile_icon ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id} ,</if>
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="flowClassId != null and flowClassId != ''">#{flowClassId} ,</if>
<if test="userId != null and userId != ''">#{userId} ,</if>
<if test="userName != null and userName != ''">#{userName} ,</if>
<if test="userCode != null and userCode != ''">#{userCode} ,</if>
<if test="profileIcon != null and profileIcon != ''">#{profileIcon} ,</if>
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_class_rule a WHERE a.sts = 'Y' ),1),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_class_rule(create_user_id, create_time, modify_user_id, modify_time, sts, flow_class_id,
user_id, user_name, user_code, profile_icon, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.flowClassId},#{entity.userId},#{entity.userName},#{entity.userCode},#{entity.profileIcon},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_class_rule(create_user_id, create_time, modify_user_id, modify_time, sts, flow_class_id,
user_id, user_name, user_code, profile_icon)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.flowClassId},#{entity.userId},#{entity.userName},#{entity.userCode},#{entity.profileIcon})
</foreach>
on duplicate key update
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
flow_class_id = values(flow_class_id),
user_id = values(user_id),
user_name = values(user_name),
user_code = values(user_code),
profile_icon = values(profile_icon)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity">
update sys_flow_class_rule set
<trim suffix="" suffixOverrides=",">
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
<if test="create_time != null">create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
<if test="flowClassId != null and flowClassId != ''">flow_class_id = #{flowClassId},</if>
<if test="userId != null and userId != ''">user_id = #{userId},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="userCode != null and userCode != ''">user_code = #{userCode},</if>
<if test="profileIcon != null and profileIcon != ''">profile_icon = #{profileIcon},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity">
update sys_flow_class_rule
set sts= 'N',
modify_time = #{modify_time},
modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition"
parameterType="com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity">
update sys_flow_class_rule set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="flowClassId != null and flowClassId != ''">and flow_class_id = #{flowClassId}</if>
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
<if test="userName != null and userName != ''">and user_name = #{userName}</if>
<if test="userCode != null and userCode != ''">and user_code = #{userCode}</if>
<if test="profileIcon != null and profileIcon != ''">and profile_icon = #{profileIcon}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete
from sys_flow_class_rule
where id = #{id}
</delete>
</mapper>

View File

@ -1,92 +0,0 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 流程主表;流程就是数环通的Linkup(SysFlow)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:23
*/
public class SysFlowEntity extends BaseEntity {
/** 流程名称 */
private String name;
/** 流程分类id */
private String classId;
private String className;
/** 触发方式id */
private String triggerModeId;
private String triggerModeName;
/** 应用组id */
private String nifiGroupId;
/** 流程描述 */
private String description;
//状态 启动/停止
private String status;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getClassId() {
return classId;
}
public void setClassId(String classId) {
this.classId = classId;
}
public String getTriggerModeId() {
return triggerModeId;
}
public void setTriggerModeId(String triggerModeId) {
this.triggerModeId = triggerModeId;
}
public String getNifiGroupId() {
return nifiGroupId;
}
public void setNifiGroupId(String nifiGroupId) {
this.nifiGroupId = nifiGroupId;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public String getTriggerModeName() {
return triggerModeName;
}
public void setTriggerModeName(String triggerModeName) {
this.triggerModeName = triggerModeName;
}
}

View File

@ -1,241 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.sys.flow.dao.impl.SysFlowDaoImpl">
<resultMap id="get-SysFlowEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="classId" column="class_id" jdbcType="VARCHAR"/>
<result property="className" column="className" jdbcType="VARCHAR"/>
<result property="triggerModeId" column="trigger_mode_id" jdbcType="VARCHAR"/>
<result property="nifiGroupId" column="nifi_group_id" jdbcType="VARCHAR"/>
<result property="description" column="description" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysFlowEntity_Base_Column_List">
sf.id
,sf.create_user_id
,sf.create_time
,sf.modify_user_id
,sf.modify_time
,sf.sts
,sf.name
,sf.status
,sf.class_id
,sfc.name as className
,sf.trigger_mode_id
,sf.nifi_group_id
,sf.description
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowEntity">
select
<include refid="SysFlowEntity_Base_Column_List" />
from sys_flow sf
left join sys_flow_class sfc on sfc.id = sf.class_id
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and sf.id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and sf.create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and sf.create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and sf.modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and sf.modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sf.sts = #{sts} </if>
<if test="name != null and name != ''"> and sf.name = #{name} </if>
<if test="status != null and status != ''"> and sf.status = #{status} </if>
<if test="classId != null and classId != ''"> and sf.class_id = #{classId} </if>
<if test="triggerModeId != null and triggerModeId != ''"> and sf.trigger_mode_id = #{triggerModeId} </if>
<if test="nifiGroupId != null and nifiGroupId != ''"> and sf.nifi_group_id = #{nifiGroupId} </if>
<if test="description != null and description != ''"> and sf.description = #{description} </if>
and sf.sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sf.sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowEntity">
select count(1) from sys_flow
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="classId != null and classId != ''"> and class_id = #{classId} </if>
<if test="triggerModeId != null and triggerModeId != ''"> and trigger_mode_id = #{triggerModeId} </if>
<if test="nifiGroupId != null and nifiGroupId != ''"> and nifi_group_id = #{nifiGroupId} </if>
<if test="description != null and description != ''"> and description = #{description} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-SysFlowEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowEntity">
select
<include refid="SysFlowEntity_Base_Column_List" />
from sys_flow sf
left join sys_flow_class sfc on sfc.id = sf.class_id
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and sf.id like concat('%',#{id},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and sf.create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and sf.create_time like concat('%',#{create_time},'%') </if>
<if test="modify_user_id != null and modify_user_id != ''"> and sf.modify_user_id like concat('%',#{modify_user_id},'%') </if>
<if test="modify_time != null"> and sf.modify_time like concat('%',#{modify_time},'%') </if>
<if test="sts != null and sts != ''"> and sf.sts like concat('%',#{sts},'%') </if>
<if test="name != null and name != ''"> and sf.name like concat('%',#{name},'%') </if>
<if test="status != null and status != ''"> and sf.status like concat('%',#{status},'%') </if>
<if test="classId != null and classId != ''"> and sf.class_id like concat('%',#{classId},'%') </if>
<if test="triggerModeId != null and triggerModeId != ''"> and sf.trigger_mode_id like concat('%',#{triggerModeId},'%') </if>
<if test="nifiGroupId != null and nifiGroupId != ''"> and sf.nifi_group_id like concat('%',#{nifiGroupId},'%') </if>
<if test="description != null and description != ''"> and sf.description like concat('%',#{description},'%') </if>
and sf.sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sf.sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="SysFlowentity_list_or" resultMap="get-SysFlowEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowEntity">
select
<include refid="SysFlowEntity_Base_Column_List" />
from sys_flow sf
left join sys_flow_class sfc on sfc.id = sf.class_id
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or sf.id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> or sf.create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or sf.create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or sf.modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or sf.modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sf.sts = #{sts} </if>
<if test="name != null and name != ''"> or sf.name = #{name} </if>
<if test="status != null and status != ''"> or sf.status = #{status} </if>
<if test="classId != null and classId != ''"> or sf.class_id = #{classId} </if>
<if test="triggerModeId != null and triggerModeId != ''"> or sf.trigger_mode_id = #{triggerModeId} </if>
<if test="nifiGroupId != null and nifiGroupId != ''"> or sf.nifi_group_id = #{nifiGroupId} </if>
<if test="description != null and description != ''"> or sf.description = #{description} </if>
and sf.sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
<if test="create_time != null">create_time ,</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="name != null and name != ''">name ,</if>
<if test="status != null and status != ''">status ,</if>
<if test="classId != null and classId != ''">class_id ,</if>
<if test="triggerModeId != null and triggerModeId != ''">trigger_mode_id ,</if>
<if test="nifiGroupId != null and nifiGroupId != ''">nifi_group_id ,</if>
<if test="description != null and description != ''">description ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id} ,</if>
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="name != null and name != ''">#{name} ,</if>
<if test="status != null and status != ''">#{status} ,</if>
<if test="classId != null and classId != ''">#{classId} ,</if>
<if test="triggerModeId != null and triggerModeId != ''">#{triggerModeId} ,</if>
<if test="nifiGroupId != null and nifiGroupId != ''">#{nifiGroupId} ,</if>
<if test="description != null and description != ''">#{description} ,</if>
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow a WHERE a.sts = 'Y' ),1),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow(create_user_id, create_time, modify_user_id, modify_time, sts, name,status, class_id, trigger_mode_id, nifi_group_id, description, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},${entity.status},#{entity.classId},#{entity.triggerModeId},#{entity.nifiGroupId},#{entity.description}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow(create_user_id, create_time, modify_user_id, modify_time, sts, name, status,class_id, trigger_mode_id, nifi_group_id, description)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.status},#{entity.classId},#{entity.triggerModeId},#{entity.nifiGroupId},#{entity.description})
</foreach>
on duplicate key update
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
name = values(name),
class_id = values(class_id),
trigger_mode_id = values(trigger_mode_id),
nifi_group_id = values(nifi_group_id),
description = values(description)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowEntity" >
update sys_flow set
<trim suffix="" suffixOverrides=",">
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="name != null and name != ''"> name = #{name},</if>
<if test="status != null and status != ''"> status = #{status},</if>
<if test="classId != null and classId != ''"> class_id = #{classId},</if>
<if test="triggerModeId != null and triggerModeId != ''"> trigger_mode_id = #{triggerModeId},</if>
<if test="nifiGroupId != null and nifiGroupId != ''"> nifi_group_id = #{nifiGroupId},</if>
<if test="description != null and description != ''"> description = #{description},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowEntity" >
update sys_flow set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowEntity" >
update sys_flow set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="classId != null and classId != ''"> and class_id = #{classId} </if>
<if test="triggerModeId != null and triggerModeId != ''"> and trigger_mode_id = #{triggerModeId} </if>
<if test="nifiGroupId != null and nifiGroupId != ''"> and nifi_group_id = #{nifiGroupId} </if>
<if test="description != null and description != ''"> and description = #{description} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_flow where id = #{id}
</delete>
</mapper>

View File

@ -1,66 +0,0 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* nifi常量(SysFlowNifiConstant)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public class SysFlowNifiConstantEntity extends BaseEntity {
/** 键 */
private String nifiKey;
/** 值 */
private String nifiValue;
/** 显示值 */
private String showValue;
/** 描述 */
private String description;
/** 分类 */
private String type;
public String getNifiKey() {
return nifiKey;
}
public void setNifiKey(String nifiKey) {
this.nifiKey = nifiKey;
}
public String getNifiValue() {
return nifiValue;
}
public void setNifiValue(String nifiValue) {
this.nifiValue = nifiValue;
}
public String getShowValue() {
return showValue;
}
public void setShowValue(String showValue) {
this.showValue = showValue;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

View File

@ -1,226 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.sys.flow.dao.impl.SysFlowNifiConstantDaoImpl">
<resultMap id="get-SysFlowNifiConstantEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="nifiKey" column="nifi_key" jdbcType="VARCHAR"/>
<result property="nifiValue" column="nifi_value" jdbcType="VARCHAR"/>
<result property="showValue" column="show_value" jdbcType="VARCHAR"/>
<result property="description" column="description" jdbcType="VARCHAR"/>
<result property="type" column="type" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysFlowNifiConstantEntity_Base_Column_List">
id
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,nifi_key
,nifi_value
,show_value
,description
,type
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowNifiConstantEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity">
select
<include refid="SysFlowNifiConstantEntity_Base_Column_List" />
from sys_flow_nifi_constant
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="nifiKey != null and nifiKey != ''"> and nifi_key = #{nifiKey} </if>
<if test="nifiValue != null and value != ''"> and nifi_value = #{nifiValue} </if>
<if test="showValue != null and showValue != ''"> and show_value = #{showValue} </if>
<if test="description != null and description != ''"> and description = #{description} </if>
<if test="type != null and type != ''"> and type = #{type} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity">
select count(1) from sys_flow_nifi_constant
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="nifiKey != null and nifiKey != ''"> and nifi_key = #{nifiKey} </if>
<if test="nifiValue != null and nifiValue != ''"> and nifi_value = #{nifiValue} </if>
<if test="showValue != null and showValue != ''"> and show_value = #{showValue} </if>
<if test="description != null and description != ''"> and description = #{description} </if>
<if test="type != null and type != ''"> and type = #{type} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-SysFlowNifiConstantEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity">
select
<include refid="SysFlowNifiConstantEntity_Base_Column_List" />
from sys_flow_nifi_constant
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
<if test="nifiKey != null and nifiKey != ''"> and nifi_key like concat('%',#{nifiKey},'%') </if>
<if test="nifiValue != null and nifiValue != ''"> and nifi_value like concat('%',#{nifiValue},'%') </if>
<if test="showValue != null and showValue != ''"> and show_value like concat('%',#{showValue},'%') </if>
<if test="description != null and description != ''"> and description like concat('%',#{description},'%') </if>
<if test="type != null and type != ''"> and type like concat('%',#{type},'%') </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="SysFlowNifiConstantentity_list_or" resultMap="get-SysFlowNifiConstantEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity">
select
<include refid="SysFlowNifiConstantEntity_Base_Column_List" />
from sys_flow_nifi_constant
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
<if test="nifiKey != null and nifiKey != ''"> or nifi_key = #{nifiKey} </if>
<if test="nifiValue != null and nifiValue != ''"> or nifi_value = #{nifiValue} </if>
<if test="showValue != null and showValue != ''"> or show_value = #{showValue} </if>
<if test="description != null and description != ''"> or description = #{description} </if>
<if test="type != null and type != ''"> or type = #{type} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_nifi_constant(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
<if test="create_time != null"> create_time , </if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
<if test="modify_time != null"> modify_time , </if>
<if test="sts != null and sts != ''"> sts , </if>
<if test="nifiKey != null and nifiKey != ''"> nifi_key , </if>
<if test="nifiValue != null and nifiValue != ''"> nifi_value , </if>
<if test="showValue != null and showValue != ''"> show_value , </if>
<if test="description != null and description != ''"> description , </if>
<if test="type != null and type != ''"> type , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
<if test="modify_time != null"> #{modify_time} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="nifiKey != null and nifiKey != ''"> #{nifiKey} ,</if>
<if test="nifiValue != null and nifiValue != ''"> #{nifiValue} ,</if>
<if test="showValue != null and showValue != ''"> #{showValue} ,</if>
<if test="description != null and description != ''"> #{description} ,</if>
<if test="type != null and type != ''"> #{type} ,</if>
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_nifi_constant a WHERE a.sts = 'Y' ),1),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_nifi_constant(create_user_id, create_time, modify_user_id, modify_time, sts, nifi_key, nifi_value, show_value, description, type, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.nifiKey},#{entity.nifiValue},#{entity.showValue},#{entity.description},#{entity.type}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_nifi_constant(create_user_id, create_time, modify_user_id, modify_time, sts, nifi_key, nifi_value, show_value, description, type)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.nifiKey},#{entity.nifiValue},#{entity.showValue},#{entity.description},#{entity.type})
</foreach>
on duplicate key update
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
nifi_key = values(nifiKey),
nifi_value = values(nifiValue),
show_value = values(show_value),
description = values(description),
type = values(type)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity" >
update sys_flow_nifi_constant set
<trim suffix="" suffixOverrides=",">
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="nifiKey != null and nifiKey != ''"> nifi_key = #{nifiKey},</if>
<if test="nifiValue != null and nifiValue != ''"> nifi_value = #{nifiValue},</if>
<if test="showValue != null and showValue != ''"> show_value = #{showValue},</if>
<if test="description != null and description != ''"> description = #{description},</if>
<if test="type != null and type != ''"> type = #{type},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity" >
update sys_flow_nifi_constant set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity" >
update sys_flow_nifi_constant set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="nifiKey != null and nifiKey != ''"> andnifi_ key = #{nifiKey} </if>
<if test="nifiValue != null and nifiValue != ''"> and nifi_value = #{nifiValue} </if>
<if test="showValue != null and showValue != ''"> and show_value = #{showValue} </if>
<if test="description != null and description != ''"> and description = #{description} </if>
<if test="type != null and type != ''"> and type = #{type} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_flow_nifi_constant where id = #{id}
</delete>
</mapper>

View File

@ -1,155 +0,0 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 流程步骤账户表(SysFlowStepAccount)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public class SysFlowStepAccountEntity extends BaseEntity {
//流程id
private String flowId;
//流程步骤id
private String stepId;
//应用id
private String appId;
/** 账户名称 */
private String name;
/** ip地址 */
private String ipAddress;
/** 端口 */
private String port;
/** 数据库名称 */
private String dbName;
/** 用户名 */
private String userName;
/** 密码 */
private String password;
/** 数据库类型 */
private String dbType;
/** 应用key */
private String appKey;
/** 应用密钥 */
private String appSecret;
/** 企业id */
private String corpid;
/** 应用id */
private String agentid;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
public String getPort() {
return port;
}
public void setPort(String port) {
this.port = port;
}
public String getDbName() {
return dbName;
}
public void setDbName(String dbName) {
this.dbName = dbName;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getDbType() {
return dbType;
}
public void setDbType(String dbType) {
this.dbType = dbType;
}
public String getAppKey() {
return appKey;
}
public void setAppKey(String appKey) {
this.appKey = appKey;
}
public String getAppSecret() {
return appSecret;
}
public void setAppSecret(String appSecret) {
this.appSecret = appSecret;
}
public String getCorpid() {
return corpid;
}
public void setCorpid(String corpid) {
this.corpid = corpid;
}
public String getAgentid() {
return agentid;
}
public void setAgentid(String agentid) {
this.agentid = agentid;
}
public String getFlowId() {
return flowId;
}
public void setFlowId(String flowId) {
this.flowId = flowId;
}
public String getStepId() {
return stepId;
}
public void setStepId(String stepId) {
this.stepId = stepId;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
}

View File

@ -1,325 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.sys.flow.dao.impl.SysFlowStepAccountDaoImpl">
<resultMap id="get-SysFlowStepAccountEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="ipAddress" column="ip_address" jdbcType="VARCHAR"/>
<result property="port" column="port" jdbcType="VARCHAR"/>
<result property="dbName" column="db_name" jdbcType="VARCHAR"/>
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
<result property="password" column="password" jdbcType="VARCHAR"/>
<result property="flowId" column="flow_id" jdbcType="VARCHAR"/>
<result property="stepId" column="step_id" jdbcType="VARCHAR"/>
<result property="appId" column="app_id" jdbcType="VARCHAR"/>
<result property="dbType" column="db_type" jdbcType="VARCHAR"/>
<result property="appKey" column="app_key" jdbcType="VARCHAR"/>
<result property="appSecret" column="app_secret" jdbcType="VARCHAR"/>
<result property="corpid" column="corpId" jdbcType="VARCHAR"/>
<result property="agentid" column="agentId" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysFlowStepAccountEntity_Base_Column_List">
id
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,name
,ip_address
,port
,db_name
,user_name
,password
,flow_id
,step_id
,app_id
,db_type
,app_key
,app_secret
,corpId
,agentId
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowStepAccountEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity">
select
<include refid="SysFlowStepAccountEntity_Base_Column_List" />
from sys_flow_step_account
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress} </if>
<if test="port != null and port != ''"> and port = #{port} </if>
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
<if test="userName != null and userName != ''"> and user_name = #{userName} </if>
<if test="password != null and password != ''"> and password = #{password} </if>
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="appKey != null and appKey != ''"> and app_key = #{appKey} </if>
<if test="appSecret != null and appSecret != ''"> and app_secret = #{appSecret} </if>
<if test="corpid != null and corpid != ''"> and corpId = #{corpid} </if>
<if test="agentid != null and agentid != ''"> and agentId = #{agentid} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity">
select count(1) from sys_flow_step_account
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress} </if>
<if test="port != null and port != ''"> and port = #{port} </if>
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
<if test="userName != null and userName != ''"> and user_name = #{userName} </if>
<if test="password != null and password != ''"> and password = #{password} </if>
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="appKey != null and appKey != ''"> and app_key = #{appKey} </if>
<if test="appSecret != null and appSecret != ''"> and app_secret = #{appSecret} </if>
<if test="corpid != null and corpid != ''"> and corpId = #{corpid} </if>
<if test="agentid != null and agentid != ''"> and agentId = #{agentid} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-SysFlowStepAccountEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity">
select
<include refid="SysFlowStepAccountEntity_Base_Column_List" />
from sys_flow_step_account
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
<if test="name != null and name != ''"> and name like concat('%',#{name},'%') </if>
<if test="ipAddress != null and ipAddress != ''"> and ip_address like concat('%',#{ipAddress},'%') </if>
<if test="port != null and port != ''"> and port like concat('%',#{port},'%') </if>
<if test="dbName != null and dbName != ''"> and db_name like concat('%',#{dbName},'%') </if>
<if test="userName != null and userName != ''"> and user_name like concat('%',#{userName},'%') </if>
<if test="password != null and password != ''"> and password like concat('%',#{password},'%') </if>
<if test="flowId != null and flowId != ''"> and flow_id like concat('%',#{flowId},'%') </if>
<if test="stepId != null and stepId != ''"> and step_id like concat('%',#{stepId},'%') </if>
<if test="appId != null and appId != ''"> and app_id like concat('%',#{appId},'%') </if>
<if test="dbType != null and dbType != ''"> and db_type like concat('%',#{dbType},'%') </if>
<if test="appKey != null and appKey != ''"> and app_key like concat('%',#{appKey},'%') </if>
<if test="appSecret != null and appSecret != ''"> and app_secret like concat('%',#{appSecret},'%') </if>
<if test="corpid != null and corpid != ''"> and corpId like concat('%',#{corpid},'%') </if>
<if test="agentid != null and agentid != ''"> and agentId like concat('%',#{agentid},'%') </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="SysFlowStepAccountentity_list_or" resultMap="get-SysFlowStepAccountEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity">
select
<include refid="SysFlowStepAccountEntity_Base_Column_List" />
from sys_flow_step_account
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
<if test="name != null and name != ''"> or name = #{name} </if>
<if test="ipAddress != null and ipAddress != ''"> or ip_address = #{ipAddress} </if>
<if test="port != null and port != ''"> or port = #{port} </if>
<if test="dbName != null and dbName != ''"> or db_name = #{dbName} </if>
<if test="userName != null and userName != ''"> or user_name = #{userName} </if>
<if test="password != null and password != ''"> or password = #{password} </if>
<if test="flowId != null and flowId != ''"> or flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> or step_id = #{stepId} </if>
<if test="appId != null and appId != ''"> or app_id = #{appId} </if>
<if test="dbType != null and dbType != ''"> or db_type = #{dbType} </if>
<if test="appKey != null and appKey != ''"> or app_key = #{appKey} </if>
<if test="appSecret != null and appSecret != ''"> or app_secret = #{appSecret} </if>
<if test="corpid != null and corpid != ''"> or corpId = #{corpid} </if>
<if test="agentid != null and agentid != ''"> or agentId = #{agentid} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_account(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
<if test="create_time != null"> create_time , </if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
<if test="modify_time != null"> modify_time , </if>
<if test="sts != null and sts != ''"> sts , </if>
<if test="name != null and name != ''"> name , </if>
<if test="ipAddress != null and ipAddress != ''"> ip_address , </if>
<if test="port != null and port != ''"> port , </if>
<if test="dbName != null and dbName != ''"> db_name , </if>
<if test="userName != null and userName != ''"> user_name , </if>
<if test="password != null and password != ''"> password , </if>
<if test="flowId != null and flowId != ''"> flow_id , </if>
<if test="stepId != null and stepId != ''"> step_id , </if>
<if test="appId != null and appId != ''"> app_id , </if>
<if test="dbType != null and dbType != ''"> db_type , </if>
<if test="appKey != null and appKey != ''"> app_key , </if>
<if test="appSecret != null and appSecret != ''"> app_secret , </if>
<if test="corpid != null and corpid != ''"> corpId , </if>
<if test="agentid != null and agentid != ''"> agentId , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
<if test="modify_time != null"> #{modify_time} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="name != null and name != ''"> #{name} ,</if>
<if test="ipAddress != null and ipAddress != ''"> #{ipAddress} ,</if>
<if test="port != null and port != ''"> #{port} ,</if>
<if test="dbName != null and dbName != ''"> #{dbName} ,</if>
<if test="userName != null and userName != ''"> #{userName} ,</if>
<if test="password != null and password != ''"> #{password} ,</if>
<if test="flowId != null and flowId != ''"> #{flowId} ,</if>
<if test="stepId != null and stepId != ''"> #{stepId} ,</if>
<if test="appId != null and appId != ''"> #{appId} ,</if>
<if test="dbType != null and dbType != ''"> #{dbType} ,</if>
<if test="appKey != null and appKey != ''"> #{appKey} ,</if>
<if test="appSecret != null and appSecret != ''"> #{appSecret} ,</if>
<if test="corpid != null and corpid != ''"> #{corpid} ,</if>
<if test="agentid != null and agentid != ''"> #{agentid} ,</if>
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_account a WHERE a.sts = 'Y' ),1),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_account(create_user_id, create_time, modify_user_id, modify_time, sts, name, ip_address, port, db_name, user_name, password,flow_id,step_id,app_id, db_type, app_key, app_secret, corpId, agentId, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.ipAddress},#{entity.port},#{entity.dbName},#{entity.userName},#{entity.password},#{entity.flowId},#{entity.stepId},#{entity.appId},#{entity.dbType},#{entity.appKey},#{entity.appSecret},#{entity.corpid},#{entity.agentid}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_account(create_user_id, create_time, modify_user_id, modify_time, sts, name, ip_address, port, db_name, user_name, password,flow_id,step_id,app_id, db_type, app_key, app_secret, corpId, agentId)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.ipAddress},#{entity.port},#{entity.dbName},#{entity.userName},#{entity.password},#{entity.flowId},#{entity.stepId},#{entity.appId},#{entity.dbType},#{entity.appKey},#{entity.appSecret},#{entity.corpid},#{entity.agentid})
</foreach>
on duplicate key update
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
name = values(name),
ip_address = values(ip_address),
port = values(port),
db_name = values(db_name),
user_name = values(user_name),
password = values(password),
flow_id = values(flow_id),
step_id = values(step_id),
app_id = values(app_id),
db_type = values(db_type),
app_key = values(app_key),
app_secret = values(app_secret),
corpId = values(corpId),
agentId = values(agentId)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity" >
update sys_flow_step_account set
<trim suffix="" suffixOverrides=",">
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="name != null and name != ''"> name = #{name},</if>
<if test="ipAddress != null and ipAddress != ''"> ip_address = #{ipAddress},</if>
<if test="port != null and port != ''"> port = #{port},</if>
<if test="dbName != null and dbName != ''"> db_name = #{dbName},</if>
<if test="userName != null and userName != ''"> user_name = #{userName},</if>
<if test="password != null and password != ''"> password = #{password},</if>
<if test="flowId != null and flowId != ''"> flow_id = #{flowId},</if>
<if test="stepId != null and stepId != ''"> step_id = #{stepId},</if>
<if test="appId != null and appId != ''"> app_id = #{appId},</if>
<if test="dbType != null and dbType != ''"> db_type = #{dbType},</if>
<if test="appKey != null and appKey != ''"> app_key = #{appKey},</if>
<if test="appSecret != null and appSecret != ''"> app_secret = #{appSecret},</if>
<if test="corpid != null and corpid != ''"> corpId = #{corpid},</if>
<if test="agentid != null and agentid != ''"> agentId = #{agentid},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity" >
update sys_flow_step_account set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity" >
update sys_flow_step_account set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress} </if>
<if test="port != null and port != ''"> and port = #{port} </if>
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
<if test="userName != null and userName != ''"> and user_name = #{userName} </if>
<if test="password != null and password != ''"> and password = #{password} </if>
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="appKey != null and appKey != ''"> and app_key = #{appKey} </if>
<if test="appSecret != null and appSecret != ''"> and app_secret = #{appSecret} </if>
<if test="corpid != null and corpid != ''"> and corpId = #{corpid} </if>
<if test="agentid != null and agentid != ''"> and agentId = #{agentid} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_flow_step_account where id = #{id}
</delete>
</mapper>

View File

@ -1,126 +0,0 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 映射信息表体(SysFlowStepConfigB)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
public class SysFlowStepConfigBEntity extends BaseEntity {
/** 主表id */
private String mainId;
/** 流程id */
private String flowId;
/** 步骤id */
private String stepId;
/** 是否主键 */
private String primaryKeyFlag;
/** 字段名 */
private String fieldName;
/** 字段备注 */
private String fieldDescription;
/** 字段类型 */
private String fieldType;
/** 查询条件 */
private String whereCondition;
/** 源字段名称;适用于插入场景 */
private String sourceFieldName;
/** 源字段类型;适用于插入场景 */
private String sourceFieldType;
/** 源字段描述;适用于插入场景 */
private String sourceFieldDescription;
public String getMainId() {
return mainId;
}
public void setMainId(String mainId) {
this.mainId = mainId;
}
public String getFlowId() {
return flowId;
}
public void setFlowId(String flowId) {
this.flowId = flowId;
}
public String getStepId() {
return stepId;
}
public void setStepId(String stepId) {
this.stepId = stepId;
}
public String getPrimaryKeyFlag() {
return primaryKeyFlag;
}
public void setPrimaryKeyFlag(String primaryKeyFlag) {
this.primaryKeyFlag = primaryKeyFlag;
}
public String getFieldName() {
return fieldName;
}
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
public String getFieldDescription() {
return fieldDescription;
}
public void setFieldDescription(String fieldDescription) {
this.fieldDescription = fieldDescription;
}
public String getFieldType() {
return fieldType;
}
public void setFieldType(String fieldType) {
this.fieldType = fieldType;
}
public String getWhereCondition() {
return whereCondition;
}
public void setWhereCondition(String whereCondition) {
this.whereCondition = whereCondition;
}
public String getSourceFieldName() {
return sourceFieldName;
}
public void setSourceFieldName(String sourceFieldName) {
this.sourceFieldName = sourceFieldName;
}
public String getSourceFieldType() {
return sourceFieldType;
}
public void setSourceFieldType(String sourceFieldType) {
this.sourceFieldType = sourceFieldType;
}
public String getSourceFieldDescription() {
return sourceFieldDescription;
}
public void setSourceFieldDescription(String sourceFieldDescription) {
this.sourceFieldDescription = sourceFieldDescription;
}
}

View File

@ -1,292 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.sys.flow.dao.impl.SysFlowStepConfigBDaoImpl">
<resultMap id="get-SysFlowStepConfigBEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="mainId" column="main_id" jdbcType="VARCHAR"/>
<result property="flowId" column="flow_id" jdbcType="VARCHAR"/>
<result property="stepId" column="step_id" jdbcType="VARCHAR"/>
<result property="primaryKeyFlag" column="primary_key_flag" jdbcType="VARCHAR"/>
<result property="fieldName" column="field_name" jdbcType="VARCHAR"/>
<result property="fieldDescription" column="field_description" jdbcType="VARCHAR"/>
<result property="fieldType" column="field_type" jdbcType="VARCHAR"/>
<result property="whereCondition" column="where_condition" jdbcType="VARCHAR"/>
<result property="sourceFieldName" column="source_field_name" jdbcType="VARCHAR"/>
<result property="sourceFieldType" column="source_field_type" jdbcType="VARCHAR"/>
<result property="sourceFieldDescription" column="source_field_description" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysFlowStepConfigBEntity_Base_Column_List">
id
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,main_id
,flow_id
,step_id
,primary_key_flag
,field_name
,field_description
,field_type
,where_condition
,source_field_name
,source_field_type
,source_field_description
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowStepConfigBEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity">
select
<include refid="SysFlowStepConfigBEntity_Base_Column_List" />
from sys_flow_step_config_b
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="mainId != null and mainId != ''"> and main_id = #{mainId} </if>
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="primaryKeyFlag != null and primaryKeyFlag != ''"> and primary_key_flag = #{primaryKeyFlag} </if>
<if test="fieldName != null and fieldName != ''"> and field_name = #{fieldName} </if>
<if test="fieldDescription != null and fieldDescription != ''"> and field_description = #{fieldDescription} </if>
<if test="fieldType != null and fieldType != ''"> and field_type = #{fieldType} </if>
<if test="whereCondition != null and whereCondition != ''"> and where_condition = #{whereCondition} </if>
<if test="sourceFieldName != null and sourceFieldName != ''"> and source_field_name = #{sourceFieldName} </if>
<if test="sourceFieldType != null and sourceFieldType != ''"> and source_field_type = #{sourceFieldType} </if>
<if test="sourceFieldDescription != null and sourceFieldDescription != ''"> and source_field_description = #{sourceFieldDescription} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity">
select count(1) from sys_flow_step_config_b
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="mainId != null and mainId != ''"> and main_id = #{mainId} </if>
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="primaryKeyFlag != null and primaryKeyFlag != ''"> and primary_key_flag = #{primaryKeyFlag} </if>
<if test="fieldName != null and fieldName != ''"> and field_name = #{fieldName} </if>
<if test="fieldDescription != null and fieldDescription != ''"> and field_description = #{fieldDescription} </if>
<if test="fieldType != null and fieldType != ''"> and field_type = #{fieldType} </if>
<if test="whereCondition != null and whereCondition != ''"> and where_condition = #{whereCondition} </if>
<if test="sourceFieldName != null and sourceFieldName != ''"> and source_field_name = #{sourceFieldName} </if>
<if test="sourceFieldType != null and sourceFieldType != ''"> and source_field_type = #{sourceFieldType} </if>
<if test="sourceFieldDescription != null and sourceFieldDescription != ''"> and source_field_description = #{sourceFieldDescription} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-SysFlowStepConfigBEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity">
select
<include refid="SysFlowStepConfigBEntity_Base_Column_List" />
from sys_flow_step_config_b
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
<if test="mainId != null and mainId != ''"> and main_id like concat('%',#{mainId},'%') </if>
<if test="flowId != null and flowId != ''"> and flow_id like concat('%',#{flowId},'%') </if>
<if test="stepId != null and stepId != ''"> and step_id like concat('%',#{stepId},'%') </if>
<if test="primaryKeyFlag != null and primaryKeyFlag != ''"> and primary_key_flag like concat('%',#{primaryKeyFlag},'%') </if>
<if test="fieldName != null and fieldName != ''"> and field_name like concat('%',#{fieldName},'%') </if>
<if test="fieldDescription != null and fieldDescription != ''"> and field_description like concat('%',#{fieldDescription},'%') </if>
<if test="fieldType != null and fieldType != ''"> and field_type like concat('%',#{fieldType},'%') </if>
<if test="whereCondition != null and whereCondition != ''"> and where_condition like concat('%',#{whereCondition},'%') </if>
<if test="sourceFieldName != null and sourceFieldName != ''"> and source_field_name like concat('%',#{sourceFieldName},'%') </if>
<if test="sourceFieldType != null and sourceFieldType != ''"> and source_field_type like concat('%',#{sourceFieldType},'%') </if>
<if test="sourceFieldDescription != null and sourceFieldDescription != ''"> and source_field_description like concat('%',#{sourceFieldDescription},'%') </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="SysFlowStepConfigBentity_list_or" resultMap="get-SysFlowStepConfigBEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity">
select
<include refid="SysFlowStepConfigBEntity_Base_Column_List" />
from sys_flow_step_config_b
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
<if test="mainId != null and mainId != ''"> or main_id = #{mainId} </if>
<if test="flowId != null and flowId != ''"> or flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> or step_id = #{stepId} </if>
<if test="primaryKeyFlag != null and primaryKeyFlag != ''"> or primary_key_flag = #{primaryKeyFlag} </if>
<if test="fieldName != null and fieldName != ''"> or field_name = #{fieldName} </if>
<if test="fieldDescription != null and fieldDescription != ''"> or field_description = #{fieldDescription} </if>
<if test="fieldType != null and fieldType != ''"> or field_type = #{fieldType} </if>
<if test="whereCondition != null and whereCondition != ''"> or where_condition = #{whereCondition} </if>
<if test="sourceFieldName != null and sourceFieldName != ''"> or source_field_name = #{sourceFieldName} </if>
<if test="sourceFieldType != null and sourceFieldType != ''"> or source_field_type = #{sourceFieldType} </if>
<if test="sourceFieldDescription != null and sourceFieldDescription != ''"> or source_field_description = #{sourceFieldDescription} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_config_b(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
<if test="create_time != null"> create_time , </if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
<if test="modify_time != null"> modify_time , </if>
<if test="sts != null and sts != ''"> sts , </if>
<if test="mainId != null and mainId != ''"> main_id , </if>
<if test="flowId != null and flowId != ''"> flow_id , </if>
<if test="stepId != null and stepId != ''"> step_id , </if>
<if test="primaryKeyFlag != null and primaryKeyFlag != ''"> primary_key_flag , </if>
<if test="fieldName != null and fieldName != ''"> field_name , </if>
<if test="fieldDescription != null and fieldDescription != ''"> field_description , </if>
<if test="fieldType != null and fieldType != ''"> field_type , </if>
<if test="whereCondition != null and whereCondition != ''"> where_condition , </if>
<if test="sourceFieldName != null and sourceFieldName != ''"> source_field_name , </if>
<if test="sourceFieldType != null and sourceFieldType != ''"> source_field_type , </if>
<if test="sourceFieldDescription != null and sourceFieldDescription != ''"> source_field_description , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
<if test="modify_time != null"> #{modify_time} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="mainId != null and mainId != ''"> #{mainId} ,</if>
<if test="flowId != null and flowId != ''"> #{flowId} ,</if>
<if test="stepId != null and stepId != ''"> #{stepId} ,</if>
<if test="primaryKeyFlag != null and primaryKeyFlag != ''"> #{primaryKeyFlag} ,</if>
<if test="fieldName != null and fieldName != ''"> #{fieldName} ,</if>
<if test="fieldDescription != null and fieldDescription != ''"> #{fieldDescription} ,</if>
<if test="fieldType != null and fieldType != ''"> #{fieldType} ,</if>
<if test="whereCondition != null and whereCondition != ''"> #{whereCondition} ,</if>
<if test="sourceFieldName != null and sourceFieldName != ''"> #{sourceFieldName} ,</if>
<if test="sourceFieldType != null and sourceFieldType != ''"> #{sourceFieldType} ,</if>
<if test="sourceFieldDescription != null and sourceFieldDescription != ''"> #{sourceFieldDescription} ,</if>
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_config_b a WHERE a.sts = 'Y' ),1),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_config_b(create_user_id, create_time, modify_user_id, modify_time, sts, main_id, flow_id, step_id, primary_key_flag, field_name, field_description, field_type, where_condition, source_field_name, source_field_type, source_field_description, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.mainId},#{entity.flowId},#{entity.stepId},#{entity.primaryKeyFlag},#{entity.fieldName},#{entity.fieldDescription},#{entity.fieldType},#{entity.whereCondition},#{entity.sourceFieldName},#{entity.sourceFieldType},#{entity.sourceFieldDescription}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_config_b(create_user_id, create_time, modify_user_id, modify_time, sts, main_id, flow_id, step_id, primary_key_flag, field_name, field_description, field_type, where_condition, source_field_name, source_field_type, source_field_description)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.mainId},#{entity.flowId},#{entity.stepId},#{entity.primaryKeyFlag},#{entity.fieldName},#{entity.fieldDescription},#{entity.fieldType},#{entity.whereCondition},#{entity.sourceFieldName},#{entity.sourceFieldType},#{entity.sourceFieldDescription})
</foreach>
on duplicate key update
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
main_id = values(main_id),
flow_id = values(flow_id),
step_id = values(step_id),
primary_key_flag = values(primary_key_flag),
field_name = values(field_name),
field_description = values(field_description),
field_type = values(field_type),
where_condition = values(where_condition),
source_field_name = values(source_field_name),
source_field_type = values(source_field_type),
source_field_description = values(source_field_description)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity" >
update sys_flow_step_config_b set
<trim suffix="" suffixOverrides=",">
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="mainId != null and mainId != ''"> main_id = #{mainId},</if>
<if test="flowId != null and flowId != ''"> flow_id = #{flowId},</if>
<if test="stepId != null and stepId != ''"> step_id = #{stepId},</if>
<if test="primaryKeyFlag != null and primaryKeyFlag != ''"> primary_key_flag = #{primaryKeyFlag},</if>
<if test="fieldName != null and fieldName != ''"> field_name = #{fieldName},</if>
<if test="fieldDescription != null and fieldDescription != ''"> field_description = #{fieldDescription},</if>
<if test="fieldType != null and fieldType != ''"> field_type = #{fieldType},</if>
<if test="whereCondition != null and whereCondition != ''"> where_condition = #{whereCondition},</if>
<if test="sourceFieldName != null and sourceFieldName != ''"> source_field_name = #{sourceFieldName},</if>
<if test="sourceFieldType != null and sourceFieldType != ''"> source_field_type = #{sourceFieldType},</if>
<if test="sourceFieldDescription != null and sourceFieldDescription != ''"> source_field_description = #{sourceFieldDescription},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity" >
update sys_flow_step_config_b set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity" >
update sys_flow_step_config_b set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="mainId != null and mainId != ''"> and main_id = #{mainId} </if>
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="primaryKeyFlag != null and primaryKeyFlag != ''"> and primary_key_flag = #{primaryKeyFlag} </if>
<if test="fieldName != null and fieldName != ''"> and field_name = #{fieldName} </if>
<if test="fieldDescription != null and fieldDescription != ''"> and field_description = #{fieldDescription} </if>
<if test="fieldType != null and fieldType != ''"> and field_type = #{fieldType} </if>
<if test="whereCondition != null and whereCondition != ''"> and where_condition = #{whereCondition} </if>
<if test="sourceFieldName != null and sourceFieldName != ''"> and source_field_name = #{sourceFieldName} </if>
<if test="sourceFieldType != null and sourceFieldType != ''"> and source_field_type = #{sourceFieldType} </if>
<if test="sourceFieldDescription != null and sourceFieldDescription != ''"> and source_field_description = #{sourceFieldDescription} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_flow_step_config_b where id = #{id}
</delete>
</mapper>

View File

@ -1,145 +0,0 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 映射信息主表(SysFlowStepConfig)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
public class SysFlowStepConfigEntity extends BaseEntity {
/** 流程id */
private String flowId;
/** 步骤id */
private String stepId;
/** 流程操作步骤配置表id */
private String setpConfigId;
/** 操作类型 */
private String actionName;
/** 数据库类型;数据库类型+版本 */
private String dbType;
/** 表名称 */
private String tableName;
/** 页码 */
private String rowNum;
/** 每页条数 */
private String pageLimit;
/** 增量数据字段;例如ts */
private String maxValueField;
/** 是否建表 */
private String createTableFlag;
/** 写入模式;覆盖写入/增量写入 */
private String writeType;
/** 动态sql语句 */
private String sqlStatement;
//步骤账户表id
private String stepAccountId;
public String getFlowId() {
return flowId;
}
public void setFlowId(String flowId) {
this.flowId = flowId;
}
public String getStepId() {
return stepId;
}
public void setStepId(String stepId) {
this.stepId = stepId;
}
public String getSetpConfigId() {
return setpConfigId;
}
public void setSetpConfigId(String setpConfigId) {
this.setpConfigId = setpConfigId;
}
public String getActionName() {
return actionName;
}
public void setActionName(String actionName) {
this.actionName = actionName;
}
public String getDbType() {
return dbType;
}
public void setDbType(String dbType) {
this.dbType = dbType;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public String getRowNum() {
return rowNum;
}
public void setRowNum(String rowNum) {
this.rowNum = rowNum;
}
public String getpageLimit() {
return pageLimit;
}
public void setpageLimit(String pageLimit) {
this.pageLimit = pageLimit;
}
public String getMaxValueField() {
return maxValueField;
}
public void setMaxValueField(String maxValueField) {
this.maxValueField = maxValueField;
}
public String getCreateTableFlag() {
return createTableFlag;
}
public void setCreateTableFlag(String createTableFlag) {
this.createTableFlag = createTableFlag;
}
public String getWriteType() {
return writeType;
}
public void setWriteType(String writeType) {
this.writeType = writeType;
}
public String getSqlStatement() {
return sqlStatement;
}
public void setSqlStatement(String sqlStatement) {
this.sqlStatement = sqlStatement;
}
public String getStepAccountId() {
return stepAccountId;
}
public void setStepAccountId(String stepAccountId) {
this.stepAccountId = stepAccountId;
}
}

View File

@ -1,303 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.sys.flow.dao.impl.SysFlowStepConfigDaoImpl">
<resultMap id="get-SysFlowStepConfigEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="flowId" column="flow_id" jdbcType="VARCHAR"/>
<result property="stepId" column="step_id" jdbcType="VARCHAR"/>
<result property="setpConfigId" column="setp_config_id" jdbcType="VARCHAR"/>
<result property="actionName" column="action_name" jdbcType="VARCHAR"/>
<result property="dbType" column="db_type" jdbcType="VARCHAR"/>
<result property="tableName" column="table_name" jdbcType="VARCHAR"/>
<result property="rowNum" column="row_num" jdbcType="VARCHAR"/>
<result property="pageLimit" column="page_limit" jdbcType="VARCHAR"/>
<result property="maxValueField" column="max_value_field" jdbcType="VARCHAR"/>
<result property="createTableFlag" column="create_table_flag" jdbcType="VARCHAR"/>
<result property="writeType" column="write_type" jdbcType="VARCHAR"/>
<result property="sqlStatement" column="sql_statement" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysFlowStepConfigEntity_Base_Column_List">
id
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,flow_id
,step_id
,setp_config_id
,action_name
,db_type
,table_name
,row_num
,page_limit
,max_value_field
,create_table_flag
,write_type
,sql_statement
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowStepConfigEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity">
select
<include refid="SysFlowStepConfigEntity_Base_Column_List" />
from sys_flow_step_config
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="setpConfigId != null and setpConfigId != ''"> and setp_config_id = #{setpConfigId} </if>
<if test="actionName != null and actionName != ''"> and action_name = #{actionName} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="tableName != null and tableName != ''"> and table_name = #{tableName} </if>
<if test="rowNum != null and rowNum != ''"> and row_num = #{rowNum} </if>
<if test="pageLimit != null and pageLimit != ''"> and page_limit = #{pageLimit} </if>
<if test="maxValueField != null and maxValueField != ''"> and max_value_field = #{maxValueField} </if>
<if test="createTableFlag != null and createTableFlag != ''"> and create_table_flag = #{createTableFlag} </if>
<if test="writeType != null and writeType != ''"> and write_type = #{writeType} </if>
<if test="sqlStatement != null and sqlStatement != ''"> and sql_statement = #{sqlStatement} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity">
select count(1) from sys_flow_step_config
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="setpConfigId != null and setpConfigId != ''"> and setp_config_id = #{setpConfigId} </if>
<if test="actionName != null and actionName != ''"> and action_name = #{actionName} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="tableName != null and tableName != ''"> and table_name = #{tableName} </if>
<if test="rowNum != null and rowNum != ''"> and row_num = #{rowNum} </if>
<if test="pageLimit != null and pageLimit != ''"> and page_limit = #{pageLimit} </if>
<if test="maxValueField != null and maxValueField != ''"> and max_value_field = #{maxValueField} </if>
<if test="createTableFlag != null and createTableFlag != ''"> and create_table_flag = #{createTableFlag} </if>
<if test="writeType != null and writeType != ''"> and write_type = #{writeType} </if>
<if test="sqlStatement != null and sqlStatement != ''"> and sql_statement = #{sqlStatement} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-SysFlowStepConfigEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity">
select
<include refid="SysFlowStepConfigEntity_Base_Column_List" />
from sys_flow_step_config
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
<if test="flowId != null and flowId != ''"> and flow_id like concat('%',#{flowId},'%') </if>
<if test="stepId != null and stepId != ''"> and step_id like concat('%',#{stepId},'%') </if>
<if test="setpConfigId != null and setpConfigId != ''"> and setp_config_id like concat('%',#{setpConfigId},'%') </if>
<if test="actionName != null and actionName != ''"> and action_name like concat('%',#{actionName},'%') </if>
<if test="dbType != null and dbType != ''"> and db_type like concat('%',#{dbType},'%') </if>
<if test="tableName != null and tableName != ''"> and table_name like concat('%',#{tableName},'%') </if>
<if test="rowNum != null and rowNum != ''"> and row_num like concat('%',#{rowNum},'%') </if>
<if test="pageLimit != null and pageLimit != ''"> and page_limit like concat('%',#{pageLimit},'%') </if>
<if test="maxValueField != null and maxValueField != ''"> and max_value_field like concat('%',#{maxValueField},'%') </if>
<if test="createTableFlag != null and createTableFlag != ''"> and create_table_flag like concat('%',#{createTableFlag},'%') </if>
<if test="writeType != null and writeType != ''"> and write_type like concat('%',#{writeType},'%') </if>
<if test="sqlStatement != null and sqlStatement != ''"> and sql_statement like concat('%',#{sqlStatement},'%') </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="SysFlowStepConfigentity_list_or" resultMap="get-SysFlowStepConfigEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity">
select
<include refid="SysFlowStepConfigEntity_Base_Column_List" />
from sys_flow_step_config
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
<if test="flowId != null and flowId != ''"> or flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> or step_id = #{stepId} </if>
<if test="setpConfigId != null and setpConfigId != ''"> or setp_config_id = #{setpConfigId} </if>
<if test="actionName != null and actionName != ''"> or action_name = #{actionName} </if>
<if test="dbType != null and dbType != ''"> or db_type = #{dbType} </if>
<if test="tableName != null and tableName != ''"> or table_name = #{tableName} </if>
<if test="rowNum != null and rowNum != ''"> or row_num = #{rowNum} </if>
<if test="pageLimit != null and pageLimit != ''"> or page_limit = #{pageLimit} </if>
<if test="maxValueField != null and maxValueField != ''"> or max_value_field = #{maxValueField} </if>
<if test="createTableFlag != null and createTableFlag != ''"> or create_table_flag = #{createTableFlag} </if>
<if test="writeType != null and writeType != ''"> or write_type = #{writeType} </if>
<if test="sqlStatement != null and sqlStatement != ''"> or sql_statement = #{sqlStatement} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_config(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
<if test="create_time != null"> create_time , </if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
<if test="modify_time != null"> modify_time , </if>
<if test="sts != null and sts != ''"> sts , </if>
<if test="flowId != null and flowId != ''"> flow_id , </if>
<if test="stepId != null and stepId != ''"> step_id , </if>
<if test="setpConfigId != null and setpConfigId != ''"> setp_config_id , </if>
<if test="actionName != null and actionName != ''"> action_name , </if>
<if test="dbType != null and dbType != ''"> db_type , </if>
<if test="tableName != null and tableName != ''"> table_name , </if>
<if test="rowNum != null and rowNum != ''"> row_num , </if>
<if test="pageLimit != null and pageLimit != ''"> page_limit , </if>
<if test="maxValueField != null and maxValueField != ''"> max_value_field , </if>
<if test="createTableFlag != null and createTableFlag != ''"> create_table_flag , </if>
<if test="writeType != null and writeType != ''"> write_type , </if>
<if test="sqlStatement != null and sqlStatement != ''"> sql_statement , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
<if test="modify_time != null"> #{modify_time} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="flowId != null and flowId != ''"> #{flowId} ,</if>
<if test="stepId != null and stepId != ''"> #{stepId} ,</if>
<if test="setpConfigId != null and setpConfigId != ''"> #{setpConfigId} ,</if>
<if test="actionName != null and actionName != ''"> #{actionName} ,</if>
<if test="dbType != null and dbType != ''"> #{dbType} ,</if>
<if test="tableName != null and tableName != ''"> #{tableName} ,</if>
<if test="rowNum != null and rowNum != ''"> #{rowNum} ,</if>
<if test="pageLimit != null and pageLimit != ''"> #{pageLimit} ,</if>
<if test="maxValueField != null and maxValueField != ''"> #{maxValueField} ,</if>
<if test="createTableFlag != null and createTableFlag != ''"> #{createTableFlag} ,</if>
<if test="writeType != null and writeType != ''"> #{writeType} ,</if>
<if test="sqlStatement != null and sqlStatement != ''"> #{sqlStatement} ,</if>
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_config a WHERE a.sts = 'Y' ),1),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_config(create_user_id, create_time, modify_user_id, modify_time, sts, flow_id, step_id, setp_config_id, action_name, db_type, table_name, row_num, page_limit, max_value_field, create_table_flag, write_type, sql_statement, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.flowId},#{entity.stepId},#{entity.setpConfigId},#{entity.actionName},#{entity.dbType},#{entity.tableName},#{entity.rowNum},#{entity.pageLimit},#{entity.maxValueField},#{entity.createTableFlag},#{entity.writeType},#{entity.sqlStatement}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_config(create_user_id, create_time, modify_user_id, modify_time, sts, flow_id, step_id, setp_config_id, action_name, db_type, table_name, row_num, page_limit, max_value_field, create_table_flag, write_type, sql_statement)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.flowId},#{entity.stepId},#{entity.setpConfigId},#{entity.actionName},#{entity.dbType},#{entity.tableName},#{entity.rowNum},#{entity.pageLimit},#{entity.maxValueField},#{entity.createTableFlag},#{entity.writeType},#{entity.sqlStatement})
</foreach>
on duplicate key update
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
flow_id = values(flow_id),
step_id = values(step_id),
setp_config_id = values(setp_config_id),
action_name = values(action_name),
db_type = values(db_type),
table_name = values(table_name),
row_num = values(row_num),
page_limit = values(page_limit),
max_value_field = values(max_value_field),
create_table_flag = values(create_table_flag),
write_type = values(write_type),
sql_statement = values(sql_statement)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity" >
update sys_flow_step_config set
<trim suffix="" suffixOverrides=",">
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="flowId != null and flowId != ''"> flow_id = #{flowId},</if>
<if test="stepId != null and stepId != ''"> step_id = #{stepId},</if>
<if test="setpConfigId != null and setpConfigId != ''"> setp_config_id = #{setpConfigId},</if>
<if test="actionName != null and actionName != ''"> action_name = #{actionName},</if>
<if test="dbType != null and dbType != ''"> db_type = #{dbType},</if>
<if test="tableName != null and tableName != ''"> table_name = #{tableName},</if>
<if test="rowNum != null and rowNum != ''"> row_num = #{rowNum},</if>
<if test="pageLimit != null and pageLimit != ''"> page_limit = #{pageLimit},</if>
<if test="maxValueField != null and maxValueField != ''"> max_value_field = #{maxValueField},</if>
<if test="createTableFlag != null and createTableFlag != ''"> create_table_flag = #{createTableFlag},</if>
<if test="writeType != null and writeType != ''"> write_type = #{writeType},</if>
<if test="sqlStatement != null and sqlStatement != ''"> sql_statement = #{sqlStatement},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity" >
update sys_flow_step_config set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity" >
update sys_flow_step_config set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
<if test="setpConfigId != null and setpConfigId != ''"> and setp_config_id = #{setpConfigId} </if>
<if test="actionName != null and actionName != ''"> and action_name = #{actionName} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="tableName != null and tableName != ''"> and table_name = #{tableName} </if>
<if test="rowNum != null and rowNum != ''"> and row_num = #{rowNum} </if>
<if test="pageLimit != null and pageLimit != ''"> and page_limit = #{pageLimit} </if>
<if test="maxValueField != null and maxValueField != ''"> and max_value_field = #{maxValueField} </if>
<if test="createTableFlag != null and createTableFlag != ''"> and create_table_flag = #{createTableFlag} </if>
<if test="writeType != null and writeType != ''"> and write_type = #{writeType} </if>
<if test="sqlStatement != null and sqlStatement != ''"> and sql_statement = #{sqlStatement} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_flow_step_config where id = #{id}
</delete>
</mapper>

View File

@ -1,143 +0,0 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 流程步骤信息(SysFlowStep)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public class SysFlowStepEntity extends BaseEntity {
/** 步骤序号 */
private Integer step;
//流程id
private String flowId;
/** 步骤类型;1定时任务2数据库3应用 */
private String stepType;
/** 描述 */
private String description;
/** 操作动作(名称);api名称/插件名称 */
private String apiName;
/** 操作动作类型;api/插件 */
private String actionType;
/** 应用id */
private String appId;
/** 操作动作id;api_id,根据操作动作类型来决定是查api还是插件 */
private String apiId;
/** nifi返回的应用id;刘工接口返回的nifi应用id不确定要不要 */
private String nifiAppId;
/** nifi的apiId */
private String nifiApiId;
/** nifi应用排序模式;先进先出/先进后出 */
private String sortMode;
//定时任务 corn表达式
private String taskCorn;
//账户对象
private SysFlowStepAccountEntity account;
public Integer getStep() {
return step;
}
public void setStep(Integer step) {
this.step = step;
}
public String getStepType() {
return stepType;
}
public void setStepType(String stepType) {
this.stepType = stepType;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getApiName() {
return apiName;
}
public void setApiName(String apiName) {
this.apiName = apiName;
}
public String getActionType() {
return actionType;
}
public void setActionType(String actionType) {
this.actionType = actionType;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public String getApiId() {
return apiId;
}
public void setApiId(String apiId) {
this.apiId = apiId;
}
public String getNifiAppId() {
return nifiAppId;
}
public void setNifiAppId(String nifiAppId) {
this.nifiAppId = nifiAppId;
}
public String getNifiApiId() {
return nifiApiId;
}
public void setNifiApiId(String nifiApiId) {
this.nifiApiId = nifiApiId;
}
public String getSortMode() {
return sortMode;
}
public void setSortMode(String sortMode) {
this.sortMode = sortMode;
}
public String getFlowId() {
return flowId;
}
public void setFlowId(String flowId) {
this.flowId = flowId;
}
public SysFlowStepAccountEntity getAccount() {
return account;
}
public void setAccount(SysFlowStepAccountEntity account) {
this.account = account;
}
public String getTaskCorn() {
return taskCorn;
}
public void setTaskCorn(String taskCorn) {
this.taskCorn = taskCorn;
}
}

View File

@ -1,318 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.sys.flow.dao.impl.SysFlowStepDaoImpl">
<resultMap id="get-SysFlowStepEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowStepEntity">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="step" column="step" jdbcType="INTEGER"/>
<result property="stepType" column="step_type" jdbcType="VARCHAR"/>
<result property="flowId" column="flow_id" jdbcType="VARCHAR"/>
<result property="description" column="description" jdbcType="VARCHAR"/>
<result property="apiName" column="api_name" jdbcType="VARCHAR"/>
<result property="actionType" column="action_type" jdbcType="VARCHAR"/>
<result property="appId" column="app_id" jdbcType="VARCHAR"/>
<result property="apiId" column="api_id" jdbcType="VARCHAR"/>
<result property="taskCorn" column="task_corn" jdbcType="VARCHAR"/>
<result property="nifiAppId" column="nifi_app_id" jdbcType="VARCHAR"/>
<result property="nifiApiId" column="nifi_api_id" jdbcType="VARCHAR"/>
<result property="sortMode" column="sort_mode" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="SysFlowStepEntity_Base_Column_List">
id,
create_user_id,
create_time,
modify_user_id,
modify_time,
sts,
step,
step_type,
flowId,
description,
api_name,
action_type,
app_id,
api_id,
taskCorn,
nifi_app_id,
nifi_api_id,
sort_mode
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowStepEntity-result"
parameterType="com.hzya.frame.sys.flow.entity.SysFlowStepEntity">
select
<include refid="SysFlowStepEntity_Base_Column_List"/>
from sys_flow_step
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="step != null">and step = #{step}</if>
<if test="stepType != null and stepType != ''">and step_type = #{stepType}</if>
<if test="flowId != null and flowId != ''">and flow_id = #{flowId}</if>
<if test="description != null and description != ''">and description = #{description}</if>
<if test="apiName != null and apiName != ''">and api_name = #{apiName}</if>
<if test="actionType != null and actionType != ''">and action_type = #{actionType}</if>
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
<if test="apiId != null and apiId != ''">and api_id = #{apiId}</if>
<if test="nifiAppId != null and nifiAppId != ''">and nifi_app_id = #{nifiAppId}</if>
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if>
<if test="sortMode != null and sortMode != ''">and sort_mode = #{sortMode}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.sys.flow.entity.SysFlowStepEntity">
select count(1) from sys_flow_step
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="step != null">and step = #{step}</if>
<if test="stepType != null and stepType != ''">and step_type = #{stepType}</if>
<if test="flowId != null and flowId != ''">and flow_id = #{flowId}</if>
<if test="description != null and description != ''">and description = #{description}</if>
<if test="apiName != null and apiName != ''">and api_name = #{apiName}</if>
<if test="actionType != null and actionType != ''">and action_type = #{actionType}</if>
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
<if test="apiId != null and apiId != ''">and api_id = #{apiId}</if>
<if test="nifiAppId != null and nifiAppId != ''">and nifi_app_id = #{nifiAppId}</if>
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if>
<if test="sortMode != null and sortMode != ''">and sort_mode = #{sortMode}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-SysFlowStepEntity-result"
parameterType="com.hzya.frame.sys.flow.entity.SysFlowStepEntity">
select
<include refid="SysFlowStepEntity_Base_Column_List"/>
from sys_flow_step
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
concat('%',#{create_user_id},'%')
</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
concat('%',#{modify_user_id},'%')
</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="step != null">and step like concat('%',#{step},'%')</if>
<if test="stepType != null and stepType != ''">and step_type like concat('%',#{stepType},'%')</if>
<if test="flowId != null and flowId != ''">and flow_id like concat('%',#{flowId},'%')</if>
<if test="description != null and description != ''">and description like concat('%',#{description},'%')
</if>
<if test="apiName != null and apiName != ''">and api_name like concat('%',#{apiName},'%')</if>
<if test="actionType != null and actionType != ''">and action_type like concat('%',#{actionType},'%')</if>
<if test="appId != null and appId != ''">and app_id like concat('%',#{appId},'%')</if>
<if test="apiId != null and apiId != ''">and api_id like concat('%',#{apiId},'%')</if>
<if test="nifiAppId != null and nifiAppId != ''">and nifi_app_id like concat('%',#{nifiAppId},'%')</if>
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id like concat('%',#{nifiApiId},'%')</if>
<if test="sortMode != null and sortMode != ''">and sort_mode like concat('%',#{sortMode},'%')</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="SysFlowStepentity_list_or" resultMap="get-SysFlowStepEntity-result"
parameterType="com.hzya.frame.sys.flow.entity.SysFlowStepEntity">
select
<include refid="SysFlowStepEntity_Base_Column_List"/>
from sys_flow_step
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">or id = #{id}</if>
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
<if test="step != null">or step = #{step}</if>
<if test="stepType != null and stepType != ''">or step_type = #{stepType}</if>
<if test="flowId != null and flowId != ''">or flow_id = #{flowId}</if>
<if test="description != null and description != ''">or description = #{description}</if>
<if test="apiName != null and apiName != ''">or api_name = #{apiName}</if>
<if test="actionType != null and actionType != ''">or action_type = #{actionType}</if>
<if test="appId != null and appId != ''">or app_id = #{appId}</if>
<if test="apiId != null and apiId != ''">or api_id = #{apiId}</if>
<if test="nifiAppId != null and nifiAppId != ''">or nifi_app_id = #{nifiAppId}</if>
<if test="nifiApiId != null and nifiApiId != ''">or nifi_api_id = #{nifiApiId}</if>
<if test="sortMode != null and sortMode != ''">or sort_mode = #{sortMode}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.sys.flow.entity.SysFlowStepEntity" keyProperty="id"
useGeneratedKeys="true">
insert into sys_flow_step(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
<if test="create_time != null">create_time ,</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="step != null">step ,</if>
<if test="stepType != null and stepType != ''">step_type ,</if>
<if test="flowId != null and flowId != ''">flow_id ,</if>
<if test="description != null and description != ''">description ,</if>
<if test="apiName != null and apiName != ''">api_name ,</if>
<if test="actionType != null and actionType != ''">action_type ,</if>
<if test="appId != null and appId != ''">app_id ,</if>
<if test="apiId != null and apiId != ''">api_id ,</if>
<if test="taskCorn != null and taskCorn != ''">task_corn ,</if>
<if test="nifiAppId != null and nifiAppId != ''">nifi_app_id ,</if>
<if test="nifiApiId != null and nifiApiId != ''">nifi_api_id ,</if>
<if test="sortMode != null and sortMode != ''">sort_mode ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id} ,</if>
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="step != null">#{step} ,</if>
<if test="stepType != null and stepType != ''">#{stepType} ,</if>
<if test="flowId != null and flowId != ''">#{flowId} ,</if>
<if test="description != null and description != ''">#{description} ,</if>
<if test="apiName != null and apiName != ''">#{apiName} ,</if>
<if test="actionType != null and actionType != ''">#{actionType} ,</if>
<if test="appId != null and appId != ''">#{appId} ,</if>
<if test="apiId != null and apiId != ''">#{apiId} ,</if>
<if test="taskCorn != null and taskCorn != ''">#{taskCorn} ,</if>
<if test="nifiAppId != null and nifiAppId != ''">#{nifiAppId} ,</if>
<if test="nifiApiId != null and nifiApiId != ''">#{nifiApiId} ,</if>
<if test="sortMode != null and sortMode != ''">#{sortMode} ,</if>
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step a
WHERE a.sts = 'Y' ),1),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step(create_user_id, create_time, modify_user_id, modify_time, sts, step,
step_type,flow_id, description, api_name, action_type, app_id, api_id, nifi_app_id, nifi_api_id, sort_mode, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.step},#{entity.stepType},#{entity.flowId},#{entity.description},#{entity.apiName},#{entity.actionType},#{entity.appId},#{entity.apiId},#{entity.nifiAppId},#{entity.nifiApiId},#{entity.sortMode},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step(create_user_id, create_time, modify_user_id, modify_time, sts, step, step_type,
flow_id,description, api_name, action_type, app_id, api_id, nifi_app_id, nifi_api_id, sort_mode)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.step},#{entity.stepType},#{entity.flowId},#{entity.description},#{entity.apiName},#{entity.actionType},#{entity.appId},#{entity.apiId},#{entity.nifiAppId},#{entity.nifiApiId},#{entity.sortMode})
</foreach>
on duplicate key update
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
step = values(step),
step_type = values(step_type),
flow_id = values(flow_id),
description = values(description),
api_name = values(api_name),
action_type = values(action_type),
app_id = values(app_id),
api_id = values(api_id),
nifi_app_id = values(nifi_app_id),
nifi_api_id = values(nifi_api_id),
sort_mode = values(sort_mode)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.sys.flow.entity.SysFlowStepEntity">
update sys_flow_step set
<trim suffix="" suffixOverrides=",">
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
<if test="create_time != null">create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
<if test="step != null">step = #{step},</if>
<if test="stepType != null and stepType != ''">step_type = #{stepType},</if>
<if test="flowId != null and flowId != ''">flow_id = #{flowId},</if>
<if test="description != null and description != ''">description = #{description},</if>
<if test="apiName != null and apiName != ''">api_name = #{apiName},</if>
<if test="actionType != null and actionType != ''">action_type = #{actionType},</if>
<if test="appId != null and appId != ''">app_id = #{appId},</if>
<if test="apiId != null and apiId != ''">api_id = #{apiId},</if>
<if test="taskCorn != null and taskCorn != ''">task_corn = #{taskCorn},</if>
<if test="nifiAppId != null and nifiAppId != ''">nifi_app_id = #{nifiAppId},</if>
<if test="nifiApiId != null and nifiApiId != ''">nifi_api_id = #{nifiApiId},</if>
<if test="sortMode != null and sortMode != ''">sort_mode = #{sortMode},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.flow.entity.SysFlowStepEntity">
update sys_flow_step
set sts= 'N',
modify_time = #{modify_time},
modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.sys.flow.entity.SysFlowStepEntity">
update sys_flow_step set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="step != null">and step = #{step}</if>
<if test="stepType != null and stepType != ''">and step_type = #{stepType}</if>
<if test="flowId != null and flowId != ''">and flow_id = #{flowId}</if>
<if test="description != null and description != ''">and description = #{description}</if>
<if test="apiName != null and apiName != ''">and api_name = #{apiName}</if>
<if test="actionType != null and actionType != ''">and action_type = #{actionType}</if>
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
<if test="apiId != null and apiId != ''">and api_id = #{apiId}</if>
<if test="taskCorn != null and taskCorn != ''">and task_corn = #{taskCorn}</if>
<if test="nifiAppId != null and nifiAppId != ''">and nifi_app_id = #{nifiAppId}</if>
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if>
<if test="sortMode != null and sortMode != ''">and sort_mode = #{sortMode}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete
from sys_flow_step
where id = #{id}
</delete>
</mapper>

View File

@ -1,76 +0,0 @@
package com.hzya.frame.sys.flow.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 步骤关联关系表(SysFlowStepRelation)实体类
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
public class SysFlowStepRelationEntity extends BaseEntity {
/** 输入步骤 */
private String inputStepId;
/** 输出步骤 */
private String outputStepId;
/** 输入nifi app id */
private String inputNifiAppId;
/** 输出nifiidapp id */
private String outputNifiAppId;
/** 输入nifi api id */
private String inputNifiApiId;
/** 输出nifiidapi id */
private String outputNifiApiId;
public String getInputStepId() {
return inputStepId;
}
public void setInputStepId(String inputStepId) {
this.inputStepId = inputStepId;
}
public String getOutputStepId() {
return outputStepId;
}
public void setOutputStepId(String outputStepId) {
this.outputStepId = outputStepId;
}
public String getInputNifiAppId() {
return inputNifiAppId;
}
public void setInputNifiAppId(String inputNifiAppId) {
this.inputNifiAppId = inputNifiAppId;
}
public String getOutputNifiAppId() {
return outputNifiAppId;
}
public void setOutputNifiAppId(String outputNifiAppId) {
this.outputNifiAppId = outputNifiAppId;
}
public String getInputNifiApiId() {
return inputNifiApiId;
}
public void setInputNifiApiId(String inputNifiApiId) {
this.inputNifiApiId = inputNifiApiId;
}
public String getOutputNifiApiId() {
return outputNifiApiId;
}
public void setOutputNifiApiId(String outputNifiApiId) {
this.outputNifiApiId = outputNifiApiId;
}
}

View File

@ -1,237 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.sys.flow.dao.impl.SysFlowStepRelationDaoImpl">
<resultMap id="get-SysFlowStepRelationEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="inputStepId" column="input_step_id" jdbcType="VARCHAR"/>
<result property="outputStepId" column="output_step_id" jdbcType="VARCHAR"/>
<result property="inputNifiAppId" column="input_nifi_app_id" jdbcType="VARCHAR"/>
<result property="outputNifiAppId" column="output_nifi_app_id" jdbcType="VARCHAR"/>
<result property="inputNifiApiId" column="input_nifi_api_id" jdbcType="VARCHAR"/>
<result property="outputNifiApiId" column="output_nifi_api_id" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysFlowStepRelationEntity_Base_Column_List">
id
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,input_step_id
,output_step_id
,input_nifi_app_id
,output_nifi_app_id
,input_nifi_api_id
,output_nifi_api_id
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysFlowStepRelationEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity">
select
<include refid="SysFlowStepRelationEntity_Base_Column_List" />
from sys_flow_step_relation
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="inputStepId != null and inputStepId != ''"> and input_step_id = #{inputStepId} </if>
<if test="outputStepId != null and outputStepId != ''"> and output_step_id = #{outputStepId} </if>
<if test="inputNifiAppId != null and inputNifiAppId != ''"> and input_nifi_app_id = #{inputNifiAppId} </if>
<if test="outputNifiAppId != null and outputNifiAppId != ''"> and output_nifi_app_id = #{outputNifiAppId} </if>
<if test="inputNifiApiId != null and inputNifiApiId != ''"> and input_nifi_api_id = #{inputNifiApiId} </if>
<if test="outputNifiApiId != null and outputNifiApiId != ''"> and output_nifi_api_id = #{outputNifiApiId} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity">
select count(1) from sys_flow_step_relation
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="inputStepId != null and inputStepId != ''"> and input_step_id = #{inputStepId} </if>
<if test="outputStepId != null and outputStepId != ''"> and output_step_id = #{outputStepId} </if>
<if test="inputNifiAppId != null and inputNifiAppId != ''"> and input_nifi_app_id = #{inputNifiAppId} </if>
<if test="outputNifiAppId != null and outputNifiAppId != ''"> and output_nifi_app_id = #{outputNifiAppId} </if>
<if test="inputNifiApiId != null and inputNifiApiId != ''"> and input_nifi_api_id = #{inputNifiApiId} </if>
<if test="outputNifiApiId != null and outputNifiApiId != ''"> and output_nifi_api_id = #{outputNifiApiId} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-SysFlowStepRelationEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity">
select
<include refid="SysFlowStepRelationEntity_Base_Column_List" />
from sys_flow_step_relation
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
<if test="inputStepId != null and inputStepId != ''"> and input_step_id like concat('%',#{inputStepId},'%') </if>
<if test="outputStepId != null and outputStepId != ''"> and output_step_id like concat('%',#{outputStepId},'%') </if>
<if test="inputNifiAppId != null and inputNifiAppId != ''"> and input_nifi_app_id like concat('%',#{inputNifiAppId},'%') </if>
<if test="outputNifiAppId != null and outputNifiAppId != ''"> and output_nifi_app_id like concat('%',#{outputNifiAppId},'%') </if>
<if test="inputNifiApiId != null and inputNifiApiId != ''"> and input_nifi_api_id like concat('%',#{inputNifiApiId},'%') </if>
<if test="outputNifiApiId != null and outputNifiApiId != ''"> and output_nifi_api_id like concat('%',#{outputNifiApiId},'%') </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="SysFlowStepRelationentity_list_or" resultMap="get-SysFlowStepRelationEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity">
select
<include refid="SysFlowStepRelationEntity_Base_Column_List" />
from sys_flow_step_relation
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
<if test="inputStepId != null and inputStepId != ''"> or input_step_id = #{inputStepId} </if>
<if test="outputStepId != null and outputStepId != ''"> or output_step_id = #{outputStepId} </if>
<if test="inputNifiAppId != null and inputNifiAppId != ''"> or input_nifi_app_id = #{inputNifiAppId} </if>
<if test="outputNifiAppId != null and outputNifiAppId != ''"> or output_nifi_app_id = #{outputNifiAppId} </if>
<if test="inputNifiApiId != null and inputNifiApiId != ''"> or input_nifi_api_id = #{inputNifiApiId} </if>
<if test="outputNifiApiId != null and outputNifiApiId != ''"> or output_nifi_api_id = #{outputNifiApiId} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_relation(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
<if test="create_time != null"> create_time , </if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
<if test="modify_time != null"> modify_time , </if>
<if test="sts != null and sts != ''"> sts , </if>
<if test="inputStepId != null and inputStepId != ''"> input_step_id , </if>
<if test="outputStepId != null and outputStepId != ''"> output_step_id , </if>
<if test="inputNifiAppId != null and inputNifiAppId != ''"> input_nifi_app_id , </if>
<if test="outputNifiAppId != null and outputNifiAppId != ''"> output_nifi_app_id , </if>
<if test="inputNifiApiId != null and inputNifiApiId != ''"> input_nifi_api_id , </if>
<if test="outputNifiApiId != null and outputNifiApiId != ''"> output_nifi_api_id , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
<if test="modify_time != null"> #{modify_time} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="inputStepId != null and inputStepId != ''"> #{inputStepId} ,</if>
<if test="outputStepId != null and outputStepId != ''"> #{outputStepId} ,</if>
<if test="inputNifiAppId != null and inputNifiAppId != ''"> #{inputNifiAppId} ,</if>
<if test="outputNifiAppId != null and outputNifiAppId != ''"> #{outputNifiAppId} ,</if>
<if test="inputNifiApiId != null and inputNifiApiId != ''"> #{inputNifiApiId} ,</if>
<if test="outputNifiApiId != null and outputNifiApiId != ''"> #{outputNifiApiId} ,</if>
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_relation a WHERE a.sts = 'Y' ),1),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_relation(create_user_id, create_time, modify_user_id, modify_time, sts, input_step_id, output_step_id, input_nifi_app_id, output_nifi_app_id, input_nifi_api_id, output_nifi_api_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.inputStepId},#{entity.outputStepId},#{entity.inputNifiAppId},#{entity.outputNifiAppId},#{entity.inputNifiApiId},#{entity.outputNifiApiId}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_flow_step_relation(create_user_id, create_time, modify_user_id, modify_time, sts, input_step_id, output_step_id, input_nifi_app_id, output_nifi_app_id, input_nifi_api_id, output_nifi_api_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.inputStepId},#{entity.outputStepId},#{entity.inputNifiAppId},#{entity.outputNifiAppId},#{entity.inputNifiApiId},#{entity.outputNifiApiId})
</foreach>
on duplicate key update
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
input_step_id = values(input_step_id),
output_step_id = values(output_step_id),
input_nifi_app_id = values(input_nifi_app_id),
output_nifi_app_id = values(output_nifi_app_id),
input_nifi_api_id = values(input_nifi_api_id),
output_nifi_api_id = values(output_nifi_api_id)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity" >
update sys_flow_step_relation set
<trim suffix="" suffixOverrides=",">
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="inputStepId != null and inputStepId != ''"> input_step_id = #{inputStepId},</if>
<if test="outputStepId != null and outputStepId != ''"> output_step_id = #{outputStepId},</if>
<if test="inputNifiAppId != null and inputNifiAppId != ''"> input_nifi_app_id = #{inputNifiAppId},</if>
<if test="outputNifiAppId != null and outputNifiAppId != ''"> output_nifi_app_id = #{outputNifiAppId},</if>
<if test="inputNifiApiId != null and inputNifiApiId != ''"> input_nifi_api_id = #{inputNifiApiId},</if>
<if test="outputNifiApiId != null and outputNifiApiId != ''"> output_nifi_api_id = #{outputNifiApiId},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity" >
update sys_flow_step_relation set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity" >
update sys_flow_step_relation set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="inputStepId != null and inputStepId != ''"> and input_step_id = #{inputStepId} </if>
<if test="outputStepId != null and outputStepId != ''"> and output_step_id = #{outputStepId} </if>
<if test="inputNifiAppId != null and inputNifiAppId != ''"> and input_nifi_app_id = #{inputNifiAppId} </if>
<if test="outputNifiAppId != null and outputNifiAppId != ''"> and output_nifi_app_id = #{outputNifiAppId} </if>
<if test="inputNifiApiId != null and inputNifiApiId != ''"> and input_nifi_api_id = #{inputNifiApiId} </if>
<if test="outputNifiApiId != null and outputNifiApiId != ''"> and output_nifi_api_id = #{outputNifiApiId} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_flow_step_relation where id = #{id}
</delete>
</mapper>

View File

@ -1,57 +0,0 @@
package com.hzya.frame.sys.flow.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* 流程分类权限表(SysFlowClassRule)表服务接口
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public interface ISysFlowClassRuleService extends IBaseService<SysFlowClassRuleEntity, String>{
/**
* 新增流程分类权限
* @param object
* @return
*/
JsonResultEntity saveFlowClassRule(JSONObject object);
/**
* 修改流程分类权限
* @param object
* @return
*/
JsonResultEntity updateFlowClassRule(JSONObject object);
/**
* 删除流程分类权限
* @param object
* @return
*/
JsonResultEntity deleteFlowClassRule(JSONObject object);
/**
* 列表查询
* @param object
* @return
*/
JsonResultEntity queryRuleList(JSONObject object);
/**
* 分页查询
* @param object
* @return
*/
JsonResultEntity queryRulePagedInfo(JSONObject object);
/**
* 查询待分配权限的用户列表
* @param object
* @return
*/
JsonResultEntity queryUserList(JSONObject object);
}

View File

@ -1,42 +0,0 @@
package com.hzya.frame.sys.flow.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.flow.entity.SysFlowClassEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* 流程分类;对应数环通项目分类(SysFlowClass)表服务接口
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public interface ISysFlowClassService extends IBaseService<SysFlowClassEntity, String>{
/**
* 根据Id查询
* @param object
* @return
*/
JsonResultEntity getFlowClass(JSONObject object);
/**
* 新增流程分类
* @param object
* @return
*/
JsonResultEntity saveFlowClass(JSONObject object);
/**
* 修改流程分类
* @param object
* @return
*/
JsonResultEntity updateFlowClass(JSONObject object);
/**
* 删除流程分类
* @param object
* @return
*/
JsonResultEntity deleteFlowClass(JSONObject object);
}

View File

@ -1,43 +0,0 @@
package com.hzya.frame.sys.flow.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* nifi常量(SysFlowNifiConstant)表服务接口
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public interface ISysFlowNifiConstantService extends IBaseService<SysFlowNifiConstantEntity, String>{
/**
* 详情
* @param object
* @return
*/
JsonResultEntity getNifiConstant(JSONObject object);
/**
* 保存nifi常量
* @param object
* @return
*/
JsonResultEntity saveNifiConstant(JSONObject object);
/**
* 更新nifi常量
* @param object
* @return
*/
JsonResultEntity updateNifiConstant(JSONObject object);
/**
* 更新nifi常量
* @param object
* @return
*/
JsonResultEntity deleteNifiConstant(JSONObject object);
}

View File

@ -1,49 +0,0 @@
package com.hzya.frame.sys.flow.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.flow.entity.SysFlowEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* 流程主表;流程就是数环通的Linkup(SysFlow)表服务接口
*
* @author xiang2lin
* @since 2025-04-29 10:16:24
*/
public interface ISysFlowService extends IBaseService<SysFlowEntity, String>{
/**
* 保存流程主表
* @param object
* @return
*/
JsonResultEntity saveFlow(JSONObject object);
/**
* 更新流程主表
* @param object
* @return
*/
JsonResultEntity updateFlow(JSONObject object);
/**
* 删除流程主表
* @param object
* @return
*/
JsonResultEntity deleteFlow(JSONObject object);
/**
* 列表查询
* @param object
* @return
*/
JsonResultEntity queryFlowList(JSONObject object);
/**
* 分页查询
* @param object
* @return
*/
JsonResultEntity queryFlowPagedInfo(JSONObject object);
}

View File

@ -1,64 +0,0 @@
package com.hzya.frame.sys.flow.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* 流程步骤账户表(SysFlowStepAccount)表服务接口
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
public interface ISysFlowStepAccountService extends IBaseService<SysFlowStepAccountEntity, String>{
/**
* 保存账户信息
* @param object
* @return
*/
JsonResultEntity saveAccount(JSONObject object);
/**
* 更新账户信息
* @param object
* @return
*/
JsonResultEntity updateAccount(JSONObject object);
/**
* 删除账户信息
* @param object
* @return
*/
JsonResultEntity deleteAccount(JSONObject object);
/**
* 查询账户详情
* @param object
* @return
*/
JsonResultEntity getAccount(JSONObject object);
/**
* 查询账户列表数据
* @param object
* @return
*/
JsonResultEntity queryAccountList(JSONObject object);
/**
* 查询账户分页数据
* @param object
* @return
*/
JsonResultEntity queryAccountPaged(JSONObject object);
/**
* 验证数据库账户
* @param object
* @return
*/
JsonResultEntity verifyDataBase(JSONObject object);
}

View File

@ -1,12 +0,0 @@
package com.hzya.frame.sys.flow.service;
import com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* 映射信息表体(SysFlowStepConfigB)表服务接口
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
public interface ISysFlowStepConfigBService extends IBaseService<SysFlowStepConfigBEntity, String>{
}

View File

@ -1,22 +0,0 @@
package com.hzya.frame.sys.flow.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* 映射信息主表(SysFlowStepConfig)表服务接口
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
public interface ISysFlowStepConfigService extends IBaseService<SysFlowStepConfigEntity, String>{
/**
* 测试sql
* @param object
* @return
*/
JsonResultEntity testSql(JSONObject object);
}

View File

@ -1,12 +0,0 @@
package com.hzya.frame.sys.flow.service;
import com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* 步骤关联关系表(SysFlowStepRelation)表服务接口
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
public interface ISysFlowStepRelationService extends IBaseService<SysFlowStepRelationEntity, String>{
}

View File

@ -1,50 +0,0 @@
package com.hzya.frame.sys.flow.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.flow.entity.SysFlowStepEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* 流程步骤信息(SysFlowStep)表服务接口
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
public interface ISysFlowStepService extends IBaseService<SysFlowStepEntity, String>{
/**
* 保存流程步骤
* @param object
* @return
*/
JsonResultEntity saveFlowStep(JSONObject object);
/**
* 更新流程步骤
* @param object
* @return
*/
JsonResultEntity updateFlowStep(JSONObject object);
/**
* 删除流程步骤
* @param object
* @return
*/
JsonResultEntity deleteFlowStep(JSONObject object);
/**
* 查询列表
* @param object
* @return
*/
JsonResultEntity queryList(JSONObject object);
/**
* 步骤详情
* @param object
* @return
*/
JsonResultEntity getFlowStep(JSONObject object);
}

View File

@ -1,193 +0,0 @@
package com.hzya.frame.sys.flow.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowClassRuleDao;
import com.hzya.frame.sys.flow.service.ISysFlowClassRuleService;
import com.hzya.frame.sysnew.user.dao.ISysUserDao;
import com.hzya.frame.sysnew.user.entity.SysUserEntity;
import com.hzya.frame.uuid.UUIDUtils;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* 流程分类权限表(SysFlowClassRule)表服务实现类
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
@Service(value = "sysFlowClassRuleService")
public class SysFlowClassRuleServiceImpl extends BaseService<SysFlowClassRuleEntity, String> implements ISysFlowClassRuleService {
private ISysFlowClassRuleDao sysFlowClassRuleDao;
@Autowired
private ISysUserDao sysUserDao;
@Autowired
public void setSysFlowClassRuleDao(ISysFlowClassRuleDao dao) {
this.sysFlowClassRuleDao = dao;
this.dao = dao;
}
/**
* 新增流程分类权限
*
* @param object
* @return
*/
@Override
public JsonResultEntity saveFlowClassRule(JSONObject object) {
SysFlowClassRuleEntity ruleEntity = getData("jsonStr",object,SysFlowClassRuleEntity.class);
try {
this.checkParams(ruleEntity,"save");
}catch(Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
addRule(ruleEntity);
return BaseResult.getSuccessMessageEntity("保存成功");
}
//保存
private void addRule(SysFlowClassRuleEntity ruleEntity) {
List<SysFlowClassRuleEntity> ruleList = ruleEntity.getRuleList();
for (SysFlowClassRuleEntity r : ruleList) {
r.setId(UUIDUtils.getUUID());
r.setCreate_time(Convert.toDate(ruleEntity.getCreate_time(),ruleEntity.getModify_time()));
r.setCreate_user_id(Convert.toStr(ruleEntity.getCreate_user_id(),ruleEntity.getModify_user_id()));
r.setModify_time(r.getCreate_time());
r.setModify_user_id(r.getCreate_user_id());
r.setFlowClassId(ruleEntity.getFlowClassId());
sysFlowClassRuleDao.save(r);
}
}
/**
* 修改流程分类权限
*
* @param object
* @return
*/
@Override
public JsonResultEntity updateFlowClassRule(JSONObject object) {
SysFlowClassRuleEntity ruleEntity = getData("jsonStr",object,SysFlowClassRuleEntity.class);
try {
this.checkParams(ruleEntity,"update");
}catch(Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
//先删除 再重新保存
SysFlowClassRuleEntity rule = new SysFlowClassRuleEntity();
rule.setFlowClassId(ruleEntity.getFlowClassId());
sysFlowClassRuleDao.logicRemoveMultiCondition(rule);
addRule(ruleEntity);
return BaseResult.getSuccessMessageEntity("更新成功");
}
/**
* 删除流程分类权限
*
* @param object
* @return
*/
@Override
public JsonResultEntity deleteFlowClassRule(JSONObject object) {
SysFlowClassRuleEntity ruleEntity = getData("jsonStr",object,SysFlowClassRuleEntity.class);
try {
this.checkParams(ruleEntity,"delete");
}catch (Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
SysFlowClassRuleEntity deleteRuleEntity = new SysFlowClassRuleEntity();
deleteRuleEntity.setFlowClassId(ruleEntity.getFlowClassId());
deleteRuleEntity.setUserId(ruleEntity.getUserId());
sysFlowClassRuleDao.logicRemoveMultiCondition(deleteRuleEntity);
return BaseResult.getSuccessMessageEntity("删除成功");
}
/**
* 列表查询
*
* @param object
* @return
*/
@Override
public JsonResultEntity queryRuleList(JSONObject object) {
SysFlowClassRuleEntity ruleEntity = getData("jsonStr",object,SysFlowClassRuleEntity.class);
try {
checkParams(ruleEntity,"queryList");
}catch(Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
List<SysFlowClassRuleEntity> sysFlowClassRuleEntities = sysFlowClassRuleDao.queryByLike(ruleEntity);
SysFlowClassRuleEntity reuslt = new SysFlowClassRuleEntity();
reuslt.setFlowClassId(ruleEntity.getFlowClassId());
reuslt.setRuleList(sysFlowClassRuleEntities);
return BaseResult.getSuccessMessageEntity("查询数据成功",reuslt);
}
/**
* 分页查询
*
* @param object
* @return
*/
@Override
public JsonResultEntity queryRulePagedInfo(JSONObject object) {
SysFlowClassRuleEntity ruleEntity = getData("jsonStr",object,SysFlowClassRuleEntity.class);
try {
checkParams(ruleEntity,"queryPaged");
}catch(Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
PageHelper.startPage(ruleEntity.getPageNum(), ruleEntity.getPageSize());
List<SysFlowClassRuleEntity> queryByLike = this.dao.queryByLike(ruleEntity);
PageInfo pageInfo = new PageInfo(queryByLike);
return BaseResult.getSuccessMessageEntity("查询数据成功",pageInfo);
}
/**
* 查询待分配权限的用户列表
*
* @param object
* @return
*/
@Override
public JsonResultEntity queryUserList(JSONObject object) {
SysUserEntity userEntity = getData("jsonStr",object,SysUserEntity.class);
if (StrUtil.isEmpty(userEntity.getFlowClassId())){
return BaseResult.getFailureMessageEntity("flowClassId不能为空");
}
List<SysUserEntity> sysUserEntities = sysUserDao.queryList(userEntity, "com.hzya.frame.sysnew.user.dao.impl.SysUserDaoImpl.entity_list_notin_sys_flowClass");
return BaseResult.getSuccessMessageEntity("查询成功",sysUserEntities);
}
/**
* 检查参数
* @param entity 参数对象
* @param type 操作类型
*/
private void checkParams(SysFlowClassRuleEntity entity,String type){
Assert.notNull(entity,"请求参数不能为空");
Assert.notEmpty(entity.getFlowClassId(),"flowClassId不能为空");
if ("save".equals(type)){
Assert.notEmpty(entity.getRuleList(),"ruleList不能为空");
}else if ("update".equals(type)){
Assert.notEmpty(entity.getRuleList(),"ruleList不能为空");
}else if ("delete".equals(type)){
}else if ("queryPaged".equals(type)){
Assert.notNull(entity.getPageNum(),"pageNum不能为空");
Assert.notNull(entity.getPageSize(),"pageSize不能为空");
}
}
}

View File

@ -1,179 +0,0 @@
package com.hzya.frame.sys.flow.service.impl;
import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.dictionaryshopNew.service.ISysDictionaryshopNewService;
import com.hzya.frame.sys.flow.dao.ISysFlowClassRuleDao;
import com.hzya.frame.sys.flow.dao.ISysFlowDao;
import com.hzya.frame.sys.flow.entity.SysFlowClassEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowClassDao;
import com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity;
import com.hzya.frame.sys.flow.entity.SysFlowEntity;
import com.hzya.frame.sys.flow.service.ISysFlowClassService;
import com.hzya.frame.sysnew.user.dao.ISysUserDao;
import com.hzya.frame.sysnew.user.entity.SysUserEntity;
import com.hzya.frame.uuid.UUIDLong;
import com.hzya.frame.uuid.UUIDUtils;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.hzya.frame.web.exception.BaseSystemException;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.Date;
import java.util.List;
/**
* 流程分类;对应数环通项目分类(SysFlowClass)表服务实现类
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
@Service(value = "sysFlowClassService")
public class SysFlowClassServiceImpl extends BaseService<SysFlowClassEntity, String> implements ISysFlowClassService {
private ISysFlowClassDao sysFlowClassDao;
@Autowired
private ISysFlowDao sysFlowDao;
@Autowired
private ISysFlowClassRuleDao flowClassRuleDao;
@Autowired
private ISysUserDao sysUserDao;
@Autowired
public void setSysFlowClassDao(ISysFlowClassDao dao) {
this.sysFlowClassDao = dao;
this.dao = dao;
}
/**
* 根据Id查询
*
* @param object
* @return
*/
@Override
public JsonResultEntity getFlowClass(JSONObject object) {
SysFlowClassEntity flowClass = getData("jsonStr",object,SysFlowClassEntity.class);
try {
this.checkParams(flowClass,"get");
}catch(Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
SysFlowClassEntity sysFlowClassEntity = sysFlowClassDao.queryOne(flowClass);
return BaseResult.getSuccessMessageEntity("查询详情成功",sysFlowClassEntity);
}
/**
* 新增流程分类
*
* @param object
* @return
*/
@Override
public JsonResultEntity saveFlowClass(JSONObject object) {
SysFlowClassEntity flowClass = getData("jsonStr",object,SysFlowClassEntity.class);
try {
this.checkParams(flowClass,"add");
}catch(Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
flowClass.setId(UUIDUtils.getUUID());
sysFlowClassDao.save(flowClass);
//给创建分类的用户保存一下权限
SysUserEntity sysUserEntity = sysUserDao.get(flowClass.getCreate_user_id());
SysFlowClassRuleEntity ruleEntity = new SysFlowClassRuleEntity();
ruleEntity.setFlowClassId(flowClass.getId());
ruleEntity.setUserId(flowClass.getCreate_user_id());
if (null != sysUserEntity){
ruleEntity.setUserName(sysUserEntity.getPersonName());
ruleEntity.setUserCode(sysUserEntity.getPersonCode());
}
ruleEntity.setCreate_time(new Date());
ruleEntity.setModify_time(new Date());
ruleEntity.setCreate_user_id(flowClass.getCreate_user_id());
ruleEntity.setModify_user_id(flowClass.getModify_user_id());
ruleEntity.setId(UUIDUtils.getUUID());
flowClassRuleDao.save(ruleEntity);
return BaseResult.getSuccessMessageEntity("新增成功");
}
/**
* 修改流程分类
*
* @param object
* @return
*/
@Override
public JsonResultEntity updateFlowClass(JSONObject object) {
SysFlowClassEntity flowClass = getData("jsonStr",object,SysFlowClassEntity.class);
try {
this.checkParams(flowClass,"update");
}catch(Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
sysFlowClassDao.update(flowClass);
return BaseResult.getSuccessMessageEntity("更新成功");
}
/**
* 删除流程分类
*
* @param object
* @return
*/
@Override
public JsonResultEntity deleteFlowClass(JSONObject object) {
SysFlowClassEntity flowClass = getData("jsonStr",object,SysFlowClassEntity.class);
try {
this.checkParams(flowClass,"delete");
}catch(Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
sysFlowClassDao.logicRemove(flowClass);
return BaseResult.getSuccessMessageEntity("删除成功");
}
/**
* 参数检查
* @param flowClass
* @param type
*/
private void checkParams(SysFlowClassEntity flowClass,String type){
Assert.notNull(flowClass,"请求参数不能为空");
if ("add".equals(type)){//新增
Assert.notEmpty(flowClass.getName(),"名称不能为空");
//查询是否有同名的
SysFlowClassEntity flowQuery = new SysFlowClassEntity();
flowQuery.setName(flowClass.getName());
List<SysFlowClassEntity> query = sysFlowClassDao.query(flowQuery);
if (CollectionUtils.isNotEmpty(query)){
throw new BaseSystemException(flowClass.getName()+"已存在");
}
}else if ("update".equals(type)){//更新
Assert.notEmpty(flowClass.getId(),"id不能为空");
//查一下有没有同名的
SysFlowClassEntity flowQuery = new SysFlowClassEntity();
flowQuery.setName(flowClass.getName());
List<SysFlowClassEntity> query = sysFlowClassDao.query(flowQuery);
if (CollectionUtils.isNotEmpty(query)){
for (SysFlowClassEntity f : query) {
if (!f.getId().equals(flowClass.getId())){
throw new BaseSystemException(flowClass.getName()+"已存在");
}
}
}
}else if ("delete".equals(type)){//删除
Assert.notEmpty(flowClass.getId(),"id不能为空");
//查一下这个分类有没有被引用
SysFlowEntity sysFlowEntity = new SysFlowEntity();
sysFlowEntity.setClassId(flowClass.getId());
List<SysFlowEntity> query = sysFlowDao.query(sysFlowEntity);
if (CollectionUtils.isNotEmpty(query)){
throw new BaseSystemException("该分类已被引用,删除失败");
}
}else if ("get".equals(type)){//查询详情
Assert.notEmpty(flowClass.getId(),"id不能为空");
}
}
}

View File

@ -1,155 +0,0 @@
package com.hzya.frame.sys.flow.service.impl;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowNifiConstantDao;
import com.hzya.frame.sys.flow.service.ISysFlowNifiConstantService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.hzya.frame.web.exception.BaseSystemException;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* nifi常量(SysFlowNifiConstant)表服务实现类
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
@Service(value = "sysFlowNifiConstantService")
public class SysFlowNifiConstantServiceImpl extends BaseService<SysFlowNifiConstantEntity, String> implements ISysFlowNifiConstantService {
private ISysFlowNifiConstantDao sysFlowNifiConstantDao;
@Autowired
public void setSysFlowNifiConstantDao(ISysFlowNifiConstantDao dao) {
this.sysFlowNifiConstantDao = dao;
this.dao = dao;
}
/**
* 详情
*
* @param object
* @return
*/
@Override
public JsonResultEntity getNifiConstant(JSONObject object) {
SysFlowNifiConstantEntity sysFlowNifiConstantEntity = null;
try {
sysFlowNifiConstantEntity = preCheck(object,"get");
}catch(Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
SysFlowNifiConstantEntity nifiConstant = sysFlowNifiConstantDao.queryOne(sysFlowNifiConstantEntity);
return BaseResult.getSuccessMessageEntity("查询详情成功",nifiConstant);
}
/**
* 保存nifi常量
*
* @param object
* @return
*/
@Override
public JsonResultEntity saveNifiConstant(JSONObject object) {
SysFlowNifiConstantEntity sysFlowNifiConstantEntity = null;
try {
sysFlowNifiConstantEntity = preCheck(object,"save");
}catch(Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
sysFlowNifiConstantDao.save(sysFlowNifiConstantEntity);
return BaseResult.getSuccessMessageEntity("保存成功");
}
/**
* 更新nifi常量
*
* @param object
* @return
*/
@Override
public JsonResultEntity updateNifiConstant(JSONObject object) {
SysFlowNifiConstantEntity sysFlowNifiConstantEntity = null;
try {
sysFlowNifiConstantEntity = preCheck(object,"update");
}catch(Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
sysFlowNifiConstantDao.update(sysFlowNifiConstantEntity);
return BaseResult.getSuccessMessageEntity("更新成功");
}
/**
* 更新nifi常量
*
* @param object
* @return
*/
@Override
public JsonResultEntity deleteNifiConstant(JSONObject object) {
SysFlowNifiConstantEntity sysFlowNifiConstantEntity = null;
try {
sysFlowNifiConstantEntity = preCheck(object,"delete");
}catch(Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
sysFlowNifiConstantDao.logicRemove(sysFlowNifiConstantEntity);
return BaseResult.getSuccessMessageEntity("删除成功");
}
/**
* 参数校验
* @param entity
* @param type
*/
private void checkParams(SysFlowNifiConstantEntity entity,String type){
Assert.notNull(entity,"请求参数不能为空");
if ("save".equals(type)){
Assert.notEmpty(entity.getNifiKey(),"nifiKey不能为空");
Assert.notEmpty(entity.getNifiValue(),"nifiValue不能为空");
//检查是否有重名的key
SysFlowNifiConstantEntity nifi = new SysFlowNifiConstantEntity();
nifi.setNifiKey(entity.getNifiKey());
List<SysFlowNifiConstantEntity> query = sysFlowNifiConstantDao.query(nifi);
if (CollectionUtils.isNotEmpty(query)){
throw new BaseSystemException(nifi.getNifiKey()+"重复");
}
}else if ("update".equals(type)){
Assert.notEmpty(entity.getId(),"id不能为空");
Assert.notEmpty(entity.getNifiKey(),"key不能为空");
Assert.notEmpty(entity.getNifiValue(),"value不能为空");
SysFlowNifiConstantEntity nifi = new SysFlowNifiConstantEntity();
nifi.setNifiKey(entity.getNifiKey());
List<SysFlowNifiConstantEntity> query = sysFlowNifiConstantDao.query(nifi);
if (CollectionUtils.isNotEmpty(query)){
for (SysFlowNifiConstantEntity n : query) {
if (!n.getId().equals(entity.getId())){
throw new BaseSystemException(entity.getNifiKey()+"重复");
}
}
}
}else if ("delete".equals(type)){
Assert.notEmpty(entity.getId(),"id不能为空");
}else if ("get".equals(type)){
Assert.notEmpty(entity.getId(),"id不能为空");
}
}
//前置操作
private SysFlowNifiConstantEntity preCheck(JSONObject object,String type){
SysFlowNifiConstantEntity entity = getData("jsonStr", object,SysFlowNifiConstantEntity.class);
checkParams(entity,type);
return entity;
}
}

View File

@ -1,190 +0,0 @@
package com.hzya.frame.sys.flow.service.impl;
import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.sys.dictionaryshopNew.entity.SysDictionaryshopNew;
import com.hzya.frame.sys.dictionaryshopNew.service.ISysDictionaryshopNewService;
import com.hzya.frame.sys.flow.entity.SysFlowEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowDao;
import com.hzya.frame.sys.flow.service.ISysFlowService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.hzya.frame.web.exception.BaseSystemException;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* 流程主表;流程就是数环通的Linkup(SysFlow)表服务实现类
*
* @author xiang2lin
* @since 2025-04-29 10:16:26
*/
@Service(value = "sysFlowService")
public class SysFlowServiceImpl extends BaseService<SysFlowEntity, String> implements ISysFlowService {
private ISysFlowDao sysFlowDao;
@Autowired
private ISysDictionaryshopNewService sysDictionaryshopNewService;
@Autowired
public void setSysFlowDao(ISysFlowDao dao) {
this.sysFlowDao = dao;
this.dao = dao;
}
/**
* 保存流程主表
*
* @param object
* @return
*/
@Override
public JsonResultEntity saveFlow(JSONObject object) {
SysFlowEntity flowEntity = getData("jsonStr",object,SysFlowEntity.class);
try {
checkParams(flowEntity,"save");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
sysFlowDao.save(flowEntity);
return BaseResult.getSuccessMessageEntity("保存成功",flowEntity);
}
/**
* 更新流程主表
*
* @param object
* @return
*/
@Override
public JsonResultEntity updateFlow(JSONObject object) {
SysFlowEntity flowEntity = getData("jsonStr",object,SysFlowEntity.class);
try {
checkParams(flowEntity,"update");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
sysFlowDao.update(flowEntity);
return BaseResult.getSuccessMessageEntity("更新成功");
}
/**
* 删除流程主表
*
* @param object
* @return
*/
@Override
public JsonResultEntity deleteFlow(JSONObject object) {
SysFlowEntity flowEntity = getData("jsonStr",object,SysFlowEntity.class);
try {
checkParams(flowEntity,"delete");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
//删除主表
sysFlowDao.logicRemove(flowEntity);
//删除子表
return BaseResult.getSuccessMessageEntity("删除成功");
}
/**
* 列表查询
*
* @param object
* @return
*/
@Override
public JsonResultEntity queryFlowList(JSONObject object) {
SysFlowEntity flowEntity = getData("jsonStr",object,SysFlowEntity.class);
try {
checkParams(flowEntity,"queryList");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
List<SysFlowEntity> list = sysFlowDao.query(flowEntity);
if (CollectionUtils.isNotEmpty(list)){
for (SysFlowEntity sysFlowEntity : list) {
transferDictionary(sysFlowEntity);
}
}
return BaseResult.getSuccessMessageEntity("查询数据成功",list);
}
/**
* 分页查询
*
* @param object
* @return
*/
@Override
public JsonResultEntity queryFlowPagedInfo(JSONObject object) {
SysFlowEntity flowEntity = getData("jsonStr",object,SysFlowEntity.class);
try {
checkParams(flowEntity,"queryPaged");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
PageHelper.startPage(flowEntity.getPageNum(),flowEntity.getPageSize());
List<SysFlowEntity> queryByLike = sysFlowDao.queryByLike(flowEntity);
if (CollectionUtils.isNotEmpty(queryByLike)){
for (SysFlowEntity sysFlowEntity : queryByLike) {
transferDictionary(sysFlowEntity);
}
}
PageInfo pageInfo = new PageInfo(queryByLike);
return BaseResult.getSuccessMessageEntity("pageInfo",pageInfo);
}
/**
* 参数检查
* @param entity
* @param type
*/
private void checkParams(SysFlowEntity entity,String type){
Assert.notNull(entity,"请求参数不能为空");
if ("save".equals(type)){
Assert.notEmpty(entity.getClassId(),"classId不能为空");
Assert.notEmpty(entity.getName(),"name不能为空");
SysFlowEntity flow = new SysFlowEntity();
flow.setName(entity.getName());
List<SysFlowEntity> flowList = sysFlowDao.query(flow);
if (CollectionUtils.isNotEmpty(flowList)){
throw new BaseSystemException(entity.getName()+"重复");
}
}else if("update".equals(type)){
Assert.notEmpty(entity.getId(),"Id不能为空");
SysFlowEntity flow = new SysFlowEntity();
flow.setName(entity.getName());
List<SysFlowEntity> flowList = sysFlowDao.query(flow);
if (CollectionUtils.isNotEmpty(flowList)){
for (SysFlowEntity sysFlowEntity : flowList) {
if (!sysFlowEntity.getId().equals(entity.getId())){
throw new BaseSystemException(entity.getName()+"重复");
}
}
}
}else if ("delete".equals(type)){
Assert.notEmpty(entity.getId(),"Id不能为空");
}else if ("queryPaged".equals(type)){
Assert.notNull(entity.getPageNum(),"pageNum不能为空");
Assert.notNull(entity.getPageSize(),"pageSize不能为空");
}
}
private void transferDictionary(SysFlowEntity sysFlowEntity){
if (null != sysFlowEntity){
SysDictionaryshopNew dictionaryshopByValue = sysDictionaryshopNewService.getDictionaryshopByValue("sys_flow", "trigger_mode_id", sysFlowEntity.getTriggerModeId());
if (null != dictionaryshopByValue){
sysFlowEntity.setTriggerModeName(dictionaryshopByValue.getColumnContent());
}
}
}
}

View File

@ -1,284 +0,0 @@
package com.hzya.frame.sys.flow.service.impl;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.datasource.DataSourceUtilProperties;
import com.hzya.frame.serviceUtil.DsDataSourceUtil;
import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepAccountDao;
import com.hzya.frame.sys.flow.service.ISysFlowStepAccountService;
import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity;
import com.hzya.frame.sysnew.application.database.service.ISysApplicationDatabaseService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.hzya.frame.web.exception.BaseSystemException;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.sql.Connection;
import java.sql.DriverManager;
import java.util.List;
/**
* 流程步骤账户表(SysFlowStepAccount)表服务实现类
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
@Service(value = "sysFlowStepAccountService")
public class SysFlowStepAccountServiceImpl extends BaseService<SysFlowStepAccountEntity, String> implements ISysFlowStepAccountService {
private ISysFlowStepAccountDao sysFlowStepAccountDao;
@Resource
private DsDataSourceUtil dsDataSourceUtil;
@Autowired
private ISysApplicationDatabaseService sysApplicationDatabaseService;
@Autowired
public void setSysFlowStepAccountDao(ISysFlowStepAccountDao dao) {
this.sysFlowStepAccountDao = dao;
this.dao = dao;
}
/**
* 保存账户信息
*
* @param object
* @return
*/
@Override
public JsonResultEntity saveAccount(JSONObject object) {
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
try {
checkParam(entity, "save");
//控制一下名字不能重复
List<SysFlowStepAccountEntity> queryList = queryByName(entity);
if (CollectionUtils.isNotEmpty(queryList) && queryList.size() > 0) {
return BaseResult.getFailureMessageEntity(entity.getName() + "重复");
}
sysFlowStepAccountDao.save(entity);
//保存数据源表测试sql的时候要用动态数据源动态数据源是从sys_application_database表查数据的
saveOrDataBase(entity);
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
return BaseResult.getSuccessMessageEntity("新增成功");
}
/**
* 保存数据源表测试sql的时候要用动态数据源动态数据源是从sys_application_database表查数据的
*
* @param entity
*/
private void saveOrDataBase(SysFlowStepAccountEntity entity) throws Exception {
Assert.notNull(entity, "参数不能为空");
Assert.notEmpty(entity.getName(), "账户名称不能为空");
SysApplicationDatabaseEntity db = new SysApplicationDatabaseEntity();
db.setSourceCode(entity.getName() + "_flow");
List<SysApplicationDatabaseEntity> queryList = sysApplicationDatabaseService.query(db);
if (CollectionUtils.isNotEmpty(queryList)) {
for (SysApplicationDatabaseEntity sys : queryList) {
sysApplicationDatabaseService.logicRemove(sys);
}
}
SysApplicationDatabaseEntity databaseEntity = new SysApplicationDatabaseEntity();
databaseEntity.setAppId(entity.getAppId());
databaseEntity.setSourceCode(entity.getName() + "_flow");
databaseEntity.setSourceName(entity.getName());
databaseEntity.setSourceType(entity.getDbType());
databaseEntity.setSourceIp(entity.getIpAddress());
databaseEntity.setSourcePort(entity.getPort());
databaseEntity.setLoginName(entity.getUserName());
databaseEntity.setPassword(entity.getPassword());
databaseEntity.setDbName(entity.getDbName());
databaseEntity.setDbStatus("1");
sysApplicationDatabaseService.save(databaseEntity);
}
/**
* 更新账户信息
*
* @param object
* @return
*/
@Override
public JsonResultEntity updateAccount(JSONObject object) {
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
try {
checkParam(entity, "update");
//检查一下名字不能重复
List<SysFlowStepAccountEntity> queryList = queryByName(entity);
if (CollectionUtils.isNotEmpty(queryList) && queryList.size() > 0) {
for (SysFlowStepAccountEntity acc : queryList) {
if (!acc.getId().equals(entity.getId())) {
return BaseResult.getFailureMessageEntity(entity.getName() + "重复");
}
}
}
sysFlowStepAccountDao.update(entity);
//保存数据源表测试sql的时候要用动态数据源动态数据源是从sys_application_database表查数据的
saveOrDataBase(entity);
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
return BaseResult.getSuccessMessageEntity("更新成功");
}
/**
* 删除账户信息
*
* @param object
* @return
*/
@Override
public JsonResultEntity deleteAccount(JSONObject object) {
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
try {
checkParam(entity, "delete");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
sysFlowStepAccountDao.logicRemove(entity);
return BaseResult.getSuccessMessageEntity("删除成功");
}
/**
* 查询账户详情
*
* @param object
* @return
*/
@Override
public JsonResultEntity getAccount(JSONObject object) {
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
try {
checkParam(entity, "get");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
SysFlowStepAccountEntity SysFlowStepAccountEntity = sysFlowStepAccountDao.get(entity.getId());
return BaseResult.getSuccessMessageEntity("查询账户详情成功", SysFlowStepAccountEntity);
}
/**
* 查询账户列表数据
*
* @param object
* @return
*/
@Override
public JsonResultEntity queryAccountList(JSONObject object) {
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
try {
checkParam(entity, "queryList");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
List<SysFlowStepAccountEntity> queryList = sysFlowStepAccountDao.query(entity);
return BaseResult.getSuccessMessageEntity("查询列表成功", queryList);
}
/**
* 查询账户分页数据
*
* @param object
* @return
*/
@Override
public JsonResultEntity queryAccountPaged(JSONObject object) {
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
try {
checkParam(entity, "queryPaged");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
return null;
}
//根据账户名称查询
private List<SysFlowStepAccountEntity> queryByName(SysFlowStepAccountEntity entity) {
if (StrUtil.isNotEmpty(entity.getName())) {
SysFlowStepAccountEntity account = new SysFlowStepAccountEntity();
account.setName(entity.getName());
List<SysFlowStepAccountEntity> queryList = sysFlowStepAccountDao.query(account);
return queryList;
}
return null;
}
/**
* 验证账户
*
* @param object
* @return
*/
@Override
public JsonResultEntity verifyDataBase(JSONObject object) {
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
try {
checkParam(entity, "verify");
String dbType = entity.getDbType();
String driveClass = "";
StringBuffer sourceUrl = new StringBuffer();
if (StrUtil.isNotEmpty(dbType)) {
if ("mysql".equals(dbType)) {
driveClass = DataSourceUtilProperties.MYSQLDRIVER_6;
sourceUrl.append("jdbc:mysql://").append(entity.getIpAddress()).append(":").append(entity.getPort()).append("/").append(entity.getDbName()).append("?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true");
} else if ("oracle".equals(dbType)) {
driveClass = DataSourceUtilProperties.ORACLEDRIVER;
sourceUrl.append("jdbc:oracle:thin:@").append(entity.getIpAddress()).append(":").append(entity.getPort()).append(":").append(entity.getDbName());
} else if ("sqlserver2000".equals(dbType)) {
driveClass = DataSourceUtilProperties.SQL2000DRIVER;
sourceUrl.append("jdbc:sqlserver://").append(entity.getIpAddress()).append(":").append(entity.getPort()).append(";DatabaseName=").append(entity.getDbName()).append(";encrypt=false;trustServerCertificate=true");
} else if ("sqlserver2005".equals(dbType)) {
driveClass = DataSourceUtilProperties.SQL2005DRIVER;
sourceUrl.append("jdbc:sqlserver://").append(entity.getIpAddress()).append(":").append(entity.getPort()).append(";DatabaseName=").append(entity.getDbName()).append(";encrypt=false;trustServerCertificate=true");
}
//测试连接
Class.forName(driveClass);
Connection connection = DriverManager.getConnection(sourceUrl.toString(), entity.getUserName(), entity.getPassword());// 相当于连接数据库
if (null != connection) {
return BaseResult.getSuccessMessageEntity("验证成功");
} else {
return BaseResult.getFailureMessageEntity("验证失败");
}
}
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
return null;
}
//数据检查
private void checkParam(SysFlowStepAccountEntity entity, String type) {
Assert.notNull(entity, "参数不能为空");
if ("save".equals(type)) {
Assert.notEmpty(entity.getFlowId(), "flowId不能为空");
Assert.notEmpty(entity.getAppId(), "appId不能为空");
Assert.notEmpty(entity.getName(), "账户名称不能为空");
} else if ("update".equals(type)) {
Assert.notEmpty(entity.getId(), "id不能为空");
} else if ("delete".equals(type)) {
Assert.notEmpty(entity.getId(), "id不能为空");
} else if ("get".equals(type)) {
Assert.notEmpty(entity.getId(), "id不能为空");
} else if ("queryList".equals(type)) {
Assert.notEmpty(entity.getFlowId(), "flowId不能为空");
Assert.notEmpty(entity.getStepId(), "stepId不能为空");
Assert.notEmpty(entity.getAppId(), "appId不能为空");
} else if ("queryPaged".equals(type)) {
Assert.notNull(entity.getPageNum(), "pageNum不能为空");
Assert.notNull(entity.getPageSize(), "pageSize不能为空");
} else if ("verify".equals(type)) {
}
}
}

View File

@ -1,26 +0,0 @@
package com.hzya.frame.sys.flow.service.impl;
import com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepConfigBDao;
import com.hzya.frame.sys.flow.service.ISysFlowStepConfigBService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
/**
* 映射信息表体(SysFlowStepConfigB)表服务实现类
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
@Service(value = "sysFlowStepConfigBService")
public class SysFlowStepConfigBServiceImpl extends BaseService<SysFlowStepConfigBEntity, String> implements ISysFlowStepConfigBService {
private ISysFlowStepConfigBDao sysFlowStepConfigBDao;
@Autowired
public void setSysFlowStepConfigBDao(ISysFlowStepConfigBDao dao) {
this.sysFlowStepConfigBDao = dao;
this.dao = dao;
}
}

View File

@ -1,82 +0,0 @@
package com.hzya.frame.sys.flow.service.impl;
import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity;
import com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepConfigDao;
import com.hzya.frame.sys.flow.service.ISysFlowStepAccountService;
import com.hzya.frame.sys.flow.service.ISysFlowStepConfigService;
import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity;
import com.hzya.frame.sysnew.application.database.service.ISysApplicationDatabaseService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.hzya.frame.web.exception.BaseSystemException;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* 映射信息主表(SysFlowStepConfig)表服务实现类
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
@Service(value = "sysFlowStepConfigService")
public class SysFlowStepConfigServiceImpl extends BaseService<SysFlowStepConfigEntity, String> implements ISysFlowStepConfigService {
Logger logger = LoggerFactory.getLogger(ISysFlowStepConfigService.class);
private ISysFlowStepConfigDao sysFlowStepConfigDao;
@Autowired
private ISysFlowStepAccountService sysFlowStepAccountService;
@Autowired
private ISysApplicationDatabaseService sysApplicationDatabaseService;
@Autowired
public void setSysFlowStepConfigDao(ISysFlowStepConfigDao dao) {
this.sysFlowStepConfigDao = dao;
this.dao = dao;
}
/**
* 测试sql
*
* @param object
* @return
*/
@Override
public JsonResultEntity testSql(JSONObject object) {
SysFlowStepConfigEntity config = getData("jsonStr",object,SysFlowStepConfigEntity.class);
try {
checkParams(config,"type");
}catch (Exception e){
return BaseResult.getFailureMessageEntity(e.getMessage());
}
SysFlowStepAccountEntity accountEntity = sysFlowStepAccountService.get(config.getId());
Assert.notNull(accountEntity,"没有找到对应账户");
//查询数据源
SysApplicationDatabaseEntity database = new SysApplicationDatabaseEntity();
database.setSourceCode(accountEntity.getName()+"_flow");
List<SysApplicationDatabaseEntity> databaseList = sysApplicationDatabaseService.query(database);
if (CollectionUtils.isEmpty(databaseList)){
throw new BaseSystemException("没有找到数据源");
}
return null;
}
/**
* 验证数据
* @param entity
* @param type
*/
private void checkParams(SysFlowStepConfigEntity entity, String type) {
Assert.notNull(entity,"参数不能为空");
Assert.notEmpty(entity.getTableName(),"tabName不能为空");
Assert.notEmpty(entity.getStepAccountId(),"tabName不能为空");
}
}

View File

@ -1,26 +0,0 @@
package com.hzya.frame.sys.flow.service.impl;
import com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepRelationDao;
import com.hzya.frame.sys.flow.service.ISysFlowStepRelationService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
/**
* 步骤关联关系表(SysFlowStepRelation)表服务实现类
*
* @author xiang2lin
* @since 2025-04-29 10:16:28
*/
@Service(value = "sysFlowStepRelationService")
public class SysFlowStepRelationServiceImpl extends BaseService<SysFlowStepRelationEntity, String> implements ISysFlowStepRelationService {
private ISysFlowStepRelationDao sysFlowStepRelationDao;
@Autowired
public void setSysFlowStepRelationDao(ISysFlowStepRelationDao dao) {
this.sysFlowStepRelationDao = dao;
this.dao = dao;
}
}

View File

@ -1,160 +0,0 @@
package com.hzya.frame.sys.flow.service.impl;
import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.flow.dao.ISysFlowStepAccountDao;
import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity;
import com.hzya.frame.sys.flow.entity.SysFlowStepEntity;
import com.hzya.frame.sys.flow.dao.ISysFlowStepDao;
import com.hzya.frame.sys.flow.service.ISysFlowStepAccountService;
import com.hzya.frame.sys.flow.service.ISysFlowStepService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* 流程步骤信息(SysFlowStep)表服务实现类
*
* @author xiang2lin
* @since 2025-04-29 10:16:27
*/
@Service(value = "sysFlowStepService")
public class SysFlowStepServiceImpl extends BaseService<SysFlowStepEntity, String> implements ISysFlowStepService {
private ISysFlowStepDao sysFlowStepDao;
@Autowired
private ISysFlowStepAccountService sysFlowStepAccountService;
@Autowired
public void setSysFlowStepDao(ISysFlowStepDao dao) {
this.sysFlowStepDao = dao;
this.dao = dao;
}
/**
* 保存流程步骤
*
* @param object
* @return
*/
@Override
public JsonResultEntity saveFlowStep(JSONObject object) {
SysFlowStepEntity sysFlowStep = getData("jsonStr", object, SysFlowStepEntity.class);
try {
checkParams(sysFlowStep, "save");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
sysFlowStepDao.save(sysFlowStep);
return BaseResult.getSuccessMessageEntity("保存成功", sysFlowStep);
}
/**
* 更新流程步骤
*
* @param object
* @return
*/
@Override
public JsonResultEntity updateFlowStep(JSONObject object) {
SysFlowStepEntity sysFlowStep = getData("jsonStr", object, SysFlowStepEntity.class);
try {
checkParams(sysFlowStep, "update");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
sysFlowStepDao.update(sysFlowStep);
//保存账户信息
if (null != sysFlowStep.getAccount()) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("jsonStr", JSONObject.toJSONString(sysFlowStep.getAccount()));
sysFlowStepAccountService.saveAccount(jsonObject);
}
return BaseResult.getSuccessMessageEntity("保存成功", sysFlowStep);
}
/**
* 删除流程步骤
*
* @param object
* @return
*/
@Override
public JsonResultEntity deleteFlowStep(JSONObject object) {
SysFlowStepEntity sysFlowStep = getData("jsonStr", object, SysFlowStepEntity.class);
try {
checkParams(sysFlowStep, "delete");
String id = sysFlowStep.getId();
SysFlowStepEntity step = sysFlowStepDao.get(id);
//删除流程步骤账户表
SysFlowStepAccountEntity stepAccount = new SysFlowStepAccountEntity();
stepAccount.setFlowId(step.getFlowId());
stepAccount.setStepId(id);
sysFlowStepAccountService.logicRemoveMultiCondition(stepAccount);
//删除流程步骤
sysFlowStepDao.logicRemove(step);
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
return BaseResult.getSuccessMessageEntity("删除成功");
}
/**
* 查询列表
*
* @param object
* @return
*/
@Override
public JsonResultEntity queryList(JSONObject object) {
SysFlowStepEntity sysFlowStep = getData("jsonStr", object, SysFlowStepEntity.class);
try {
checkParams(sysFlowStep, "queryList");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
List<SysFlowStepEntity> list = sysFlowStepDao.query(sysFlowStep);
return BaseResult.getSuccessMessageEntity("查询数据成功", list);
}
/**
* 步骤详情
*
* @param object
* @return
*/
@Override
public JsonResultEntity getFlowStep(JSONObject object) {
SysFlowStepEntity sysFlowStep = getData("jsonStr", object, SysFlowStepEntity.class);
try {
checkParams(sysFlowStep, "get");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity(e.getMessage());
}
SysFlowStepEntity entity = sysFlowStepDao.get(sysFlowStep.getId());
return BaseResult.getSuccessMessageEntity("查询详情成功", entity);
}
private void checkParams(SysFlowStepEntity entity, String type) {
Assert.notNull(entity, "参数不能为空");
if ("save".equals(type)) {
Assert.notEmpty(entity.getFlowId(), "flowId不能为空");
Assert.notNull(entity.getStep(), "步骤号不能为空");
Assert.notEmpty(entity.getStepType(), "stepType不能为空");
} else if ("update".equals(type)) {
Assert.notEmpty(entity.getAppId(), "appId不能为空");
Assert.notEmpty(entity.getNifiApiId(), "nifiApiId不能为空");
} else if ("delete".equals(type)) {
Assert.notEmpty(entity.getId(), "id不能为空");
}else if ("queryList".equals(type)){
Assert.notEmpty(entity.getFlowId(),"flowId不能为空");
}else if ("get".equals(type)){
Assert.notEmpty(entity.getId(),"id不能为空");
}
}
}

View File

@ -82,9 +82,6 @@ public class SysApplicationApiEntity extends BaseEntity {
/** 返回描述字段*/
private String returnMsg;
//对应nifi的apiid
private String nifiApiId;
public String getReturnMsg() {
return returnMsg;
}
@ -324,13 +321,5 @@ public class SysApplicationApiEntity extends BaseEntity {
public void setAppCode(Long appCode) {
this.appCode = appCode;
}
public String getNifiApiId() {
return nifiApiId;
}
public void setNifiApiId(String nifiApiId) {
this.nifiApiId = nifiApiId;
}
}

View File

@ -10,7 +10,6 @@
<result property="appCode" column="app_code"/>
<result property="apiPath" column="api_path" jdbcType="VARCHAR"/>
<result property="appId" column="app_id" jdbcType="VARCHAR"/>
<result property="nifiApiId" column="nifi_api_id" jdbcType="VARCHAR"/>
<result property="appName" column="app_name" jdbcType="VARCHAR"/>
<result property="appUrl" column="app_url" jdbcType="VARCHAR"/>
<result property="catalogueId" column="catalogue_id" jdbcType="VARCHAR"/>
@ -43,7 +42,6 @@
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="appName" column="app_name" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="SysApplicationApiEntity_Base_Column_List">
@ -52,8 +50,7 @@
,api_code
,api_path
,app_id
,nifi_api_id
,catalogue_id
,catalogue_id
,api_name
,api_remark
,need_Login
@ -87,7 +84,6 @@
<sql id="SysApplicationApiEntity_join_sysApp_like_Column_Lis">
sys_application_api.id,
sys_application.app_id as app_code,
sys_application.nifi_api_id as nifi_api_id,
sys_application_api.api_code,
sys_application_api.api_name,
sys_application_api.api_remark,
@ -114,7 +110,6 @@
b.name as app_name,
b.interface_address as app_url,
a.app_id,
a.nifi_api_id,
a.catalogue_id,
c.name as catalogue_name,
a.api_name,
@ -161,89 +156,52 @@ WHERE
<select id="entity_list_base" resultMap="get-SysApplicationApiEntity-result"
parameterType="com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity">
select
api.id
,api.api_status
,api.api_code
,api.api_path
,api.app_id
,api.nifi_api_id
,api.catalogue_id
,api.api_name
,api.api_remark
,api.need_Login
,api.authentication_port
,api.parameter_passing_mode
,api.destination_address
,api.request_coding
,api.request_method
,api.timeout_period
,api.current_limiting
,api.header_in
,api.query_in
,api.body_in_type
,api.body_in
,api.body_out
,api.bean_name
,api.return_msg
,api.return_success_field
,api.return_success_value
,api.fun_name
,api.extension_api
,api.sorts
,api.create_user_id
,api.create_time
,api.modify_user_id
,api.modify_time
,api.sts
,api.org_id
,app.name as app_name
from sys_application_api api
left join sys_application app on api.app_id = app.id
<include refid="SysApplicationApiEntity_Base_Column_List"/>
from sys_application_api
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and api.id = #{id}</if>
<if test="apiStatus != null and apiStatus != ''">and api.api_status = #{apiStatus}</if>
<if test="apiCode != null ">and api.api_code = #{apiCode}</if>
<if test="apiPath != null and apiPath != ''">and api.api_path = #{apiPath}</if>
<if test="appId != null and appId != ''">and api.app_id = #{appId}</if>
<if test="nifiApiId != null and nifiApiId != ''">and api.nifi_api_id = #{nifiApiId}</if>
<if test="catalogueId != null and catalogueId != ''">and api.catalogue_id = #{catalogueId}</if>
<if test="apiName != null and apiName != ''">and api.api_name = #{apiName}</if>
<if test="apiRemark != null and apiRemark != ''">and api.api_remark = #{apiRemark}</if>
<if test="needLogin != null and needLogin != ''">and api.need_Login = #{needLogin}</if>
<if test="authenticationPort != null and authenticationPort != ''">and api.authentication_port =
<if test="id != null and id != ''">and id = #{id}</if>
<if test="apiStatus != null and apiStatus != ''">and api_status = #{apiStatus}</if>
<if test="apiCode != null ">and api_code = #{apiCode}</if>
<if test="apiPath != null and apiPath != ''">and api_path = #{apiPath}</if>
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
<if test="catalogueId != null and catalogueId != ''">and catalogue_id = #{catalogueId}</if>
<if test="apiName != null and apiName != ''">and api_name = #{apiName}</if>
<if test="apiRemark != null and apiRemark != ''">and api_remark = #{apiRemark}</if>
<if test="needLogin != null and needLogin != ''">and need_Login = #{needLogin}</if>
<if test="authenticationPort != null and authenticationPort != ''">and authentication_port =
#{authenticationPort}
</if>
<if test="parameterPassingMode != null and parameterPassingMode != ''">and api.parameter_passing_mode =
<if test="parameterPassingMode != null and parameterPassingMode != ''">and parameter_passing_mode =
#{parameterPassingMode}
</if>
<if test="destinationAddress != null and destinationAddress != ''">and api.destination_address =
<if test="destinationAddress != null and destinationAddress != ''">and destination_address =
#{destinationAddress}
</if>
<if test="requestCoding != null and requestCoding != ''">and api.request_coding = #{requestCoding}</if>
<if test="requestMethod != null and requestMethod != ''">and api.request_method = #{requestMethod}</if>
<if test="timeoutPeriod != null and timeoutPeriod != ''">and api.timeout_period = #{timeoutPeriod}</if>
<if test="currentLimiting != null and currentLimiting != ''">and api.current_limiting = #{currentLimiting}</if>
<if test="headerIn != null and headerIn != ''">and api.header_in = #{headerIn}</if>
<if test="queryIn != null and queryIn != ''">and api.query_in = #{queryIn}</if>
<if test="bodyInType != null and bodyInType != ''">and api.body_in_type = #{bodyInType}</if>
<if test="bodyIn != null and bodyIn != ''">and api.body_in = #{bodyIn}</if>
<if test="bodyOut != null and bodyOut != ''">and api.body_out = #{bodyOut}</if>
<if test="beanName != null and beanName != ''">and api.bean_name = #{beanName}</if>
<if test="returnMsg != null and returnMsg != ''">and api.return_msg = #{returnMsg}</if>
<if test="returnSuccessField != null and returnSuccessField != ''">and api.return_success_field = #{returnSuccessField}</if>
<if test="returnSuccessValue != null and returnSuccessValue != ''">and api.return_success_value = #{returnSuccessValue}</if>
<if test="funName != null and funName != ''">and api.fun_name = #{funName}</if>
<if test="extensionApi != null and extensionApi != ''">and api.extension_api = #{extensionApi}</if>
<if test="sorts != null">and api.sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and api.create_user_id = #{create_user_id}</if>
<if test="create_time != null">and api.create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and api.modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and api.modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and api.sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and api.org_id = #{org_id}</if>
and api.sts='Y'
<if test="requestCoding != null and requestCoding != ''">and request_coding = #{requestCoding}</if>
<if test="requestMethod != null and requestMethod != ''">and request_method = #{requestMethod}</if>
<if test="timeoutPeriod != null and timeoutPeriod != ''">and timeout_period = #{timeoutPeriod}</if>
<if test="currentLimiting != null and currentLimiting != ''">and current_limiting = #{currentLimiting}</if>
<if test="headerIn != null and headerIn != ''">and header_in = #{headerIn}</if>
<if test="queryIn != null and queryIn != ''">and query_in = #{queryIn}</if>
<if test="bodyInType != null and bodyInType != ''">and body_in_type = #{bodyInType}</if>
<if test="bodyIn != null and bodyIn != ''">and body_in = #{bodyIn}</if>
<if test="bodyOut != null and bodyOut != ''">and body_out = #{bodyOut}</if>
<if test="beanName != null and beanName != ''">and bean_name = #{beanName}</if>
<if test="returnMsg != null and returnMsg != ''">and return_msg = #{returnMsg}</if>
<if test="returnSuccessField != null and returnSuccessField != ''">and return_success_field = #{returnSuccessField}</if>
<if test="returnSuccessValue != null and returnSuccessValue != ''">and return_success_value = #{returnSuccessValue}</if>
<if test="funName != null and funName != ''">and fun_name = #{funName}</if>
<if test="extensionApi != null and extensionApi != ''">and extension_api = #{extensionApi}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by api.sorts asc</if>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
@ -257,7 +215,6 @@ WHERE
<if test="apiCode != null ">and api_code = #{apiCode}</if>
<if test="apiPath != null and apiPath != ''">and api_path = #{apiPath}</if>
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if>
<if test="catalogueId != null and catalogueId != ''">and catalogue_id = #{catalogueId}</if>
<if test="apiName != null and apiName != ''">and api_name = #{apiName}</if>
<if test="apiRemark != null and apiRemark != ''">and api_remark = #{apiRemark}</if>
@ -311,7 +268,6 @@ WHERE
<if test="apiCode != null ">and api_code like concat('%',#{apiCode},'%')</if>
<if test="apiPath != null and apiPath != ''">and api_path like concat('%',#{apiPath},'%')</if>
<if test="appId != null and appId != ''">and app_id like concat('%',#{appId},'%')</if>
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id like concat('%',#{nifiApiId},'%')</if>
<if test="catalogueId != null and catalogueId != ''">and catalogue_id like concat('%',#{catalogueId},'%')
</if>
<if test="apiName != null and apiName != ''">and api_name like concat('%',#{apiName},'%')</if>
@ -380,7 +336,6 @@ WHERE
<if test="apiCode != null ">and sys_application_api.api_code like concat('%',#{apiCode},'%')</if>
<if test="apiPath != null and apiPath != ''">and sys_application_api.api_path like concat('%',#{apiPath},'%')</if>
<if test="appId != null and appId != ''">and sys_application_api.app_id like concat('%',#{appId},'%')</if>
<if test="nifiApiId != null and nifiApiId != ''">and sys_application_api.nifi_api_id like concat('%',#{nifiApiId},'%')</if>
<if test="catalogueId != null and catalogueId != ''">and sys_application_api.catalogue_id like concat('%',#{catalogueId},'%')
</if>
<if test="apiName != null and apiName != ''">and sys_application_api.api_name like concat('%',#{apiName},'%')</if>
@ -447,7 +402,6 @@ WHERE
<if test="apiCode != null ">or api_code = #{apiCode}</if>
<if test="apiPath != null and apiPath != ''">or api_path = #{apiPath}</if>
<if test="appId != null and appId != ''">or app_id = #{appId}</if>
<if test="nifiApiId != null and nifiApiId != ''">or nifi_api_id = #{nifiApiId}</if>
<if test="catalogueId != null and catalogueId != ''">or catalogue_id = #{catalogueId}</if>
<if test="apiName != null and apiName != ''">or api_name = #{apiName}</if>
<if test="apiRemark != null and apiRemark != ''">or api_remark = #{apiRemark}</if>
@ -500,7 +454,6 @@ WHERE
<if test="apiCode == null ">api_code ,</if>
<if test="apiPath != null and apiPath != ''">api_path ,</if>
<if test="appId != null and appId != ''">app_id ,</if>
<if test="nifiApiId != null and nifiApiId != ''">nifi_api_id ,</if>
<if test="catalogueId != null and catalogueId != ''">catalogue_id ,</if>
<if test="apiName != null and apiName != ''">api_name ,</if>
<if test="apiRemark != null and apiRemark != ''">api_remark ,</if>
@ -542,7 +495,6 @@ WHERE
</if>
<if test="apiPath != null and apiPath != ''">#{apiPath} ,</if>
<if test="appId != null and appId != ''">#{appId} ,</if>
<if test="nifiApiId != null and nifiApiId != ''">#{nifiApiId} ,</if>
<if test="catalogueId != null and catalogueId != ''">#{catalogueId} ,</if>
<if test="apiName != null and apiName != ''">#{apiName} ,</if>
<if test="apiRemark != null and apiRemark != ''">#{apiRemark} ,</if>
@ -579,32 +531,31 @@ WHERE
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" >
insert into sys_application_api(api_status,api_code,api_path, app_id,nifi_api_id, catalogue_id, api_name, api_remark,
insert into sys_application_api(api_status,api_code,api_path, app_id, catalogue_id, api_name, api_remark,
need_Login, authentication_port, parameter_passing_mode, destination_address, request_coding, request_method,
timeout_period, current_limiting, header_in, query_in, body_in_type, body_in, body_out, bean_name,return_msg,return_success_field,return_success_value, fun_name, extension_api, sorts, create_user_id,
create_time, modify_user_id, modify_time, sts, org_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.apiStatus},#{entity.apiCode},#{entity.apiPath},#{entity.appId},#{entity.nifiApiId},#{entity.catalogueId},#{entity.apiName},#{entity.apiRemark},#{entity.needLogin},#{entity.authenticationPort},#{entity.parameterPassingMode},#{entity.destinationAddress},#{entity.requestCoding},#{entity.requestMethod},#{entity.timeoutPeriod},#{entity.currentLimiting},#{entity.headerIn},#{entity.queryIn},#{entity.bodyInType},#{entity.bodyIn},#{entity.bodyOut},#{entity.beanName},#{entity.returnMsg},#{entity.returnSuccessField},#{entity.returnSuccessValue},#{entity.funName},#{entity.extensionApi},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},
(#{entity.apiStatus},#{entity.apiCode},#{entity.apiPath},#{entity.appId},#{entity.catalogueId},#{entity.apiName},#{entity.apiRemark},#{entity.needLogin},#{entity.authenticationPort},#{entity.parameterPassingMode},#{entity.destinationAddress},#{entity.requestCoding},#{entity.requestMethod},#{entity.timeoutPeriod},#{entity.currentLimiting},#{entity.headerIn},#{entity.queryIn},#{entity.bodyInType},#{entity.bodyIn},#{entity.bodyOut},#{entity.beanName},#{entity.returnMsg},#{entity.returnSuccessField},#{entity.returnSuccessValue},#{entity.funName},#{entity.extensionApi},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" >
insert into sys_application_api(api_status,api_code,api_path, app_id,nifi_api_id, catalogue_id, api_name, api_remark,
insert into sys_application_api(api_status,api_code,api_path, app_id, catalogue_id, api_name, api_remark,
need_Login, authentication_port, parameter_passing_mode, destination_address, request_coding, request_method,
timeout_period, current_limiting, header_in, query_in, body_in_type, body_in, body_out,bean_name,return_msg,return_success_field,return_success_value,fun_name,extension_api, sorts, create_user_id,
create_time, modify_user_id, modify_time, sts, org_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.apiStatus},#{entity.apiCode},#{entity.apiPath},#{entity.appId},#{entity.nifiApiId},#{entity.catalogueId},#{entity.apiName},#{entity.apiRemark},#{entity.needLogin},#{entity.authenticationPort},#{entity.parameterPassingMode},#{entity.destinationAddress},#{entity.requestCoding},#{entity.requestMethod},#{entity.timeoutPeriod},#{entity.currentLimiting},#{entity.headerIn},#{entity.queryIn},#{entity.bodyInType},#{entity.bodyIn},#{entity.bodyOut},#{entity.beanName},#{entity.returnMsg},#{entity.returnSuccessField},#{entity.returnSuccessValue},#{entity.funName},#{entity.extensionApi},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
(#{entity.apiStatus},#{entity.apiCode},#{entity.apiPath},#{entity.appId},#{entity.catalogueId},#{entity.apiName},#{entity.apiRemark},#{entity.needLogin},#{entity.authenticationPort},#{entity.parameterPassingMode},#{entity.destinationAddress},#{entity.requestCoding},#{entity.requestMethod},#{entity.timeoutPeriod},#{entity.currentLimiting},#{entity.headerIn},#{entity.queryIn},#{entity.bodyInType},#{entity.bodyIn},#{entity.bodyOut},#{entity.beanName},#{entity.returnMsg},#{entity.returnSuccessField},#{entity.returnSuccessValue},#{entity.funName},#{entity.extensionApi},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
</foreach>
on duplicate key update
api_status = values(api_status),
api_code = values(api_code),
api_path = values(api_path),
app_id = values(app_id),
nifi_api_id = values(nifi_api_id),
catalogue_id = values(catalogue_id),
api_name = values(api_name),
api_remark = values(api_remark),
@ -643,7 +594,6 @@ WHERE
<if test="apiCode != null ">api_code = #{apiCode},</if>
<if test="apiPath != null and apiPath != ''">api_path = #{apiPath},</if>
<if test="appId != null and appId != ''">app_id = #{appId},</if>
<if test="nifiApiId != null and nifiApiId != ''">nifi_api_id = #{nifiApiId},</if>
<if test="catalogueId != null and catalogueId != ''">catalogue_id = #{catalogueId},</if>
<if test="apiName != null and apiName != ''">api_name = #{apiName},</if>
<if test="apiRemark != null and apiRemark != ''">api_remark = #{apiRemark},</if>
@ -697,7 +647,6 @@ where id = #{id}
<if test="apiCode != null ">and api_code = #{apiCode}</if>
<if test="apiPath != null and apiPath != ''">and api_path = #{apiPath}</if>
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if>
<if test="catalogueId != null and catalogueId != ''">and catalogue_id = #{catalogueId}</if>
<if test="apiName != null and apiName != ''">and api_name = #{apiName}</if>
<if test="apiRemark != null and apiRemark != ''">and api_remark = #{apiRemark}</if>
@ -934,7 +883,6 @@ where id = #{id}
select
id
,app_id
,nifi_api_id
,api_name
from sys_application_api
<trim prefix="where" prefixOverrides="and">
@ -943,7 +891,6 @@ where id = #{id}
<if test="apiCode != null ">and api_code = #{apiCode}</if>
<if test="apiPath != null and apiPath != ''">and api_path = #{apiPath}</if>
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if>
<if test="catalogueId != null and catalogueId != ''">and catalogue_id = #{catalogueId}</if>
<if test="apiName != null and apiName != ''">and api_name = #{apiName}</if>
<if test="apiRemark != null and apiRemark != ''">and api_remark = #{apiRemark}</if>

View File

@ -24,8 +24,6 @@ public interface ISysApplicationApiService extends IBaseService<SysApplicationAp
**/
JsonResultEntity queryEntity(JSONObject jsonObject);
JsonResultEntity queryMultiAppPage(JSONObject jsonObject);
/**
* 模糊查询联查sys_app
* @param entity

Some files were not shown because too many files have changed in this diff Show More