对比新文件 |
| | |
| | | package com.iailab.module.mhub.common.enums; |
| | | |
| | | /** |
| | | * 常量 |
| | | * |
| | | * @author Mark sunlightcs@gmail.com |
| | | */ |
| | | public interface MdkConstant { |
| | | /** |
| | | * JNI |
| | | */ |
| | | String JNI = "JNI"; |
| | | /** |
| | | * impl |
| | | */ |
| | | String IMPL = "impl"; |
| | | /** |
| | | * C++ |
| | | */ |
| | | String C = "C++"; |
| | | /** |
| | | * IAILMDK |
| | | */ |
| | | String IAILMDK = "IAILMDK"; |
| | | /** |
| | | * Algs |
| | | */ |
| | | String ALGS = "Algs"; |
| | | /** |
| | | * libs |
| | | */ |
| | | String LIBS = "libs"; |
| | | /** |
| | | * dll |
| | | */ |
| | | String DLL = "dll"; |
| | | /** |
| | | * jar |
| | | */ |
| | | String JAR = "jar"; |
| | | /** |
| | | * 分隔符 dll、jar文件名 |
| | | */ |
| | | String SPLIT = "__"; |
| | | /** |
| | | * 项目未发布dll和jar目录 |
| | | */ |
| | | String PROJECT_UNPUBLISH = "projectUnpublish"; |
| | | /** |
| | | * 项目发布dll和jar目录 |
| | | */ |
| | | String PROJECT_PUBLISH = "projectPublish"; |
| | | /** |
| | | * setup.py |
| | | */ |
| | | String SETUP_PY = "setup.py"; |
| | | /** |
| | | * 编译pyd生成文件后缀 |
| | | */ |
| | | String PYD_SUFFIX = ".cp37-win_amd64.pyd"; |
| | | /** |
| | | * 默认模型路径key |
| | | */ |
| | | String PY_FILE_KEY = "pyFile"; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.dao; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.Master; |
| | | import com.iailab.framework.mybatis.core.mapper.BaseMapperX; |
| | | import com.iailab.module.mhub.mdk.entity.MdkModelFileEntity; |
| | | import com.iailab.module.mhub.mdk.vo.MdkModelFileRespVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * MDK模型文件 |
| | | * |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年08月14日 |
| | | */ |
| | | @Master |
| | | @Mapper |
| | | public interface MdkModelFileDao extends BaseMapperX<MdkModelFileEntity> { |
| | | |
| | | MdkModelFileRespVO get(String id); |
| | | |
| | | List<MdkModelFileRespVO> selectByIds(@Param("ids") List<String> ids); |
| | | |
| | | List<MdkModelFileRespVO> list(@Param("params") Map<String, Object> params); |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.dao; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.Master; |
| | | import com.iailab.framework.mybatis.core.mapper.BaseMapperX; |
| | | import com.iailab.module.mhub.mdk.entity.MdkModelSettingEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2025年06月09日 |
| | | */ |
| | | @Master |
| | | @Mapper |
| | | public interface MdkModelSettingDao extends BaseMapperX<MdkModelSettingEntity> { |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.dao; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.Master; |
| | | import com.iailab.framework.mybatis.core.mapper.BaseMapperX; |
| | | import com.iailab.module.mhub.mdk.entity.MdkSettingSelectEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @description: |
| | | * @author: dzd |
| | | * @date: 2024/9/14 15:11 |
| | | **/ |
| | | @Master |
| | | @Mapper |
| | | public interface MdkSettingSelectDao extends BaseMapperX<MdkSettingSelectEntity> { |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * MDK模型文件 |
| | | * |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年08月14日 |
| | | */ |
| | | @Data |
| | | @TableName("t_mdk_model_file") |
| | | public class MdkModelFileEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @TableId |
| | | private String id; |
| | | |
| | | /** |
| | | * 模型名称 |
| | | */ |
| | | private String pyName; |
| | | |
| | | /** |
| | | * 模型中文名称 |
| | | */ |
| | | private String pyChineseName; |
| | | |
| | | /** |
| | | * 源文件保存路径 |
| | | */ |
| | | private String filePath; |
| | | |
| | | /** |
| | | * 模型类型 |
| | | */ |
| | | private String pyType; |
| | | |
| | | /** |
| | | * 包名 |
| | | */ |
| | | private String pkgName; |
| | | |
| | | /** |
| | | * 类名 |
| | | */ |
| | | private String className; |
| | | |
| | | /** |
| | | * 模型路径 |
| | | */ |
| | | private String pyModule; |
| | | |
| | | /** |
| | | * icon图片名 |
| | | */ |
| | | private String icon; |
| | | |
| | | /** |
| | | * 所属菜单 |
| | | */ |
| | | private String menuName; |
| | | |
| | | /** |
| | | * 所属组 |
| | | */ |
| | | private String groupName; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 更新者 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Long updater; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Date updateDate; |
| | | |
| | | /** |
| | | * 创建者 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long creator; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createDate; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2025年06月09日 |
| | | */ |
| | | @Data |
| | | @TableName("t_mdk_model_setting") |
| | | public class MdkModelSettingEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @TableId |
| | | private String id; |
| | | |
| | | /** |
| | | * 方法id |
| | | */ |
| | | private String methodId; |
| | | |
| | | /** |
| | | * key |
| | | */ |
| | | private String settingKey; |
| | | |
| | | /** |
| | | * 参数名称 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 参数默认值 |
| | | */ |
| | | private String value; |
| | | |
| | | /** |
| | | * 输入类型 |
| | | */ |
| | | private String type; |
| | | |
| | | /** |
| | | * 参数类型 |
| | | */ |
| | | private String valueType; |
| | | |
| | | /** |
| | | * 最大值 |
| | | */ |
| | | private Integer max; |
| | | |
| | | /** |
| | | * 最小值 |
| | | */ |
| | | private Integer min; |
| | | |
| | | /** |
| | | * 排序 |
| | | */ |
| | | private Integer sort; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @description: 参数选项关联表 |
| | | * @author: dzd |
| | | * @date: 2024/9/13 15:49 |
| | | **/ |
| | | @Data |
| | | @TableName("t_mdk_setting_select") |
| | | public class MdkSettingSelectEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @TableId |
| | | private String id; |
| | | |
| | | /** |
| | | * '参数id' |
| | | */ |
| | | private String settingId; |
| | | |
| | | /** |
| | | * key |
| | | */ |
| | | private String selectKey; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 排序 |
| | | */ |
| | | private Integer sort; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.service; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2025年06月09日 |
| | | */ |
| | | public interface MdkModelFileService { |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.service; |
| | | |
| | | import com.iailab.module.mhub.mdk.vo.MdkModelSettingSaveReqVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description: |
| | | * @author: dzd |
| | | * @date: 2024/9/14 15:10 |
| | | **/ |
| | | public interface MdkModelSettingService { |
| | | |
| | | void insertList(List<MdkModelSettingSaveReqVO> list, String MethodId); |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.service; |
| | | |
| | | import com.iailab.module.mhub.mdk.vo.MdkSettingSelectRespVO; |
| | | import com.iailab.module.mhub.mdk.vo.MdkSettingSelectSaveReqVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2025年06月09日 |
| | | */ |
| | | public interface MdkSettingSelectService { |
| | | |
| | | void deleteBySettingId(String settingId); |
| | | |
| | | void insertList(List<MdkSettingSelectSaveReqVO> list, String settingId); |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.service.impl; |
| | | |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | | import com.iailab.module.mhub.common.enums.MdkConstant; |
| | | import com.iailab.module.mhub.mdk.dao.MdkModelSettingDao; |
| | | import com.iailab.module.mhub.mdk.entity.MdkModelSettingEntity; |
| | | import com.iailab.module.mhub.mdk.service.MdkModelSettingService; |
| | | import com.iailab.module.mhub.mdk.service.MdkSettingSelectService; |
| | | import com.iailab.module.mhub.mdk.vo.MdkModelSettingSaveReqVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2025年06月09日 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class MdkModelSettingServiceImpl implements MdkModelSettingService { |
| | | |
| | | @Resource |
| | | private MdkModelSettingDao mdkModelSettingDao; |
| | | |
| | | @Resource |
| | | private MdkSettingSelectService mdkSettingSelectService; |
| | | |
| | | @Override |
| | | public void insertList(List<MdkModelSettingSaveReqVO> list, String MethodId) { |
| | | List<MdkModelSettingEntity> entityList = ConvertUtils.sourceToTarget(list, MdkModelSettingEntity.class); |
| | | // pyFile排第一 |
| | | entityList.sort((e1, e2) -> e1.getSettingKey().equals(MdkConstant.PY_FILE_KEY) ? -1 : e2.getSettingKey().equals(MdkConstant.PY_FILE_KEY) ? 1 : 0); |
| | | for (int i = 0; i < entityList.size(); i++) { |
| | | MdkModelSettingEntity entity = entityList.get(i); |
| | | if (StringUtils.isNotBlank(entity.getValue())) { |
| | | // 去掉空格 |
| | | entity.setValue(entity.getValue().trim().replaceAll("\\s+", "")); |
| | | } |
| | | entity.setId(UUID.randomUUID().toString()); |
| | | entity.setMethodId(MethodId); |
| | | entity.setSort(i); |
| | | mdkModelSettingDao.insert(entity); |
| | | if (!CollectionUtils.isEmpty(list.get(i).getSettingSelects())) { |
| | | mdkSettingSelectService.insertList(list.get(i).getSettingSelects(), entity.getId()); |
| | | } |
| | | } |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | | import com.iailab.module.mhub.mdk.dao.MdkSettingSelectDao; |
| | | import com.iailab.module.mhub.mdk.entity.MdkSettingSelectEntity; |
| | | import com.iailab.module.mhub.mdk.service.MdkSettingSelectService; |
| | | import com.iailab.module.mhub.mdk.vo.MdkSettingSelectRespVO; |
| | | import com.iailab.module.mhub.mdk.vo.MdkSettingSelectSaveReqVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2025年06月09日 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class MdkSettingSelectServiceImpl implements MdkSettingSelectService { |
| | | |
| | | @Autowired |
| | | private MdkSettingSelectDao mdkSettingSelectDao; |
| | | |
| | | @Override |
| | | public void deleteBySettingId(String settingId) { |
| | | QueryWrapper<MdkSettingSelectEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq(StringUtils.isNotBlank(settingId), "setting_id", settingId); |
| | | mdkSettingSelectDao.delete(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void insertList(List<MdkSettingSelectSaveReqVO> list, String settingId) { |
| | | List<MdkSettingSelectEntity> entityList = ConvertUtils.sourceToTarget(list, MdkSettingSelectEntity.class); |
| | | for(int i = 0; i < entityList.size(); i++){ |
| | | MdkSettingSelectEntity entity = entityList.get(i); |
| | | entity.setId(UUID.randomUUID().toString()); |
| | | entity.setSettingId(settingId); |
| | | entity.setSort(i); |
| | | mdkSettingSelectDao.insert(entity); |
| | | } |
| | | |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2025年06月09日 |
| | | */ |
| | | @Schema(description = "模型托管平台 - MDK模型文件 Response VO") |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class MdkModelFileRespVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private String id; |
| | | |
| | | private String pyName; |
| | | |
| | | private String pyChineseName; |
| | | |
| | | private String filePath; |
| | | |
| | | private String pyType; |
| | | |
| | | private String pkgName; |
| | | |
| | | private String className; |
| | | |
| | | private String pyModule; |
| | | |
| | | private String icon; |
| | | |
| | | private String menuName; |
| | | |
| | | private String groupName; |
| | | |
| | | private String remark; |
| | | |
| | | private Long updater; |
| | | |
| | | private Date updateDate; |
| | | |
| | | private Long creator; |
| | | |
| | | private Date createDate; |
| | | |
| | | private List<String> menuAndGroup; |
| | | |
| | | private List<MdkModelMethodRespVO> modelMethods; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description: MPK模型方法 |
| | | * @author: dzd |
| | | * @date: 2024/9/9 10:52 |
| | | **/ |
| | | @Data |
| | | public class MdkModelMethodRespVO implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private String id; |
| | | |
| | | private String mpkFileId; |
| | | |
| | | private String methodName; |
| | | |
| | | private Integer dataLength; |
| | | |
| | | private Integer model; |
| | | |
| | | private String resultKey; |
| | | |
| | | private List<MdkModelSettingRespVO> methodSettings; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description: 方法参数关联表 |
| | | * @author: dzd |
| | | * @date: 2024/9/13 15:49 |
| | | **/ |
| | | @Data |
| | | public class MdkModelSettingRespVO implements Serializable { |
| | | |
| | | @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| | | @ExcelProperty("ID") |
| | | private String id; |
| | | |
| | | @Schema(description = "方法id", example = "") |
| | | private String methodId; |
| | | |
| | | @Schema(description = "key", example = "") |
| | | private String settingKey; |
| | | |
| | | @Schema(description = "参数名称", example = "") |
| | | private String name; |
| | | |
| | | @Schema(description = "参数默认值", example = "") |
| | | private String value; |
| | | |
| | | @Schema(description = "输入类型", example = "") |
| | | private String type; |
| | | |
| | | @Schema(description = "参数类型", example = "") |
| | | private String valueType; |
| | | |
| | | @Schema(description = "最大值", example = "") |
| | | private Integer max; |
| | | |
| | | @Schema(description = "最小值", example = "") |
| | | private Integer min; |
| | | |
| | | @Schema(description = "参数值", example = "") |
| | | private String settingValue; |
| | | |
| | | @Schema(description = "关联参数", example = "") |
| | | private List<MdkSettingSelectRespVO> settingSelects; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2025年06月09日 |
| | | */ |
| | | @Schema(description = "模型托管 - 模型方法参数创建/修改 Request VO") |
| | | @Data |
| | | public class MdkModelSettingSaveReqVO { |
| | | |
| | | @Schema(description = "id") |
| | | private String id; |
| | | |
| | | @Schema(description = "方法id") |
| | | private String methodId; |
| | | |
| | | @Schema(description = "key") |
| | | private String settingKey; |
| | | |
| | | @Schema(description = "参数名称") |
| | | private String name; |
| | | |
| | | @Schema(description = "参数默认值") |
| | | private String value; |
| | | |
| | | @Schema(description = "输入类型") |
| | | private String type; |
| | | |
| | | @Schema(description = "参数类型") |
| | | private String valueType; |
| | | |
| | | @Schema(description = "最大值") |
| | | private Integer max; |
| | | |
| | | @Schema(description = "最小值") |
| | | private Integer min; |
| | | |
| | | @Schema(description = "参数值") |
| | | private String settingValue; |
| | | |
| | | private List<MdkSettingSelectSaveReqVO> settingSelects; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2025年06月09日 |
| | | */ |
| | | @Schema(description = "模型托管平台 - MDK参数选项关联 Response VO") |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class MdkSettingSelectRespVO { |
| | | |
| | | @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| | | @ExcelProperty("ID") |
| | | private String id; |
| | | |
| | | @Schema(description = "参数id", example = "") |
| | | private String settingId; |
| | | |
| | | @Schema(description = "key", example = "") |
| | | private String selectKey; |
| | | |
| | | @Schema(description = "名称", example = "") |
| | | private String name; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.mhub.mdk.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2025年06月09日 |
| | | */ |
| | | @Data |
| | | public class MdkSettingSelectSaveReqVO { |
| | | |
| | | @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| | | private String id; |
| | | |
| | | @Schema(description = "参数id", example = "") |
| | | private String settingId; |
| | | |
| | | @Schema(description = "key", example = "") |
| | | private String selectKey; |
| | | |
| | | @Schema(description = "名称", example = "") |
| | | private String name; |
| | | } |
对比新文件 |
| | |
| | | <?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.iailab.module.mhub.mdk.dao.MdkModelFileDao"> |
| | | <resultMap id="mpkFile" type="com.iailab.module.mhub.mdk.vo.MdkModelFileRespVO"> |
| | | <id property="id" column="id"/> |
| | | <result property="pyName" column="py_name"/> |
| | | <result property="pyChineseName" column="py_chinese_name"/> |
| | | <result property="filePath" column="file_path"/> |
| | | <result property="pyType" column="py_type"/> |
| | | <result property="pkgName" column="pkg_name"/> |
| | | <result property="className" column="class_name"/> |
| | | <result property="pyModule" column="py_module"/> |
| | | <result property="icon" column="icon"/> |
| | | <result property="menuName" column="menu_name"/> |
| | | <result property="groupName" column="group_name"/> |
| | | <result property="remark" column="remark"/> |
| | | <result property="creator" column="creator"/> |
| | | <result property="createDate" column="create_date"/> |
| | | <result property="updater" column="updater"/> |
| | | <result property="updateDate" column="update_date"/> |
| | | <collection property="modelMethods" ofType="com.iailab.module.mhub.mdk.vo.MdkModelMethodRespVO"> |
| | | <id property="id" column="method_id"/> |
| | | <result property="methodName" column="method_name"/> |
| | | <result property="dataLength" column="data_length"/> |
| | | <result property="model" column="model"/> |
| | | <result property="resultKey" column="result_key"/> |
| | | <collection property="methodSettings" ofType="com.iailab.module.mhub.mdk.vo.MdkModelSettingRespVO"> |
| | | <id property="id" column="setting_id"/> |
| | | <result property="settingKey" column="setting_key"/> |
| | | <result property="name" column="setting_name"/> |
| | | <result property="value" column="value"/> |
| | | <result property="type" column="type"/> |
| | | <result property="valueType" column="value_type"/> |
| | | <result property="max" column="max"/> |
| | | <result property="min" column="min"/> |
| | | <collection property="settingSelects" ofType="com.iailab.module.mhub.mdk.vo.MdkSettingSelectRespVO"> |
| | | <id property="id" column="select_id"/> |
| | | <result property="selectKey" column="select_key"/> |
| | | <result property="name" column="select_name"/> |
| | | </collection> |
| | | </collection> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | <select id="get" resultMap="mpkFile"> |
| | | SELECT |
| | | a.*, |
| | | b.id method_id, |
| | | b.method_name, |
| | | b.data_length, |
| | | b.model, |
| | | b.result_key, |
| | | c.id setting_id, |
| | | c.setting_key, |
| | | c.name setting_name, |
| | | c.value, |
| | | c.type, |
| | | c.value_type, |
| | | c.max, |
| | | c.min, |
| | | d.id select_id, |
| | | d.select_key, |
| | | d.name select_name |
| | | FROM t_mdk_model_file a |
| | | LEFT JOIN t_mdk_model_method b ON a.id = b.mpk_file_id |
| | | LEFT JOIN t_mdk_model_setting c ON b.id = c.method_id |
| | | LEFT JOIN t_mdk_setting_select d ON c.id = d.setting_id |
| | | WHERE a.id = #{id} |
| | | ORDER BY b.sort,c.sort,d.sort |
| | | </select> |
| | | <select id="selectByIds" resultMap="mpkFile"> |
| | | SELECT |
| | | a.*, |
| | | b.id method_id, |
| | | b.method_name, |
| | | b.data_length, |
| | | b.model, |
| | | b.result_key, |
| | | c.id setting_id, |
| | | c.setting_key, |
| | | c.name setting_name, |
| | | c.value, |
| | | c.type, |
| | | c.value_type, |
| | | c.max, |
| | | c.min, |
| | | d.id select_id, |
| | | d.select_key, |
| | | d.name select_name |
| | | FROM t_mdk_model_file a |
| | | LEFT JOIN t_mdk_model_method b ON a.id = b.mpk_file_id |
| | | LEFT JOIN t_mdk_model_setting c ON b.id = c.method_id |
| | | LEFT JOIN t_mdk_setting_select d ON c.id = d.setting_id |
| | | LEFT JOIN t_mdk_file_menu e ON e.name = a.menu_name |
| | | LEFT JOIN t_mdk_file_group f ON f.menu_id = e.id and f.name = a.group_name |
| | | WHERE a.id in |
| | | <foreach collection="ids" item="item" open="(" close=")" separator=","> |
| | | #{item} |
| | | </foreach> |
| | | ORDER BY b.sort,c.sort,d.sort,e.sort,f.sort,a.create_date |
| | | </select> |
| | | <select id="list" resultMap="mpkFile" parameterType="map"> |
| | | SELECT |
| | | a.*, |
| | | b.id method_id, |
| | | b.method_name, |
| | | b.data_length, |
| | | b.model, |
| | | b.result_key, |
| | | c.id setting_id, |
| | | c.setting_key, |
| | | c.name setting_name, |
| | | c.value, |
| | | c.type, |
| | | c.value_type, |
| | | c.max, |
| | | c.min, |
| | | d.id select_id, |
| | | d.select_key, |
| | | d.name select_name |
| | | FROM t_mpk_file a |
| | | LEFT JOIN t_mdk_model_method b ON a.id = b.mpk_file_id |
| | | LEFT JOIN t_mdk_model_setting c ON b.id = c.method_id |
| | | LEFT JOIN t_mdk_setting_select d ON c.id = d.setting_id |
| | | LEFT JOIN t_mdk_file_menu e ON e.name = a.menu_name |
| | | LEFT JOIN t_mdk_file_group f ON f.menu_id = e.id and f.name = a.group_name |
| | | <where> |
| | | <if test="params.pyType != null and params.pyType != ''"> |
| | | AND a.py_type = #{params.pyType} |
| | | </if> |
| | | </where> |
| | | ORDER BY b.sort,c.sort,d.sort,e.sort,f.sort,a.create_date |
| | | </select> |
| | | </mapper> |