master
parent
8a7363243a
commit
73c79effac
|
@ -88,18 +88,6 @@ public class SysDept extends BaseEntity {
|
||||||
* 子部门
|
* 子部门
|
||||||
*/
|
*/
|
||||||
private List<SysDept> children = new ArrayList<SysDept>();
|
private List<SysDept> children = new ArrayList<SysDept>();
|
||||||
/**
|
|
||||||
* 是否授权
|
|
||||||
*/
|
|
||||||
private Boolean IsAuth=false;
|
|
||||||
|
|
||||||
public Boolean getAuth() {
|
|
||||||
return IsAuth;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAuth(Boolean auth) {
|
|
||||||
IsAuth = auth;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getDeptId () {
|
public Long getDeptId () {
|
||||||
return deptId;
|
return deptId;
|
||||||
|
|
|
@ -108,16 +108,6 @@ public class SysUser extends BaseEntity {
|
||||||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||||
private Date loginDate;
|
private Date loginDate;
|
||||||
|
|
||||||
private Boolean isAuth = false;
|
|
||||||
|
|
||||||
public Boolean getAuth() {
|
|
||||||
return isAuth;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAuth(Boolean auth) {
|
|
||||||
isAuth = auth;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门对象
|
* 部门对象
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.muyu.etl;
|
||||||
|
|
||||||
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
|
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
|
|
||||||
|
@EnableCustomConfig
|
||||||
|
@EnableCustomSwagger2
|
||||||
|
@EnableMyFeignClients
|
||||||
|
@SpringBootApplication
|
||||||
|
public class MuYuEtlApplication {
|
||||||
|
public static void main (String[] args) {
|
||||||
|
SpringApplication.run(MuYuEtlApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,89 @@
|
||||||
|
package com.muyu.etl.domain;
|
||||||
|
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
public class AssetAccredit extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 部门id */
|
||||||
|
@Excel(name = "部门id")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
/** 数据表id */
|
||||||
|
@Excel(name = "数据表id")
|
||||||
|
private Long dataAssetId;
|
||||||
|
|
||||||
|
|
||||||
|
/** 用户id */
|
||||||
|
@Excel(name = "用户id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setDeptId(Long deptId)
|
||||||
|
{
|
||||||
|
this.deptId = deptId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getDeptId()
|
||||||
|
{
|
||||||
|
return deptId;
|
||||||
|
}
|
||||||
|
public void setDataAssetId(Long dataAssetId)
|
||||||
|
{
|
||||||
|
this.dataAssetId = dataAssetId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getDataAssetId()
|
||||||
|
{
|
||||||
|
return dataAssetId;
|
||||||
|
}
|
||||||
|
public void setUserId(Long userId)
|
||||||
|
{
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getUserId()
|
||||||
|
{
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("deptId", getDeptId())
|
||||||
|
.append("dataAssetId", getDataAssetId())
|
||||||
|
.append("userId", getUserId())
|
||||||
|
.append("remark", getRemark())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,86 @@
|
||||||
|
package com.muyu.etl.domain;
|
||||||
|
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
public class SourceAccredit extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 部门id */
|
||||||
|
@Excel(name = "部门id")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
/** 数据源id */
|
||||||
|
@Excel(name = "数据源id")
|
||||||
|
private Long dataSourceId;
|
||||||
|
|
||||||
|
|
||||||
|
/** 用户id */
|
||||||
|
@Excel(name = "用户id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getDeptId() {
|
||||||
|
return deptId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeptId(Long deptId) {
|
||||||
|
this.deptId = deptId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getDataSourceId() {
|
||||||
|
return dataSourceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataSourceId(Long dataSourceId) {
|
||||||
|
this.dataSourceId = dataSourceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserId(Long userId)
|
||||||
|
{
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getUserId()
|
||||||
|
{
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("deptId", getDeptId())
|
||||||
|
.append("dataSourceId", getDataSourceId())
|
||||||
|
.append("userId", getUserId())
|
||||||
|
.append("remark", getRemark())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
package com.muyu.etl.domain.custom;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TableAssets {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段注释
|
||||||
|
*/
|
||||||
|
private String comment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否主键
|
||||||
|
*/
|
||||||
|
private String isPrimaryKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 映射类型
|
||||||
|
*/
|
||||||
|
private String mappingType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长度
|
||||||
|
*/
|
||||||
|
private String length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小数位
|
||||||
|
*/
|
||||||
|
private String decimalPlaces;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可为空
|
||||||
|
*/
|
||||||
|
private String isNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认值
|
||||||
|
*/
|
||||||
|
private String defaultValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否字典
|
||||||
|
*/
|
||||||
|
private String isDict;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段key
|
||||||
|
*/
|
||||||
|
private String dictKey;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.muyu.etl.domain.custom;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class VTClass {
|
||||||
|
|
||||||
|
private String value;
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.muyu.etl.domain.model;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
public class AccreditModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于存储与用户认证相关的模型ID
|
||||||
|
*/
|
||||||
|
private List<Long> userAccreditModelIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于存储与部门认证相关的模型ID
|
||||||
|
*/
|
||||||
|
private List<Long> deptAccreditModelIds;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,206 @@
|
||||||
|
<?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.AssetModelMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.muyu.etl.domain.AssetModel" id="AssetModelResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="dataAssetId" column="data_asset_id" />
|
||||||
|
<result property="name" column="name" />
|
||||||
|
<result property="comment" column="comment" />
|
||||||
|
<result property="isPrimaryKey" column="is_primary_key" />
|
||||||
|
<result property="type" column="type" />
|
||||||
|
<result property="mappingType" column="mapping_type" />
|
||||||
|
<result property="length" column="length" />
|
||||||
|
<result property="decimalPlaces" column="decimal_places" />
|
||||||
|
<result property="isNull" column="is_null" />
|
||||||
|
<result property="isDict" column="is_dict" />
|
||||||
|
<result property="defaultValue" column="default_value" />
|
||||||
|
<result property="dictKey" column="dict_key" />
|
||||||
|
<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="selectAssetModelVo">
|
||||||
|
select id, data_asset_id, name, comment, is_primary_key, type, mapping_type, length, decimal_places, is_null, is_dict,default_value, dict_key, create_by, create_time, update_by, update_time, remark from asset_model
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectAssetModelList" parameterType="com.muyu.etl.domain.AssetModel" resultMap="AssetModelResult">
|
||||||
|
<include refid="selectAssetModelVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="dataAssetId != null "> and data_asset_id = #{dataAssetId}</if>
|
||||||
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||||
|
<if test="comment != null and comment != ''"> and comment = #{comment}</if>
|
||||||
|
<if test="isPrimaryKey != null and isPrimaryKey != ''"> and is_primary_key = #{isPrimaryKey}</if>
|
||||||
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||||
|
<if test="mappingType != null and mappingType != ''"> and mapping_type = #{mappingType}</if>
|
||||||
|
<if test="length != null and length != ''"> and length = #{length}</if>
|
||||||
|
<if test="decimalPlaces != null and decimalPlaces != ''"> and decimal_places = #{decimalPlaces}</if>
|
||||||
|
<if test="isNull != null and isNull != ''"> and is_null = #{isNull}</if>
|
||||||
|
<if test="isDict != null and isDict != ''"> and is_dict = #{isDict}</if>
|
||||||
|
<if test="defaultValue != null and defaultValue != ''"> and default_value = #{defaultValue}</if>
|
||||||
|
<if test="dictKey != null and dictKey != ''"> and dict_key = #{dictKey}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectAssetModelById" parameterType="Long" resultMap="AssetModelResult">
|
||||||
|
<include refid="selectAssetModelVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertAssetModel" parameterType="com.muyu.etl.domain.AssetModel" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into asset_model
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="dataAssetId != null">data_asset_id,</if>
|
||||||
|
<if test="name != null">name,</if>
|
||||||
|
<if test="comment != null">comment,</if>
|
||||||
|
<if test="isPrimaryKey != null">is_primary_key,</if>
|
||||||
|
<if test="type != null">type,</if>
|
||||||
|
<if test="mappingType != null">mapping_type,</if>
|
||||||
|
<if test="length != null">length,</if>
|
||||||
|
<if test="decimalPlaces != null">decimal_places,</if>
|
||||||
|
<if test="isNull != null">is_null,</if>
|
||||||
|
<if test="isDict != null">is_dict,</if>
|
||||||
|
<if test="defaultValue != null">default_value,</if>
|
||||||
|
<if test="dictKey != null">dict_key,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">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="dataAssetId != null">#{dataAssetId},</if>
|
||||||
|
<if test="name != null">#{name},</if>
|
||||||
|
<if test="comment != null">#{comment},</if>
|
||||||
|
<if test="isPrimaryKey != null">#{isPrimaryKey},</if>
|
||||||
|
<if test="type != null">#{type},</if>
|
||||||
|
<if test="mappingType != null">#{mappingType},</if>
|
||||||
|
<if test="length != null">#{length},</if>
|
||||||
|
<if test="decimalPlaces != null">#{decimalPlaces},</if>
|
||||||
|
<if test="isNull != null">#{isNull},</if>
|
||||||
|
<if test="isDict != null">#{isDict},</if>
|
||||||
|
<if test="defaultValue != null">#{defaultValue},</if>
|
||||||
|
<if test="dictKey != null">#{dictKey},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{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>
|
||||||
|
<insert id="batchInsert" parameterType="com.muyu.etl.domain.AssetModel">
|
||||||
|
insert into `asset_model` (
|
||||||
|
`data_asset_id`,
|
||||||
|
`name`,
|
||||||
|
comment,
|
||||||
|
is_primary_key,
|
||||||
|
`type`,
|
||||||
|
mapping_type,
|
||||||
|
`length`,
|
||||||
|
decimal_places,
|
||||||
|
is_null,
|
||||||
|
is_dict,
|
||||||
|
default_value,
|
||||||
|
dict_key,
|
||||||
|
create_by,
|
||||||
|
create_time
|
||||||
|
) values
|
||||||
|
<foreach collection="tableAssets" item="item" separator=",">
|
||||||
|
(
|
||||||
|
#{item.dataAssetId},
|
||||||
|
#{item.name},
|
||||||
|
#{item.comment},
|
||||||
|
#{item.isPrimaryKey},
|
||||||
|
#{item.type},
|
||||||
|
#{item.mappingType},
|
||||||
|
#{item.length},
|
||||||
|
#{item.decimalPlaces},
|
||||||
|
#{item.isNull},
|
||||||
|
#{item.isDict},
|
||||||
|
#{item.defaultValue},
|
||||||
|
#{item.dictKey},
|
||||||
|
#{item.createBy},
|
||||||
|
#{item.createTime}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
<!-- <insert id="batchInsert" parameterType="com.muyu.etl.domain.AssetModel" >-->
|
||||||
|
<!-- insert into `asset_model`-->
|
||||||
|
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
|
||||||
|
<!-- `data_asset_id`,-->
|
||||||
|
<!-- `name`,-->
|
||||||
|
<!-- comment,-->
|
||||||
|
<!-- is_primary_key,-->
|
||||||
|
<!-- `type`,-->
|
||||||
|
<!-- mapping_type,-->
|
||||||
|
<!-- `length`,-->
|
||||||
|
<!-- decimal_places,-->
|
||||||
|
<!-- is_null,-->
|
||||||
|
<!-- is_dict,-->
|
||||||
|
<!-- default_value,-->
|
||||||
|
<!-- dict_key,-->
|
||||||
|
<!-- create_by,-->
|
||||||
|
<!-- create_time,-->
|
||||||
|
<!-- </trim>-->
|
||||||
|
<!-- values-->
|
||||||
|
<!-- <foreach collection="tableAssets" item="item" separator=",">-->
|
||||||
|
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
|
||||||
|
<!-- <if test="item.dataAssetId != null">#{item.dataAssetId},</if>-->
|
||||||
|
<!-- <if test="item.name != null">#{item.name},</if>-->
|
||||||
|
<!-- <if test="item.comment != null">#{item.comment},</if>-->
|
||||||
|
<!-- <if test="item.isPrimaryKey != null">#{item.isPrimaryKey},</if>-->
|
||||||
|
<!-- <if test="item.type != null">#{item.type},</if>-->
|
||||||
|
<!-- <if test="item.mappingType != null">#{item.mappingType},</if>-->
|
||||||
|
<!-- <if test="item.length != null">#{item.length},</if>-->
|
||||||
|
<!-- <if test="item.decimalPlaces != null">#{item.decimalPlaces},</if>-->
|
||||||
|
<!-- <if test="item.isNull != null">#{item.isNull},</if>-->
|
||||||
|
<!-- <if test="item.isDict != null">#{item.isDict},</if>-->
|
||||||
|
<!-- <if test="item.defaultValue != null">#{item.defaultValue},</if>-->
|
||||||
|
<!-- <if test="item.dictKey != null">#{item.dictKey},</if>-->
|
||||||
|
<!-- <if test="item.createBy != null and item.createBy != ''">#{item.createBy},</if>-->
|
||||||
|
<!-- <if test="item.createTime != null">#{item.createTime},</if>-->
|
||||||
|
<!-- </trim>-->
|
||||||
|
<!-- </foreach>-->
|
||||||
|
|
||||||
|
<!-- </insert>-->
|
||||||
|
|
||||||
|
<update id="updateAssetModel" parameterType="com.muyu.etl.domain.AssetModel">
|
||||||
|
update asset_model
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="dataAssetId != null">data_asset_id = #{dataAssetId},</if>
|
||||||
|
<if test="name != null">name = #{name},</if>
|
||||||
|
<if test="comment != null">comment = #{comment},</if>
|
||||||
|
<if test="isPrimaryKey != null">is_primary_key = #{isPrimaryKey},</if>
|
||||||
|
<if test="type != null">type = #{type},</if>
|
||||||
|
<if test="mappingType != null">mapping_type = #{mappingType},</if>
|
||||||
|
<if test="length != null">length = #{length},</if>
|
||||||
|
<if test="decimalPlaces != null">decimal_places = #{decimalPlaces},</if>
|
||||||
|
<if test="isNull != null">is_null = #{isNull},</if>
|
||||||
|
<if test="isDict != null">is_dict = #{isDict},</if>
|
||||||
|
<if test="defaultValue != null">default_value = #{defaultValue},</if>
|
||||||
|
<if test="dictKey != null">dict_key = #{dictKey},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">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="deleteAssetModelById" parameterType="Long">
|
||||||
|
delete from asset_model where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteAssetModelByIds" parameterType="String">
|
||||||
|
delete from asset_model where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,120 @@
|
||||||
|
<?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.DataAssetMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.muyu.etl.domain.DataAsset" id="DataAssetResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="dataSourceId" column="data_source_id" />
|
||||||
|
<result property="tableName" column="table_name" />
|
||||||
|
<result property="tableComment" column="table_comment" />
|
||||||
|
<result property="tableCount" column="table_count" />
|
||||||
|
<result property="fields" column="fields" />
|
||||||
|
<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="selectDataAssetVo">
|
||||||
|
select id, data_source_id, table_name, table_comment, table_count, fields, create_by, create_time, update_by, update_time, remark from data_asset
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectDataAssetList" parameterType="com.muyu.etl.domain.DataAsset" resultMap="DataAssetResult">
|
||||||
|
<include refid="selectDataAssetVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="dataSourceId != null "> and data_source_id = #{dataSourceId}</if>
|
||||||
|
<if test="tableName != null and tableName != ''"> and table_name like concat('%', #{tableName}, '%')</if>
|
||||||
|
<if test="tableComment != null and tableComment != ''"> and table_comment = #{tableComment}</if>
|
||||||
|
<if test="tableCount != null "> and table_count = #{tableCount}</if>
|
||||||
|
<if test="fields != null "> and fields = #{fields}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDataAssetById" parameterType="Long" resultMap="DataAssetResult">
|
||||||
|
<include refid="selectDataAssetVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertDataAsset" parameterType="com.muyu.etl.domain.DataAsset" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into data_asset
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="dataSourceId != null">data_source_id,</if>
|
||||||
|
<if test="tableName != null">table_name,</if>
|
||||||
|
<if test="tableComment != null">table_comment,</if>
|
||||||
|
<if test="tableCount != null">table_count,</if>
|
||||||
|
<if test="fields != null">fields,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">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="dataSourceId != null">#{dataSourceId},</if>
|
||||||
|
<if test="tableName != null">#{tableName},</if>
|
||||||
|
<if test="tableComment != null">#{tableComment},</if>
|
||||||
|
<if test="tableCount != null">#{tableCount},</if>
|
||||||
|
<if test="fields != null">#{fields},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{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>
|
||||||
|
<insert id="batchInsert" parameterType="com.muyu.etl.domain.DataAsset" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into data_asset
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
data_source_id,
|
||||||
|
`table_name`,
|
||||||
|
table_comment,
|
||||||
|
table_count,
|
||||||
|
fields,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
</trim>
|
||||||
|
values
|
||||||
|
<foreach collection="dataAssets" item="item" separator=",">
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
#{item.dataSourceId},
|
||||||
|
#{item.tableName},
|
||||||
|
#{item.tableComment},
|
||||||
|
#{item.tableCount},
|
||||||
|
#{item.fields},
|
||||||
|
#{item.createBy},
|
||||||
|
#{item.createTime},
|
||||||
|
</trim>
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateDataAsset" parameterType="com.muyu.etl.domain.DataAsset">
|
||||||
|
update data_asset
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="dataSourceId != null">data_source_id = #{dataSourceId},</if>
|
||||||
|
<if test="tableName != null">table_name = #{tableName},</if>
|
||||||
|
<if test="tableComment != null">table_comment = #{tableComment},</if>
|
||||||
|
<if test="tableCount != null">table_count = #{tableCount},</if>
|
||||||
|
<if test="fields != null">fields = #{fields},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">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="deleteDataAssetById" parameterType="Long">
|
||||||
|
delete from data_asset where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteDataAssetByIds" parameterType="String">
|
||||||
|
delete from data_asset where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue