重构项目5
parent
d1e233042d
commit
e36668152d
|
@ -3,12 +3,16 @@ package com.muyu.common.system.remote;
|
|||
import com.muyu.common.core.constant.SecurityConstants;
|
||||
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.system.domain.SysDept;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户服务
|
||||
*
|
||||
|
@ -37,4 +41,24 @@ public interface RemoteUserService {
|
|||
*/
|
||||
@PostMapping("/user/register")
|
||||
public Result<Boolean> registerUserInfo (@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户对象
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/user/list")
|
||||
public Result<List<SysUser>> list (@RequestBody SysUser user, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 获取部门
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/dept/{deptId}")
|
||||
public Result<SysDept> getInfo (@PathVariable("deptId") Long deptId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@PostMapping(value = "/dept/list")
|
||||
Result<List<SysDept>> list(@RequestBody SysDept dept, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
}
|
||||
|
|
|
@ -10,109 +10,70 @@ import lombok.NoArgsConstructor;
|
|||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 结构对象 Structure
|
||||
* 结构对象 structure
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/11
|
||||
* @author Saisai
|
||||
* @date 2024-04-22
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
public class Structure extends BaseEntity {
|
||||
|
||||
public class Structure extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
/** 主键 */
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 表id
|
||||
*/
|
||||
/** 表id */
|
||||
@Excel(name = "表id")
|
||||
private Long tableId;
|
||||
|
||||
|
||||
/**
|
||||
* 字段名称
|
||||
*/
|
||||
/** 字段名称 */
|
||||
@Excel(name = "字段名称")
|
||||
private String columnName;
|
||||
|
||||
|
||||
/**
|
||||
* 字段注释
|
||||
*/
|
||||
/** 字段注释 */
|
||||
@Excel(name = "字段注释")
|
||||
private String columnRemark;
|
||||
|
||||
|
||||
/**
|
||||
* 是否主键 'Y'是主键 'N'不是主键
|
||||
*/
|
||||
/** 是否主键 'Y'是主键 'N'不是主键 */
|
||||
@Excel(name = "是否主键 'Y'是主键 'N'不是主键")
|
||||
private String isPrimary;
|
||||
|
||||
|
||||
/**
|
||||
* 数据类型
|
||||
*/
|
||||
/** 数据类型 */
|
||||
@Excel(name = "数据类型")
|
||||
private String columnType;
|
||||
|
||||
|
||||
/**
|
||||
* 映射类型
|
||||
*/
|
||||
/** 映射类型 */
|
||||
@Excel(name = "映射类型")
|
||||
private String javaType;
|
||||
|
||||
|
||||
/**
|
||||
* 字段长度
|
||||
*/
|
||||
/** 字段长度 */
|
||||
@Excel(name = "字段长度")
|
||||
private String columnLength;
|
||||
|
||||
|
||||
/**
|
||||
* 小数位数
|
||||
*/
|
||||
/** 小数位数 */
|
||||
@Excel(name = "小数位数")
|
||||
private String columnDecimals;
|
||||
|
||||
|
||||
/**
|
||||
* 是否为空 'Y' 是 'N'不是
|
||||
*/
|
||||
@Excel(name = "是否为空 '是' 'N'不是")
|
||||
/** 是否为空 'Y'是 'N'不是 */
|
||||
@Excel(name = "是否为空 'Y'是 'N'不是")
|
||||
private String isNull;
|
||||
|
||||
|
||||
/**
|
||||
* 默认值
|
||||
*/
|
||||
/** 默认值 */
|
||||
@Excel(name = "默认值")
|
||||
private String defaultValue;
|
||||
|
||||
|
||||
/**
|
||||
* 是否字典 'Y'是 'N'不是
|
||||
*/
|
||||
/** 是否字典 'Y'是 'N'不是 */
|
||||
@Excel(name = "是否字典 'Y'是 'N'不是")
|
||||
private String isDictionary;
|
||||
|
||||
|
||||
/**
|
||||
* 映射字典
|
||||
*/
|
||||
/** 映射字典 */
|
||||
@Excel(name = "映射字典")
|
||||
private String dictionaryTable;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -9,46 +9,42 @@ import lombok.NoArgsConstructor;
|
|||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 资产赋权对象 AssetImpowerReq
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/11
|
||||
* @ClassName AssetImpowerReq
|
||||
* @Description 描述
|
||||
* @Author SaiSai.Liu
|
||||
* @Date 2024/4/29 14:04
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
public class AssetImpowerReq {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 表id
|
||||
*/
|
||||
@Excel(name = "表id")
|
||||
private Long tableId;
|
||||
|
||||
|
||||
/**
|
||||
* 接入id
|
||||
*/
|
||||
@Excel(name = "接入id")
|
||||
private Long basicId;
|
||||
|
||||
|
||||
/**
|
||||
* 部门Id
|
||||
* 部门id
|
||||
*/
|
||||
@Excel(name = "部门id")
|
||||
private Long doptId;
|
||||
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
|
|
|
@ -11,102 +11,66 @@ import lombok.experimental.SuperBuilder;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 接入数据库 BasicConfigQueryReq
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/8
|
||||
* @ClassName BasicQueryReq
|
||||
* @Description 描述
|
||||
* @Author SaiSai.Liu
|
||||
* @Date 2024/4/21 10:42
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
public class BasicConfigQueryReq {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
/** 主键 */
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 接入源名称
|
||||
*/
|
||||
/** 接入源名称 */
|
||||
@Excel(name = "接入源名称")
|
||||
private String dataResourceName;
|
||||
|
||||
|
||||
/**
|
||||
* 数据来源系统名称
|
||||
*/
|
||||
/** 数据来源系统名称 */
|
||||
@Excel(name = "数据来源系统名称")
|
||||
private String dataSourcesSystemName;
|
||||
|
||||
|
||||
/**
|
||||
* 主机ip地址
|
||||
*/
|
||||
/** 主机ip地址 */
|
||||
@Excel(name = "主机ip地址")
|
||||
private String host;
|
||||
|
||||
|
||||
/**
|
||||
* 端口
|
||||
*/
|
||||
/** 端口 */
|
||||
@Excel(name = "端口")
|
||||
private String port;
|
||||
|
||||
|
||||
/**
|
||||
* 数据接入类型
|
||||
*/
|
||||
/** 数据接入类型 */
|
||||
@Excel(name = "数据接入类型")
|
||||
private String databaseType;
|
||||
|
||||
|
||||
/**
|
||||
* 数控库名称
|
||||
*/
|
||||
/** 数据库名称 */
|
||||
@Excel(name = "数据库名称")
|
||||
private String databaseName;
|
||||
|
||||
|
||||
/**
|
||||
* 初始化连接数量
|
||||
*/
|
||||
/** 初始化连接数量 */
|
||||
@Excel(name = "初始化连接数量")
|
||||
private Long initLinkNum;
|
||||
|
||||
|
||||
/**
|
||||
* 最大连接数量
|
||||
*/
|
||||
/** 最大连接数量 */
|
||||
@Excel(name = "最大连接数量")
|
||||
private Long maxLinkNum;
|
||||
|
||||
|
||||
/**
|
||||
* 最大等待时间
|
||||
*/
|
||||
/** 最大等待时间 */
|
||||
@Excel(name = "最大等待时间")
|
||||
private Long maxWaitTime;
|
||||
|
||||
|
||||
/**
|
||||
* 最大等待次数
|
||||
*/
|
||||
/** 最大等待次数 */
|
||||
@Excel(name = "最大等待次数")
|
||||
private Long maxWaitTimes;
|
||||
|
||||
|
||||
private String connectionParams;
|
||||
private String createBy;
|
||||
private String updateBy;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -9,97 +9,60 @@ import lombok.experimental.SuperBuilder;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 响应对象 BasicConfigResp
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/11
|
||||
*/
|
||||
|
||||
/**
|
||||
* 响应对象
|
||||
* @ClassName BasicConfigResp
|
||||
* @Description 描述
|
||||
* @Author SaiSai.Liu
|
||||
* @Date 2024/4/21 10:45
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
public class BasicConfigResp {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private static final long serialVersionUID = 1L;
|
||||
/** 主键 */
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 接入源名称
|
||||
*/
|
||||
/** 接入源名称 */
|
||||
private String dataResourceName;
|
||||
|
||||
|
||||
/**
|
||||
* 数据来源系统名称
|
||||
*/
|
||||
/** 数据来源系统名称 */
|
||||
private String dataSourcesSystemName;
|
||||
|
||||
|
||||
/**
|
||||
* 主机ip地址
|
||||
*/
|
||||
/** 主机ip地址 */
|
||||
private String host;
|
||||
|
||||
|
||||
/**
|
||||
* 端口
|
||||
*/
|
||||
/** 端口 */
|
||||
private String port;
|
||||
|
||||
|
||||
/**
|
||||
* 数据接入类型
|
||||
*/
|
||||
/** 数据接入类型 */
|
||||
private String databaseType;
|
||||
|
||||
|
||||
/**
|
||||
* 数据库名称
|
||||
*/
|
||||
/** 数据库名称 */
|
||||
private String databaseName;
|
||||
|
||||
|
||||
/**
|
||||
* 初始化连接数量
|
||||
*/
|
||||
/** 初始化连接数量 */
|
||||
private Long initLinkNum;
|
||||
|
||||
|
||||
/**
|
||||
* 最大连接数量
|
||||
*/
|
||||
/** 最大连接数量 */
|
||||
private Long maxLinkNum;
|
||||
|
||||
|
||||
/**
|
||||
* 最大等待时间
|
||||
*/
|
||||
/** 最大等待时间 */
|
||||
private Long maxWaitTime;
|
||||
|
||||
|
||||
/**
|
||||
* 最大等待次数
|
||||
*/
|
||||
/** 最大等待次数 */
|
||||
private Long maxWaitTimes;
|
||||
|
||||
|
||||
/**
|
||||
* 拼接链接
|
||||
*/
|
||||
/** 拼接链接 */
|
||||
private String connectionParams;
|
||||
private String remark;
|
||||
private String createBy;
|
||||
private String updateBy;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -6,63 +6,58 @@ import lombok.NoArgsConstructor;
|
|||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 接入--表基础信息(授权) BasicTableInfoResp
|
||||
* 接入--表基础信息(授权)
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/11
|
||||
* @ClassName BasicTableInfoResp
|
||||
* @Description 描述
|
||||
* @Author SaiSai.Liu
|
||||
* @Date 2024/4/30 11:58
|
||||
*/
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class BasicTableInfoResp {
|
||||
|
||||
|
||||
/**
|
||||
* 表id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 接入id
|
||||
*/
|
||||
private Long basicId;
|
||||
|
||||
|
||||
/**
|
||||
* 数据接入名
|
||||
*/
|
||||
private String dataResourceName;
|
||||
|
||||
|
||||
/**
|
||||
* 数据接入系统名
|
||||
*/
|
||||
private String dataSourcesSystemName;
|
||||
|
||||
|
||||
/**
|
||||
* 数据库名
|
||||
*/
|
||||
private String databaseName;
|
||||
|
||||
|
||||
/**
|
||||
* 表名(中文
|
||||
* 表名(中文)
|
||||
*/
|
||||
private String tableRemark;
|
||||
|
||||
|
||||
/**
|
||||
* 表名(英文
|
||||
* 表明
|
||||
*/
|
||||
private String tableName;
|
||||
|
||||
|
||||
/**
|
||||
* 数据条数
|
||||
*/
|
||||
private Long tatalNum;
|
||||
private Long totalNum;
|
||||
|
||||
}
|
||||
|
|
|
@ -12,61 +12,49 @@ import lombok.experimental.SuperBuilder;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库表基础信息对象 TableInfoStructureResp
|
||||
* 库表基础信息对象 table_info
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/11
|
||||
* @author Saisai
|
||||
* @date 2024-04-22
|
||||
*/
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
public class TableInfoStructureResp {
|
||||
@SuperBuilder
|
||||
public class TableInfoStructureResp
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final long serialVersionUID = 1L;
|
||||
/** 主键 */
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
private Long basicId;
|
||||
|
||||
|
||||
/**
|
||||
* 表名称/数据库
|
||||
*/
|
||||
/** 表名称/数据库 */
|
||||
@Excel(name = "表名称/数据库")
|
||||
private String tableName;
|
||||
|
||||
|
||||
/**
|
||||
* 表备注
|
||||
*/
|
||||
/** 表备注 */
|
||||
@Excel(name = "表备注")
|
||||
private String tableRemark;
|
||||
|
||||
private Long parentId;
|
||||
|
||||
|
||||
/**
|
||||
* 数据量
|
||||
*/
|
||||
/** 数据量 */
|
||||
@Excel(name = "数据量")
|
||||
private Long dataNum;
|
||||
/** 表备注 */
|
||||
@Excel(name = "数据来源类型")
|
||||
private String type;
|
||||
|
||||
|
||||
/**
|
||||
* 是否核心'Y'是 'N'不是
|
||||
*/
|
||||
@Excel(name = "是否核心 'Y'是 'N'不是 ")
|
||||
/** 是否核心 'Y'是 'N'不是 */
|
||||
@Excel(name = "是否核心 'Y'是 'N'不是")
|
||||
private String center;
|
||||
|
||||
|
||||
private String databaseType;
|
||||
|
||||
private List<Structure> structureList;
|
||||
|
||||
}
|
||||
|
|
|
@ -12,37 +12,29 @@ import lombok.experimental.SuperBuilder;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 树级结构 TableTreeResp
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/11
|
||||
* 树级结构
|
||||
* @ClassName TableTreeResp
|
||||
* @Description 描述
|
||||
* @Author SaiSai.Liu
|
||||
* @Date 2024/4/23 8:59
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TableTreeResp {
|
||||
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long Id;
|
||||
|
||||
|
||||
/**
|
||||
* 父级信息
|
||||
*/
|
||||
private TableInfo tableInfo;
|
||||
|
||||
|
||||
/**
|
||||
* 链接信息
|
||||
*/
|
||||
private BasicConfigInfo basicConfigInfo;
|
||||
|
||||
|
||||
/**
|
||||
* 子级信息
|
||||
*/
|
||||
private List<TableInfoStructureResp> Children;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
package com.muyu.etl.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.etl.domain.AssetImpower;
|
||||
import com.muyu.etl.domain.TableInfo;
|
||||
import com.muyu.etl.service.AssetImpowerService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资产赋权 AssetImpowerController
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/impower")
|
||||
public class AssetImpowerController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private AssetImpowerService assetImpowerService;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -23,19 +23,14 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据接入 BasicConfigInfoController
|
||||
* 基础信息Controller
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/9
|
||||
* @author muyu
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/info")
|
||||
public class BasicConfigInfoController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private BasicConfigInfoService basicConfigInfoService;
|
||||
|
||||
@Autowired
|
||||
private BasicConfigInfoService basicConfigInfoService;
|
||||
@Autowired
|
||||
|
@ -119,6 +114,16 @@ public class BasicConfigInfoController extends BaseController {
|
|||
return toAjax(basicConfigInfoService.connectionTest(basicConfigInfo));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 获取成功链接中的
|
||||
// * @return
|
||||
// */
|
||||
// @RequiresPermissions("etl:info:test")
|
||||
// @Log(title = "获取成功链接中的")
|
||||
// @GetMapping("/dataConstruct")
|
||||
// public Result<TableDataInfo<List>> getData() {
|
||||
// return getDataTable(basicConfigInfoService.getDataByEtl());
|
||||
// }
|
||||
|
||||
/**
|
||||
* 树级结构数据
|
||||
|
@ -156,7 +161,8 @@ public class BasicConfigInfoController extends BaseController {
|
|||
@GetMapping("/getTableInfo/{tableId}")
|
||||
public Result<TableInfoStructureResp>
|
||||
getTableInfo(@PathVariable Long tableId) {
|
||||
return Result.success(basicConfigInfoService.getTableInfo(tableId));
|
||||
return Result.success
|
||||
(basicConfigInfoService.getTableInfo(tableId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -195,7 +201,8 @@ public class BasicConfigInfoController extends BaseController {
|
|||
@GetMapping("/getBasicTableInfo/{tableId}")
|
||||
public Result getBasicTableInfo(@PathVariable Long tableId)
|
||||
throws ServletException {
|
||||
return Result.success(basicConfigInfoService.getBasicTableInfo(tableId));
|
||||
return Result.success(basicConfigInfoService
|
||||
.getBasicTableInfo(tableId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -209,6 +216,8 @@ public class BasicConfigInfoController extends BaseController {
|
|||
public Result updateStructureInfo
|
||||
(@RequestBody Structure structure) {
|
||||
return Result.success(structureService.updateStructureInfoDict(structure), "修改成功");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
package com.muyu.etl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.etl.domain.AssetDataDict;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资产数据字典Mapper接口
|
||||
*
|
||||
* @author Saisai
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface AssetDataDictMapper extends BaseMapper<AssetDataDict>
|
||||
{
|
||||
/**
|
||||
* 查询资产数据字典
|
||||
*
|
||||
* @param id 资产数据字典主键
|
||||
* @return 资产数据字典
|
||||
*/
|
||||
public AssetDataDict selectAssetDataDictById(Long id);
|
||||
|
||||
/**
|
||||
* 查询资产数据字典列表
|
||||
*
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return 资产数据字典集合
|
||||
*/
|
||||
public List<AssetDataDict> selectAssetDataDictList(AssetDataDict assetDataDict);
|
||||
|
||||
/**
|
||||
* 新增资产数据字典
|
||||
*
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAssetDataDict(AssetDataDict assetDataDict);
|
||||
|
||||
/**
|
||||
* 修改资产数据字典
|
||||
*
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAssetDataDict(AssetDataDict assetDataDict);
|
||||
|
||||
/**
|
||||
* 删除资产数据字典
|
||||
*
|
||||
* @param id 资产数据字典主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetDataDictById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除资产数据字典
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetDataDictByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.muyu.etl.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.etl.domain.AssetImpower;
|
||||
|
||||
/**
|
||||
* 资产赋权Mapper接口
|
||||
*
|
||||
* @author Saisai
|
||||
* @date 2024-04-28
|
||||
*/
|
||||
public interface AssetImpowerMapper extends BaseMapper<AssetImpower>
|
||||
{
|
||||
/**
|
||||
* 查询资产赋权
|
||||
*
|
||||
* @param id 资产赋权主键
|
||||
* @return 资产赋权
|
||||
*/
|
||||
public AssetImpower selectAssetImpowerById(Long id);
|
||||
|
||||
/**
|
||||
* 查询资产赋权列表
|
||||
*
|
||||
* @param assetImpower 资产赋权
|
||||
* @return 资产赋权集合
|
||||
*/
|
||||
public List<AssetImpower> selectAssetImpowerList(AssetImpower assetImpower);
|
||||
|
||||
/**
|
||||
* 新增资产赋权
|
||||
*
|
||||
* @param assetImpower 资产赋权
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAssetImpower(AssetImpower assetImpower);
|
||||
|
||||
/**
|
||||
* 修改资产赋权
|
||||
*
|
||||
* @param assetImpower 资产赋权
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAssetImpower(AssetImpower assetImpower);
|
||||
|
||||
/**
|
||||
* 删除资产赋权
|
||||
*
|
||||
* @param id 资产赋权主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetImpowerById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除资产赋权
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetImpowerByIds(Long[] ids);
|
||||
}
|
|
@ -2,36 +2,62 @@ package com.muyu.etl.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.etl.domain.BasicConfigInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据接入mapper层 BasicConfigInfoMapper
|
||||
* Mapper接口
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/9
|
||||
* @author muyu
|
||||
* @date 2024-04-20
|
||||
*/
|
||||
|
||||
public interface BasicConfigInfoMapper extends BaseMapper<BasicConfigInfo> {
|
||||
public interface BasicConfigInfoMapper extends BaseMapper<BasicConfigInfo>
|
||||
{
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
public BasicConfigInfo selectBasicConfigInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*
|
||||
* @param basicConfigInfo
|
||||
* @return
|
||||
* @return 集合
|
||||
*/
|
||||
List<BasicConfigInfo> selectBasicConfigInfoList(BasicConfigInfo basicConfigInfo);
|
||||
public List<BasicConfigInfo> selectBasicConfigInfoList(BasicConfigInfo basicConfigInfo);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param id
|
||||
* @return
|
||||
* 新增
|
||||
*
|
||||
* @param basicConfigInfo
|
||||
* @return 结果
|
||||
*/
|
||||
BasicConfigInfo selectBasicConfigInfoById(Long id);
|
||||
public int insertBasicConfigInfo(BasicConfigInfo basicConfigInfo);
|
||||
|
||||
int insertBasicConfigInfo(BasicConfigInfo configQueryReq);
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param basicConfigInfo
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasicConfigInfo(BasicConfigInfo basicConfigInfo);
|
||||
|
||||
int updateBasicConfigInfo(BasicConfigInfo configQueryReq);
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasicConfigInfoById(Long id);
|
||||
|
||||
int deleteBasicConfigInfoByIds(Long[] ids);
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasicConfigInfoByIds(Long[] ids);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
package com.muyu.etl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.etl.domain.DictInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典详细内容Mapper接口
|
||||
*
|
||||
* @author Saisai
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface DictInfoMapper extends BaseMapper<DictInfo>
|
||||
{
|
||||
/**
|
||||
* 查询字典详细内容
|
||||
*
|
||||
* @param id 字典详细内容主键
|
||||
* @return 字典详细内容
|
||||
*/
|
||||
public DictInfo selectDictInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询字典详细内容列表
|
||||
*
|
||||
* @param dictInfo 字典详细内容
|
||||
* @return 字典详细内容集合
|
||||
*/
|
||||
public List<DictInfo> selectDictInfoList(DictInfo dictInfo);
|
||||
|
||||
/**
|
||||
* 新增字典详细内容
|
||||
*
|
||||
* @param dictInfo 字典详细内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDictInfo(DictInfo dictInfo);
|
||||
|
||||
/**
|
||||
* 修改字典详细内容
|
||||
*
|
||||
* @param dictInfo 字典详细内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDictInfo(DictInfo dictInfo);
|
||||
|
||||
/**
|
||||
* 删除字典详细内容
|
||||
*
|
||||
* @param id 字典详细内容主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除字典详细内容
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictInfoByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.muyu.etl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.etl.domain.Structure;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 结构Mapper接口
|
||||
*
|
||||
* @author Saisai
|
||||
* @date 2024-04-22
|
||||
*/
|
||||
public interface StructureMapper extends BaseMapper<Structure>
|
||||
{
|
||||
/**
|
||||
* 查询结构
|
||||
*
|
||||
* @param id 结构主键
|
||||
* @return 结构
|
||||
*/
|
||||
public Structure selectStructureById(Long id);
|
||||
|
||||
/**
|
||||
* 查询结构列表
|
||||
*
|
||||
* @param structure 结构
|
||||
* @return 结构集合
|
||||
*/
|
||||
public List<Structure> selectStructureList(Structure structure);
|
||||
|
||||
/**
|
||||
* 新增结构
|
||||
*
|
||||
* @param structure 结构
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStructure(Structure structure);
|
||||
|
||||
/**
|
||||
* 修改结构
|
||||
*
|
||||
* @param structure 结构
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStructure(Structure structure);
|
||||
|
||||
/**
|
||||
* 删除结构
|
||||
*
|
||||
* @param id 结构主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStructureById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除结构
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStructureByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.muyu.etl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.etl.domain.TableInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库表基础信息Mapper接口
|
||||
*
|
||||
* @author Saisai
|
||||
* @date 2024-04-22
|
||||
*/
|
||||
public interface TableInfoMapper extends BaseMapper<TableInfo>
|
||||
{
|
||||
/**
|
||||
* 查询库表基础信息
|
||||
*
|
||||
* @param id 库表基础信息主键
|
||||
* @return 库表基础信息
|
||||
*/
|
||||
public TableInfo selectTableInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询库表基础信息列表
|
||||
*
|
||||
* @param tableInfo 库表基础信息
|
||||
* @return 库表基础信息集合
|
||||
*/
|
||||
public List<TableInfo> selectTableInfoList(TableInfo tableInfo);
|
||||
|
||||
/**
|
||||
* 新增库表基础信息
|
||||
*
|
||||
* @param tableInfo 库表基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTableInfo(TableInfo tableInfo);
|
||||
|
||||
/**
|
||||
* 修改库表基础信息
|
||||
*
|
||||
* @param tableInfo 库表基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTableInfo(TableInfo tableInfo);
|
||||
|
||||
/**
|
||||
* 删除库表基础信息
|
||||
*
|
||||
* @param id 库表基础信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTableInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除库表基础信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTableInfoByIds(Long[] ids);
|
||||
|
||||
|
||||
TableInfo selectTableInfoByName(TableInfo table);
|
||||
}
|
|
@ -1,19 +1,68 @@
|
|||
package com.muyu.etl.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.etl.domain.AssetDataDict;
|
||||
import com.muyu.etl.domain.resp.BasicDictResp;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资产数据字典 AssetDataDictService
|
||||
* 资产数据字典Service接口
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/12
|
||||
* @author Saisai
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface AssetDataDictService {
|
||||
public interface AssetDataDictService extends IService<AssetDataDict>
|
||||
{
|
||||
/**
|
||||
* 查询资产数据字典
|
||||
*
|
||||
* @param id 资产数据字典主键
|
||||
* @return 资产数据字典
|
||||
*/
|
||||
public AssetDataDict selectAssetDataDictById(Long id);
|
||||
|
||||
/**
|
||||
* 查询资产数据字典列表
|
||||
*
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return 资产数据字典集合
|
||||
*/
|
||||
public List<AssetDataDict> selectAssetDataDictList(AssetDataDict assetDataDict);
|
||||
|
||||
/**
|
||||
* 新增资产数据字典
|
||||
*
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean insertAssetDataDict(AssetDataDict assetDataDict) throws ServletException;
|
||||
|
||||
/**
|
||||
* 修改资产数据字典
|
||||
*
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAssetDataDict(AssetDataDict assetDataDict);
|
||||
|
||||
/**
|
||||
* 批量删除资产数据字典
|
||||
*
|
||||
* @param ids 需要删除的资产数据字典主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetDataDictByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除资产数据字典信息
|
||||
*
|
||||
* @param id 资产数据字典主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetDataDictById(Long id);
|
||||
|
||||
List<BasicDictResp> getDict(Long basicId);
|
||||
|
||||
Object insertAssetDataDict(AssetDataDict assetDataDict);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,65 @@
|
|||
package com.muyu.etl.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.etl.domain.AssetImpower;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资产赋权 AssetImpowerService
|
||||
* 资产赋权Service接口
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/12
|
||||
* @author Saisai
|
||||
* @date 2024-04-28
|
||||
*/
|
||||
public interface AssetImpowerService {
|
||||
public interface AssetImpowerService extends IService<AssetImpower>
|
||||
{
|
||||
/**
|
||||
* 查询资产赋权
|
||||
*
|
||||
* @param id 资产赋权主键
|
||||
* @return 资产赋权
|
||||
*/
|
||||
public AssetImpower selectAssetImpowerById(Long id);
|
||||
|
||||
/**
|
||||
* 查询资产赋权列表
|
||||
*
|
||||
* @param assetImpower 资产赋权
|
||||
* @return 资产赋权集合
|
||||
*/
|
||||
public List<AssetImpower> selectAssetImpowerList(AssetImpower assetImpower);
|
||||
|
||||
/**
|
||||
* 新增资产赋权
|
||||
*
|
||||
* @param assetImpower 资产赋权
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAssetImpower(AssetImpower assetImpower);
|
||||
|
||||
/**
|
||||
* 修改资产赋权
|
||||
*
|
||||
* @param assetImpower 资产赋权
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAssetImpower(AssetImpower assetImpower);
|
||||
|
||||
/**
|
||||
* 批量删除资产赋权
|
||||
*
|
||||
* @param ids 需要删除的资产赋权主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetImpowerByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除资产赋权信息
|
||||
*
|
||||
* @param id 资产赋权主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetImpowerById(Long id);
|
||||
|
||||
List<AssetImpower> getPowerByTableId(Long tableId);
|
||||
}
|
||||
|
|
|
@ -2,41 +2,76 @@ package com.muyu.etl.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.etl.domain.BasicConfigInfo;
|
||||
import com.muyu.etl.domain.resp.BasicTableInfoResp;
|
||||
import com.muyu.etl.domain.resp.TableInfoStructureResp;
|
||||
import com.muyu.etl.domain.resp.TableTreeResp;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.sql.rowset.serial.SerialException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据接入的service层 BasicConfigInfoService
|
||||
* Service接口
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/9
|
||||
* @author muyu
|
||||
* @date 2024-04-20
|
||||
*/
|
||||
public interface BasicConfigInfoService extends IService<BasicConfigInfo> {
|
||||
public interface BasicConfigInfoService extends IService<BasicConfigInfo>
|
||||
{
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
public BasicConfigInfo selectBasicConfigInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*
|
||||
* @param basicConfigInfo
|
||||
* @return
|
||||
* @return 集合
|
||||
*/
|
||||
List<BasicConfigInfo> selectBasicConfigInfoList(BasicConfigInfo basicConfigInfo);
|
||||
public List<BasicConfigInfo> selectBasicConfigInfoList(BasicConfigInfo basicConfigInfo);
|
||||
|
||||
BasicConfigInfo selectBasicConfigInfoById(Long id);
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param configQueryReq
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasicConfigInfo(BasicConfigInfo configQueryReq);
|
||||
|
||||
int insertBasicConfigInfo(BasicConfigInfo configQueryReq);
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param basicConfigInfo
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasicConfigInfo(BasicConfigInfo basicConfigInfo);
|
||||
|
||||
int updateBasicConfigInfo(BasicConfigInfo configQueryReq);
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids 需要删除的主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasicConfigInfoByIds(Long[] ids);
|
||||
|
||||
int deleteBasicConfigInfoByIds(Long[] ids);
|
||||
/**
|
||||
* 删除信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasicConfigInfoById(Long id);
|
||||
|
||||
boolean connectionTest(BasicConfigInfo basicConfigInfo) throws ServletException;
|
||||
|
||||
// List getDataByEtl();
|
||||
|
||||
List<TableTreeResp> getTableTree();
|
||||
|
||||
TableInfoStructureResp getTableInfo(Long tableId);
|
||||
|
||||
Object getBasicTableInfo(Long tableId);
|
||||
BasicTableInfoResp getBasicTableInfo(Long tableId);
|
||||
}
|
||||
|
|
|
@ -1,13 +1,64 @@
|
|||
package com.muyu.etl.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.etl.domain.DictInfo;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* DictInfoService
|
||||
* 字典详细内容Service接口
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/12
|
||||
* @author Saisai
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface DictInfoService {
|
||||
Object insertDictInfo(DictInfo dictInfo);
|
||||
public interface DictInfoService extends IService<DictInfo>
|
||||
{
|
||||
/**
|
||||
* 查询字典详细内容
|
||||
*
|
||||
* @param id 字典详细内容主键
|
||||
* @return 字典详细内容
|
||||
*/
|
||||
public DictInfo selectDictInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询字典详细内容列表
|
||||
*
|
||||
* @param dictInfo 字典详细内容
|
||||
* @return 字典详细内容集合
|
||||
*/
|
||||
public List<DictInfo> selectDictInfoList(DictInfo dictInfo);
|
||||
|
||||
/**
|
||||
* 新增字典详细内容
|
||||
*
|
||||
* @param dictInfo 字典详细内容
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean insertDictInfo(DictInfo dictInfo) throws ServletException;
|
||||
|
||||
/**
|
||||
* 修改字典详细内容
|
||||
*
|
||||
* @param dictInfo 字典详细内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDictInfo(DictInfo dictInfo);
|
||||
|
||||
/**
|
||||
* 批量删除字典详细内容
|
||||
*
|
||||
* @param ids 需要删除的字典详细内容主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除字典详细内容信息
|
||||
*
|
||||
* @param id 字典详细内容主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictInfoById(Long id);
|
||||
}
|
||||
|
|
|
@ -6,48 +6,60 @@ import com.muyu.etl.domain.Structure;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 结构 StructureService
|
||||
* 结构Service接口
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/12
|
||||
* @author Saisai
|
||||
* @date 2024-04-22
|
||||
*/
|
||||
public interface StructureService extends IService<Structure> {
|
||||
|
||||
public interface StructureService extends IService<Structure>
|
||||
{
|
||||
/**
|
||||
* 查询结构
|
||||
*
|
||||
* @param id 结构主键
|
||||
* @return 结构
|
||||
*/
|
||||
public Structure selectStructureById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询结构列表
|
||||
*
|
||||
* @param structure 结构
|
||||
* @return 结构集合
|
||||
*/
|
||||
public List<Structure> selectStructureList(Structure structure);
|
||||
|
||||
|
||||
/**
|
||||
* 新增结构
|
||||
*
|
||||
* @param structure 结构
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStructure(Structure structure);
|
||||
|
||||
|
||||
/**
|
||||
* 修改结构
|
||||
*
|
||||
* @param structure 结构
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStructure(Structure structure);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除结构
|
||||
*
|
||||
* @param ids 需要删除的结构主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStructureByIds(Long[] ids);
|
||||
|
||||
|
||||
/**
|
||||
* 删除结构信息
|
||||
*
|
||||
* @param id 结构主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStructureById(Long id);
|
||||
|
||||
boolean updateStructureInfoDict(Structure structure);
|
||||
|
||||
}
|
||||
|
|
|
@ -6,47 +6,61 @@ import com.muyu.etl.domain.TableInfo;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库表基础信息 TableInfoService
|
||||
* 库表基础信息Service接口
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/12
|
||||
* @author Saisai
|
||||
* @date 2024-04-22
|
||||
*/
|
||||
public interface TableInfoService extends IService<TableInfo> {
|
||||
|
||||
public interface TableInfoService extends IService<TableInfo>
|
||||
{
|
||||
/**
|
||||
* 查询库表基础信息
|
||||
*
|
||||
* @param id 库表基础信息主键
|
||||
* @return 库表基础信息
|
||||
*/
|
||||
public TableInfo selectTableInfoById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询库表基础信息列表
|
||||
*
|
||||
* @param tableInfo 库表基础信息
|
||||
* @return 库表基础信息集合
|
||||
*/
|
||||
public List<TableInfo> selectTableInfoList(TableInfo tableInfo);
|
||||
|
||||
|
||||
/**
|
||||
* 新增库表基础信息
|
||||
*
|
||||
* @param tableInfo 库表基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTableInfo(TableInfo tableInfo);
|
||||
|
||||
|
||||
/**
|
||||
* 修改库表基础信息
|
||||
*
|
||||
* @param tableInfo 库表基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTableInfo(TableInfo tableInfo);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除库表基础信息
|
||||
*
|
||||
* @param ids 需要删除的库表基础信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTableInfoByIds(Long[] ids);
|
||||
|
||||
|
||||
/**
|
||||
* 删除库表基础信息
|
||||
* 删除库表基础信息信息
|
||||
*
|
||||
* @param id 库表基础信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTableInfoById(Long id);
|
||||
|
||||
TableInfo selectTableInfoByName(TableInfo build);
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,136 @@
|
|||
package com.muyu.etl.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.etl.domain.AssetDataDict;
|
||||
import com.muyu.etl.domain.DictInfo;
|
||||
import com.muyu.etl.domain.resp.BasicDictResp;
|
||||
import com.muyu.etl.mapper.AssetDataDictMapper;
|
||||
import com.muyu.etl.service.AssetDataDictService;
|
||||
import com.muyu.etl.service.DictInfoService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 资产数据字典 AssetDataDictServiceImpl
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/13
|
||||
*/
|
||||
|
||||
@Service
|
||||
@Log4j2
|
||||
public class AssetDataDictServiceImpl extends ServiceImpl<AssetDataDictMapper, AssetDataDict> implements AssetDataDictService {
|
||||
|
||||
@Autowired
|
||||
private AssetDataDictMapper assetDataDictMapper;
|
||||
|
||||
@Autowired
|
||||
private DictInfoService dictInfoService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询资产数据字典
|
||||
* @param id 资产数据字典主键
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AssetDataDict selectAssetDataDictById(Long id) {
|
||||
return assetDataDictMapper.selectAssetDataDictById(id);
|
||||
}
|
||||
|
||||
|
||||
//查询资产数据字典列表
|
||||
@Override
|
||||
public List<AssetDataDict> selectAssetDataDictList(AssetDataDict assetDataDict) {
|
||||
return assetDataDictMapper.selectAssetDataDictList(assetDataDict);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增资产
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return
|
||||
* @throws ServletException
|
||||
*/
|
||||
@Override
|
||||
public boolean insertAssetDataDict(AssetDataDict assetDataDict) throws ServletException {
|
||||
assetDataDict.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
AssetDataDict one = this.getOne(new LambdaUpdateWrapper<>(AssetDataDict.class){{
|
||||
eq(AssetDataDict::getDictType,assetDataDict.getDictType());
|
||||
eq(AssetDataDict::getBasicId,assetDataDict.getBasicId());
|
||||
}});
|
||||
|
||||
if (one!=null){
|
||||
throw new ServletException("该字典已存在");
|
||||
}
|
||||
|
||||
return this.saveOrUpdate(assetDataDict,new LambdaUpdateWrapper<>(AssetDataDict.class){{
|
||||
eq(AssetDataDict::getDictType,assetDataDict.getDictType());
|
||||
eq(AssetDataDict::getBasicId,assetDataDict.getBasicId());
|
||||
}});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资产数据字典
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int updateAssetDataDict(AssetDataDict assetDataDict) {
|
||||
assetDataDict.setUpdateTime(DateUtils.getNowDate());
|
||||
return assetDataDictMapper.updateAssetDataDict(assetDataDict);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids 需要删除的资产数据字典主键集合
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int deleteAssetDataDictByIds(Long[] ids) {
|
||||
return assetDataDictMapper.deleteAssetDataDictByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除资产
|
||||
* @param id 资产数据字典主键
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int deleteAssetDataDictById(Long id) {
|
||||
return assetDataDictMapper.deleteAssetDataDictById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BasicDictResp> getDict(Long basicId) {
|
||||
List<AssetDataDict> list = this.list(new LambdaUpdateWrapper<AssetDataDict>(){{
|
||||
eq(AssetDataDict :: getBasicId, basicId);
|
||||
or(assetDataDictLambdaUpdateWrapper -> assetDataDictLambdaUpdateWrapper.eq(AssetDataDict::getId, 1L));
|
||||
}});
|
||||
|
||||
List<BasicDictResp> collect = list.stream().map(assetDataDict -> {
|
||||
List<DictInfo> dictInfoList = dictInfoService.list(
|
||||
new LambdaUpdateWrapper<DictInfo>()
|
||||
.eq(DictInfo::getDictId,assetDataDict.getId())
|
||||
);
|
||||
|
||||
return BasicDictResp.builder()
|
||||
.id(assetDataDict.getId())
|
||||
.dictType(assetDataDict.getDictType())
|
||||
.dictName(assetDataDict.getDictName())
|
||||
.dictInfoList(dictInfoList)
|
||||
.basicId(assetDataDict.getBasicId())
|
||||
.build();
|
||||
}).collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
package com.muyu.etl.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.constant.SecurityConstants;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.system.domain.SysDept;
|
||||
import com.muyu.common.system.remote.RemoteFileService;
|
||||
import com.muyu.common.system.remote.RemoteUserService;
|
||||
import com.muyu.etl.domain.AssetImpower;
|
||||
import com.muyu.etl.mapper.AssetImpowerMapper;
|
||||
import com.muyu.etl.service.AssetImpowerService;
|
||||
import com.muyu.etl.service.TableInfoService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资产赋权 AssetImpowerServiceImpl
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/13
|
||||
*/
|
||||
|
||||
@Service
|
||||
@Log4j2
|
||||
public class AssetImpowerServiceImpl extends ServiceImpl<AssetImpowerMapper, AssetImpower> implements AssetImpowerService {
|
||||
|
||||
@Autowired
|
||||
private AssetImpowerMapper assetImpowerMapper;
|
||||
|
||||
@Autowired
|
||||
private TableInfoService tableInfoService;
|
||||
|
||||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
/**
|
||||
* 查询资产赋权
|
||||
* @param id 资产赋权主键
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AssetImpower selectAssetImpowerById(Long id) {
|
||||
return assetImpowerMapper.selectAssetImpowerById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询资产赋权列表
|
||||
* @param assetImpower 资产赋权
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<AssetImpower> selectAssetImpowerList(AssetImpower assetImpower) {
|
||||
return assetImpowerMapper.selectAssetImpowerList(assetImpower);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增资产赋权
|
||||
* @param assetImpower 资产赋权
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int insertAssetImpower(AssetImpower assetImpower) {
|
||||
List<AssetImpower> rows = new ArrayList<>();
|
||||
assetImpower.setCreateTime(DateUtils.getNowDate());
|
||||
//创建一个部门容器和用户容器
|
||||
List<SysDept> deptList = remoteUserService.list(new SysDept(), SecurityConstants.INNER).getData();
|
||||
System.out.println(remoteUserService.list(new SysDept(), SecurityConstants.INNER));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateAssetImpower(AssetImpower assetImpower) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAssetImpowerByIds(Long[] ids) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAssetImpowerById(Long id) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AssetImpower> getPowerByTableId(Long tableId) {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -1,40 +1,44 @@
|
|||
package com.muyu.etl.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.etl.domain.BasicConfigInfo;
|
||||
import com.muyu.etl.domain.Structure;
|
||||
import com.muyu.etl.domain.TableInfo;
|
||||
import com.muyu.etl.domain.resp.BasicTableInfoResp;
|
||||
import com.muyu.etl.domain.resp.TableInfoStructureResp;
|
||||
import com.muyu.etl.domain.resp.TableTreeResp;
|
||||
import com.muyu.etl.mapper.BasicConfigInfoMapper;
|
||||
import com.muyu.etl.service.BasicConfigInfoService;
|
||||
import com.muyu.etl.service.StructureService;
|
||||
import com.muyu.etl.service.TableInfoService;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import net.sf.jsqlparser.schema.Table;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.sql.rowset.serial.SerialException;
|
||||
import java.sql.*;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 数据接入 BasicConfigInfoServiceImpl
|
||||
* Service业务层处理
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/9
|
||||
* @author muyu
|
||||
* @date 2024-04-20
|
||||
*/
|
||||
@Service
|
||||
@Log4j2
|
||||
public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMapper, BasicConfigInfo> implements BasicConfigInfoService {
|
||||
|
||||
@Autowired
|
||||
private BasicConfigInfoMapper basicConfigInfoMapper;
|
||||
|
||||
|
@ -44,52 +48,83 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMappe
|
|||
@Autowired
|
||||
private TableInfoService tableInfoService;
|
||||
|
||||
@Autowired
|
||||
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param basicConfigInfo
|
||||
* 查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BasicConfigInfo> selectBasicConfigInfoList(BasicConfigInfo basicConfigInfo) {
|
||||
|
||||
return basicConfigInfoMapper.selectBasicConfigInfoList(basicConfigInfo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BasicConfigInfo selectBasicConfigInfoById(Long id) {
|
||||
return basicConfigInfoMapper.selectBasicConfigInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*
|
||||
* @param basicConfigInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BasicConfigInfo> selectBasicConfigInfoList(BasicConfigInfo basicConfigInfo) {
|
||||
return basicConfigInfoMapper.selectBasicConfigInfoList(basicConfigInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param configQueryReq
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBasicConfigInfo(BasicConfigInfo configQueryReq) {
|
||||
return basicConfigInfoMapper.insertBasicConfigInfo(configQueryReq);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param configQueryReq
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBasicConfigInfo(BasicConfigInfo configQueryReq) {
|
||||
return basicConfigInfoMapper.updateBasicConfigInfo(configQueryReq);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids 需要删除的主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasicConfigInfoByIds(Long[] ids) {
|
||||
return basicConfigInfoMapper.deleteBasicConfigInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试练级并同步
|
||||
* 删除信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasicConfigInfoById(Long id) {
|
||||
return basicConfigInfoMapper.deleteBasicConfigInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试连接并同步
|
||||
*
|
||||
* @param basicConfigInfo
|
||||
* @return
|
||||
* @throws SerialException
|
||||
* @throws ServletException
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean connectionTest(BasicConfigInfo basicConfigInfo) throws ServletException {
|
||||
|
||||
//定义下面需要的对象
|
||||
String host = basicConfigInfo.getHost();
|
||||
String port = basicConfigInfo.getPort();
|
||||
|
@ -99,13 +134,11 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMappe
|
|||
String user = basicConfigInfo.getUsername();
|
||||
String password = basicConfigInfo.getPassword();
|
||||
Connection conn = null;
|
||||
|
||||
try {
|
||||
conn = DriverManager.getConnection(url,user,password);
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
System.out.println("Connected to the MySQL server successfully.");
|
||||
|
||||
//同步数据库信息
|
||||
//树级结构 库 表
|
||||
//树级结构,库,表
|
||||
TableInfo tableInfoInsert = TableInfo.builder()
|
||||
.basicId(basicConfigInfo.getId())
|
||||
.parentId(0L)
|
||||
|
@ -116,19 +149,17 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMappe
|
|||
.createBy(SecurityUtils.getUsername())
|
||||
.createTime(new Date())
|
||||
.build();
|
||||
|
||||
tableInfoService.saveOrUpdate(tableInfoInsert,new LambdaUpdateWrapper<>(TableInfo.class) {{
|
||||
eq(TableInfo::getTableName,tableInfoInsert.getTableName());
|
||||
eq(TableInfo::getBasicId,basicConfigInfo.getId());
|
||||
tableInfoService.saveOrUpdate(tableInfoInsert, new LambdaUpdateWrapper<TableInfo>(TableInfo.class) {{
|
||||
eq(TableInfo::getTableName, tableInfoInsert.getTableName());
|
||||
eq(TableInfo::getBasicId, basicConfigInfo.getId());
|
||||
}});
|
||||
|
||||
//查询列表中的所有tableinfo basiac_id 不存在删除
|
||||
//通过查询获取当前tableinfo对象的id
|
||||
|
||||
//查询列表中的所有tableInfo basic_id 不存在删除
|
||||
//通过查询或去当前tableinfo对象的id
|
||||
TableInfo tableInfo = tableInfoService.selectTableInfoByName(tableInfoInsert);
|
||||
DatabaseMetaData metaData = conn.getMetaData();
|
||||
ResultSet rs = metaData.getTables(databaseName, null, "%", new String[]{"TABLE", "VIEW"});
|
||||
while (rs.next()){
|
||||
ResultSet rs = metaData.getTables(databaseName,
|
||||
null, "%", new String[]{"TABLE", "VIEW"});
|
||||
while (rs.next()) {
|
||||
//表名
|
||||
String tableName = rs.getString("TABLE_NAME");
|
||||
String tableRemark = rs.getString("REMARKS");
|
||||
|
@ -136,13 +167,13 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMappe
|
|||
PreparedStatement ps = conn.prepareStatement("select * from " + tableName);
|
||||
ResultSet rset = ps.executeQuery();
|
||||
Long rowCount = 0L;
|
||||
while (rset.next()){
|
||||
while (rset.next()) {
|
||||
rowCount++;
|
||||
}
|
||||
|
||||
TableInfo build = TableInfo.builder()
|
||||
.basicId(basicConfigInfo.getId())
|
||||
.tableName(tableName)
|
||||
//bug点,tableRemark为空,造成空指针异常
|
||||
.tableRemark(tableRemark == null ? "" : tableRemark)
|
||||
.parentId(tableInfo.getId())
|
||||
.type("dataTable")
|
||||
|
@ -151,38 +182,58 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMappe
|
|||
.dataNum(rowCount)
|
||||
.updateTime(new Date())
|
||||
.build();
|
||||
|
||||
tableInfoService.saveOrUpdate(build,new LambdaUpdateWrapper<>(TableInfo.class) {{
|
||||
tableInfoService.saveOrUpdate(build, new LambdaUpdateWrapper<>(TableInfo.class) {{
|
||||
eq(TableInfo::getTableName, build.getTableName());
|
||||
eq(TableInfo::getBasicId, basicConfigInfo.getId());
|
||||
}});
|
||||
|
||||
TableInfo table = tableInfoService.selectTableInfoByName(build);
|
||||
//线程池
|
||||
ExecutorService threadPool = Executors.newCachedThreadPool();
|
||||
|
||||
threadPool.submit(() ->{
|
||||
|
||||
})
|
||||
|
||||
threadPool.submit(() -> {
|
||||
try {
|
||||
syncData(finalConn, databaseName, table);
|
||||
} catch (SQLException e) {
|
||||
try {
|
||||
throw new ServletException("同步数据失败");
|
||||
} catch (ServletException ex) {
|
||||
throw new RuntimeException(ex.getMessage());
|
||||
}
|
||||
}
|
||||
});
|
||||
Runnable thread = new Runnable() {
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
//同步
|
||||
syncData(finalConn, databaseName, table);
|
||||
} catch (SQLException e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServletException("连接失败");
|
||||
}
|
||||
}
|
||||
};
|
||||
thread.run();
|
||||
ps.close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
log.error(e.getMessage());
|
||||
throw new ServletException("连接失败");
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 同步数据
|
||||
* @return
|
||||
*
|
||||
* @param conn
|
||||
* @param databaseName
|
||||
* @param table
|
||||
* @throws SQLException
|
||||
*/
|
||||
public void syncData(Connection conn,String databaseName,TableInfo table) throws SQLException{
|
||||
public void syncData(Connection conn, String databaseName, TableInfo table) throws SQLException {
|
||||
ExecutorService threadPool = Executors.newCachedThreadPool();
|
||||
PreparedStatement ps = conn.prepareStatement(
|
||||
" SELECT " +
|
||||
|
@ -206,10 +257,12 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMappe
|
|||
"FROM INFORMATION_SCHEMA.COLUMNS WHERE \n" +
|
||||
"TABLE_SCHEMA = '" + databaseName + "' -- 替换为你的数据库名称 \n" +
|
||||
"AND TABLE_NAME = '" + table.getTableName() + "'");
|
||||
|
||||
// "SELECT COLUMN_NAME,DATA_TYPE,IS_NULLABLE,COLUMN_KEY,COLUMN_DEFAULT,
|
||||
// COLUMN_COMMENT,CHARACTER_MAXIMUM_LENGTH,NUMERIC_PRECISION,
|
||||
// NUMERIC_SCALE FROM INFORMATION_SCHEMA.COLUMNS
|
||||
// WHERE TABLE_SCHEMA = '数据库名' AND TABLE_NAME = '表名'"
|
||||
ResultSet resultSet = ps.executeQuery();
|
||||
|
||||
while (resultSet.next()){
|
||||
while (resultSet.next()) {
|
||||
String columnName = String.valueOf(resultSet.getString(1));
|
||||
String columnComment = String.valueOf(resultSet.getObject(2));
|
||||
String columnKey = String.valueOf(resultSet.getObject(3));
|
||||
|
@ -233,12 +286,11 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMappe
|
|||
.isNull("YES".equals(isNullable) ? "Y" : "N")
|
||||
.defaultValue(columnDefault)
|
||||
.build();
|
||||
|
||||
threadPool.submit(() -> {
|
||||
structureService.saveOrUpdate(build,new LambdaUpdateWrapper<>(){{
|
||||
eq(Structure::getTableId,build.getTableId());
|
||||
eq(Structure::getColumnName,build.getColumnName());
|
||||
eq(Structure::getColumnDecimals,build.getColumnRemark());
|
||||
structureService.saveOrUpdate(build, new LambdaUpdateWrapper<Structure>() {{
|
||||
eq(Structure::getTableId, build.getTableId());
|
||||
eq(Structure::getColumnName, build.getColumnName());
|
||||
eq(Structure::getColumnRemark, build.getColumnRemark());
|
||||
}});
|
||||
});
|
||||
}
|
||||
|
@ -246,14 +298,113 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMappe
|
|||
ps.close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取响应体对象
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<TableTreeResp> getTableTree() {
|
||||
ExecutorService threadPool = Executors.newCachedThreadPool();
|
||||
List<TableTreeResp> tableTreeRespList = tableInfoService.selectTableInfoList(new TableInfo() {{
|
||||
setParentId(0L);
|
||||
}}).stream().map(tableInfo -> {
|
||||
BasicConfigInfo basicConfigInfo = this.selectBasicConfigInfoById(tableInfo.getBasicId());
|
||||
List<TableInfoStructureResp> tableInfoStructureRespList = tableInfoService.selectTableInfoList(new TableInfo() {{
|
||||
setParentId(tableInfo.getId());
|
||||
}}).stream().map(info -> {
|
||||
TableInfoStructureResp tableInfoStructureResp = null;
|
||||
Future<TableInfoStructureResp> submit = threadPool.submit(() -> {
|
||||
return TableInfoStructureResp.builder()
|
||||
.id(info.getId())
|
||||
.tableName(info.getTableName())
|
||||
.center(info.getCenter())
|
||||
.tableRemark(info.getTableRemark())
|
||||
.type(info.getType())
|
||||
.dataNum(info.getDataNum())
|
||||
.parentId(info.getParentId())
|
||||
.databaseType(basicConfigInfo.getDatabaseType())
|
||||
.structureList(null)
|
||||
.basicId(info.getBasicId())
|
||||
.build();
|
||||
});
|
||||
try {
|
||||
tableInfoStructureResp = submit.get();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return tableInfoStructureResp;
|
||||
}).collect(Collectors.toList());
|
||||
return TableTreeResp.builder()
|
||||
.tableInfo(tableInfo)
|
||||
.basicConfigInfo(basicConfigInfo)
|
||||
.Children(tableInfoStructureRespList)
|
||||
.build();
|
||||
}).collect(Collectors.toList());
|
||||
threadPool.shutdown();
|
||||
while (true) if (threadPool.isTerminated()) break;
|
||||
|
||||
|
||||
return tableTreeRespList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableInfoStructureResp getTableInfo(Long tableId) {
|
||||
TableInfo tableInfo = tableInfoService.selectTableInfoById(tableId);
|
||||
BasicConfigInfo basicConfigInfo = this.selectBasicConfigInfoById(tableInfo.getBasicId());
|
||||
List<Structure> structureList = structureService.list(new LambdaQueryWrapper<Structure>()
|
||||
.eq(Structure::getTableId, tableInfo.getId()));
|
||||
return TableInfoStructureResp.builder()
|
||||
.id(tableInfo.getId())
|
||||
.tableName(tableInfo.getTableName())
|
||||
.center(tableInfo.getCenter())
|
||||
.tableRemark(tableInfo.getTableRemark())
|
||||
.dataNum(tableInfo.getDataNum())
|
||||
.parentId(tableInfo.getParentId())
|
||||
.databaseType(basicConfigInfo.getDatabaseType())
|
||||
.structureList(structureList)
|
||||
.basicId(tableInfo.getBasicId())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BasicTableInfoResp getBasicTableInfo(Long tableId) {
|
||||
TableInfo tableInfo = tableInfoService.selectTableInfoById(tableId);
|
||||
BasicConfigInfo basicConfigInfo = this.selectBasicConfigInfoById(tableInfo.getBasicId());
|
||||
String host = basicConfigInfo.getHost();
|
||||
String port = basicConfigInfo.getPort();
|
||||
String databaseName = basicConfigInfo.getDatabaseName();
|
||||
String databaseType = basicConfigInfo.getDatabaseType();
|
||||
String url = "jdbc:" + databaseType + "://" + host + ":" + port + "/" + databaseName + "?" + basicConfigInfo.getConnectionParams();
|
||||
String user = basicConfigInfo.getUsername();
|
||||
String password = basicConfigInfo.getPassword();
|
||||
Long totalNum = null;
|
||||
BasicTableInfoResp basicTableInfoResp = null;
|
||||
Connection conn = null;
|
||||
try {
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
PreparedStatement ps = conn.prepareStatement("select Count(0) from " + tableInfo.getTableName());
|
||||
ResultSet resultSet = ps.executeQuery();
|
||||
while (resultSet.next()){
|
||||
String a = String.valueOf(resultSet.getObject(1));
|
||||
totalNum = resultSet.getLong(1);
|
||||
}
|
||||
basicTableInfoResp = BasicTableInfoResp.builder()
|
||||
.dataResourceName(basicConfigInfo.getDataResourceName())
|
||||
.dataSourcesSystemName(basicConfigInfo.getDataSourcesSystemName())
|
||||
.databaseName(basicConfigInfo.getDatabaseName())
|
||||
.tableName(tableInfo.getTableName())
|
||||
.tableRemark(tableInfo.getTableRemark())
|
||||
.id(tableId)
|
||||
.basicId(basicConfigInfo.getId())
|
||||
.totalNum(totalNum)
|
||||
.build();
|
||||
ps.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return basicTableInfoResp;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
package com.muyu.etl.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.etl.domain.Structure;
|
||||
import com.muyu.etl.mapper.StructureMapper;
|
||||
import com.muyu.etl.service.StructureService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 结构Service业务层处理
|
||||
*
|
||||
* @author Saisai
|
||||
* @date 2024-04-22
|
||||
*/
|
||||
@Service
|
||||
@Log4j2
|
||||
public class StructureServiceImpl extends ServiceImpl<StructureMapper, Structure> implements StructureService
|
||||
{
|
||||
@Autowired
|
||||
private StructureMapper structureMapper;
|
||||
|
||||
/**
|
||||
* 查询结构
|
||||
*
|
||||
* @param id 结构主键
|
||||
* @return 结构
|
||||
*/
|
||||
@Override
|
||||
public Structure selectStructureById(Long id)
|
||||
{
|
||||
return structureMapper.selectStructureById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询结构列表
|
||||
*
|
||||
* @param structure 结构
|
||||
* @return 结构
|
||||
*/
|
||||
@Override
|
||||
public List<Structure> selectStructureList(Structure structure)
|
||||
{
|
||||
return structureMapper.selectStructureList(structure);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增结构
|
||||
*
|
||||
* @param structure 结构
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertStructure(Structure structure)
|
||||
{
|
||||
structure.setCreateTime(DateUtils.getNowDate());
|
||||
return structureMapper.insertStructure(structure);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改结构
|
||||
*
|
||||
* @param structure 结构
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateStructure(Structure structure)
|
||||
{
|
||||
structure.setUpdateTime(DateUtils.getNowDate());
|
||||
return structureMapper.updateStructure(structure);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除结构
|
||||
*
|
||||
* @param ids 需要删除的结构主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteStructureByIds(Long[] ids)
|
||||
{
|
||||
return structureMapper.deleteStructureByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除结构信息
|
||||
*
|
||||
* @param id 结构主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteStructureById(Long id)
|
||||
{
|
||||
return structureMapper.deleteStructureById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateStructureInfoDict(Structure structure) {
|
||||
if ("N".equals(structure.getIsDictionary())){
|
||||
structure.setDictionaryTable("");
|
||||
}
|
||||
return this.saveOrUpdate(structure);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
package com.muyu.etl.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.etl.domain.TableInfo;
|
||||
import com.muyu.etl.mapper.TableInfoMapper;
|
||||
import com.muyu.etl.service.StructureService;
|
||||
import com.muyu.etl.service.TableInfoService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库表基础信息 TableInfoServiceImpl
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/5/13
|
||||
*/
|
||||
@Log4j2
|
||||
@Service
|
||||
public class TableInfoServiceImpl extends ServiceImpl<TableInfoMapper, TableInfo> implements TableInfoService {
|
||||
|
||||
@Autowired
|
||||
private TableInfoMapper tableInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private StructureService structureService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询库表基础信息
|
||||
*/
|
||||
@Override
|
||||
public TableInfo selectTableInfoById(Long id){
|
||||
return tableInfoMapper.selectTableInfoById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询库表基础信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<TableInfo> selectTableInfoList(TableInfo tableInfo){
|
||||
return tableInfoMapper.selectTableInfoList(tableInfo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增库表基础信息
|
||||
*/
|
||||
@Override
|
||||
public int insertTableInfo(TableInfo tableInfo){
|
||||
tableInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return tableInfoMapper.insertTableInfo(tableInfo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@Override
|
||||
public int updateTableInfo(TableInfo tableInfo){
|
||||
tableInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return tableInfoMapper.updateTableInfo(tableInfo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
@Override
|
||||
public int deleteTableInfoByIds(Long[] ids){
|
||||
return tableInfoMapper.deleteTableInfoByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@Override
|
||||
public int deleteTableInfoById(Long id){
|
||||
return tableInfoMapper.deleteTableInfoById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public TableInfo selectTableInfoByName(TableInfo table){
|
||||
return tableInfoMapper.selectTableInfoByName(table);
|
||||
}
|
||||
}
|
|
@ -1,13 +1,29 @@
|
|||
<?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">
|
||||
<?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.muyu.etl.mapper.BasicConfigInfoMapper">
|
||||
|
||||
<resultMap type="com.muyu.etl.domain.BasicConfigInfo" id="BasicConfigInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="dataResourceName" column="data_resource_name" />
|
||||
<result property="dataSourcesSystemName" column="data_sources_system_name" />
|
||||
<result property="host" column="host" />
|
||||
<result property="port" column="port" />
|
||||
<result property="databaseType" column="database_type" />
|
||||
<result property="databaseName" column="database_name" />
|
||||
<result property="initLinkNum" column="init_link_num" />
|
||||
<result property="maxLinkNum" column="max_link_num" />
|
||||
<result property="maxWaitTime" column="max_wait_time" />
|
||||
<result property="maxWaitTimes" column="max_wait_times" />
|
||||
<result property="connectionParams" column="connection_params" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBasicConfigInfoVo">
|
||||
select id, data_resource_name,username,password, data_sources_system_name, host, port, database_type, database_name, init_link_num, max_link_num, max_wait_time, max_wait_times,connection_params, remark from basic_config_info
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectBasicConfigInfoList" parameterType="com.muyu.etl.domain.BasicConfigInfo" resultMap="BasicConfigInfoResult">
|
||||
<include refid="selectBasicConfigInfoVo"/>
|
||||
<where>
|
||||
|
@ -26,84 +42,78 @@
|
|||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectBasicConfigInfoById" parameterType="Long" resultMap="BasicConfigInfoResult">
|
||||
<include refid="selectBasicConfigInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<insert id="insertBasicConfigInfo" parameterType="com.muyu.etl.domain.BasicConfigInfo">
|
||||
insert into basic_config_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="dataResourceName != null">data_resource_name,</if>
|
||||
<if test="dataSourcesSystemName != null">data_sources_system_name,</if>
|
||||
<if test="host != null">host,</if>
|
||||
<if test="port != null">port,</if>
|
||||
<if test="databaseType != null">database_type,</if>
|
||||
<if test="databaseName != null">database_name,</if>
|
||||
<if test="username != null">username,</if>
|
||||
<if test="password != null">password</if>
|
||||
<if test="initeLinkNum != null">init_link_num,</if>
|
||||
<if test="maxLinkNum != null">max_link_num,</if>
|
||||
<if test="maxWaitTime != null">max_wait_time,</if>
|
||||
<if test="maxWaitTimes != null">max_wait_times,</if>
|
||||
<if test="connextionParams != null">connection_params,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id !=null">#{id},</if>
|
||||
<if test="dataResourceName != null">#{dataResourceName},</if>
|
||||
<if test="dataSourcesSystemName !=null">#{dataSourcesSystemName},</if>
|
||||
<if test="host != null">#{host},</if>
|
||||
<if test="port != null">#{port},</if>
|
||||
<if test="databaseType != null">#{databaseType},</if>
|
||||
<if test="databaseName != null">#{databaseName},</if>
|
||||
<if test="username != null">#{username},</if>
|
||||
<if test="password != null">#{password},</if>
|
||||
<if test="initLinkNum != null">#{initLinkNum},</if>
|
||||
<if test="maxLinkNum != null">#{maxLinkNum},</if>
|
||||
<if test="maxWaitTime != null">#{maxWaitTime},</if>
|
||||
<if test="maxWaitTimes != null">#{maxWaitTimes},</if>
|
||||
<if test="connectionParams != null">#{connectionParams},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
|
||||
insert into basic_config_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="dataResourceName != null">data_resource_name,</if>
|
||||
<if test="dataSourcesSystemName != null">data_sources_system_name,</if>
|
||||
<if test="host != null">host,</if>
|
||||
<if test="port != null">port,</if>
|
||||
<if test="databaseType != null">database_type,</if>
|
||||
<if test="databaseName != null">database_name,</if>
|
||||
<if test="username != null">username,</if>
|
||||
<if test="password != null">password,</if>
|
||||
<if test="initLinkNum != null">init_link_num,</if>
|
||||
<if test="maxLinkNum != null">max_link_num,</if>
|
||||
<if test="maxWaitTime != null">max_wait_time,</if>
|
||||
<if test="maxWaitTimes != null">max_wait_times,</if>
|
||||
<if test="connectionParams != null">connection_params,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="dataResourceName != null">#{dataResourceName},</if>
|
||||
<if test="dataSourcesSystemName != null">#{dataSourcesSystemName},</if>
|
||||
<if test="host != null">#{host},</if>
|
||||
<if test="port != null">#{port},</if>
|
||||
<if test="databaseType != null">#{databaseType},</if>
|
||||
<if test="databaseName != null">#{databaseName},</if>
|
||||
<if test="username != null">#{username},</if>
|
||||
<if test="password != null">#{password},</if>
|
||||
<if test="initLinkNum != null">#{initLinkNum},</if>
|
||||
<if test="maxLinkNum != null">#{maxLinkNum},</if>
|
||||
<if test="maxWaitTime != null">#{maxWaitTime},</if>
|
||||
<if test="maxWaitTimes != null">#{maxWaitTimes},</if>
|
||||
<if test="connectionParams != null">#{connectionParams},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateBasicConfigInfo" parameterType="com.muyu.etl.domain.BasicConfigInfo">
|
||||
update basic_config_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="dataResourceName !=null">data_resource_name = #{dataResourceName},</if>
|
||||
<if test="dataSourcesSystemName != null">data_sources_system_name = #{dataSourcesSystemName},</if>
|
||||
<if test="host != null">host = #{host},</if>
|
||||
<if test="port != null">port =#{port},</if>
|
||||
<if test="databaseType != null">database_type = #{databaseType},</if>
|
||||
<if test="databaseName != null">database_name =#{databaseName},</if>
|
||||
<if test="username != null">username =#{username},</if>
|
||||
<if test="password != null">password = #{password},</if>
|
||||
<if test="initLinkNum != null">init_link_num = #{initLinkNum},</if>
|
||||
<if test="maxLinkNum != null">max_link_num = #{maxLinkNum},</if>
|
||||
<if test="maxWaitTime != null">max_wait_time=#{maxWaitTime},</if>
|
||||
<if test="maxWaitTimes != null">max_wait_times = #{maxWaitTimes},</if>
|
||||
<if test="connectionParams != null">connection_params = #{connectionParams},</if>
|
||||
<if test="remark != null">remark =#{remark},</if>
|
||||
|
||||
</trim>
|
||||
where id = #{id}
|
||||
|
||||
update basic_config_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="dataResourceName != null">data_resource_name = #{dataResourceName},</if>
|
||||
<if test="dataSourcesSystemName != null">data_sources_system_name = #{dataSourcesSystemName},</if>
|
||||
<if test="host != null">host = #{host},</if>
|
||||
<if test="port != null">port = #{port},</if>
|
||||
<if test="databaseType != null">database_type = #{databaseType},</if>
|
||||
<if test="databaseName != null">database_name = #{databaseName},</if>
|
||||
<if test="username != null">username = #{username},</if>
|
||||
<if test="password != null">password = #{password},</if>
|
||||
<if test="initLinkNum != null">init_link_num = #{initLinkNum},</if>
|
||||
<if test="maxLinkNum != null">max_link_num = #{maxLinkNum},</if>
|
||||
<if test="maxWaitTime != null">max_wait_time = #{maxWaitTime},</if>
|
||||
<if test="maxWaitTimes != null">max_wait_times = #{maxWaitTimes},</if>
|
||||
<if test="connectionParams != null">connection_params = #{connectionParams},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<delete id="deleteBasicConfigInfoByIds" parameterType="String">
|
||||
delete from basic_config_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
<delete id="deleteBasicConfigInfoById" parameterType="Long">
|
||||
delete from basic_config_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBasicConfigInfoByIds" parameterType="String">
|
||||
delete from basic_config_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue