瀏覽代碼

模型管理

ZhuDeKang 7 月之前
父節點
當前提交
4433bb5bde

+ 110 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/TbModelsController.java

@@ -0,0 +1,110 @@
+package com.ruoyi.interfaces.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.interfaces.domain.TbModels;
+import com.ruoyi.interfaces.service.TbModelsService;
+import io.swagger.annotations.ApiOperation;
+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.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 模型Controller
+ * 
+ * @author ruoyi
+ * @date 2025-06-12
+ */
+@RestController
+@RequestMapping("/tb/models")
+public class TbModelsController extends BaseController
+{
+    @Autowired
+    private TbModelsService tbModelsService;
+
+    /**
+     * 查询模型列表
+     */
+    @ApiOperation("查询模型列表")
+    @GetMapping("/list")
+    public TableDataInfo list(TbModels tbModels)
+    {
+        startPage();
+        List<TbModels> list = tbModelsService.selectTbModelsList(tbModels);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出模型列表
+     */
+    @ApiOperation("导出模型列表")
+    @Log(title = "模型", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TbModels tbModels)
+    {
+        List<TbModels> list = tbModelsService.selectTbModelsList(tbModels);
+        ExcelUtil<TbModels> util = new ExcelUtil<TbModels>(TbModels.class);
+        util.exportExcel(response, list, "模型数据");
+    }
+
+    /**
+     * 获取模型详细信息
+     */
+    @ApiOperation("获取模型详细信息")
+    @GetMapping(value = "/{modelId}")
+    public AjaxResult getInfo(@PathVariable("modelId") Long modelId)
+    {
+        return success(tbModelsService.selectTbModelsByModelId(modelId));
+    }
+
+    /**
+     * 新增模型
+     */
+    @ApiOperation("新增模型")
+    @Log(title = "模型", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TbModels tbModels)
+    {
+        tbModels.setCreatedBy(getUsername());
+        tbModels.setCreatedTime(DateUtils.getNowDate());
+        return toAjax(tbModelsService.insertTbModels(tbModels));
+    }
+
+    /**
+     * 修改模型
+     */
+    @ApiOperation("修改模型")
+    @Log(title = "模型", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TbModels tbModels)
+    {
+        tbModels.setUpdatedBy(getUsername());
+        tbModels.setUpdatedTime(DateUtils.getNowDate());
+        return toAjax(tbModelsService.updateTbModels(tbModels));
+    }
+
+    /**
+     * 删除模型
+     */
+    @ApiOperation("删除模型")
+    @Log(title = "模型", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{modelIds}")
+    public AjaxResult remove(@PathVariable Long[] modelIds)
+    {
+        return toAjax(tbModelsService.deleteTbModelsByModelIds(modelIds));
+    }
+}

+ 427 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/domain/TbModels.java

@@ -0,0 +1,427 @@
+package com.ruoyi.interfaces.domain;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 模型对象 tb_models
+ *
+ * @author ruoyi
+ * @date 2025-06-12
+ */
+public class TbModels extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 模型编号;
+     */
+    @ApiModelProperty("模型编号id")
+    private Long modelId;
+
+    /**
+     * 模型名称;模型名称
+     */
+    @ApiModelProperty("模型名称")
+    @Excel(name = "模型名称")
+    private String modelName;
+
+    /**
+     * 模型简称;模型简称
+     */
+    @ApiModelProperty("模型简称")
+    @Excel(name = "模型简称")
+    private String modelShortname;
+
+    /**
+     * 模型分组;模型分组
+     */
+    @ApiModelProperty("模型分组")
+    @Excel(name = "模型分组")
+    private String modelGroup;
+
+    /**
+     * 模型描述;模型描述
+     */
+    @ApiModelProperty("模型描述")
+    @Excel(name = "模型描述")
+    private String modelDescription;
+
+    /**
+     * 版本;版本
+     */
+    @ApiModelProperty("版本")
+    @Excel(name = "版本")
+    private String version;
+
+    /**
+     * 模型类型;模型类型
+     */
+    @ApiModelProperty("模型类型")
+    @Excel(name = "模型类型")
+    private String modelType;
+
+    /**
+     * 模型执行类型;模型执行类型
+     */
+    @ApiModelProperty("模型执行类型")
+    @Excel(name = "模型执行类型")
+    private String executionType;
+
+    /**
+     * 任务类型;任务类型
+     */
+    @ApiModelProperty("任务类型")
+    @Excel(name = "任务类型")
+    private String taskType;
+
+    /**
+     * 提供单位;提供单位
+     */
+    @ApiModelProperty("提供单位")
+    @Excel(name = "提供单位")
+    private String providerUnit;
+
+    /**
+     * 动态库路径;动态库路径
+     */
+    @ApiModelProperty("动态库路径")
+    @Excel(name = "动态库路径")
+    private String dllPath;
+
+    /**
+     * 是否可率定;是否可率定
+     */
+    @ApiModelProperty(value = "是否可率定",allowableValues = "1")
+    @Excel(name = "是否可率定")
+    private String isCalibratable;
+
+    /**
+     * 状态;状态
+     */
+    @ApiModelProperty(value = "状态",allowableValues = "1")
+    @Excel(name = "状态")
+    private String status;
+
+    /**
+     * 创建人
+     */
+    @ApiModelProperty("创建人")
+    @Excel(name = "创建人")
+    private String createdBy;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty("创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdTime;
+
+    /**
+     * 更新人
+     */
+    @ApiModelProperty("更新人")
+    @Excel(name = "更新人")
+    private String updatedBy;
+
+    /**
+     * 更新时间
+     */
+    @ApiModelProperty("更新时间")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedTime;
+
+    /**
+     * 程序语言
+     */
+    @ApiModelProperty("程序语言")
+    @Excel(name = "程序语言")
+    private String modelLanguafe;
+
+    /**
+     * 版本号
+     */
+    @ApiModelProperty("版本号")
+    @Excel(name = "版本号")
+    private String modelVersion;
+
+    /**
+     * 模型运行需要的最小CPU核心数
+     */
+    @ApiModelProperty("模型运行需要的最小CPU核心数")
+    @Excel(name = "模型运行需要的最小CPU核心数")
+    private String cpuNum;
+
+    /**
+     * 模型运行需要的最小内存
+     */
+    @ApiModelProperty("模型运行需要的最小内存")
+    @Excel(name = "模型运行需要的最小内存")
+    private String memo;
+
+    /**
+     * 是否需要GPU
+     */
+    @ApiModelProperty("是否需要GPU")
+    @Excel(name = "是否需要GPU")
+    private String isGpu;
+
+    /**
+     * CPU架构平台
+     */
+    @ApiModelProperty("CPU架构平台")
+    @Excel(name = "CPU架构平台")
+    private String platform;
+
+    /**
+     * 模型执行命令
+     */
+    @ApiModelProperty("模型执行命令")
+    @Excel(name = "模型执行命令")
+    private String runModel;
+
+    /**
+     * 输入、输出示例文件地址
+     */
+    @ApiModelProperty("输入、输出示例文件地址")
+    @Excel(name = "输入、输出示例文件地址")
+    private String modelExample;
+
+    public void setModelId(Long modelId) {
+        this.modelId = modelId;
+    }
+
+    public Long getModelId() {
+        return modelId;
+    }
+
+    public void setModelName(String modelName) {
+        this.modelName = modelName;
+    }
+
+    public String getModelName() {
+        return modelName;
+    }
+
+    public void setModelShortname(String modelShortname) {
+        this.modelShortname = modelShortname;
+    }
+
+    public String getModelShortname() {
+        return modelShortname;
+    }
+
+    public void setModelGroup(String modelGroup) {
+        this.modelGroup = modelGroup;
+    }
+
+    public String getModelGroup() {
+        return modelGroup;
+    }
+
+    public void setModelDescription(String modelDescription) {
+        this.modelDescription = modelDescription;
+    }
+
+    public String getModelDescription() {
+        return modelDescription;
+    }
+
+    public void setVersion(String version) {
+        this.version = version;
+    }
+
+    public String getVersion() {
+        return version;
+    }
+
+    public void setModelType(String modelType) {
+        this.modelType = modelType;
+    }
+
+    public String getModelType() {
+        return modelType;
+    }
+
+    public void setExecutionType(String executionType) {
+        this.executionType = executionType;
+    }
+
+    public String getExecutionType() {
+        return executionType;
+    }
+
+    public void setTaskType(String taskType) {
+        this.taskType = taskType;
+    }
+
+    public String getTaskType() {
+        return taskType;
+    }
+
+    public void setProviderUnit(String providerUnit) {
+        this.providerUnit = providerUnit;
+    }
+
+    public String getProviderUnit() {
+        return providerUnit;
+    }
+
+    public void setDllPath(String dllPath) {
+        this.dllPath = dllPath;
+    }
+
+    public String getDllPath() {
+        return dllPath;
+    }
+
+    public void setIsCalibratable(String isCalibratable) {
+        this.isCalibratable = isCalibratable;
+    }
+
+    public String getIsCalibratable() {
+        return isCalibratable;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setCreatedBy(String createdBy) {
+        this.createdBy = createdBy;
+    }
+
+    public String getCreatedBy() {
+        return createdBy;
+    }
+
+    public void setCreatedTime(Date createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    public Date getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setUpdatedBy(String updatedBy) {
+        this.updatedBy = updatedBy;
+    }
+
+    public String getUpdatedBy() {
+        return updatedBy;
+    }
+
+    public void setUpdatedTime(Date updatedTime) {
+        this.updatedTime = updatedTime;
+    }
+
+    public Date getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setModelLanguafe(String modelLanguafe) {
+        this.modelLanguafe = modelLanguafe;
+    }
+
+    public String getModelLanguafe() {
+        return modelLanguafe;
+    }
+
+    public void setModelVersion(String modelVersion) {
+        this.modelVersion = modelVersion;
+    }
+
+    public String getModelVersion() {
+        return modelVersion;
+    }
+
+    public void setCpuNum(String cpuNum) {
+        this.cpuNum = cpuNum;
+    }
+
+    public String getCpuNum() {
+        return cpuNum;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo;
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setIsGpu(String isGpu) {
+        this.isGpu = isGpu;
+    }
+
+    public String getIsGpu() {
+        return isGpu;
+    }
+
+    public void setPlatform(String platform) {
+        this.platform = platform;
+    }
+
+    public String getPlatform() {
+        return platform;
+    }
+
+    public void setRunModel(String runModel) {
+        this.runModel = runModel;
+    }
+
+    public String getRunModel() {
+        return runModel;
+    }
+
+    public void setModelExample(String modelExample) {
+        this.modelExample = modelExample;
+    }
+
+    public String getModelExample() {
+        return modelExample;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("modelId", getModelId())
+                .append("modelName", getModelName())
+                .append("modelShortname", getModelShortname())
+                .append("modelGroup", getModelGroup())
+                .append("modelDescription", getModelDescription())
+                .append("VERSION", getVersion())
+                .append("modelType", getModelType())
+                .append("executionType", getExecutionType())
+                .append("taskType", getTaskType())
+                .append("providerUnit", getProviderUnit())
+                .append("dllPath", getDllPath())
+                .append("isCalibratable", getIsCalibratable())
+                .append("STATUS", getStatus())
+                .append("createdBy", getCreatedBy())
+                .append("createdTime", getCreatedTime())
+                .append("updatedBy", getUpdatedBy())
+                .append("updatedTime", getUpdatedTime())
+                .append("modelLanguafe", getModelLanguafe())
+                .append("modelVersion", getModelVersion())
+                .append("cpuNum", getCpuNum())
+                .append("MEMO", getMemo())
+                .append("isGpu", getIsGpu())
+                .append("PLATFORM", getPlatform())
+                .append("runModel", getRunModel())
+                .append("modelExample", getModelExample())
+                .toString();
+    }
+}

+ 64 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/mapper/TbModelsMapper.java

@@ -0,0 +1,64 @@
+package com.ruoyi.interfaces.mapper;
+
+import com.ruoyi.common.annotation.DataSource;
+import com.ruoyi.common.enums.DataSourceType;
+import com.ruoyi.interfaces.domain.TbModels;
+
+import java.util.List;
+
+/**
+ * 模型Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2025-06-12
+ */
+public interface TbModelsMapper
+{
+    /**
+     * 查询模型
+     * 
+     * @param modelId 模型主键
+     * @return 模型
+     */
+    public TbModels selectTbModelsByModelId(Long modelId);
+
+    /**
+     * 查询模型列表
+     * 
+     * @param tbModels 模型
+     * @return 模型集合
+     */
+    public List<TbModels> selectTbModelsList(TbModels tbModels);
+
+    /**
+     * 新增模型
+     * 
+     * @param tbModels 模型
+     * @return 结果
+     */
+    public int insertTbModels(TbModels tbModels);
+
+    /**
+     * 修改模型
+     * 
+     * @param tbModels 模型
+     * @return 结果
+     */
+    public int updateTbModels(TbModels tbModels);
+
+    /**
+     * 删除模型
+     * 
+     * @param modelId 模型主键
+     * @return 结果
+     */
+    public int deleteTbModelsByModelId(Long modelId);
+
+    /**
+     * 批量删除模型
+     * 
+     * @param modelIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTbModelsByModelIds(Long[] modelIds);
+}

+ 62 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/TbModelsService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.interfaces.service;
+
+import com.ruoyi.interfaces.domain.TbModels;
+
+import java.util.List;
+
+/**
+ * 模型Service接口
+ * 
+ * @author ruoyi
+ * @date 2025-06-12
+ */
+public interface TbModelsService
+{
+    /**
+     * 查询模型
+     * 
+     * @param modelId 模型主键
+     * @return 模型
+     */
+    public TbModels selectTbModelsByModelId(Long modelId);
+
+    /**
+     * 查询模型列表
+     * 
+     * @param tbModels 模型
+     * @return 模型集合
+     */
+    public List<TbModels> selectTbModelsList(TbModels tbModels);
+
+    /**
+     * 新增模型
+     * 
+     * @param tbModels 模型
+     * @return 结果
+     */
+    public int insertTbModels(TbModels tbModels);
+
+    /**
+     * 修改模型
+     * 
+     * @param tbModels 模型
+     * @return 结果
+     */
+    public int updateTbModels(TbModels tbModels);
+
+    /**
+     * 批量删除模型
+     * 
+     * @param modelIds 需要删除的模型主键集合
+     * @return 结果
+     */
+    public int deleteTbModelsByModelIds(Long[] modelIds);
+
+    /**
+     * 删除模型信息
+     * 
+     * @param modelId 模型主键
+     * @return 结果
+     */
+    public int deleteTbModelsByModelId(Long modelId);
+}

+ 94 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/impl/TbModelsServiceImpl.java

@@ -0,0 +1,94 @@
+package com.ruoyi.interfaces.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.interfaces.domain.TbModels;
+import com.ruoyi.interfaces.mapper.TbModelsMapper;
+import com.ruoyi.interfaces.service.TbModelsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 模型Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2025-06-12
+ */
+@Service
+public class TbModelsServiceImpl implements TbModelsService
+{
+    @Autowired
+    private TbModelsMapper tbModelsMapper;
+
+    /**
+     * 查询模型
+     * 
+     * @param modelId 模型主键
+     * @return 模型
+     */
+    @Override
+    public TbModels selectTbModelsByModelId(Long modelId)
+    {
+        return tbModelsMapper.selectTbModelsByModelId(modelId);
+    }
+
+    /**
+     * 查询模型列表
+     * 
+     * @param tbModels 模型
+     * @return 模型
+     */
+    @Override
+    public List<TbModels> selectTbModelsList(TbModels tbModels)
+    {
+        return tbModelsMapper.selectTbModelsList(tbModels);
+    }
+
+    /**
+     * 新增模型
+     * 
+     * @param tbModels 模型
+     * @return 结果
+     */
+    @Override
+    public int insertTbModels(TbModels tbModels)
+    {
+        return tbModelsMapper.insertTbModels(tbModels);
+    }
+
+    /**
+     * 修改模型
+     * 
+     * @param tbModels 模型
+     * @return 结果
+     */
+    @Override
+    public int updateTbModels(TbModels tbModels)
+    {
+        return tbModelsMapper.updateTbModels(tbModels);
+    }
+
+    /**
+     * 批量删除模型
+     * 
+     * @param modelIds 需要删除的模型主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTbModelsByModelIds(Long[] modelIds)
+    {
+        return tbModelsMapper.deleteTbModelsByModelIds(modelIds);
+    }
+
+    /**
+     * 删除模型信息
+     * 
+     * @param modelId 模型主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTbModelsByModelId(Long modelId)
+    {
+        return tbModelsMapper.deleteTbModelsByModelId(modelId);
+    }
+}

+ 171 - 0
ruoyi-api-patform/src/main/resources/mapper/interfaces/TbModelsMapper.xml

@@ -0,0 +1,171 @@
+<?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.ruoyi.interfaces.mapper.TbModelsMapper">
+
+    <resultMap type="com.ruoyi.interfaces.domain.TbModels" id="TbModelsResult">
+        <result property="modelId"    column="MODEL_ID"    />
+        <result property="modelName"    column="MODEL_NAME"    />
+        <result property="modelShortname"    column="MODEL_SHORTNAME"    />
+        <result property="modelGroup"    column="MODEL_GROUP"    />
+        <result property="modelDescription"    column="MODEL_DESCRIPTION"    />
+        <result property="version"    column="VERSION"    />
+        <result property="modelType"    column="MODEL_TYPE"    />
+        <result property="executionType"    column="EXECUTION_TYPE"    />
+        <result property="taskType"    column="TASK_TYPE"    />
+        <result property="providerUnit"    column="PROVIDER_UNIT"    />
+        <result property="dllPath"    column="DLL_PATH"    />
+        <result property="isCalibratable"    column="IS_CALIBRATABLE"    />
+        <result property="status"    column="STATUS"    />
+        <result property="createdBy"    column="CREATED_BY"    />
+        <result property="createdTime"    column="CREATED_TIME"    />
+        <result property="updatedBy"    column="UPDATED_BY"    />
+        <result property="updatedTime"    column="UPDATED_TIME"    />
+        <result property="modelLanguafe"    column="MODEL_LANGUAFE"    />
+        <result property="modelVersion"    column="MODEL_VERSION"    />
+        <result property="cpuNum"    column="CPU_NUM"    />
+        <result property="memo"    column="MEMO"    />
+        <result property="isGpu"    column="IS_GPU"    />
+        <result property="platform"    column="PLATFORM"    />
+        <result property="runModel"    column="RUN_MODEL"    />
+        <result property="modelExample"    column="MODEL_EXAMPLE"    />
+    </resultMap>
+
+    <sql id="selectTbModelsVo">
+        select MODEL_ID, MODEL_NAME, MODEL_SHORTNAME, MODEL_GROUP, MODEL_DESCRIPTION, VERSION, MODEL_TYPE, EXECUTION_TYPE, TASK_TYPE, PROVIDER_UNIT, DLL_PATH, IS_CALIBRATABLE, STATUS, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, MODEL_LANGUAFE, MODEL_VERSION, CPU_NUM, MEMO, IS_GPU, PLATFORM, RUN_MODEL, MODEL_EXAMPLE from sh_model.tb_models
+    </sql>
+
+    <select id="selectTbModelsList" parameterType="com.ruoyi.interfaces.domain.TbModels" resultMap="TbModelsResult">
+        <include refid="selectTbModelsVo"/>
+        <where>
+            <if test="modelName != null  and modelName != ''"> and MODEL_NAME like concat('%', #{modelName}, '%')</if>
+            <if test="modelShortname != null  and modelShortname != ''"> and MODEL_SHORTNAME like concat('%', #{modelShortname}, '%')</if>
+            <if test="modelGroup != null  and modelGroup != ''"> and MODEL_GROUP = #{modelGroup}</if>
+            <if test="modelDescription != null  and modelDescription != ''"> and MODEL_DESCRIPTION = #{modelDescription}</if>
+            <if test="version != null  and version != ''"> and VERSION = #{version}</if>
+            <if test="modelType != null  and modelType != ''"> and MODEL_TYPE = #{modelType}</if>
+            <if test="executionType != null  and executionType != ''"> and EXECUTION_TYPE = #{executionType}</if>
+            <if test="taskType != null  and taskType != ''"> and TASK_TYPE = #{taskType}</if>
+            <if test="providerUnit != null  and providerUnit != ''"> and PROVIDER_UNIT = #{providerUnit}</if>
+            <if test="dllPath != null  and dllPath != ''"> and DLL_PATH = #{dllPath}</if>
+            <if test="isCalibratable != null  and isCalibratable != ''"> and IS_CALIBRATABLE = #{isCalibratable}</if>
+            <if test="status != null  and status != ''"> and STATUS = #{status}</if>
+            <if test="createdBy != null  and createdBy != ''"> and CREATED_BY = #{createdBy}</if>
+            <if test="createdTime != null "> and CREATED_TIME = #{createdTime}</if>
+            <if test="updatedBy != null  and updatedBy != ''"> and UPDATED_BY = #{updatedBy}</if>
+            <if test="updatedTime != null "> and UPDATED_TIME = #{updatedTime}</if>
+            <if test="modelLanguafe != null  and modelLanguafe != ''"> and MODEL_LANGUAFE = #{modelLanguafe}</if>
+            <if test="modelVersion != null  and modelVersion != ''"> and MODEL_VERSION = #{modelVersion}</if>
+            <if test="cpuNum != null  and cpuNum != ''"> and CPU_NUM = #{cpuNum}</if>
+            <if test="memo != null  and memo != ''"> and MEMO = #{memo}</if>
+            <if test="isGpu != null  and isGpu != ''"> and IS_GPU = #{isGpu}</if>
+            <if test="platform != null  and platform != ''"> and PLATFORM = #{platform}</if>
+            <if test="runModel != null  and runModel != ''"> and RUN_MODEL = #{runModel}</if>
+            <if test="modelExample != null  and modelExample != ''"> and modelExample = #{MODEL_EXAMPLE}</if>
+        </where>
+    </select>
+
+    <select id="selectTbModelsByModelId" parameterType="Long" resultMap="TbModelsResult">
+        <include refid="selectTbModelsVo"/>
+        where MODEL_ID = #{modelId}
+    </select>
+
+    <insert id="insertTbModels" parameterType="com.ruoyi.interfaces.domain.TbModels" useGeneratedKeys="true" keyProperty="modelId">
+        insert into sh_model.tb_models
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="modelName != null">MODEL_NAME,</if>
+            <if test="modelShortname != null">MODEL_SHORTNAME,</if>
+            <if test="modelGroup != null">MODEL_GROUP,</if>
+            <if test="modelDescription != null">MODEL_DESCRIPTION,</if>
+            <if test="version != null">VERSION,</if>
+            <if test="modelType != null">MODEL_TYPE,</if>
+            <if test="executionType != null">EXECUTION_TYPE,</if>
+            <if test="taskType != null">TASK_TYPE,</if>
+            <if test="providerUnit != null">PROVIDER_UNIT,</if>
+            <if test="dllPath != null">DLL_PATH,</if>
+            <if test="isCalibratable != null">IS_CALIBRATABLE,</if>
+            <if test="status != null">STATUS,</if>
+            <if test="createdBy != null">CREATED_BY,</if>
+            <if test="createdTime != null">CREATED_TIME,</if>
+            <if test="updatedBy != null">UPDATED_BY,</if>
+            <if test="updatedTime != null">UPDATED_TIME,</if>
+            <if test="modelLanguafe != null">MODEL_LANGUAFE,</if>
+            <if test="modelVersion != null">MODEL_VERSION,</if>
+            <if test="cpuNum != null">CPU_NUM,</if>
+            <if test="memo != null">MEMO,</if>
+            <if test="isGpu != null">IS_GPU,</if>
+            <if test="platform != null">PLATFORM,</if>
+            <if test="runModel != null">RUN_MODEL,</if>
+            <if test="modelExample != null">MODEL_EXAMPLE,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="modelName != null">#{modelName},</if>
+            <if test="modelShortname != null">#{modelShortname},</if>
+            <if test="modelGroup != null">#{modelGroup},</if>
+            <if test="modelDescription != null">#{modelDescription},</if>
+            <if test="version != null">#{version},</if>
+            <if test="modelType != null">#{modelType},</if>
+            <if test="executionType != null">#{executionType},</if>
+            <if test="taskType != null">#{taskType},</if>
+            <if test="providerUnit != null">#{providerUnit},</if>
+            <if test="dllPath != null">#{dllPath},</if>
+            <if test="isCalibratable != null">#{isCalibratable},</if>
+            <if test="status != null">#{status},</if>
+            <if test="createdBy != null">#{createdBy},</if>
+            <if test="createdTime != null">#{createdTime},</if>
+            <if test="updatedBy != null">#{updatedBy},</if>
+            <if test="updatedTime != null">#{updatedTime},</if>
+            <if test="modelLanguafe != null">#{modelLanguafe},</if>
+            <if test="modelVersion != null">#{modelVersion},</if>
+            <if test="cpuNum != null">#{cpuNum},</if>
+            <if test="memo != null">#{memo},</if>
+            <if test="isGpu != null">#{isGpu},</if>
+            <if test="platform != null">#{platform},</if>
+            <if test="runModel != null">#{runModel},</if>
+            <if test="modelExample != null">#{modelExample},</if>
+        </trim>
+    </insert>
+
+    <update id="updateTbModels" parameterType="com.ruoyi.interfaces.domain.TbModels">
+        update sh_model.tb_models
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="modelName != null">MODEL_NAME = #{modelName},</if>
+            <if test="modelShortname != null">MODEL_SHORTNAME = #{modelShortname},</if>
+            <if test="modelGroup != null">MODEL_GROUP = #{modelGroup},</if>
+            <if test="modelDescription != null">MODEL_DESCRIPTION = #{modelDescription},</if>
+            <if test="version != null">VERSION = #{version},</if>
+            <if test="modelType != null">MODEL_TYPE = #{modelType},</if>
+            <if test="executionType != null">EXECUTION_TYPE = #{executionType},</if>
+            <if test="taskType != null">TASK_TYPE = #{taskType},</if>
+            <if test="providerUnit != null">PROVIDER_UNIT = #{providerUnit},</if>
+            <if test="dllPath != null">DLL_PATH = #{dllPath},</if>
+            <if test="isCalibratable != null">IS_CALIBRATABLE = #{isCalibratable},</if>
+            <if test="status != null">STATUS = #{status},</if>
+            <if test="createdBy != null">CREATED_BY = #{createdBy},</if>
+            <if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
+            <if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>
+            <if test="updatedTime != null">UPDATED_TIME = #{updatedTime},</if>
+            <if test="modelLanguafe != null">MODEL_LANGUAFE = #{modelLanguafe},</if>
+            <if test="modelVersion != null">MODEL_VERSION = #{modelVersion},</if>
+            <if test="cpuNum != null">CPU_NUM = #{cpuNum},</if>
+            <if test="memo != null">MEMO = #{memo},</if>
+            <if test="isGpu != null">IS_GPU = #{isGpu},</if>
+            <if test="platform != null">PLATFORM = #{platform},</if>
+            <if test="runModel != null">RUN_MODEL = #{runModel},</if>
+            <if test="modelExample != null">MODEL_EXAMPLE = #{modelExample},</if>
+        </trim>
+        where MODEL_ID = #{modelId}
+    </update>
+
+    <delete id="deleteTbModelsByModelId" parameterType="Long">
+        delete from sh_model.tb_models where MODEL_ID = #{modelId}
+    </delete>
+
+    <delete id="deleteTbModelsByModelIds" parameterType="String">
+        delete from sh_model.tb_models where MODEL_ID in
+        <foreach item="modelId" collection="array" open="(" separator="," close=")">
+            #{modelId}
+        </foreach>
+    </delete>
+</mapper>