ETL模版
parent
ca2b2ce9d5
commit
747aa9ddf9
|
@ -136,6 +136,11 @@
|
|||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -27,6 +27,7 @@ public class InnerAuthAspect implements Ordered {
|
|||
throw new InnerAuthException("没有内部访问权限,不允许访问");
|
||||
}
|
||||
|
||||
|
||||
String userid = ServletUtils.getRequest().getHeader(SecurityConstants.DETAILS_USER_ID);
|
||||
String username = ServletUtils.getRequest().getHeader(SecurityConstants.DETAILS_USERNAME);
|
||||
// 用户信息验证
|
||||
|
|
|
@ -1,210 +0,0 @@
|
|||
package com.etl.data.source.domain;
|
||||
|
||||
|
||||
import com.etl.common.core.annotation.Excel;
|
||||
import com.etl.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 data_source
|
||||
*
|
||||
* @author fei
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
public class DataSource extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
|
||||
/** 接入源名称 */
|
||||
@Excel(name = "接入源名称")
|
||||
private String name;
|
||||
|
||||
/** 数据来源系统名称 */
|
||||
@Excel(name = "数据来源系统名称")
|
||||
private String systemName;
|
||||
|
||||
/** 主机ip地址 */
|
||||
@Excel(name = "主机ip地址")
|
||||
private String host;
|
||||
|
||||
/** 端口 */
|
||||
@Excel(name = "端口")
|
||||
private String port;
|
||||
|
||||
/** 用户名 */
|
||||
@Excel(name = "用户名")
|
||||
private String username;
|
||||
|
||||
/** 密码 */
|
||||
@Excel(name = "密码")
|
||||
private String password;
|
||||
|
||||
/** 数据接入类型 */
|
||||
@Excel(name = "数据接入类型")
|
||||
private String type;
|
||||
|
||||
/** 数据库名称 */
|
||||
@Excel(name = "数据库名称")
|
||||
private String databaseName;
|
||||
|
||||
/** 数据连接参数 */
|
||||
@Excel(name = "数据连接参数")
|
||||
private String connectionParam;
|
||||
|
||||
/** 初始连接数量 */
|
||||
@Excel(name = "初始连接数量")
|
||||
private Long initNum;
|
||||
|
||||
/** 最大连接数量 */
|
||||
@Excel(name = "最大连接数量")
|
||||
private Long maxNum;
|
||||
|
||||
/** 最大等待时间 */
|
||||
@Excel(name = "最大等待时间")
|
||||
private Long maxWaitTime;
|
||||
|
||||
/** 最大等待次数 */
|
||||
@Excel(name = "最大等待次数")
|
||||
private Long maxWaitSize;
|
||||
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getSystemName() {
|
||||
return systemName;
|
||||
}
|
||||
|
||||
public void setSystemName(String systemName) {
|
||||
this.systemName = systemName;
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
public void setHost(String host) {
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
public String getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(String port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
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 getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getDatabaseName() {
|
||||
return databaseName;
|
||||
}
|
||||
|
||||
public void setDatabaseName(String databaseName) {
|
||||
this.databaseName = databaseName;
|
||||
}
|
||||
|
||||
public String getConnectionParam() {
|
||||
return connectionParam;
|
||||
}
|
||||
|
||||
public void setConnectionParam(String connectionParam) {
|
||||
this.connectionParam = connectionParam;
|
||||
}
|
||||
|
||||
public Long getInitNum() {
|
||||
return initNum;
|
||||
}
|
||||
|
||||
public void setInitNum(Long initNum) {
|
||||
this.initNum = initNum;
|
||||
}
|
||||
|
||||
public Long getMaxNum() {
|
||||
return maxNum;
|
||||
}
|
||||
|
||||
public void setMaxNum(Long maxNum) {
|
||||
this.maxNum = maxNum;
|
||||
}
|
||||
|
||||
public Long getMaxWaitTime() {
|
||||
return maxWaitTime;
|
||||
}
|
||||
|
||||
public void setMaxWaitTime(Long maxWaitTime) {
|
||||
this.maxWaitTime = maxWaitTime;
|
||||
}
|
||||
|
||||
public Long getMaxWaitSize() {
|
||||
return maxWaitSize;
|
||||
}
|
||||
|
||||
public void setMaxWaitSize(Long maxWaitSize) {
|
||||
this.maxWaitSize = maxWaitSize;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DataSource{" +
|
||||
"id=" + id +
|
||||
", name='" + name + '\'' +
|
||||
", systemName='" + systemName + '\'' +
|
||||
", host='" + host + '\'' +
|
||||
", port='" + port + '\'' +
|
||||
", username='" + username + '\'' +
|
||||
", password='" + password + '\'' +
|
||||
", type='" + type + '\'' +
|
||||
", databaseName='" + databaseName + '\'' +
|
||||
", connectionParam='" + connectionParam + '\'' +
|
||||
", initNum=" + initNum +
|
||||
", maxNum=" + maxNum +
|
||||
", maxWaitTime=" + maxWaitTime +
|
||||
", maxWaitSize=" + maxWaitSize +
|
||||
"} " + super.toString ( );
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -92,6 +92,13 @@
|
|||
<artifactId>etl-data-source-remote</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 添加 PostgreSQL JDBC 驱动 -->
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.5.0</version> <!-- 使用当前最新稳定版本 -->
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
package com.etl.data.source;
|
||||
|
||||
import com.etl.common.security.annotation.EnableCustomConfig;
|
||||
import com.etl.common.security.annotation.EnableMyFeignClients;
|
||||
import com.etl.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
*
|
||||
* @author etl
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
public class ETLDataSourceApplication {
|
||||
public static void main (String[] args) {
|
||||
SpringApplication.run(ETLDataSourceApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -1,105 +0,0 @@
|
|||
package com.etl.data.source.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.etl.data.source.domain.DataSource;
|
||||
import com.etl.data.source.service.IDataSourceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.etl.common.log.annotation.Log;
|
||||
import com.etl.common.log.enums.BusinessType;
|
||||
import com.etl.common.security.annotation.RequiresPermissions;
|
||||
import com.etl.common.core.web.controller.BaseController;
|
||||
import com.etl.common.core.domain.Result;
|
||||
import com.etl.common.core.utils.poi.ExcelUtil;
|
||||
import com.etl.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Controller
|
||||
*
|
||||
* @author fei
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/source")
|
||||
public class DataSourceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDataSourceService dataSourceService;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*/
|
||||
@RequiresPermissions("data_source:source:list")
|
||||
@GetMapping("/list")
|
||||
public Result< TableDataInfo< DataSource > > list(DataSource dataSource)
|
||||
{
|
||||
startPage();
|
||||
List<DataSource> list = dataSourceService.selectDataSourceList(dataSource);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出【请填写功能名称】列表
|
||||
*/
|
||||
@RequiresPermissions("data_source:source:export")
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DataSource dataSource)
|
||||
{
|
||||
List<DataSource> list = dataSourceService.selectDataSourceList(dataSource);
|
||||
ExcelUtil<DataSource> util = new ExcelUtil<DataSource>(DataSource.class);
|
||||
util.exportExcel(response, list, "【请填写功能名称】数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取【请填写功能名称】详细信息
|
||||
*/
|
||||
@RequiresPermissions("data_source:source:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(dataSourceService.selectDataSourceById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*/
|
||||
@RequiresPermissions("data_source:source:add")
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody DataSource dataSource)
|
||||
{
|
||||
return toAjax(dataSourceService.insertDataSource(dataSource));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*/
|
||||
@RequiresPermissions("data_source:source:edit")
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody DataSource dataSource)
|
||||
{
|
||||
return toAjax(dataSourceService.updateDataSource(dataSource));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
*/
|
||||
@RequiresPermissions("data_source:source:remove")
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(dataSourceService.deleteDataSourceByIds(ids));
|
||||
}
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
package com.etl.data.source.mapper;
|
||||
|
||||
import com.etl.data.source.domain.DataSource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* @author fei
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
public interface DataSourceMapper
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
public DataSource selectDataSourceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param dataSource 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
*/
|
||||
public List<DataSource> selectDataSourceList(DataSource dataSource);
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param dataSource 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDataSource(DataSource dataSource);
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param dataSource 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDataSource(DataSource dataSource);
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDataSourceById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDataSourceByIds(Long[] ids);
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
package com.etl.data.source.service;
|
||||
|
||||
import com.etl.data.source.domain.DataSource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service接口
|
||||
*
|
||||
* @author fei
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
public interface IDataSourceService
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
public DataSource selectDataSourceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param dataSource 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
*/
|
||||
public List<DataSource> selectDataSourceList(DataSource dataSource);
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param dataSource 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDataSource(DataSource dataSource);
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param dataSource 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDataSource(DataSource dataSource);
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的【请填写功能名称】主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDataSourceByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】信息
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDataSourceById(Long id);
|
||||
}
|
|
@ -1,96 +0,0 @@
|
|||
package com.etl.data.source.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.etl.common.core.utils.DateUtils;
|
||||
import com.etl.data.source.domain.DataSource;
|
||||
import com.etl.data.source.mapper.DataSourceMapper;
|
||||
import com.etl.data.source.service.IDataSourceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
*
|
||||
* @author fei
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
@Service
|
||||
public class DataSourceServiceImpl implements IDataSourceService
|
||||
{
|
||||
@Autowired
|
||||
private DataSourceMapper dataSourceMapper;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public DataSource selectDataSourceById(Long id)
|
||||
{
|
||||
return dataSourceMapper.selectDataSourceById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param dataSource 【请填写功能名称】
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public List<DataSource> selectDataSourceList(DataSource dataSource)
|
||||
{
|
||||
return dataSourceMapper.selectDataSourceList(dataSource);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param dataSource 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDataSource(DataSource dataSource)
|
||||
{
|
||||
dataSource.setCreateTime(DateUtils.getNowDate());
|
||||
return dataSourceMapper.insertDataSource(dataSource);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param dataSource 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDataSource(DataSource dataSource)
|
||||
{
|
||||
dataSource.setUpdateTime(DateUtils.getNowDate());
|
||||
return dataSourceMapper.updateDataSource(dataSource);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDataSourceByIds(Long[] ids)
|
||||
{
|
||||
return dataSourceMapper.deleteDataSourceByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】信息
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDataSourceById(Long id)
|
||||
{
|
||||
return dataSourceMapper.deleteDataSourceById(id);
|
||||
}
|
||||
}
|
|
@ -31,4 +31,4 @@ spring:
|
|||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
logging:
|
||||
level:
|
||||
com.etl.shop.cart.mapper: DEBUG
|
||||
com.etl.data.mapper: DEBUG
|
||||
|
|
|
@ -1,138 +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.etl.data.source.mapper.DataSourceMapper">
|
||||
|
||||
<resultMap type="com.etl.data.source.domain.DataSource" id="DataSourceResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="systemName" column="systemName" />
|
||||
<result property="host" column="host" />
|
||||
<result property="port" column="port" />
|
||||
<result property="username" column="username" />
|
||||
<result property="password" column="password" />
|
||||
<result property="type" column="type" />
|
||||
<result property="databaseName" column="database_name" />
|
||||
<result property="connectionParam" column="connection_param" />
|
||||
<result property="initNum" column="init_num" />
|
||||
<result property="maxNum" column="max_num" />
|
||||
<result property="maxWaitTime" column="max_wait_time" />
|
||||
<result property="maxWaitSize" column="max_wait_size" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDataSourceVo">
|
||||
select id, name, systemName, host, port, username, password, type, database_name, connection_param, init_num, max_num, max_wait_time, max_wait_size, create_by, create_time, update_by, update_time, remark from data_source
|
||||
</sql>
|
||||
|
||||
<select id="selectDataSourceList" parameterType="com.etl.data.source.domain.DataSource" resultMap="DataSourceResult">
|
||||
<include refid="selectDataSourceVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="systemName != null and systemName != ''"> and systemName like concat('%', #{systemName}, '%')</if>
|
||||
<if test="host != null and host != ''"> and host = #{host}</if>
|
||||
<if test="port != null and port != ''"> and port = #{port}</if>
|
||||
<if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
|
||||
<if test="password != null and password != ''"> and password = #{password}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="databaseName != null and databaseName != ''"> and database_name like concat('%', #{databaseName}, '%')</if>
|
||||
<if test="connectionParam != null and connectionParam != ''"> and connection_param = #{connectionParam}</if>
|
||||
<if test="initNum != null "> and init_num = #{initNum}</if>
|
||||
<if test="maxNum != null "> and max_num = #{maxNum}</if>
|
||||
<if test="maxWaitTime != null "> and max_wait_time = #{maxWaitTime}</if>
|
||||
<if test="maxWaitSize != null "> and max_wait_size = #{maxWaitSize}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDataSourceById" parameterType="Long" resultMap="DataSourceResult">
|
||||
<include refid="selectDataSourceVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDataSource" parameterType="com.etl.data.source.domain.DataSource">
|
||||
insert into data_source
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="systemName != null">systemName,</if>
|
||||
<if test="host != null">host,</if>
|
||||
<if test="port != null">port,</if>
|
||||
<if test="username != null">username,</if>
|
||||
<if test="password != null">password,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="databaseName != null">database_name,</if>
|
||||
<if test="connectionParam != null">connection_param,</if>
|
||||
<if test="initNum != null">init_num,</if>
|
||||
<if test="maxNum != null">max_num,</if>
|
||||
<if test="maxWaitTime != null">max_wait_time,</if>
|
||||
<if test="maxWaitSize != null">max_wait_size,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="systemName != null">#{systemName},</if>
|
||||
<if test="host != null">#{host},</if>
|
||||
<if test="port != null">#{port},</if>
|
||||
<if test="username != null">#{username},</if>
|
||||
<if test="password != null">#{password},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="databaseName != null">#{databaseName},</if>
|
||||
<if test="connectionParam != null">#{connectionParam},</if>
|
||||
<if test="initNum != null">#{initNum},</if>
|
||||
<if test="maxNum != null">#{maxNum},</if>
|
||||
<if test="maxWaitTime != null">#{maxWaitTime},</if>
|
||||
<if test="maxWaitSize != null">#{maxWaitSize},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDataSource" parameterType="com.etl.data.source.domain.DataSource">
|
||||
update data_source
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="systemName != null">systemName = #{systemName},</if>
|
||||
<if test="host != null">host = #{host},</if>
|
||||
<if test="port != null">port = #{port},</if>
|
||||
<if test="username != null">username = #{username},</if>
|
||||
<if test="password != null">password = #{password},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="databaseName != null">database_name = #{databaseName},</if>
|
||||
<if test="connectionParam != null">connection_param = #{connectionParam},</if>
|
||||
<if test="initNum != null">init_num = #{initNum},</if>
|
||||
<if test="maxNum != null">max_num = #{maxNum},</if>
|
||||
<if test="maxWaitTime != null">max_wait_time = #{maxWaitTime},</if>
|
||||
<if test="maxWaitSize != null">max_wait_size = #{maxWaitSize},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDataSourceById" parameterType="Long">
|
||||
delete from data_source where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDataSourceByIds" parameterType="String">
|
||||
delete from data_source where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -50,7 +50,7 @@ public class VelocityUtils {
|
|||
VelocityContext velocityContext = new VelocityContext();
|
||||
velocityContext.put("tplCategory", genTable.getTplCategory());
|
||||
velocityContext.put("tableName", genTable.getTableName());
|
||||
velocityContext.put("functionName", StringUtils.isNotEmpty(functionName) ? functionName : "【请填写功能名称】");
|
||||
velocityContext.put("functionName", StringUtils.isNotEmpty(functionName) ? functionName : "数据源");
|
||||
velocityContext.put("ClassName", genTable.getClassName());
|
||||
velocityContext.put("className", StringUtils.uncapitalize(genTable.getClassName()));
|
||||
velocityContext.put("moduleName", genTable.getModuleName());
|
||||
|
|
Loading…
Reference in New Issue