master
parent
9daa2558b4
commit
ae35c4a607
|
@ -13,7 +13,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Controller
|
||||
* 【数据模型】Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-22
|
||||
|
@ -71,10 +71,10 @@ public class AssetModelController extends BaseController
|
|||
@PutMapping("UpdateAssetModel")
|
||||
public Result edit(@RequestBody AssetModel assetModel)
|
||||
{
|
||||
// 调用资产模型服务,更新资产模型信息,并将结果转换为Ajax形式返回
|
||||
return toAjax(assetModelService.updateAssetModel(assetModel));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
*/
|
||||
|
|
|
@ -15,7 +15,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Controller
|
||||
* 【数据源】Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-20
|
||||
|
@ -111,6 +111,7 @@ public class DataSourceController extends BaseController
|
|||
public Result synchronization(@RequestBody DataSource dataSource){
|
||||
return dataSourceService.synchronization(dataSource);
|
||||
}
|
||||
|
||||
@PostMapping("dataAssetList")
|
||||
public Result dataAssetList(@RequestBody DataSource dataSource){
|
||||
return dataSourceService.dataAssetList(dataSource);
|
||||
|
@ -123,4 +124,5 @@ public class DataSourceController extends BaseController
|
|||
public Result statisticsInfo(){
|
||||
return dataSourceService.statisticsInfo();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.muyu.common.core.domain.Result;
|
|||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
import com.muyu.etl.domain.Dictionary;
|
||||
import com.muyu.etl.service.DictionaryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -14,7 +13,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Controller
|
||||
* 【字典】Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-24
|
||||
|
@ -70,15 +69,14 @@ public class DictionaryController extends BaseController
|
|||
* 修改【请填写功能名称】
|
||||
*/
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody Dictionary dictionary)
|
||||
{
|
||||
public Result edit(@RequestBody Dictionary dictionary) {
|
||||
return toAjax(dictionaryService.updateDictionary(dictionary));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
*/
|
||||
@DeleteMapping("/{ids}")
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(dictionaryService.deleteDictionaryByIds(ids));
|
||||
|
@ -87,10 +85,8 @@ public class DictionaryController extends BaseController
|
|||
public Result getDictionaryList(@RequestParam("dataSourceId") Long dataSourceId){
|
||||
return dictionaryService.getDictionaryList(dataSourceId);
|
||||
}
|
||||
|
||||
// @GetMapping("delDict")
|
||||
// public Result delDict(Long id){
|
||||
// return dictionaryService.delDict(id);
|
||||
// }
|
||||
|
||||
@GetMapping("delDict")
|
||||
public Result delDict(Long id){
|
||||
return dictionaryService.delDict(id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Controller
|
||||
* 【字典详情值】Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-24
|
||||
|
@ -82,4 +82,8 @@ public class DictionaryDataController extends BaseController
|
|||
{
|
||||
return toAjax(dictionaryDataService.deleteDictionaryDataByIds(ids));
|
||||
}
|
||||
@PostMapping("delById")
|
||||
public Result delById(@RequestParam Long id){
|
||||
return toAjax(dictionaryDataService.deleteDictionaryDataById(id));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ 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;
|
||||
|
@ -15,7 +14,6 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class AssetAccredit extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
|
|
|
@ -8,7 +8,6 @@ import lombok.NoArgsConstructor;
|
|||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
@ -18,9 +17,9 @@ import java.util.Date;
|
|||
* @Date 2024/4/22 20:41
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class DataAsset extends BaseEntity {
|
||||
private Long id;
|
||||
private Long dataSourceId;
|
||||
|
@ -29,67 +28,16 @@ public class DataAsset extends BaseEntity {
|
|||
private Long tableCount;
|
||||
private Long fields;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getDataSourceId() {
|
||||
return dataSourceId;
|
||||
}
|
||||
|
||||
public void setDataSourceId(Long dataSourceId) {
|
||||
this.dataSourceId = dataSourceId;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public String getTableComment() {
|
||||
return tableComment;
|
||||
}
|
||||
|
||||
public void setTableComment(String tableComment) {
|
||||
this.tableComment = tableComment;
|
||||
}
|
||||
|
||||
public Long getTableCount() {
|
||||
return tableCount;
|
||||
}
|
||||
|
||||
public void setTableCount(Long tableCount) {
|
||||
this.tableCount = tableCount;
|
||||
}
|
||||
|
||||
public Long getFields() {
|
||||
return fields;
|
||||
}
|
||||
|
||||
public void setFields(Long fields) {
|
||||
this.fields = fields;
|
||||
}
|
||||
|
||||
public DataAsset dataAssetBuild(DataSource dataSource,ResultSet resultSet){
|
||||
try {
|
||||
return DataAsset.builder()
|
||||
.tableName(resultSet.getString("t_name"))
|
||||
.tableComment(resultSet.getString("table_comment") == null ? "-":resultSet.getString("table_comment"))
|
||||
.tableCount(Long.valueOf(resultSet.getString("table_rows")))
|
||||
.fields(Long.valueOf(resultSet.getString("fields")))
|
||||
.dataSourceId(dataSource.getId())
|
||||
.createBy(SecurityUtils.getUsername())
|
||||
.createTime(new Date())
|
||||
.build();
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
public DataAsset dataAsset(DataAsset dataAsset , ResultSet resultSet){
|
||||
return DataAsset.builder()
|
||||
.id(dataAsset.getId())
|
||||
.dataSourceId(dataAsset.getDataSourceId())
|
||||
.tableName(dataAsset.getTableName())
|
||||
.tableComment(dataAsset.getTableComment())
|
||||
.tableCount(dataAsset.getTableCount())
|
||||
.fields(dataAsset.getFields())
|
||||
.updateBy(SecurityUtils.getUsername())
|
||||
.updateTime(new Date())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,28 +17,23 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DictionaryData extends BaseEntity {
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 字典表Id
|
||||
*/
|
||||
private Long dictionaryId;
|
||||
|
||||
/**
|
||||
* 字典标签
|
||||
*/
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* 字典值
|
||||
*/
|
||||
private String val;
|
||||
|
||||
private List<Dictionary> dictionaryDatas;
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
|
||||
private Boolean isEdit = false;
|
||||
|
||||
private List<Dictionary> dictionaryDatas;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
package com.muyu.etl.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Statistics {
|
||||
|
||||
// 数据资产ID
|
||||
private Long dataAsset;
|
||||
// 资产模型ID
|
||||
private Long assetModel;
|
||||
// 数据模型ID
|
||||
private Long dataModel;
|
||||
|
||||
}
|
|
@ -1,14 +1,12 @@
|
|||
package com.muyu.etl.domain.custom;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class Statistics {
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
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;
|
||||
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
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;
|
||||
|
||||
}
|
|
@ -12,7 +12,6 @@ import java.util.List;
|
|||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class AccreditModel {
|
||||
|
||||
/**
|
||||
* 用于存储与用户认证相关的模型ID
|
||||
*/
|
||||
|
@ -22,5 +21,4 @@ public class AccreditModel {
|
|||
* 用于存储与部门认证相关的模型ID
|
||||
*/
|
||||
private List<Long> deptAccreditModelIds;
|
||||
|
||||
}
|
||||
|
|
|
@ -12,9 +12,7 @@ import java.util.List;
|
|||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
public class AssetAccreditReq {
|
||||
|
||||
private List<Long> deptIds;
|
||||
private Long userId;
|
||||
private Long dataAssetId;
|
||||
|
||||
}
|
||||
|
|
|
@ -12,9 +12,7 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
public class SourceAccreditReq {
|
||||
|
||||
private List<Long> deptIds;
|
||||
private Long userId;
|
||||
private Long dataSourceId;
|
||||
|
||||
private List<Long> deptIds;
|
||||
private Long userId;
|
||||
private Long dataSourceId;
|
||||
}
|
||||
|
|
|
@ -4,14 +4,11 @@ import com.muyu.etl.domain.AssetAccredit;
|
|||
import com.muyu.etl.domain.req.AssetAccreditReq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.PropertyValues;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface AssetAccreditMapper {
|
||||
|
||||
List<AssetAccredit> selectAssetAccreditList(AssetAccredit assetAccredit);
|
||||
|
||||
public AssetAccredit selectAssetAccreditById(Long id);
|
||||
|
@ -31,5 +28,4 @@ public interface AssetAccreditMapper {
|
|||
List<AssetAccredit> getSourceAccreditByUserId(Long userId);
|
||||
|
||||
void insertBachAssetAccredit(@Param("assetAccredits") List<AssetAccredit> assetAccredits);
|
||||
|
||||
}
|
||||
|
|
|
@ -68,7 +68,5 @@ public interface AssetModelMapper
|
|||
int clearTable1(@Param("id") Long[] id);
|
||||
|
||||
void batchInsert(@Param("tableAssets") List<AssetModel> tableAssets);
|
||||
|
||||
void updateAssetModelDiction(Long id);
|
||||
|
||||
}
|
||||
|
|
|
@ -65,9 +65,7 @@ public interface DataAssetMapper
|
|||
public int deleteDataAssetByIds(Long[] ids);
|
||||
|
||||
void batchInsert(@Param("dataAssets") ArrayList<DataAsset> dataAssets);
|
||||
|
||||
List<DataAsset> selectById(Long id);
|
||||
|
||||
List<DataAsset> getDataAssetByAssetId(@Param("assetIds") List<Long> assetIds);
|
||||
|
||||
}
|
||||
|
|
|
@ -56,7 +56,5 @@ public interface DictionaryMapper {
|
|||
|
||||
|
||||
List<Dictionary> getDictionaryList(@Param("dataSourceId") Long dataSourceId);
|
||||
|
||||
List<Dictionary> getDictionaryDataList(@Param("string") List<String> string);
|
||||
|
||||
}
|
||||
|
|
|
@ -3,13 +3,18 @@ package com.muyu.etl.mapper;
|
|||
import com.muyu.etl.domain.SourceAccredit;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-25
|
||||
*/
|
||||
@Mapper
|
||||
public interface SourceAccreditMapper {
|
||||
|
||||
public interface SourceAccreditMapper
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
|
@ -67,5 +72,4 @@ public interface SourceAccreditMapper {
|
|||
void insertBatchSourceAccredit(@Param("sourceAccredits") List<SourceAccredit> sourceAccredits);
|
||||
|
||||
void deleteSourceAccreditByDeptUser(@Param("deptIds") List<Long> deptIds, @Param("userId") Long userId, @Param("dataSourceId") Long dataSourceId);
|
||||
|
||||
}
|
||||
|
|
|
@ -3,28 +3,22 @@ package com.muyu.etl.service;
|
|||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.etl.domain.AssetAccredit;
|
||||
import com.muyu.etl.domain.req.AssetAccreditReq;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public interface AssetAccreditService {
|
||||
|
||||
List<AssetAccredit> selectAssetAccreditList(AssetAccredit assetAccredit);
|
||||
|
||||
AssetAccredit selectAssetAccreditById(Long id);
|
||||
|
||||
public Result insertAssetAccredit(AssetAccreditReq assetAccreditReq);
|
||||
|
||||
public int updateAssetAccredit(AssetAccredit assetAccredit);
|
||||
|
||||
public int deleteAssetAccreditByIds(Long[] ids);
|
||||
|
||||
public int deleteAssetAccreditById(Long id);
|
||||
|
||||
Result getAssetAccreditByDataAssetId(Long id);
|
||||
|
||||
Result deleteAssetAccreditByAssetId(AssetAccreditReq assetAccreditReq);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.muyu.etl.service;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.etl.domain.DictionaryData;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -55,9 +54,4 @@ public interface DictionaryDataService {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDictionaryDataById(Long id);
|
||||
|
||||
Result getDictionaryList(Long dataSourceId);
|
||||
|
||||
Result delDict(Long id);
|
||||
|
||||
}
|
||||
|
|
|
@ -53,9 +53,7 @@ public interface DictionaryService {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDictionaryById(Long id);
|
||||
|
||||
Result getDictionaryList(Long dataSourceId);
|
||||
|
||||
Result delDict(Long id);
|
||||
|
||||
}
|
||||
|
|
|
@ -14,8 +14,8 @@ import java.util.List;
|
|||
* @date 2024-04-25
|
||||
*/
|
||||
@Service
|
||||
public interface SourceAccreditService {
|
||||
|
||||
public interface SourceAccreditService
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
|
@ -67,5 +67,4 @@ public interface SourceAccreditService {
|
|||
Result getSourceAccreditByDataSourceId(Long id);
|
||||
|
||||
Result deleteSourceAccreditBySourceIds(SourceAccreditReq sourceAccreditReq);
|
||||
|
||||
}
|
||||
|
|
|
@ -16,12 +16,6 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @ClassName AssetAccreditServiceImpl
|
||||
* @Description 描述
|
||||
* @Author HaoRan.Zhang
|
||||
* @Date 2024/4/28 15:11
|
||||
*/
|
||||
@Service
|
||||
public class AssetAccreditServiceImpl implements AssetAccreditService {
|
||||
|
||||
|
@ -42,7 +36,6 @@ public class AssetAccreditServiceImpl implements AssetAccreditService {
|
|||
|
||||
@Override
|
||||
public Result insertAssetAccredit(AssetAccreditReq assetAccreditReq) {
|
||||
|
||||
// 根据资产ID删除资产授权信息
|
||||
deleteAssetAccreditByAssetId(assetAccreditReq);
|
||||
List<AssetAccredit> assetAccredits = new ArrayList<>();
|
||||
|
@ -116,7 +109,6 @@ public class AssetAccreditServiceImpl implements AssetAccreditService {
|
|||
return Result.success(accreditModel);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Result deleteAssetAccreditByAssetId(AssetAccreditReq assetAccreditReq)
|
||||
{
|
||||
|
|
|
@ -230,7 +230,7 @@ public class DataSourceServiceImpl implements DataSourceService{
|
|||
case "varchar":
|
||||
case "char":
|
||||
case "text":
|
||||
return "String";
|
||||
return "String";
|
||||
case "datetime":
|
||||
return "Date";
|
||||
case "blob":
|
||||
|
@ -425,7 +425,7 @@ public class DataSourceServiceImpl implements DataSourceService{
|
|||
//数据同步
|
||||
@Override
|
||||
public Result synchronization(DataSource dataSource) {
|
||||
List<DataSource> dataSources = dataSourceMapper.selectId(dataSource.getId()); // 根据数据源ID查询所有相关数据源
|
||||
List<DataSource> dataSources = dataSourceMapper.selectId(dataSource.getId()); // 根据数据源ID查询所有相关数据源-+
|
||||
List<Long> longList = dataSources.stream().map(DataSource::getId).toList(); // 提取数据源ID列表
|
||||
ArrayList<Long> l = new ArrayList<>();
|
||||
for (Long aLong : longList) {
|
||||
|
|
|
@ -1,14 +1,9 @@
|
|||
package com.muyu.etl.service.impl;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.etl.domain.Dictionary;
|
||||
import com.muyu.etl.domain.DictionaryData;
|
||||
import com.muyu.etl.mapper.AssetModelMapper;
|
||||
import com.muyu.etl.mapper.DictionaryDataMapper;
|
||||
import com.muyu.etl.mapper.DictionaryMapper;
|
||||
import com.muyu.etl.service.AssetModelService;
|
||||
import com.muyu.etl.service.DictionaryDataService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -17,16 +12,9 @@ import java.util.List;
|
|||
|
||||
@Service
|
||||
public class DictionaryDataServiceImpl implements DictionaryDataService {
|
||||
|
||||
@Autowired
|
||||
private DictionaryDataMapper dictionaryDataMapper;
|
||||
|
||||
@Autowired
|
||||
private DictionaryMapper dictionaryMapper;
|
||||
|
||||
@Autowired
|
||||
private AssetModelMapper assetModelMapper;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
|
@ -102,66 +90,4 @@ public class DictionaryDataServiceImpl implements DictionaryDataService {
|
|||
{
|
||||
return dictionaryDataMapper.deleteDictionaryDataById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据源对应的字典列表。
|
||||
*
|
||||
* @param dataSourceId 数据源ID,用于查询与之相关的字典列表。
|
||||
* @return 返回字典列表的成功结果,其中包含了字典及其相关数据。
|
||||
*/
|
||||
@Override
|
||||
public Result getDictionaryList(Long dataSourceId) {
|
||||
// 从字典mapper中查询指定数据源ID的字典列表
|
||||
List<Dictionary> dictionaryList = dictionaryMapper.getDictionaryList(dataSourceId);
|
||||
if (!dictionaryList.isEmpty()){
|
||||
// 将字典列表中每个字典的ID提取出来,形成一个新的ID列表
|
||||
List<Long> longs = dictionaryList.stream()
|
||||
.map(Dictionary::getId).toList();
|
||||
// 根据提取出的ID列表,从字典数据mapper中查询相应的字典数据列表
|
||||
List<DictionaryData> dictionaryDataList = dictionaryDataMapper.getDictionaryDataList(longs);
|
||||
// 为每个字典设置其对应的字典数据列表
|
||||
dictionaryList.stream()
|
||||
.forEach(dictionary->{
|
||||
// 过滤出与当前字典ID匹配的字典数据,并为当前字典设置这个列表
|
||||
dictionaryDataList.stream().filter(dictionaryData -> dictionaryData.getDictionaryId().equals(dictionary.getId()) ).toList();
|
||||
dictionary.setDictionaryDataList(dictionaryDataList);
|
||||
});
|
||||
}
|
||||
// 返回成功结果,包含处理后的字典列表
|
||||
return Result.success(dictionaryList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result delDict(Long id) {
|
||||
dictionaryDataMapper.deleteDictionaryDataBy(id);
|
||||
dictionaryMapper.deleteDictionaryById(id);
|
||||
assetModelMapper.updateAssetModelDiction(id);
|
||||
return Result.success();
|
||||
}
|
||||
/**
|
||||
* 获取字典数据列表。
|
||||
*
|
||||
* @param string 一个字符串列表,代表需要查询的字典项的标识符。
|
||||
* @return 返回一个结果对象,其中包含了查询到的字典数据列表。如果查询成功,则结果对象的状态为成功,并附带字典数据列表;如果查询失败,则结果对象的状态为失败,并可能包含错误信息。
|
||||
*/
|
||||
public Result getDictionaryDataList(List<String> string){
|
||||
// 通过字符串列表查询字典数据列表
|
||||
List<Dictionary> dictionaryDataList = dictionaryMapper.getDictionaryDataList(string);
|
||||
if (!dictionaryDataList.isEmpty()){
|
||||
// 将字典数据列表中的每个字典项的ID提取出来,形成一个新的ID列表
|
||||
List<Long> longs = dictionaryDataList.stream()
|
||||
.map(Dictionary::getId).toList();
|
||||
// 根据ID列表查询相应的字典详细数据列表
|
||||
List<DictionaryData> dictionaryDataList1 = dictionaryDataMapper.getDictionaryDataList(longs);
|
||||
// 为每个字典项设置其详细的字典数据列表
|
||||
dictionaryDataList.stream()
|
||||
.forEach(dictionary -> {
|
||||
dictionaryDataList1.stream().filter(dictionaryData -> dictionaryData.getDictionaryId() ==(dictionary.getId())).toList();
|
||||
dictionary.setDictionaryDataList(dictionaryDataList1);
|
||||
});
|
||||
}
|
||||
// 返回成功结果,包含处理后的字典数据列表
|
||||
return Result.success(dictionaryDataList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?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">
|
||||
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">
|
||||
|
@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dataAssetId != null">#{dataAssetId},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
|
@ -91,47 +91,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
<!-- <insert id="batchInsert" parameterType="com.muyu.etl.domain.AssetModel" useGeneratedKeys="true" keyProperty="id" >-->
|
||||
<!-- insert into `asset_model_copy1`-->
|
||||
<!-- <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 id="batchInsert" parameterType="com.muyu.etl.domain.AssetModel" useGeneratedKeys="true" keyProperty="id" >-->
|
||||
<!-- insert into `asset_model_copy1`-->
|
||||
<!-- <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>-->
|
||||
<!-- </insert>-->
|
||||
<insert id="batchInsert" parameterType="com.muyu.etl.domain.AssetModel" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO `asset_model_copy1` (
|
||||
`data_asset_id`, `name`, `comment`, `is_primary_key`, `type`, `mapping_type`,
|
||||
|
@ -181,9 +181,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateAssetModelDiction">
|
||||
update asset_model_copy1 set is_dict = '',dictionary_id = null where dictionary_id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAssetModelById" parameterType="Long">
|
||||
delete from asset_model_copy1 where id = #{id}
|
||||
|
|
|
@ -37,22 +37,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectDataAssetVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectById" resultType="com.muyu.etl.domain.DataAsset">
|
||||
select * from data_asset where data_source_id= #{id}
|
||||
</select>
|
||||
|
||||
<select id="getDataAssetByAssetId" resultType="com.muyu.etl.domain.DataAsset">
|
||||
<include refid="selectDataAssetVo"/>
|
||||
<where>
|
||||
and id in (
|
||||
<foreach collection="assetIds" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
<foreach collection="assetIds" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertDataAsset" parameterType="com.muyu.etl.domain.DataAsset" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into data_asset
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.etl.mapper.DataSourceMapper">
|
||||
|
||||
|
||||
|
@ -107,7 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="maxWaitTime != null">max_wait_time,</if>
|
||||
<if test="connectionParam != null">connection_param,</if>
|
||||
<if test="systemName != null">systemName,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dataSourceName != null">#{dataSourceName},</if>
|
||||
<if test="linkAddress != null">#{linkAddress},</if>
|
||||
|
@ -126,7 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="maxWaitTime != null">#{maxWaitTime},</if>
|
||||
<if test="connectionParam != null">#{connectionParam},</if>
|
||||
<if test="systemName != null">#{systemName},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="batchInsert" parameterType="com.muyu.etl.domain.DataAsset" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into data_asset
|
||||
|
@ -214,8 +214,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
<delete id="clearTable">
|
||||
delete from data_asset where data_source_id in
|
||||
<foreach collection="id" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<foreach collection="id" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
|
@ -94,14 +94,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="delDict">
|
||||
delete dictionarydata where dictionary_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDictionaryDataBy">
|
||||
delete from dictionarydata where dictionary_id = #{id}
|
||||
</delete>
|
||||
|
|
|
@ -38,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<where>
|
||||
and data_source_id = #{dataSourceId}
|
||||
</where>
|
||||
Group by id
|
||||
</select>
|
||||
<select id="getDictionaryDataList" resultType="com.muyu.etl.domain.Dictionary">
|
||||
<include refid="selectDictionaryVo"></include>
|
||||
|
|
|
@ -1,206 +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.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>
|
|
@ -1,120 +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.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>
|
|
@ -0,0 +1,84 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-rule-engine</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -1,18 +1,22 @@
|
|||
package com.muyu.etl;
|
||||
package com.muyu.rule.engine;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
*
|
||||
* @author muyu
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
public class MuYuEtlApplication {
|
||||
public class MuYuRuleEngineApplication {
|
||||
public static void main (String[] args) {
|
||||
SpringApplication.run(MuYuEtlApplication.class, args);
|
||||
SpringApplication.run(MuYuRuleEngineApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -14,6 +14,7 @@
|
|||
<module>muyu-job</module>
|
||||
<module>muyu-file</module>
|
||||
<module>muyu-etl</module>
|
||||
<module>muyu-rule-engine</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>muyu-modules</artifactId>
|
||||
|
|
Loading…
Reference in New Issue