dengzedong
2024-09-14 0255ea0526f2c07e1947586278a394f7896311b9
mpk 模型方法添加参数、选项
已修改7个文件
已重命名2个文件
已添加8个文件
530 ■■■■ 文件已修改
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/MpkFileController.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/MethodSettingDTO.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/ModelMethodDTO.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/MpkFileDTO.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/SettingSelectDTO.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/entity/MethodSettingEntity.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/entity/ModelMethodEntity.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/entity/MpkFileEntity.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/entity/SettingSelectEntity.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/MethodSettingService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/MpkFileService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/SettingSelectService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MethodSettingServiceImpl.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MpkFileServiceImpl.java 77 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ProjectServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/SettingSelectServiceImpl.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mpk/MpkFileDao.xml 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/MpkFileController.java
@@ -1,16 +1,12 @@
package com.iailab.module.model.mpk.controller.admin;
import com.alibaba.fastjson.JSON;
import com.iailab.framework.common.page.PageData;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.util.date.DateUtils;
import com.iailab.module.model.mpk.common.utils.Readtxt;
import com.iailab.module.model.mpk.dto.MpkFileDTO;
import com.iailab.module.model.mpk.service.MdkFileService;
import com.iailab.module.model.mpk.service.MpkFileService;
import io.swagger.v3.oas.annotations.Operation;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -30,51 +26,51 @@
@RequestMapping("/model/mpk/file")
public class MpkFileController {
    @Autowired
    private MdkFileService mdkFileService;
    private MpkFileService mpkFileService;
    @GetMapping("page")
    @Operation(summary = "分页")
    public CommonResult<PageData<MpkFileDTO>> page(@RequestParam Map<String, Object> params) {
        PageData<MpkFileDTO> page = mdkFileService.page(params);
        PageData<MpkFileDTO> page = mpkFileService.page(params);
        return success(page);
    }
    @GetMapping("{id}")
    public CommonResult<MpkFileDTO> info(@PathVariable("id") String id) {
        MpkFileDTO schedule = mdkFileService.get(id);
        MpkFileDTO schedule = mpkFileService.get(id);
        return success(schedule);
    }
    @GetMapping("list")
    public CommonResult<List<MpkFileDTO>> list() {
        List<MpkFileDTO> list = mdkFileService.list(new HashMap<>());
        List<MpkFileDTO> list = mpkFileService.list(new HashMap<>());
        return success(list);
    }
    @PostMapping
    public CommonResult save(@RequestBody MpkFileDTO dto) {
        mdkFileService.save(dto);
        mpkFileService.save(dto);
        return CommonResult.success();
    }
    @DeleteMapping
    public CommonResult delete(String id) {
        mdkFileService.delete(id);
        mpkFileService.delete(id);
        return CommonResult.success();
    }
    @PutMapping
    public CommonResult update(@RequestBody MpkFileDTO dto) {
        mdkFileService.update(dto);
        mpkFileService.update(dto);
        return CommonResult.success();
    }
    @GetMapping("generat")
    public void generat(String id, String remark,String zipFileName, HttpServletResponse response) throws IOException {
        byte[] data = mdkFileService.generatorCode(id, remark,zipFileName);
        byte[] data = mpkFileService.generatorCode(id, remark,zipFileName);
        response.reset();
        response.setHeader("Content-Disposition", "attachment; filename=\"" + URLEncoder.encode(zipFileName, "UTF-8") + "\"");
@@ -88,7 +84,7 @@
    public void packageModel(String ids ,String projectId,String log ,String projectName,String version,String zipFileName,HttpServletResponse response) throws IOException {
        byte[] data;
        try {
            data = mdkFileService.packageModel(Arrays.asList(ids.split(",")),projectId,projectName,zipFileName,log,version);
            data = mpkFileService.packageModel(Arrays.asList(ids.split(",")),projectId,projectName,zipFileName,log,version);
        } catch (InterruptedException e) {
            throw new RuntimeException("模型打包失败",e);
        }
@@ -104,7 +100,7 @@
    @PostMapping("/upload")
    @Operation(summary = "python文件上传")
    public CommonResult<Map<String,String>> importExcel(@RequestParam("file") MultipartFile file) throws Exception {
        Map<String,String> result = mdkFileService.savePyFile(file);
        Map<String,String> result = mpkFileService.savePyFile(file);
        return success(result);
    }
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/MethodSettingDTO.java
对比新文件
@@ -0,0 +1,64 @@
package com.iailab.module.model.mpk.dto;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
 * @description: 方法参数关联表
 * @author: dzd
 * @date: 2024/9/13 15:49
 **/
@Data
public class MethodSettingDTO implements Serializable {
    /**
     * id
     */
    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 List<SettingSelectDTO> settingSelects;
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/ModelMethodDTO.java
@@ -1,10 +1,9 @@
package com.iailab.module.model.mpk.dto;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
 * @description: MPK模型方法
@@ -24,4 +23,8 @@
    private Integer dataLength;
    private Integer model;
    private String resultKey;
    private List<MethodSettingDTO> methodSettings;
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/MpkFileDTO.java
@@ -20,6 +20,8 @@
    private String pyName;
    private String pyChineseName;
    private String filePath;
    private String pyType;
@@ -29,6 +31,12 @@
    private String className;
    private String pyModule;
    private String icon;
    private String menuName;
    private String groupName;
    private String remark;
@@ -40,5 +48,5 @@
    private Date createDate;
    private List<ModelMethodEntity> modelMethods;
    private List<ModelMethodDTO> modelMethods;
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/SettingSelectDTO.java
对比新文件
@@ -0,0 +1,36 @@
package com.iailab.module.model.mpk.dto;
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
public class SettingSelectDTO implements Serializable {
    /**
     * id
     */
    private String id;
    /**
     * '参数id'
     */
    private String settingId;
    /**
     * key
     */
    private String selectKey;
    /**
     * 名称
     */
    private String name;
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/entity/MethodSettingEntity.java
对比新文件
@@ -0,0 +1,64 @@
package com.iailab.module.model.mpk.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.checkerframework.checker.units.qual.min;
import java.io.Serializable;
/**
 * @description: 方法参数关联表
 * @author: dzd
 * @date: 2024/9/13 15:49
 **/
@Data
@TableName("t_mpk_method_setting")
public class MethodSettingEntity implements Serializable {
    /**
     * 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;
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/entity/ModelMethodEntity.java
@@ -43,4 +43,8 @@
     * 是否有model(0:否,1:是)
     */
    private Integer model;
    /**
     * 结果key
     */
    private String resultKey;
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/entity/MpkFileEntity.java
@@ -32,6 +32,11 @@
    private String pyName;
    /**
     * 模型中文名称
     */
    private String pyChineseName;
    /**
     * 源文件保存路径
     */
    private String filePath;
@@ -57,6 +62,21 @@
    private String pyModule;
    /**
     * icon图片名
     */
        private String icon;
    /**
     * 所属菜单
     */
    private String menuName;
    /**
     * 所属组
     */
    private String groupName;
    /**
     * 备注
     */
    private String remark;
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/entity/SettingSelectEntity.java
对比新文件
@@ -0,0 +1,38 @@
package com.iailab.module.model.mpk.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_mpk_setting_select")
public class SettingSelectEntity implements Serializable {
    /**
     * id
     */
    @TableId
    private String id;
    /**
     * '参数id'
     */
    private String settingId;
    /**
     * key
     */
    private String selectKey;
    /**
     * 名称
     */
    private String name;
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/MethodSettingService.java
对比新文件
@@ -0,0 +1,14 @@
package com.iailab.module.model.mpk.service;
import com.iailab.framework.common.service.BaseService;
import com.iailab.module.model.mpk.entity.MethodSettingEntity;
import java.util.Map;
/**
 * @description:
 * @author: dzd
 * @date: 2024/9/14 15:10
 **/
public interface MethodSettingService extends BaseService<MethodSettingEntity> {
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/MpkFileService.java
文件名从 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/MdkFileService.java 修改
@@ -15,7 +15,7 @@
 * @Description
 * @createTime 2024年08月14日
 */
public interface MdkFileService extends BaseService<MpkFileEntity> {
public interface MpkFileService extends BaseService<MpkFileEntity> {
    PageData<MpkFileDTO> page(Map<String, Object> params);
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/SettingSelectService.java
对比新文件
@@ -0,0 +1,16 @@
package com.iailab.module.model.mpk.service;
import com.iailab.framework.common.service.BaseService;
import com.iailab.module.model.mpk.entity.SettingSelectEntity;
import java.util.Map;
/**
 * @description:
 * @author: dzd
 * @date: 2024/9/14 15:10
 **/
public interface SettingSelectService extends BaseService<SettingSelectEntity> {
    void deleteByMap(Map<String, Object> map);
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MethodSettingServiceImpl.java
对比新文件
@@ -0,0 +1,22 @@
package com.iailab.module.model.mpk.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.iailab.framework.common.service.impl.BaseServiceImpl;
import com.iailab.module.model.mpk.dao.MethodSettingDao;
import com.iailab.module.model.mpk.entity.MethodSettingEntity;
import com.iailab.module.model.mpk.service.MethodSettingService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
 * @description:
 * @author: dzd
 * @date: 2024/9/14 15:12
 **/
@Slf4j
@Service
public class MethodSettingServiceImpl extends BaseServiceImpl<MethodSettingDao, MethodSettingEntity> implements MethodSettingService {
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MpkFileServiceImpl.java
文件名从 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MdkFileServiceImpl.java 修改
@@ -15,13 +15,8 @@
import com.iailab.module.model.mpk.common.MdkConstant;
import com.iailab.module.model.mpk.common.utils.GenUtils;
import com.iailab.module.model.mpk.dao.MpkFileDao;
import com.iailab.module.model.mpk.dto.GeneratorCodeHistoryDTO;
import com.iailab.module.model.mpk.dto.MpkFileDTO;
import com.iailab.module.model.mpk.dto.ProjectPackageHistoryDTO;
import com.iailab.module.model.mpk.entity.GeneratorCodeHistoryEntity;
import com.iailab.module.model.mpk.entity.ModelMethodEntity;
import com.iailab.module.model.mpk.entity.MpkFileEntity;
import com.iailab.module.model.mpk.entity.ProjectPackageHistoryModelEntity;
import com.iailab.module.model.mpk.dto.*;
import com.iailab.module.model.mpk.entity.*;
import com.iailab.module.model.mpk.service.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
@@ -36,7 +31,6 @@
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
@@ -53,7 +47,7 @@
 */
@Slf4j
@Service
public class MdkFileServiceImpl extends BaseServiceImpl<MpkFileDao, MpkFileEntity> implements MdkFileService {
public class MpkFileServiceImpl extends BaseServiceImpl<MpkFileDao, MpkFileEntity> implements MpkFileService {
    @Autowired
    private GeneratorCodeHistoryService generatorCodeHistoryService;
@@ -63,6 +57,10 @@
    private ProjectPackageHistoryService projectPackageHistoryService;
    @Autowired
    private ModelMethodService modelMethodService;
    @Autowired
    private MethodSettingService methodSettingService;
    @Autowired
    private SettingSelectService settingSelectService;
    @Autowired
    private ProjectPackageHistoryModelService projectPackageHistoryModelService;
@@ -135,22 +133,56 @@
        updateById(entity);
        String mpkId = dto.getId();
        // 删除模型方法
        // 删除模型方法 会级联删除setting和select
        deleteModelMethod(mpkId);
        // 添加模型方法
        insertModelMethod(dto.getModelMethods(),mpkId);
    }
    private void insertModelMethod(List<ModelMethodEntity> modelMethods,String mpkId) {
    private void insertModelMethod(List<ModelMethodDTO> modelMethods, String mpkId) {
        List<MethodSettingDTO> methodSettingList = new ArrayList<>();
        if (!CollectionUtils.isEmpty(modelMethods)) {
            modelMethods.forEach(e -> {
                e.setId(UUID.randomUUID().toString());
                String methodId = UUID.randomUUID().toString();
                e.setId(methodId);
                e.setMpkFileId(mpkId);
                e.getMethodSettings().forEach(s -> {
                    s.setId(UUID.randomUUID().toString());
                    s.setMethodId(methodId);
                    methodSettingList.add(s);
                });
            });
            modelMethodService.insertBatch(modelMethods);
            modelMethodService.insertBatch(ConvertUtils.sourceToTarget(modelMethods, ModelMethodEntity.class));
            //添加setting
            insertMethodSetting(methodSettingList);
        }
    }
    private void insertMethodSetting(List<MethodSettingDTO> methodSettings) {
        List<SettingSelectEntity> settingSelectList = new ArrayList<>();
        if (!CollectionUtils.isEmpty(methodSettings)) {
            methodSettings.forEach(e -> {
                String settingId = UUID.randomUUID().toString();
                e.setId(settingId);
                e.getSettingSelects().forEach(s -> {
                    s.setId(UUID.randomUUID().toString());
                    s.setSettingId(settingId);
                    settingSelectList.add(ConvertUtils.sourceToTarget(s,SettingSelectEntity.class));
                });
            });
            methodSettingService.insertBatch(ConvertUtils.sourceToTarget(methodSettings, MethodSettingEntity.class));
            //添加select
            settingSelectService.insertBatch(settingSelectList);
        }
    }
    private void deleteModelMethod(String mpkId) {
        Map<String,Object> map = new HashMap<>();
        map.put("mpkFileId", mpkId);
@@ -171,9 +203,6 @@
            }
        }
        //删除
        deleteById(id);
        //删除备份文件
        Map<String,Object> map1 = new HashMap<>();
        map1.put("mdkId",id);
@@ -186,17 +215,19 @@
            }
        });
        //删除生成历史
        //删除 会级联删除掉关联表
        deleteById(id);
        generatorCodeHistoryService.deleteByMap(map1);
        //删除生成历史
//        generatorCodeHistoryService.deleteByMap(map1);
        //删除关联项目
        Map<String,Object> map = new HashMap<>();
        map.put("modelId",id);
        projectModelService.deleteByMap(map);
//        Map<String,Object> map = new HashMap<>();
//        map.put("modelId",id);
//        projectModelService.deleteByMap(map);
        //删除模型方法
        deleteModelMethod(id);
//        deleteModelMethod(id);
    }
@@ -354,7 +385,7 @@
            entity.setPkgName(e.getPkgName());
            entity.setPyModule(e.getPyModule());
            entity.setRemark(e.getRemark());
            List<ModelMethodEntity> methods = e.getModelMethods();
            List<ModelMethodDTO> methods = e.getModelMethods();
            if (!CollectionUtils.isEmpty(methods)) {
                entity.setMethodInfo(JSON.toJSONString(methods));
            }
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ProjectServiceImpl.java
@@ -137,16 +137,9 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void delete(String id) {
        //删除
        baseDao.deleteById(id);
        //删除模型关联
        //删除备份文件
        Map<String,Object> map = new HashMap<>();
        map.put("projectId",id);
        projectModelService.deleteByMap(map);
        //删除备份文件
        List<ProjectPackageHistoryDTO> list = projectPackageHistoryService.list(map);
        list.forEach(e -> {
            File file = new File(e.getFilePath());
@@ -156,11 +149,17 @@
            }
        });
        //删除 (级联删除)
        baseDao.deleteById(id);
        //删除模型关联
//        projectModelService.deleteByMap(map);
        //删除打包历史
        projectPackageHistoryService.deleteByMap(map);
//        projectPackageHistoryService.deleteByMap(map);
        //删除打包历史模型关联
        projectPackageHistoryModelService.deleteByMap(map);
//        projectPackageHistoryModelService.deleteByMap(map);
    }
    @Override
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/SettingSelectServiceImpl.java
对比新文件
@@ -0,0 +1,37 @@
package com.iailab.module.model.mpk.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.iailab.framework.common.service.impl.BaseServiceImpl;
import com.iailab.module.model.mpk.dao.SettingSelectDao;
import com.iailab.module.model.mpk.entity.SettingSelectEntity;
import com.iailab.module.model.mpk.service.SettingSelectService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
 * @description:
 * @author: dzd
 * @date: 2024/9/14 15:13
 **/
@Slf4j
@Service
public class SettingSelectServiceImpl extends BaseServiceImpl<SettingSelectDao, SettingSelectEntity> implements SettingSelectService {
    @Override
    public void deleteByMap(Map<String, Object> map) {
        baseDao.delete(getWrapper(map));
    }
    private QueryWrapper<SettingSelectEntity> getWrapper(Map<String, Object> params) {
        String settingId = (String) params.get("settingId");
        QueryWrapper<SettingSelectEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(settingId), "setting_id", settingId);
        return wrapper;
    }
}
iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mpk/MpkFileDao.xml
@@ -5,20 +5,41 @@
    <resultMap id="mpkFile" type="com.iailab.module.model.mpk.dto.MpkFileDTO">
        <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.model.mpk.entity.ModelMethodEntity">
        <collection property="modelMethods" ofType="com.iailab.module.model.mpk.dto.ModelMethodDTO">
            <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.model.mpk.dto.MethodSettingDTO">
                <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.model.mpk.dto.SettingSelectDTO">
                    <id property="id" column="select_id"/>
                    <result property="selectKey" column="select_key"/>
                    <result property="name" column="select_name"/>
                </collection>
            </collection>
        </collection>
    </resultMap>
@@ -28,10 +49,24 @@
            b.id method_id,
            b.method_name,
            b.data_length,
            b.model
            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_mpk_model_method b ON a.id = b.mpk_file_id
            LEFT JOIN t_mpk_method_setting c ON b.id = c.method_id
            LEFT JOIN t_mpk_setting_select d ON c.id = d.setting_id
        WHERE a.id = #{id}
    </select>
    <select id="selectByIds" resultMap="mpkFile">
@@ -40,10 +75,24 @@
            b.id method_id,
            b.method_name,
            b.data_length,
            b.model
            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_mpk_model_method b ON a.id = b.mpk_file_id
                LEFT JOIN t_mpk_method_setting c ON b.id = c.method_id
                LEFT JOIN t_mpk_setting_select d ON c.id = d.setting_id
        WHERE a.id in
        <foreach collection="ids" item="item" open="(" close=")" separator=",">
            #{item}
@@ -59,7 +108,22 @@
    </select>
    <select id="getProjectModel" resultMap="mpkFile">
        SELECT
            t3.*,t4.method_name,t4.data_length,t4.model
            t3.*,
            t4.method_name,
            t4.data_length,
            t4.model,
            t4.result_key,
            t5.id setting_id,
            t5.setting_key,
            t5.name setting_name,
            t5.value,
            t5.type,
            t5.value_type,
            t5.max,
            t5.min,
            t6.id select_id,
            t6.select_key,
            t6.name select_name
        FROM
            (
                SELECT
@@ -82,5 +146,7 @@
                    LIMIT #{params.offset},#{params.pageSize}
            ) t3
                LEFT JOIN t_mpk_model_method t4 ON t3.id = t4.mpk_file_id
                LEFT JOIN t_mpk_method_setting t5 ON t4.id = t5.method_id
                LEFT JOIN t_mpk_setting_select t6 ON t5.id = t6.setting_id
    </select>
</mapper>