Ver Fonte

update modelcontroller

maqingyang há 1 ano atrás
pai
commit
bdf907f6e9

+ 6 - 7
src/main/java/com/kexun/common/User.java

@@ -1,7 +1,6 @@
 package com.kexun.common;
+import com.kexun.entity.ModelEntity;
 import com.kexun.entity.UserField;
-import com.kexun.entity.UserModel;
-import com.kexun.service.SysUserService;
 import com.kexun.service.UserApprovalService;
 import com.kexun.service.UserFieldService;
 import com.kexun.service.UserModelService;
@@ -53,11 +52,11 @@ public class User {
     public void initUser(String name)
     {
         user_name=name;
-        List<UserModel> model_list=userModelServices.findByUserName(user_name);
-        if(model_list!=null) {
-            for (int i = 0; i < model_list.size(); i++) {
-                model_name.add(model_list.get(i).getModelName());
-                model_state.add(model_list.get(i).getStatus());
+        List<ModelEntity> model_Entity_list =userModelServices.findByUserName(user_name);
+        if(model_Entity_list !=null) {
+            for (int i = 0; i < model_Entity_list.size(); i++) {
+                model_name.add(model_Entity_list.get(i).getModelName());
+                model_state.add(model_Entity_list.get(i).getStatus());
             }
         }
         UserField userField=userFieldServices.findByUserName(user_name);

+ 6 - 3
src/main/java/com/kexun/controller/CooperatorController.java

@@ -37,9 +37,12 @@ public class CooperatorController {
     private CooperatorService CooperatorService;
 
     // 获取合作方信息
-    @GetMapping("cooperatorList")
-    public Result cooperatorList(@RequestParam int pageNum) {
-        int pageSize = 10;
+    @RequestMapping("cooperatorList")
+
+    public Result cooperatorList(@RequestBody String json) {
+        JSONObject req = JSON.parseObject(json);
+        int pageNum = req.getIntValue("pageNum");
+        int pageSize = req.getIntValue("pageSize");
         PageHelper.startPage(pageNum, pageSize);//设置分页信息
         JSONObject resJson=new JSONObject();
         List<CooperatorInfo> list= CooperatorService.selectPage();

+ 6 - 3
src/main/java/com/kexun/controller/CooperatorProductController.java

@@ -28,9 +28,12 @@ public class CooperatorProductController {
     private CooperatorProductService CooperatorProductService;
 
     // 获取合作产品信息
-    @GetMapping("cooperatorProductList")
-    public Result cooperatorProductList(@RequestParam int pageNum) {
-        int pageSize = 10;
+    @RequestMapping("cooperatorProductList")
+
+    public Result cooperatorProductList(@RequestBody String json) {
+        JSONObject req = JSON.parseObject(json);
+        int pageNum = req.getIntValue("pageNum");
+        int pageSize = req.getIntValue("pageSize");
         PageHelper.startPage(pageNum, pageSize);//设置分页信息
         JSONObject resJson=new JSONObject();
         List<CooperatorProduct> list=CooperatorProductService.selectPage();

+ 13 - 6
src/main/java/com/kexun/controller/FieldDefineController.java

@@ -1,6 +1,7 @@
 package com.kexun.controller;
 
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.pagehelper.PageHelper;
@@ -55,8 +56,10 @@ public class FieldDefineController {
 
     @RequestMapping("/fieldListNew")
     @ResponseBody
-    public Result findAll(@RequestParam int pageNum){
-        int pageSize = 10;
+    public Result findAll(@RequestBody String json){
+        JSONObject req = JSON.parseObject(json);
+        int pageNum = req.getIntValue("pageNum");
+        int pageSize = req.getIntValue("pageSize");
         PageHelper.startPage(pageNum, pageSize);//设置分页信息
         List<FieldDefineEntity> list = fieldDefineService.selectPage();
 
@@ -78,8 +81,10 @@ public class FieldDefineController {
 
     @RequestMapping("/fieldListBase")
     @ResponseBody
-    public Result fieldListBase(@RequestParam int pageNum){
-        int pageSize = 10;
+    public Result fieldListBase(@RequestBody String json){
+        JSONObject req = JSON.parseObject(json);
+        int pageNum = req.getIntValue("pageNum");
+        int pageSize = req.getIntValue("pageSize");
         PageHelper.startPage(pageNum, pageSize);//设置分页信息
         List<FieldDefineEntity> list = fieldDefineService.selectPage();
 
@@ -95,8 +100,10 @@ public class FieldDefineController {
 
     @RequestMapping("/fieldListDerive")
     @ResponseBody
-    public Result fieldListDerive(@RequestParam int pageNum){
-        int pageSize = 10;
+    public Result fieldListDerive(@RequestBody String json){
+        JSONObject req = JSON.parseObject(json);
+        int pageNum = req.getIntValue("pageNum");
+        int pageSize = req.getIntValue("pageSize");
         PageHelper.startPage(pageNum, pageSize);//设置分页信息
 
         List<FieldDefineEntity> list2 = fieldDefineService.selectPage2();

+ 7 - 3
src/main/java/com/kexun/controller/FieldTemplateController.java

@@ -1,6 +1,7 @@
 package com.kexun.controller;
 
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.pagehelper.PageHelper;
@@ -58,8 +59,11 @@ public class FieldTemplateController {
 
     @RequestMapping("/findAll")
     @ResponseBody
-    public Result findAll(@RequestParam int pageNum){
-        int pageSize = 10;
+    public Result findAll(@RequestBody String json){
+        JSONObject req = JSON.parseObject(json);
+        int pageNum = req.getIntValue("pageNum");
+        int pageSize = req.getIntValue("pageSize");
+
         PageHelper.startPage(pageNum, pageSize);//设置分页信息
         List<FieldTemplateEntity> list = fieldTemplateService.selectPage();
         PageInfo pageInfo=new PageInfo(list);
@@ -113,7 +117,7 @@ public class FieldTemplateController {
     public Result update(@RequestBody FiledTemplateUpdateRO filedTemplateUpdateRO) {
         Result result = new Result();
         if (null != filedTemplateUpdateRO.getId()) {
-            fieldTemplateService.saveOrUpdate(filedTemplateUpdateRO);
+            fieldTemplateService.newUpdate(filedTemplateUpdateRO);
         } else {
             return Result.error(-1, "id不存在");
         }

+ 29 - 30
src/main/java/com/kexun/controller/FileUploadController.java

@@ -1,16 +1,15 @@
 package com.kexun.controller;
+
+import com.kexun.entity.ModelEntity;
 import org.apache.commons.io.FileUtils;
 
 //import ch.qos.logback.core.rolling.helper.FileStoreUtil;
 //import ch.qos.logback.core.util.FileUtil;
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.kexun.common.FileUploadUtil;
 import com.kexun.common.utils.Result;
 import com.kexun.entity.SysUser;
 import com.kexun.entity.UserApproval;
-import com.kexun.entity.UserModel;
 import com.kexun.service.UserApprovalService;
 import com.kexun.service.UserModelService;
 import lombok.extern.java.Log;
@@ -60,13 +59,13 @@ public class FileUploadController {
         String filename = name.split("\\.")[0];
         String filefmt = name.split("\\.")[1];
         String fullFileName = String.join("-", new String[]{filename, uid, index + "", "." + filefmt});
-        String filePath=fileuploadPath + "/" + sysUser.getUserName() + "/" +filename+"."+filefmt;
+        String filePath = fileuploadPath + "/" + sysUser.getUserName() + "/" + filename + "." + filefmt;
         log.info("filename:" + fullFileName);
         File dir = new File(fileuploadPath + "/" + sysUser.getUserName() + "/");
 
-        if (!dir.exists())
+        if (!dir.exists()) {
             dir.mkdirs();
-
+        }
         File file = new File(fileuploadPath + "/" + sysUser.getUserName() + "/" + fullFileName);
         FileCopyUtils.copy(chunk.getInputStream(), new FileOutputStream(file));
         FileUploadUtil.put(uid, index, chunksLength, fullFileName, fileuploadPath + "/" + sysUser.getUserName() + "/");
@@ -82,8 +81,8 @@ public class FileUploadController {
             throw new RuntimeException(ex.getMessage());
         }
 
-        UserModel model=userModelService.findByID(id);
-        String oldFilePath=model.getFilePath();
+        ModelEntity modelEntity = userModelService.findByID(id);
+        String oldFilePath = modelEntity.getFilePath();
         File oldFile = new File(oldFilePath);
 
         if (oldFile.exists()) {
@@ -93,13 +92,12 @@ public class FileUploadController {
             } catch (IOException e) {
                 System.out.println("file delete fail: " + e.getMessage());
             }
-        }
-        else {
+        } else {
             System.out.println("file not exist");
         }
 
-        model.setFilePath(filePath);
-        userModelService.updateById(model);
+        modelEntity.setFilePath(filePath);
+        userModelService.updateById(modelEntity);
 
 
         return Result.success();
@@ -116,13 +114,13 @@ public class FileUploadController {
             String filename = name.split("\\.")[0];
             String filefmt = name.split("\\.")[1];
             String fullFileName = String.join("-", new String[]{filename, uid, index + "", "." + filefmt});
-            String filePath=fileuploadPath + "/" + sysUser.getUserName() + "/" +filename+"."+filefmt;
+            String filePath = fileuploadPath + "/" + sysUser.getUserName() + "/" + filename + "." + filefmt;
             log.info("filename:" + fullFileName);
             File dir = new File(fileuploadPath + "/" + sysUser.getUserName() + "/");
 
-            if (!dir.exists())
+            if (!dir.exists()) {
                 dir.mkdirs();
-
+            }
             File file = new File(fileuploadPath + "/" + sysUser.getUserName() + "/" + fullFileName);
             FileCopyUtils.copy(chunk.getInputStream(), new FileOutputStream(file));
             FileUploadUtil.put(uid, index, chunksLength, fullFileName, fileuploadPath + "/" + sysUser.getUserName() + "/");
@@ -148,15 +146,15 @@ public class FileUploadController {
 
             //model 数据库连接接口
             String userName = sysUser.getUserName();
-            UserModel new_model = new UserModel();
-            new_model.setCreateBy(userName);
-            new_model.setModelName(model_name);
-            new_model.setModelType(type);
-            new_model.setStatus("暂停使用");
+            ModelEntity new_modelEntity = new ModelEntity();
+            new_modelEntity.setCreateBy(sysUser.getId());
+            new_modelEntity.setModelName(model_name);
+            new_modelEntity.setModelType(type);
+            new_modelEntity.setStatus("暂停使用");
 //            new_model.setOtherData(name);
 //            new_model.setOutputList(output_list);
-            new_model.setFilePath(filePath);
-            userModelService.save(new_model);
+            new_modelEntity.setFilePath(filePath);
+            userModelService.save(new_modelEntity);
 
         } else {
             // http请求
@@ -165,8 +163,9 @@ public class FileUploadController {
             String fullFileName = String.join("-", new String[]{filename, uid, index + "", "." + filefmt});
             log.info("filename:" + fullFileName);
             File dir = new File(warPath);
-            if (!dir.exists())
+            if (!dir.exists()) {
                 dir.mkdirs();
+            }
             File file = new File(warPath + "/" + fullFileName);
             FileCopyUtils.copy(chunk.getInputStream(), new FileOutputStream(file));
             FileUploadUtil.put(uid, index, chunksLength, fullFileName, warPath);
@@ -196,15 +195,15 @@ public class FileUploadController {
 
 
             String userName = sysUser.getUserName();
-            UserModel new_model = new UserModel();
-            new_model.setCreateBy(userName);
-            new_model.setModelName(model_name);
-            new_model.setModelType(type);
-            new_model.setStatus("暂停使用");
+            ModelEntity new_modelEntity = new ModelEntity();
+            new_modelEntity.setCreateBy(sysUser.getId());
+            new_modelEntity.setModelName(model_name);
+            new_modelEntity.setModelType(type);
+            new_modelEntity.setStatus("暂停使用");
 //                new_model.setOtherData(name);
 //                new_model.setOutputList(output_list);
-            new_model.setFilePath(warPath + "/" + fullFileName);
-            userModelService.save(new_model);
+            new_modelEntity.setFilePath(warPath + "/" + fullFileName);
+            userModelService.save(new_modelEntity);
         }
         return Result.success();
     }

+ 201 - 227
src/main/java/com/kexun/controller/ModelController.java

@@ -47,43 +47,42 @@ public class ModelController {
     private FilterResultService parseResultService;
 
 
-    private JsonFile jsonFile=new JsonFile();
+    private JsonFile jsonFile = new JsonFile();
 
     //给模型复核员提供模型复核
     @GetMapping("listUser")
-    public Result listUser(SysUser sysUser)
-    {
+    public Result listUser(SysUser sysUser) {
         QueryWrapper<SysUser> w = new QueryWrapper<>();
-        w.eq("role_id",4);
-        List<SysUser> list=sysUserService.list(w);
-        List<JSONObject> user_list =new ArrayList<>();
-        for(int i=0;i<list.size();i++)
-        {
-            String user_name=list.get(i).getUserName();
-            JSONObject user_json=new JSONObject();
-            List<UserModel> model_list=userModelService.findByUserName(user_name);
-            UserField userField=userFieldService.findByUserName(user_name);
-
-            user_json.put("userName",user_name);
-            user_json.put("modelList",model_list);
-            user_json.put("userField",userField);
+        w.eq("role_id", 4);
+        List<SysUser> list = sysUserService.list(w);
+        List<JSONObject> user_list = new ArrayList<>();
+        for (int i = 0; i < list.size(); i++) {
+            String user_name = list.get(i).getUserName();
+            JSONObject user_json = new JSONObject();
+            List<ModelEntity> model_Entity_list = userModelService.findByUserName(user_name);
+            UserField userField = userFieldService.findByUserName(user_name);
+
+            user_json.put("userName", user_name);
+            user_json.put("modelList", model_Entity_list);
+            user_json.put("userField", userField);
             user_list.add(user_json);
         }
-        return Result.success("ok",user_list);
+        return Result.success("ok", user_list);
     }
 
 
     @GetMapping("getApproval")
-    public Result getApproval()
-    {
-        JSONObject resJson=new JSONObject();
-        List<UserApproval> approval_list=userApprovalService.list();
-        resJson.put("approval_list",approval_list);
-        return Result.success("ok",resJson);
+    public Result getApproval() {
+        JSONObject resJson = new JSONObject();
+        List<UserApproval> approval_list = userApprovalService.list();
+        resJson.put("approval_list", approval_list);
+        return Result.success("ok", resJson);
 
     }
+
     /**
      * 读取json文件,返回json串
+     *
      * @param fileName
      * @return
      */
@@ -96,7 +95,7 @@ public class ModelController {
             Reader reader = new InputStreamReader(new FileInputStream(jsonFile), "utf-8");
             int ch = 0;
             StringBuffer sb = new StringBuffer();
-            while ((ch = reader.read()) != -1) {
+            while((ch = reader.read()) != -1) {
                 sb.append((char) ch);
             }
 
@@ -109,16 +108,17 @@ public class ModelController {
             return null;
         }
     }
+
     private static String getType(Object a) {
         return a.getClass().toString();
     }
 
     //上传字段组合
     @PostMapping("addField")
-    public Result addField(@RequestBody String json,SysUser sysUser) throws IOException {
+    public Result addField(@RequestBody String json, SysUser sysUser) throws IOException {
         JSONObject req = JSON.parseObject(json);
 
-        String field_combine=req.getString("fieldcombine");
+        String field_combine = req.getString("fieldcombine");
 
         //添加异常判断,重名模型名?,yuan尚未实现,先忽略掉
 //        JSONObject resJson = new JSONObject();
@@ -130,8 +130,8 @@ public class ModelController {
 //        resJson.put("state", 1);
 
 //        此为自定义字段组合所需数据
-        String userName=req.getString("username");
-        String fieldData=req.getString("fielddata");
+        String userName = req.getString("username");
+        String fieldData = req.getString("fielddata");
 //        String fieldCombine = req.getString("fieldcombine");
         String fieldRemark = req.getString("remark");
 //        customizedModel.setModelName(modelName);
@@ -208,7 +208,7 @@ public class ModelController {
 //            userFieldService.updateById(userField);
 //        }
 //yuan
-        UserApproval approval=new UserApproval();
+        UserApproval approval = new UserApproval();
         approval.setUserName(sysUser.getUserName());
         approval.setApprovalId((long) 2);
         approval.setData(field_combine);
@@ -222,20 +222,21 @@ public class ModelController {
     //yuan 前端获取user_field表的信息,但是在获取id时,会进行四舍五入操作导致id错误,因此通过字段组合名更新
     @GetMapping("fieldCombineList")
     public Result fieldCombineList() {
-        JSONObject resJson=new JSONObject();
-        List<UserField> list=userFieldService.list();
-        resJson.put("field_combine_list",list);
-        return Result.success("ok",resJson);
+        JSONObject resJson = new JSONObject();
+        List<UserField> list = userFieldService.list();
+        resJson.put("field_combine_list", list);
+        return Result.success("ok", resJson);
 
     }
+
     // sxr
     @PostMapping("updateFieldCombineList")
-    public Result updateFieldCombineList(@RequestBody String json,SysUser sysUser) {
+    public Result updateFieldCombineList(@RequestBody String json, SysUser sysUser) {
         JSONObject req = JSON.parseObject(json);
 
-        long fieldId=Long.valueOf(req.getString("fieldId")) ;
-        String fieldCombine=req.getString("fieldCombine");
-        String choseData=req.getString("choseData");
+        long fieldId = Long.valueOf(req.getString("fieldId"));
+        String fieldCombine = req.getString("fieldCombine");
+        String choseData = req.getString("choseData");
 
         UserField userField = userFieldService.findByID(fieldId);
         userField.setFieldCombine(fieldCombine);
@@ -249,7 +250,7 @@ public class ModelController {
     // sxr
     @GetMapping("getFieldById")
     public Result getFieldById(Long fieldId) {
-        System.out.println( fieldId);
+        System.out.println(fieldId);
         JSONObject result = new JSONObject();
         UserField userField = userFieldService.findByID(fieldId);
 
@@ -258,30 +259,31 @@ public class ModelController {
 
         JSONObject fieldDateJson = new JSONObject();
         String fieldData = userField.getFieldData();
-        fieldData = fieldData.substring(1,fieldData.length()-1);
+        fieldData = fieldData.substring(1, fieldData.length() - 1);
         String[] temp = fieldData.split("]");
-        for(int i=0;i< temp.length;i++)
-        {
+        for (int i = 0; i < temp.length; i++) {
             System.out.println(temp[i]);
-            String key="";
-            if(i==0){  key = temp[i].split(":")[0].substring(1, temp[i].split(":")[0].length()-1);}
-            else{  key = temp[i].split(":")[0].substring(2, temp[i].split(":")[0].length()-1);}
+            String key = "";
+            if (i == 0) {
+                key = temp[i].split(":")[0].substring(1, temp[i].split(":")[0].length() - 1);
+            } else {
+                key = temp[i].split(":")[0].substring(2, temp[i].split(":")[0].length() - 1);
+            }
             String valuetmp[] = (temp[i].split(":")[1].substring(1).split(","));
             String value[] = {};
-            for(int j=0;j<valuetmp.length;j++)
-            {
+            for (int j = 0; j < valuetmp.length; j++) {
 
-                System.out.println( valuetmp[j]);
+                System.out.println(valuetmp[j]);
                 System.out.println(valuetmp[j].length());
 
-                valuetmp[j] = valuetmp[j].substring(1,valuetmp[j].length()-1);
+                valuetmp[j] = valuetmp[j].substring(1, valuetmp[j].length() - 1);
             }
 
             fieldDateJson.put(key, valuetmp);
 
         }
         System.out.println(fieldDateJson);
-        result.put("fieldData",fieldDateJson);
+        result.put("fieldData", fieldDateJson);
 //        System.out.println(userField.getFieldData());
         return Result.success("ok", result);
     }
@@ -362,155 +364,145 @@ public class ModelController {
 //    }
 
     @GetMapping("getField")
-    public Result getField(SysUser sysUser)
-    {
+    public Result getField(SysUser sysUser) {
         JSONObject resJson = new JSONObject();
-        String userName=sysUser.getUserName();
-        UserField userField=userFieldService.findByUserName(userName);
-        if(userField==null)
-        {
-            resJson.put("fieldData","暂无申请字段");
-            resJson.put("fieldState","未配置字段");
+        String userName = sysUser.getUserName();
+        UserField userField = userFieldService.findByUserName(userName);
+        if (userField == null) {
+            resJson.put("fieldData", "暂无申请字段");
+            resJson.put("fieldState", "未配置字段");
+        } else {
+            resJson.put("fieldData", userField.getFieldData());
+            resJson.put("fieldState", userField.getFieldState());
         }
-        else
-        {
-            resJson.put("fieldData",userField.getFieldData());
-            resJson.put("fieldState",userField.getFieldState());
-        }
-        return Result.success("ok",resJson);
+        return Result.success("ok", resJson);
     }
 
     @PostMapping("getFieldByName")
-    public Result getFieldByName(@RequestBody String json)
-    {
-        JSONObject req=JSON.parseObject(json);
+    public Result getFieldByName(@RequestBody String json) {
+        JSONObject req = JSON.parseObject(json);
         JSONObject resJson = new JSONObject();
-        String userName= req.getString("username");
-        UserField userField=userFieldService.findByUserName(userName);
-        if(userField==null)
-        {
-            resJson.put("fieldData","暂无申请字段");
-            resJson.put("fieldState","未配置字段");
+        String userName = req.getString("username");
+        UserField userField = userFieldService.findByUserName(userName);
+        if (userField == null) {
+            resJson.put("fieldData", "暂无申请字段");
+            resJson.put("fieldState", "未配置字段");
+        } else {
+            resJson.put("fieldData", userField.getFieldData());
+            resJson.put("fieldState", userField.getFieldState());
         }
-        else
-        {
-            resJson.put("fieldData",userField.getFieldData());
-            resJson.put("fieldState",userField.getFieldState());
-        }
-        return Result.success("ok",resJson);
+        return Result.success("ok", resJson);
     }
 
 
     //新增自定义模型
     @PostMapping("addModel")
-    public Result addModel(@RequestBody String json,SysUser sysUser) throws IOException {
+    public Result addModel(@RequestBody String json, SysUser sysUser) throws IOException {
         //获取用户模型,并按json文件保存
         JSONObject req = JSON.parseObject(json);
-        String model_name=req.getString("modelname");
+        String model_name = req.getString("modelname");
         JSONObject resJson = new JSONObject();
         //添加异常判断,重名模型名?
-        if(userModelService.findByUserAndModel(sysUser.getUserName(),model_name)!=null) {
+        if (userModelService.findByUserAndModel(sysUser.getUserName(), model_name) != null) {
             resJson.put("state", 0);
-            return Result.success("ok",resJson);
+            return Result.success("ok", resJson);
         }
         //非重名
         resJson.put("state", 1);
 
-        String model_data=req.getString("modeldata");
-        JSONObject model_json=JSON.parseObject(model_data);
+        String model_data = req.getString("modeldata");
+        JSONObject model_json = JSON.parseObject(model_data);
 
 //        String select_data = model_json.getJSONArray("select_data").toString();
 
-        String file_name=sysUser.getUserName()+"_"+model_name;
-        jsonFile.writerFile(model_json,file_name);
+        String file_name = sysUser.getUserName() + "_" + model_name;
+        jsonFile.writerFile(model_json, file_name);
 
         //  这个地方应该先加到审批页面上
-        UserApproval approval=new UserApproval();
+        UserApproval approval = new UserApproval();
         approval.setUserName(sysUser.getUserName());
         approval.setApprovalId((long) 1);
         approval.setData(model_name);
         userApprovalService.save(approval);
         //写入数据库
-        String userName=sysUser.getUserName();
-        UserModel new_model=new UserModel();
-        new_model.setCreateBy(userName);
-        new_model.setModelName(model_name);
-        new_model.setModelType(0);
-        new_model.setStatus("审批中");
+        String userName = sysUser.getUserName();
+        ModelEntity new_modelEntity = new ModelEntity();
+        new_modelEntity.setCreateBy(sysUser.getId());
+        new_modelEntity.setModelName(model_name);
+        new_modelEntity.setModelType(0);
+        new_modelEntity.setStatus("审批中");
 //        new_model.setFieldCombine("暂未指定");
-        new_model.setModelRule(model_data);
-        userModelService.save(new_model);
+        new_modelEntity.setModelRule(model_data);
+        userModelService.save(new_modelEntity);
 
 
-        return Result.success("ok",resJson);
+        return Result.success("ok", resJson);
 
     }
+
     //列举usermodel
     @GetMapping("getUserModel")
-    public Result getUserModel(SysUser sysUser)
-    {
-        JSONObject resJson=new JSONObject();
-        List<UserModel> model_list=userModelService.findByUserName("1");
-        System.out.println(sysUser.getUserName());
-        resJson.put("modelData", model_list);
-
-        return Result.success("ok",resJson);
+    public Result getUserModel(SysUser sysUser) {
+        JSONObject resJson = new JSONObject();
+        List<ModelEntity> model_Entity_list = userModelService.findByUserName(sysUser.getUserName());
+//        System.out.println(model_list.get(0).getId());
+        resJson.put("modelData", model_Entity_list);
+        return Result.success("ok", resJson);
 
 
     }
+
     //    获取当前模型
     @PostMapping("getModelByName")
-    public Result getModelByName(@RequestBody String json,SysUser sysUser)
-    {
+    public Result getModelByName(@RequestBody String json, SysUser sysUser) {
 
-        JSONObject resJson=new JSONObject();
+        JSONObject resJson = new JSONObject();
 
         JSONObject req = JSON.parseObject(json);
         //user_name+model_name就是文件名
-        String model_name=req.getString("modelName");
-        String user_name=sysUser.getUserName();
+        String model_name = req.getString("modelName");
+        String user_name = sysUser.getUserName();
         //读取对应文件
-        JSONObject model=jsonFile.ReadJson(user_name+"_"+model_name);
+        JSONObject model = jsonFile.ReadJson(user_name + "_" + model_name);
         System.out.println(model);
 
 //        resJson.put("model", model);
 
-        return Result.success("ok",resJson);
+        return Result.success("ok", resJson);
 
     }
 
 
-    @PostMapping("changeModelByID")
-    public Result changeModelByID(@RequestBody String json,SysUser sysUser) throws IOException {
+        @PostMapping("changeModelByID")
+        public Result changeModelByID(@RequestBody String json, SysUser sysUser) throws IOException {
         //获取参数
-        JSONObject resJson=new JSONObject();
-        JSONObject req=JSON.parseObject(json);
-        String model_name=req.getString("modelname");
-        String model_data=req.getString("modeldata");
-        long id=Long.parseLong( req.getString("modelid"));
+        JSONObject resJson = new JSONObject();
+        JSONObject req = JSON.parseObject(json);
+        String model_name = req.getString("modelname");
+        String model_data = req.getString("modeldata");
+        long id = Long.parseLong(req.getString("modelid"));
 //        System.out.println(id);
 //        System.out.println(req.getString("modelid"));
-        UserModel model=userModelService.findByID(id);
+        ModelEntity modelEntity = userModelService.findByID(id);
 
         //删除旧模型(文件)
-        String old_name=model.getModelName();
+        String old_name = modelEntity.getModelName();
 
 
         //新模型写入
-        JSONObject model_json=JSON.parseObject(model_data);
-        String file_name=sysUser.getUserName()+"_"+model_name;
-        jsonFile.writerFile(model_json,file_name);
-        model.setModelName(model_name);
-        model.setStatus("审批中");
+        JSONObject model_json = JSON.parseObject(model_data);
+        String file_name = sysUser.getUserName() + "_" + model_name;
+        jsonFile.writerFile(model_json, file_name);
+        modelEntity.setModelName(model_name);
+        modelEntity.setStatus("审批中");
         //重新审批
-        UserApproval approval=new UserApproval();
+        UserApproval approval = new UserApproval();
         approval.setUserName(sysUser.getUserName());
         approval.setApprovalId((long) 1);
         approval.setData(model_name);
         userApprovalService.save(approval);
 
-        userModelService.updateById(model);
-
+        userModelService.updateById(modelEntity);
 
 
         return Result.success();
@@ -519,40 +511,40 @@ public class ModelController {
 
     //修改产品号
     @PostMapping("changeProduct")
-    public Result changeProduct(@RequestBody String json,SysUser sysUser)
-    {
-        JSONObject req=JSON.parseObject(json);
-        long id= Long.parseLong(req.getString("modelid"));
-        String productNum=req.getString("productnum");
-        UserModel model=userModelService.findByID(id);
-        model.setModelNo(productNum);
-        userModelService.updateById(model);
+    public Result changeProduct(@RequestBody String json, SysUser sysUser) {
+        JSONObject req = JSON.parseObject(json);
+        long id = Long.parseLong(req.getString("modelid"));
+        String productNum = req.getString("productnum");
+        ModelEntity modelEntity = userModelService.findByID(id);
+        modelEntity.setModelNo(productNum);
+        userModelService.updateById(modelEntity);
         return Result.success();
 
     }
+
     //mqy add changeModelName
     @PostMapping("changeModelName")
-    public Result changeModelName(@RequestBody String json){
-        JSONObject req=JSON.parseObject(json);
-        long modelNo= Long.parseLong(req.getString("modelNo"));
-        String modelName=req.getString("modelName");
+    public Result changeModelName(@RequestBody String json) {
+        JSONObject req = JSON.parseObject(json);
+        long modelNo = Long.parseLong(req.getString("modelNo"));
+        String modelName = req.getString("modelName");
         System.out.println(modelNo);
         System.out.println(modelName);
-        userModelService.changeModelName(modelName,modelNo);
+        userModelService.changeModelName(modelName, modelNo);
         return Result.success("ok");
     }
+
     //yuan修改组合对应模型号
     @PostMapping("combineReleModel")
-    public Result combineReleModel(@RequestBody String json,SysUser sysUser)
-    {
-        JSONObject req=JSON.parseObject(json);
-        String field_combine=req.getString("field_combine");
-        String modelName=req.getString("model_name");
-        UserField field=userFieldService.findByFieldCombine(field_combine);
-        UserModel model = userModelService.findByModelName(modelName);
+    public Result combineReleModel(@RequestBody String json, SysUser sysUser) {
+        JSONObject req = JSON.parseObject(json);
+        String field_combine = req.getString("field_combine");
+        String modelName = req.getString("model_name");
+        UserField field = userFieldService.findByFieldCombine(field_combine);
+        ModelEntity modelEntity = userModelService.findByModelName(modelName);
 //        model.setFieldCombine(field_combine);
         field.setModelName(modelName);
-        userModelService.updateById(model);
+        userModelService.updateById(modelEntity);
         userFieldService.updateById(field);
         return Result.success();
     }
@@ -576,28 +568,26 @@ public class ModelController {
     //这个接口是将模型从审核通过/暂停改为上线
 //    审批中/已上线/审核通过/暂停使用
     @PostMapping("changeState")
-    public Result changeState(@RequestBody String json,SysUser sysUser)
-    {
-        JSONObject req=JSON.parseObject(json);
-        long id= Long.parseLong(req.getString("modelid"));
-        String state=req.getString("modelstate");
+    public Result changeState(@RequestBody String json, SysUser sysUser) {
+        JSONObject req = JSON.parseObject(json);
+        long id = Long.parseLong(req.getString("modelid"));
+        String state = req.getString("modelstate");
 
         System.out.println(id);
-        UserModel model=userModelService.findByID(id);
+        ModelEntity modelEntity = userModelService.findByID(id);
 
-        model.setStatus(state);
+        modelEntity.setStatus(state);
 
-        userModelService.updateById(model);
+        userModelService.updateById(modelEntity);
 
         return Result.success();
 
     }
 
     @PostMapping("deleteModel")
-    public Result deleteModel(@RequestBody String json,SysUser sysUser)
-    {
-        JSONObject req=JSON.parseObject(json);
-        long id= Long.parseLong(req.getString("modelid"));
+    public Result deleteModel(@RequestBody String json, SysUser sysUser) {
+        JSONObject req = JSON.parseObject(json);
+        long id = Long.parseLong(req.getString("modelid"));
         String fieldCombine = req.getString("fieldCombine");
 //        if(fieldCombine.equals("暂未指定")){
 //
@@ -607,8 +597,8 @@ public class ModelController {
 //            userFieldService.updateById(field);
 //        }
 
-        UserModel model=userModelService.findByID(id);
-        String oldFilePath=model.getFilePath();
+        ModelEntity modelEntity = userModelService.findByID(id);
+        String oldFilePath = modelEntity.getFilePath();
         File oldFile = new File(oldFilePath);
 
         if (oldFile.exists()) {
@@ -618,8 +608,7 @@ public class ModelController {
             } catch (IOException e) {
                 System.out.println("file delete fail: " + e.getMessage());
             }
-        }
-        else {
+        } else {
             System.out.println("file not exist");
         }
 
@@ -630,21 +619,21 @@ public class ModelController {
 
     // 获取审核模块的详情,主要是模型详情
     @PostMapping("getDetails")
-    public Result getDetails(@RequestBody String json)
-    {
-        JSONObject jsonrq=JSON.parseObject(json);
-        int type=jsonrq.getInteger("type");
-        if(type==1)
-        {
+    public Result getDetails(@RequestBody String json) {
+        JSONObject jsonrq = JSON.parseObject(json);
+        int type = jsonrq.getInteger("type");
+        if (type == 1) {
             //首先获取对应模型
             JSONObject res = new JSONObject();
-            String user_name=jsonrq.getString("username");
-            String model_name=jsonrq.getString("modelname");
-            UserModel model=userModelService.findByUserAndModel(user_name,model_name);
-            if(model==null)   return Result.error();
+            String user_name = jsonrq.getString("username");
+            String model_name = jsonrq.getString("modelname");
+            ModelEntity modelEntity = userModelService.findByUserAndModel(user_name, model_name);
+            if (modelEntity == null) {
+                return Result.error();
+            }
             //模型类型
-            res.put("model_type",model.getModelType());
-            if(model.getModelType()==0) {//自定义模型
+            res.put("model_type", modelEntity.getModelType());
+            if (modelEntity.getModelType() == 0) {//自定义模型
                 JSONObject model_data = jsonFile.ReadJson(user_name + "_" + model_name);
                 if (model_data != null) {
                     res.put("error_code", 0);
@@ -654,90 +643,75 @@ public class ModelController {
                     res.put("error_info", "模型不存在!");
 
                 }
-            }
-            else if(model.getModelType()==1 || model.getModelType()==2)
-            {
+            } else if (modelEntity.getModelType() == 1 || modelEntity.getModelType() == 2) {
                 //res.put("output_list",model.getOutputList());
                 //res.put("other_data",model.getOtherData());
 
             }
-            return Result.success("ok",res);
-        }
-        else if(type==2)
-        {
+            return Result.success("ok", res);
+        } else if (type == 2) {
             //字段信息 直接获取 不用这一步
 //            JSONObject res = new JSONObject();
 //            String user_name=jsonrq.getString("username");
 //            String field_data=jsonrq.getString("modelname");
 
-        }
-        else
-        {
+        } else {
 
         }
         return Result.success();
     }
 
     @PostMapping("doApproval")
-    public Result doApproval(@RequestBody String json)
-    {
-        String reason_list[]={"错误字段选择","错误模型逻辑","其他"};
-        JSONObject jsonrq=JSON.parseObject(json);
-        int type=jsonrq.getInteger("type");
-        long id= Long.parseLong(jsonrq.getString("id"));
-
-        if(type==1)
-        {
+    public Result doApproval(@RequestBody String json) {
+        String reason_list[] = {"错误字段选择", "错误模型逻辑", "其他"};
+        JSONObject jsonrq = JSON.parseObject(json);
+        int type = jsonrq.getInteger("type");
+        long id = Long.parseLong(jsonrq.getString("id"));
+
+        if (type == 1) {
             JSONObject res = new JSONObject();
-            String user_name=jsonrq.getString("username");
-            String model_name=jsonrq.getString("data");
-            int pass=jsonrq.getInteger("pass");
+            String user_name = jsonrq.getString("username");
+            String model_name = jsonrq.getString("data");
+            int pass = jsonrq.getInteger("pass");
             //通过
-            if(pass==1)
-            {
-                UserModel model=userModelService.findByUserAndModel(user_name,model_name);
-                if(model!=null) {
-                    model.setStatus("审核通过");
-                    userModelService.updateById(model);
+            if (pass == 1) {
+                ModelEntity modelEntity = userModelService.findByUserAndModel(user_name, model_name);
+                if (modelEntity != null) {
+                    modelEntity.setStatus("审核通过");
+                    userModelService.updateById(modelEntity);
                 }
             }
             //不通过
             else {
-                int reason=jsonrq.getInteger("reason");
-                UserModel model = userModelService.findByUserAndModel(user_name, model_name);
-                if(model!=null) {
-                    model.setStatus("审核不通过:"+reason_list[reason]);
-                    userModelService.updateById(model);
+                int reason = jsonrq.getInteger("reason");
+                ModelEntity modelEntity = userModelService.findByUserAndModel(user_name, model_name);
+                if (modelEntity != null) {
+                    modelEntity.setStatus("审核不通过:" + reason_list[reason]);
+                    userModelService.updateById(modelEntity);
                 }
             }
-        }
-        else if(type==2)
-        {
-            String user_name=jsonrq.getString("username");
-            String user_field=jsonrq.getString("data");
-            int pass=jsonrq.getInteger("pass");
+        } else if (type == 2) {
+            String user_name = jsonrq.getString("username");
+            String user_field = jsonrq.getString("data");
+            int pass = jsonrq.getInteger("pass");
 
             System.out.println("审核了字段");
             System.out.println(user_name);
-            if(pass==1)
-            {
-                UserField userField=userFieldService.findByFieldCombine(user_field);
-                if(userField!=null) {
+            if (pass == 1) {
+                UserField userField = userFieldService.findByFieldCombine(user_field);
+                if (userField != null) {
                     userField.setFieldState("审核通过");
                     userFieldService.updateById(userField);
                 }
 
-            }
-            else {
-                UserField userField=userFieldService.findByUserName(user_name);
-                if(userField!=null) {
+            } else {
+                UserField userField = userFieldService.findByUserName(user_name);
+                if (userField != null) {
                     userField.setFieldState("审核不通过");
                     userFieldService.updateById(userField);
                 }
             }
-        }
-        else
-        {
+        } else {
 
         }
         System.out.println(id);

+ 14 - 24
src/main/java/com/kexun/entity/UserModel.java → src/main/java/com/kexun/entity/ModelEntity.java

@@ -1,4 +1,5 @@
 package com.kexun.entity;
+
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -9,51 +10,40 @@ import lombok.Data;
 import java.io.Serializable;
 import java.util.Date;
 
+/**
+ * Description: 模型实体类
+ *
+ * @author lgs
+ * @date 2023/12/08
+ */
 @TableName(value = "model")
 @Data
-public class UserModel implements Serializable {
-    @JsonSerialize(using = ToStringSerializer.class)
-    @TableId(value = "id")
-    private Long id;
-
-    @TableField(value = "create_by")
-    private String createBy;
+public class ModelEntity extends BaseEntity implements Serializable {
 
     @TableField(value = "model_name")
     private String modelName;
 
-//    @TableField(value = "field_combine")
-//    private String fieldCombine;
-
     @TableField(value = "model_no")
     private String modelNo;
 
     @TableField(value = "status")
     private String status;
 
-    //    0  自定义模型
-//    1  jar包
-//    2  python包
-//    3  http服务
+    /**
+     * 0  自定义模型
+     * 1  jar包
+     * 2  python包
+     * 3  http服务
+     */
     @TableField(value = "model_type")
     private int modelType;
 
-
-//    @TableField(value = "other_data")
-//    private String otherData;
-
-//    @TableField(value = "output_list")
-//    private String outputList;
-
     @TableField(value = "model_rule")
     private String modelRule;
 
     @TableField(value = "file_path")
     private String filePath;
 
-    @TableField(value = "create_time")
-    private String createTime;
-
     @TableField(exist = false)
     private static final long serialVersionUID = 1L;
 

+ 2 - 2
src/main/java/com/kexun/mapper/UserModelMapper.java

@@ -1,9 +1,9 @@
 package com.kexun.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.kexun.entity.UserModel;
+import com.kexun.entity.ModelEntity;
 import org.springframework.data.repository.query.Param;
 
-public interface UserModelMapper extends BaseMapper<UserModel> {
+public interface UserModelMapper extends BaseMapper<ModelEntity> {
     void changeModelNameQuery(@Param("modelName") String modelName, @Param("modelNo") long modelNo);
 }

+ 1 - 1
src/main/java/com/kexun/service/FieldTemplateService.java

@@ -37,7 +37,7 @@ public interface FieldTemplateService extends IService<FieldTemplateEntity> {
      * 修改
      * @param filedTemplateUpdateRO
      */
-    void saveOrUpdate(FiledTemplateUpdateRO filedTemplateUpdateRO);
+    void newUpdate(FiledTemplateUpdateRO filedTemplateUpdateRO);
 
     /**
      * 修改

+ 0 - 1
src/main/java/com/kexun/service/UserFieldService.java

@@ -2,7 +2,6 @@ package com.kexun.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.kexun.entity.UserField;
-import com.kexun.entity.UserModel;
 
 public interface UserFieldService extends IService<UserField> {
     UserField findByUserName(String user_name);

+ 6 - 7
src/main/java/com/kexun/service/UserModelService.java

@@ -1,17 +1,16 @@
 package com.kexun.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.kexun.entity.UserField;
-import com.kexun.entity.UserModel;
+import com.kexun.entity.ModelEntity;
 
 import java.util.List;
 
-public interface UserModelService extends IService<UserModel> {
+public interface UserModelService extends IService<ModelEntity> {
 
-    List<UserModel> findByUserName(String user_name);
-    UserModel findByModelName(String model_name);
-    UserModel findByUserAndModel(String user_name,String model_name);
-    UserModel findByID(long id);
+    List<ModelEntity> findByUserName(String user_name);
+    ModelEntity findByModelName(String model_name);
+    ModelEntity findByUserAndModel(String user_name, String model_name);
+    ModelEntity findByID(long id);
     void removeModelByID(long id);
 
     void changeModelName(String modelName,long modelNo);

+ 8 - 16
src/main/java/com/kexun/service/impl/FieldTemplateServiceImpl.java

@@ -107,7 +107,7 @@ public class FieldTemplateServiceImpl extends ServiceImpl<FieldTemplateMapper, F
                 fieldTemplateRefList.add(fieldTemplateRefEntity);
             }
             for (int i=0;i<fieldSelected2.size();i++){
-                Long fid = Long.parseLong(fieldSelected.get(i));
+                Long fid = Long.parseLong(fieldSelected2.get(i));
                 FieldDefineEntity fieldDefine = fieldDefineService.findByID(fid);
                 FieldTemplateRefEntity fieldTemplateRefEntity = new FieldTemplateRefEntity();
                 fieldTemplateRefEntity.setIsDeleted(false);
@@ -141,23 +141,15 @@ public class FieldTemplateServiceImpl extends ServiceImpl<FieldTemplateMapper, F
      * @param filedTemplateUpdateRO
      */
     @Override
-    public void saveOrUpdate(FiledTemplateUpdateRO filedTemplateUpdateRO) {
+    public void newUpdate(FiledTemplateUpdateRO filedTemplateUpdateRO) {
         Long id = filedTemplateUpdateRO.getId();
-        FieldTemplateEntity templateEntity = getById(id);
-        FieldTemplateEntity FieldTemplateEntity = new FieldTemplateEntity();
-        List<FiledUpdateRO> filedList = filedTemplateUpdateRO.getFieldSelected();
-        System.out.println(filedList);
-        if (null != templateEntity) {
-            BeanUtils.copyProperties(filedTemplateUpdateRO,FieldTemplateEntity);
-
-            updateById(FieldTemplateEntity);
-        }else {
-            long time1 = System.currentTimeMillis();
-            filedTemplateUpdateRO.setTemplateNo(Long.toString(time1));
-            BeanUtils.copyProperties(filedTemplateUpdateRO,FieldTemplateEntity);
-            save(FieldTemplateEntity);
+        FieldTemplateEntity fieldTemplateEntity = new FieldTemplateEntity();
+        fieldTemplateEntity.setTemplateNo(filedTemplateUpdateRO.getTemplateNo());
+        fieldTemplateEntity.setTemplateName(filedTemplateUpdateRO.getTemplateName());
+        BeanUtils.copyProperties(filedTemplateUpdateRO,fieldTemplateEntity);
+        updateById(fieldTemplateEntity);
+
         }
-    }
 
     /**
      * 修改模板

+ 0 - 1
src/main/java/com/kexun/service/impl/UserFieldServiceImpl.java

@@ -3,7 +3,6 @@ package com.kexun.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.kexun.entity.UserField;
-import com.kexun.entity.UserModel;
 import com.kexun.mapper.UserFieldMapper;
 import com.kexun.service.UserFieldService;
 import org.springframework.stereotype.Service;

+ 13 - 14
src/main/java/com/kexun/service/impl/UserModelServiceImpl.java

@@ -2,8 +2,7 @@ package com.kexun.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.kexun.entity.UserModel;
-import com.kexun.mapper.CooperatorProductMapper;
+import com.kexun.entity.ModelEntity;
 import com.kexun.mapper.UserModelMapper;
 import com.kexun.service.UserModelService;
 import org.springframework.stereotype.Service;
@@ -11,47 +10,47 @@ import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import java.util.List;
 @Service
-public class UserModelServiceImpl extends ServiceImpl<UserModelMapper,UserModel>
+public class UserModelServiceImpl extends ServiceImpl<UserModelMapper, ModelEntity>
         implements UserModelService
 {
     @Resource
     UserModelMapper userModelMapper;
     @Override
-    public List<UserModel> findByUserName(String user_name) {
+    public List<ModelEntity> findByUserName(String user_name) {
 
-        QueryWrapper<UserModel> wrapper=new QueryWrapper<UserModel>().eq("create_by",user_name);
-        List<UserModel> model_list=list(wrapper);
-        return model_list;
+        QueryWrapper<ModelEntity> wrapper=new QueryWrapper<ModelEntity>().eq("create_by",user_name);
+        List<ModelEntity> model_Entity_list =list(wrapper);
+        return model_Entity_list;
     }
 
     @Override
 
-    public UserModel findByModelName(String model_name)
+    public ModelEntity findByModelName(String model_name)
     {
-        QueryWrapper<UserModel> wrapper=new QueryWrapper<UserModel>().eq("model_name",model_name);
+        QueryWrapper<ModelEntity> wrapper=new QueryWrapper<ModelEntity>().eq("model_name",model_name);
 
         return getOne(wrapper);
 
     }
     @Override
 
-    public UserModel findByUserAndModel(String user_name,String model_name)
+    public ModelEntity findByUserAndModel(String user_name, String model_name)
     {
-        QueryWrapper<UserModel> wrapper=new QueryWrapper<UserModel>().eq("create_by",user_name);
+        QueryWrapper<ModelEntity> wrapper=new QueryWrapper<ModelEntity>().eq("create_by",user_name);
         wrapper.eq("model_name",model_name);
         return getOne(wrapper);
 
     }
 
     @Override
-    public UserModel findByID(long id) {
-        QueryWrapper<UserModel> wrapper=new QueryWrapper<UserModel>().eq("id",id);
+    public ModelEntity findByID(long id) {
+        QueryWrapper<ModelEntity> wrapper=new QueryWrapper<ModelEntity>().eq("id",id);
         return getOne(wrapper);
     }
 
     @Override
     public void removeModelByID(long id) {
-        QueryWrapper<UserModel> wrapper=new QueryWrapper<UserModel>().eq("id",id);
+        QueryWrapper<ModelEntity> wrapper=new QueryWrapper<ModelEntity>().eq("id",id);
         remove(wrapper);
     }
     @Override

+ 1 - 1
src/main/resources/mapper/UserModelMapper.xml

@@ -4,7 +4,7 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.kexun.mapper.UserModelMapper">
 
-    <resultMap id="BaseResultMap" type="com.kexun.entity.UserModel">
+    <resultMap id="BaseResultMap" type="com.kexun.entity.ModelEntity">
         <id property="id" column="id" jdbcType="BIGINT"/>
         <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
         <result property="modelName" column="model_name" jdbcType="VARCHAR"/>