新增规则模块 新增规则模块CRUD
This commit is contained in:
@@ -61,6 +61,15 @@
|
|||||||
<artifactId>solution-generator</artifactId>
|
<artifactId>solution-generator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.solution</groupId>
|
||||||
|
<artifactId>solution-behaviour</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.solution</groupId>
|
||||||
|
<artifactId>solution-algo</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
package com.solution.web.controller.algo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
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.solution.common.annotation.Log;
|
||||||
|
import com.solution.common.core.controller.BaseController;
|
||||||
|
import com.solution.common.core.domain.AjaxResult;
|
||||||
|
import com.solution.common.enums.BusinessType;
|
||||||
|
import com.solution.algo.domain.SysAlgoConfig;
|
||||||
|
import com.solution.algo.service.ISysAlgoConfigService;
|
||||||
|
import com.solution.common.utils.poi.ExcelUtil;
|
||||||
|
import com.solution.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态规则配置Controller
|
||||||
|
*
|
||||||
|
* @author zouju
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/algo/algo")
|
||||||
|
public class SysAlgoConfigController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISysAlgoConfigService sysAlgoConfigService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询动态规则配置列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('algo:algo:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysAlgoConfig sysAlgoConfig)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysAlgoConfig> list = sysAlgoConfigService.selectSysAlgoConfigList(sysAlgoConfig);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出动态规则配置列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('algo:algo:export')")
|
||||||
|
@Log(title = "动态规则配置", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, SysAlgoConfig sysAlgoConfig)
|
||||||
|
{
|
||||||
|
List<SysAlgoConfig> list = sysAlgoConfigService.selectSysAlgoConfigList(sysAlgoConfig);
|
||||||
|
ExcelUtil<SysAlgoConfig> util = new ExcelUtil<SysAlgoConfig>(SysAlgoConfig.class);
|
||||||
|
util.exportExcel(response, list, "动态规则配置数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取动态规则配置详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('algo:algo:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(sysAlgoConfigService.selectSysAlgoConfigById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增动态规则配置
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('algo:algo:add')")
|
||||||
|
@Log(title = "动态规则配置", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody SysAlgoConfig sysAlgoConfig)
|
||||||
|
{
|
||||||
|
return toAjax(sysAlgoConfigService.insertSysAlgoConfig(sysAlgoConfig));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改动态规则配置
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('algo:algo:edit')")
|
||||||
|
@Log(title = "动态规则配置", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody SysAlgoConfig sysAlgoConfig)
|
||||||
|
{
|
||||||
|
return toAjax(sysAlgoConfigService.updateSysAlgoConfig(sysAlgoConfig));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除动态规则配置
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('algo:algo:remove')")
|
||||||
|
@Log(title = "动态规则配置", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(sysAlgoConfigService.deleteSysAlgoConfigByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
28
auto-solution-algo/pom.xml
Normal file
28
auto-solution-algo/pom.xml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?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">
|
||||||
|
<parent>
|
||||||
|
<artifactId>solution</artifactId>
|
||||||
|
<groupId>com.solution</groupId>
|
||||||
|
<version>3.9.1</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>solution-algo</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
algo模块
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- 通用工具-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.solution</groupId>
|
||||||
|
<artifactId>solution-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,176 @@
|
|||||||
|
package com.solution.algo.domain;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.solution.common.annotation.Excel;
|
||||||
|
import com.solution.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态规则配置对象 sys_algo_config
|
||||||
|
*
|
||||||
|
* @author zouju
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
public class SysAlgoConfig extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键ID */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 算法唯一标识(Type),用于接口路由 */
|
||||||
|
@Excel(name = "算法唯一标识(Type),用于接口路由")
|
||||||
|
private String algoType;
|
||||||
|
|
||||||
|
/** 算法名称,后台展示用 */
|
||||||
|
@Excel(name = "算法名称,后台展示用")
|
||||||
|
private String algoName;
|
||||||
|
|
||||||
|
/** 执行引擎类型: GROOVY, PYTHON, JS, LUA等 */
|
||||||
|
@Excel(name = "执行引擎类型: GROOVY, PYTHON, JS, LUA等")
|
||||||
|
private String engineType;
|
||||||
|
|
||||||
|
/** 参数定义模型(JSON Schema),用于自动校验入参 */
|
||||||
|
@Excel(name = "参数定义模型(JSON Schema),用于自动校验入参")
|
||||||
|
private String inputSchema;
|
||||||
|
|
||||||
|
/** 算法脚本代码或规则表达式 */
|
||||||
|
@Excel(name = "算法脚本代码或规则表达式")
|
||||||
|
private String scriptContent;
|
||||||
|
|
||||||
|
/** 算法描述 */
|
||||||
|
@Excel(name = "算法描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/** 状态: 1-启用, 0-禁用 */
|
||||||
|
@Excel(name = "状态: 1-启用, 0-禁用")
|
||||||
|
private Long status;
|
||||||
|
|
||||||
|
/** 创建时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date createdAt;
|
||||||
|
|
||||||
|
/** 更新时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date updatedAt;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlgoType(String algoType)
|
||||||
|
{
|
||||||
|
this.algoType = algoType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAlgoType()
|
||||||
|
{
|
||||||
|
return algoType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlgoName(String algoName)
|
||||||
|
{
|
||||||
|
this.algoName = algoName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAlgoName()
|
||||||
|
{
|
||||||
|
return algoName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEngineType(String engineType)
|
||||||
|
{
|
||||||
|
this.engineType = engineType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEngineType()
|
||||||
|
{
|
||||||
|
return engineType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInputSchema(String inputSchema)
|
||||||
|
{
|
||||||
|
this.inputSchema = inputSchema;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInputSchema()
|
||||||
|
{
|
||||||
|
return inputSchema;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScriptContent(String scriptContent)
|
||||||
|
{
|
||||||
|
this.scriptContent = scriptContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getScriptContent()
|
||||||
|
{
|
||||||
|
return scriptContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description)
|
||||||
|
{
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription()
|
||||||
|
{
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Long status)
|
||||||
|
{
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getStatus()
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedAt(Date createdAt)
|
||||||
|
{
|
||||||
|
this.createdAt = createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCreatedAt()
|
||||||
|
{
|
||||||
|
return createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdatedAt(Date updatedAt)
|
||||||
|
{
|
||||||
|
this.updatedAt = updatedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getUpdatedAt()
|
||||||
|
{
|
||||||
|
return updatedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("algoType", getAlgoType())
|
||||||
|
.append("algoName", getAlgoName())
|
||||||
|
.append("engineType", getEngineType())
|
||||||
|
.append("inputSchema", getInputSchema())
|
||||||
|
.append("scriptContent", getScriptContent())
|
||||||
|
.append("description", getDescription())
|
||||||
|
.append("status", getStatus())
|
||||||
|
.append("createdAt", getCreatedAt())
|
||||||
|
.append("updatedAt", getUpdatedAt())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.solution.algo.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.solution.algo.domain.SysAlgoConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态规则配置Mapper接口
|
||||||
|
*
|
||||||
|
* @author zouju
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
public interface SysAlgoConfigMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询动态规则配置
|
||||||
|
*
|
||||||
|
* @param id 动态规则配置主键
|
||||||
|
* @return 动态规则配置
|
||||||
|
*/
|
||||||
|
public SysAlgoConfig selectSysAlgoConfigById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询动态规则配置列表
|
||||||
|
*
|
||||||
|
* @param sysAlgoConfig 动态规则配置
|
||||||
|
* @return 动态规则配置集合
|
||||||
|
*/
|
||||||
|
public List<SysAlgoConfig> selectSysAlgoConfigList(SysAlgoConfig sysAlgoConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增动态规则配置
|
||||||
|
*
|
||||||
|
* @param sysAlgoConfig 动态规则配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSysAlgoConfig(SysAlgoConfig sysAlgoConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改动态规则配置
|
||||||
|
*
|
||||||
|
* @param sysAlgoConfig 动态规则配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSysAlgoConfig(SysAlgoConfig sysAlgoConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除动态规则配置
|
||||||
|
*
|
||||||
|
* @param id 动态规则配置主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSysAlgoConfigById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除动态规则配置
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSysAlgoConfigByIds(Long[] ids);
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.solution.algo.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.solution.algo.domain.SysAlgoConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态规则配置Service接口
|
||||||
|
*
|
||||||
|
* @author zouju
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
public interface ISysAlgoConfigService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询动态规则配置
|
||||||
|
*
|
||||||
|
* @param id 动态规则配置主键
|
||||||
|
* @return 动态规则配置
|
||||||
|
*/
|
||||||
|
public SysAlgoConfig selectSysAlgoConfigById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询动态规则配置列表
|
||||||
|
*
|
||||||
|
* @param sysAlgoConfig 动态规则配置
|
||||||
|
* @return 动态规则配置集合
|
||||||
|
*/
|
||||||
|
public List<SysAlgoConfig> selectSysAlgoConfigList(SysAlgoConfig sysAlgoConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增动态规则配置
|
||||||
|
*
|
||||||
|
* @param sysAlgoConfig 动态规则配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSysAlgoConfig(SysAlgoConfig sysAlgoConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改动态规则配置
|
||||||
|
*
|
||||||
|
* @param sysAlgoConfig 动态规则配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSysAlgoConfig(SysAlgoConfig sysAlgoConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除动态规则配置
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的动态规则配置主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSysAlgoConfigByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除动态规则配置信息
|
||||||
|
*
|
||||||
|
* @param id 动态规则配置主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSysAlgoConfigById(Long id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
package com.solution.algo.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.solution.algo.mapper.SysAlgoConfigMapper;
|
||||||
|
import com.solution.algo.domain.SysAlgoConfig;
|
||||||
|
import com.solution.algo.service.ISysAlgoConfigService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态规则配置Service业务层处理
|
||||||
|
*
|
||||||
|
* @author zouju
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysAlgoConfigServiceImpl implements ISysAlgoConfigService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private SysAlgoConfigMapper sysAlgoConfigMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询动态规则配置
|
||||||
|
*
|
||||||
|
* @param id 动态规则配置主键
|
||||||
|
* @return 动态规则配置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SysAlgoConfig selectSysAlgoConfigById(Long id)
|
||||||
|
{
|
||||||
|
return sysAlgoConfigMapper.selectSysAlgoConfigById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询动态规则配置列表
|
||||||
|
*
|
||||||
|
* @param sysAlgoConfig 动态规则配置
|
||||||
|
* @return 动态规则配置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysAlgoConfig> selectSysAlgoConfigList(SysAlgoConfig sysAlgoConfig)
|
||||||
|
{
|
||||||
|
return sysAlgoConfigMapper.selectSysAlgoConfigList(sysAlgoConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增动态规则配置
|
||||||
|
*
|
||||||
|
* @param sysAlgoConfig 动态规则配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertSysAlgoConfig(SysAlgoConfig sysAlgoConfig)
|
||||||
|
{
|
||||||
|
return sysAlgoConfigMapper.insertSysAlgoConfig(sysAlgoConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改动态规则配置
|
||||||
|
*
|
||||||
|
* @param sysAlgoConfig 动态规则配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateSysAlgoConfig(SysAlgoConfig sysAlgoConfig)
|
||||||
|
{
|
||||||
|
return sysAlgoConfigMapper.updateSysAlgoConfig(sysAlgoConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除动态规则配置
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的动态规则配置主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSysAlgoConfigByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return sysAlgoConfigMapper.deleteSysAlgoConfigByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除动态规则配置信息
|
||||||
|
*
|
||||||
|
* @param id 动态规则配置主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSysAlgoConfigById(Long id)
|
||||||
|
{
|
||||||
|
return sysAlgoConfigMapper.deleteSysAlgoConfigById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<?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.solution.algo.mapper.SysAlgoConfigMapper">
|
||||||
|
|
||||||
|
<resultMap type="SysAlgoConfig" id="SysAlgoConfigResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="algoType" column="algo_type" />
|
||||||
|
<result property="algoName" column="algo_name" />
|
||||||
|
<result property="engineType" column="engine_type" />
|
||||||
|
<result property="inputSchema" column="input_schema" />
|
||||||
|
<result property="scriptContent" column="script_content" />
|
||||||
|
<result property="description" column="description" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="createdAt" column="created_at" />
|
||||||
|
<result property="updatedAt" column="updated_at" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectSysAlgoConfigVo">
|
||||||
|
select id, algo_type, algo_name, engine_type, input_schema, script_content, description, status, created_at, updated_at from sys_algo_config
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectSysAlgoConfigList" parameterType="SysAlgoConfig" resultMap="SysAlgoConfigResult">
|
||||||
|
<include refid="selectSysAlgoConfigVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="algoType != null and algoType != ''"> and algo_type = #{algoType}</if>
|
||||||
|
<if test="algoName != null and algoName != ''"> and algo_name like concat('%', #{algoName}, '%')</if>
|
||||||
|
<if test="engineType != null and engineType != ''"> and engine_type = #{engineType}</if>
|
||||||
|
<if test="inputSchema != null and inputSchema != ''"> and input_schema = #{inputSchema}</if>
|
||||||
|
<if test="scriptContent != null and scriptContent != ''"> and script_content = #{scriptContent}</if>
|
||||||
|
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||||
|
<if test="status != null "> and status = #{status}</if>
|
||||||
|
<if test="createdAt != null "> and created_at = #{createdAt}</if>
|
||||||
|
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSysAlgoConfigById" parameterType="Long" resultMap="SysAlgoConfigResult">
|
||||||
|
<include refid="selectSysAlgoConfigVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertSysAlgoConfig" parameterType="SysAlgoConfig" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into sys_algo_config
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="algoType != null and algoType != ''">algo_type,</if>
|
||||||
|
<if test="algoName != null and algoName != ''">algo_name,</if>
|
||||||
|
<if test="engineType != null and engineType != ''">engine_type,</if>
|
||||||
|
<if test="inputSchema != null">input_schema,</if>
|
||||||
|
<if test="scriptContent != null">script_content,</if>
|
||||||
|
<if test="description != null">description,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
<if test="createdAt != null">created_at,</if>
|
||||||
|
<if test="updatedAt != null">updated_at,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="algoType != null and algoType != ''">#{algoType},</if>
|
||||||
|
<if test="algoName != null and algoName != ''">#{algoName},</if>
|
||||||
|
<if test="engineType != null and engineType != ''">#{engineType},</if>
|
||||||
|
<if test="inputSchema != null">#{inputSchema},</if>
|
||||||
|
<if test="scriptContent != null">#{scriptContent},</if>
|
||||||
|
<if test="description != null">#{description},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="createdAt != null">#{createdAt},</if>
|
||||||
|
<if test="updatedAt != null">#{updatedAt},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateSysAlgoConfig" parameterType="SysAlgoConfig">
|
||||||
|
update sys_algo_config
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="algoType != null and algoType != ''">algo_type = #{algoType},</if>
|
||||||
|
<if test="algoName != null and algoName != ''">algo_name = #{algoName},</if>
|
||||||
|
<if test="engineType != null and engineType != ''">engine_type = #{engineType},</if>
|
||||||
|
<if test="inputSchema != null">input_schema = #{inputSchema},</if>
|
||||||
|
<if test="scriptContent != null">script_content = #{scriptContent},</if>
|
||||||
|
<if test="description != null">description = #{description},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
|
<if test="createdAt != null">created_at = #{createdAt},</if>
|
||||||
|
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteSysAlgoConfigById" parameterType="Long">
|
||||||
|
delete from sys_algo_config where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteSysAlgoConfigByIds" parameterType="String">
|
||||||
|
delete from sys_algo_config where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
9
pom.xml
9
pom.xml
@@ -224,12 +224,21 @@
|
|||||||
<version>${solution.version}</version>
|
<version>${solution.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 规则模块-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.solution</groupId>
|
||||||
|
<artifactId>solution-algo</artifactId>
|
||||||
|
<version>${solution.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>auto-solution-admin</module>
|
<module>auto-solution-admin</module>
|
||||||
<module>auto-solution-behaviour</module>
|
<module>auto-solution-behaviour</module>
|
||||||
|
|
||||||
|
<module>auto-solution-algo</module>
|
||||||
<module>auto-solution-framework</module>
|
<module>auto-solution-framework</module>
|
||||||
<module>auto-solution-system</module>
|
<module>auto-solution-system</module>
|
||||||
<module>auto-solution-quartz</module>
|
<module>auto-solution-quartz</module>
|
||||||
|
|||||||
Reference in New Issue
Block a user