ludc
2023-07-14 7602a824e39e19260ae32bb45e799e6ce43300ac
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
@@ -412,7 +412,7 @@
        switchDateAttrOnOrder(templateVO, orderDTO);
        //9.生成编码的信息
//      ClientBusinessObject cbo = boService.createCBOByBtmName(classifyFullInfo.getTopClassifyVO().getBtmtypeid());
        BaseModel cbo = createCBOByBtmName(classifyFullInfo.getTopClassifyVO().getBtmtypeid());
        BaseModel cbo = createCBOByBtmName(classifyFullInfo.getTopClassifyVO().getBtmTypeId());
//      //默认的属性都不用从前端拷贝
//      //设置编码需要的默认属性的内容
        copyValueToCBO(classifyFullInfo, cbo, orderDTO, templateVO, false);
@@ -650,7 +650,7 @@
        if (!CollectionUtils.isEmpty(conditionMap)) {
//         final String[] sql = {"select count(*) from " + VciBaseUtil.getTableName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()) + " t where 1 = 1 "};
            R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getTopClassifyVO().getBtmtypeid()));
            R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getTopClassifyVO().getBtmTypeId()));
//            String referTable = VciBaseUtil.getTableName(referVO.getReferType());
            if (!listR.isSuccess() || listR.getData().size() == 0) {
                throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
@@ -963,13 +963,16 @@
        CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(codeClassifyOid);
        List<UIFormItemVO> itemVOS = new ArrayList<>();
        Map<String, List<CodeClassifyTemplateAttrVO>> attrGroupMap = templateVO.getAttributes().stream().
                filter(s -> StringUtils.isNotBlank(s.getAttributeGroup())).collect(Collectors.groupingBy(s -> s.getAttributeGroup()));
        templateVO.getAttributes().forEach(attrVO -> {
            UIFormItemVO formItemVO = templateAttr2FormField(attrVO, templateVO.getBtmTypeId());
            itemVOS.add(formItemVO);
        });
      Map<String, List<CodeClassifyTemplateAttrVO>> attrGroupMap = new HashMap<>();
      if (Func.isNotEmpty(templateVO.getAttributes())) {
         attrGroupMap = templateVO.getAttributes().stream().
            filter(s -> StringUtils.isNotBlank(s.getAttributeGroup())).collect(Collectors.groupingBy(s -> s.getAttributeGroup()));
         templateVO.getAttributes().forEach(attrVO -> {
            UIFormItemVO formItemVO = templateAttr2FormField(attrVO, templateVO.getBtmTypeId());
            itemVOS.add(formItemVO);
         });
      }
        //处理属性分组
        if (!CollectionUtils.isEmpty(attrGroupMap)) {
            //按照分组的属性排列,找到每一个分组的第一个属性
@@ -1275,7 +1278,7 @@
            conditionMap.putAll(andConditionMap);
            PageHelper pageHelper = new PageHelper(-1);
            pageHelper.addDefaultDesc("id");
            return queryGrid(fullInfoBO.getTopClassifyVO().getBtmtypeid(), templateVO, conditionMap, pageHelper);
            return queryGrid(fullInfoBO.getTopClassifyVO().getBtmTypeId(), templateVO, conditionMap, pageHelper);
        }
        return new DataGrid<>();
    }
@@ -1296,11 +1299,11 @@
            //说明已经存在
            return resembleRuleService.getObjectByOid(currentClassifyVO.getCodeResembleRuleOid());
        }
        if (StringUtils.isBlank(currentClassifyVO.getParentcodeclassifyoid())) {
        if (StringUtils.isBlank(currentClassifyVO.getParentCodeClassifyOid())) {
            return null;
        }
        Map<String, CodeClassifyVO> classifyVOMap = fullInfoBO.getParentClassifyVOs().stream().collect(Collectors.toMap(s -> s.getOid(), t -> t));
        return getUseResembleRule(fullInfoBO, classifyVOMap.getOrDefault(currentClassifyVO.getParentcodeclassifyoid(), null));
        return getUseResembleRule(fullInfoBO, classifyVOMap.getOrDefault(currentClassifyVO.getParentCodeClassifyOid(), null));
    }
    /**
@@ -1440,26 +1443,32 @@
        }
        //先转换一下时间格式
        List<String> finalOnlySelectAttrIdList = onlySelectAttrIdList.stream().collect(Collectors.toList());
        List<CodeClassifyTemplateAttrVO> dateFormatAttrVOs = templateVO.getAttributes().stream().filter(
                s -> StringUtils.isNotBlank(s.getCodeDateFormat()) &&
                        (finalOnlySelectAttrIdList.size() == 0 || finalOnlySelectAttrIdList.contains(s.getId().toLowerCase(Locale.ROOT)))
        ).collect(Collectors.toList());
        //枚举的内容
        List<CodeClassifyTemplateAttrVO> enumAttrVOs = templateVO.getAttributes().stream().filter(
                s -> (StringUtils.isNotBlank(s.getEnumId()) || StringUtils.isNotBlank(s.getEnumString()))
                        &&
                        (finalOnlySelectAttrIdList.size() == 0 || finalOnlySelectAttrIdList.contains(s.getId().toLowerCase(Locale.ROOT)))
        ).collect(Collectors.toList());
      List<CodeClassifyTemplateAttrVO> dateFormatAttrVOs = new ArrayList<>();
      List<CodeClassifyTemplateAttrVO> enumAttrVOs = new ArrayList<>();
      if (Func.isNotEmpty(templateVO.getAttributes())) {
         dateFormatAttrVOs = templateVO.getAttributes().stream().filter(
            s -> StringUtils.isNotBlank(s.getCodeDateFormat()) &&
               (finalOnlySelectAttrIdList.size() == 0 || finalOnlySelectAttrIdList.contains(s.getId().toLowerCase(Locale.ROOT)))
         ).collect(Collectors.toList());
         //枚举的内容
         enumAttrVOs = templateVO.getAttributes().stream().filter(
            s -> (StringUtils.isNotBlank(s.getEnumId()) || StringUtils.isNotBlank(s.getEnumString()))
               &&
               (finalOnlySelectAttrIdList.size() == 0 || finalOnlySelectAttrIdList.contains(s.getId().toLowerCase(Locale.ROOT)))
         ).collect(Collectors.toList());
      }
        List<String> userIds = new ArrayList<>();
        dataMap.stream().forEach(data -> {
      List<CodeClassifyTemplateAttrVO> finalDateFormatAttrVOs = dateFormatAttrVOs;
      List<CodeClassifyTemplateAttrVO> finalEnumAttrVOs = enumAttrVOs;
      dataMap.stream().forEach(data -> {
            //处理时间
            if (!form) {
                //表单的时候只能用统一的时间格式
                wrapperDateFormat(dateFormatAttrVOs, data);
                wrapperDateFormat(finalDateFormatAttrVOs, data);
            }
            //处理枚举
            wrapperEnum(enumAttrVOs, data);
            wrapperEnum(finalEnumAttrVOs, data);
            String lcstatus = data.get(VciQueryWrapperForDO.LC_STATUS_FIELD);
            String copyFromVersion = data.getOrDefault(COPY_FROM_VERSION, "");
            if ((CodeDefaultLC.EDITING.getValue().equalsIgnoreCase(lcstatus) || CodeDefaultLC.AUDITING.getValue().equalsIgnoreCase(lcstatus))
@@ -1574,17 +1583,25 @@
        //因为参照不一定是在平台的属性池里面设置,所以我们得需要自行处理
        //参考VciQueryWrapper来处理
        //1. 找到所有的字段,
        Map<String, CodeClassifyTemplateAttrVO> attrVOMap = templateVO.getAttributes().stream().collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t));
        List<String> selectFieldList = attrVOMap.keySet().stream().collect(Collectors.toList());
      Map<String, CodeClassifyTemplateAttrVO> attrVOMap = new HashMap<>();
      List<String> selectFieldList = new ArrayList<>();
      if(Func.isNotEmpty(templateVO.getAttributes())){
         attrVOMap = templateVO.getAttributes().stream().collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t));
         selectFieldList = attrVOMap.keySet().stream().collect(Collectors.toList());
      }
        //所有的参照的字段
        Map<String/**属性字段**/, String> joinTableList = new ConcurrentHashMap<>();
        List<CodeClassifyTemplateAttrVO> referAttrVOs = templateVO.getAttributes().stream().filter(
                s -> StringUtils.isNotBlank(s.getReferBtmId()) || StringUtils.isNotBlank(s.getReferConfig())
        ).collect(Collectors.toList());
      List<CodeClassifyTemplateAttrVO> referAttrVOs = null;
      if (Func.isNotEmpty(templateVO.getAttributes())) {
         referAttrVOs = templateVO.getAttributes().stream().filter(
            s -> StringUtils.isNotBlank(s.getReferBtmId()) || StringUtils.isNotBlank(s.getReferConfig())
         ).collect(Collectors.toList());
      }
        Map<String/**参照的属性**/, String/**实际的字段**/> referFieldMap = new ConcurrentHashMap<>();
        if (!CollectionUtils.isEmpty(referAttrVOs)) {
            referAttrVOs.parallelStream().forEach(attrVO -> {
         List<String> finalSelectFieldList = selectFieldList;
         referAttrVOs.parallelStream().forEach(attrVO -> {
                UIFormReferVO referVO = null;
                if (StringUtils.isNotBlank(attrVO.getReferConfig())) {
                    referVO = JSONObject.parseObject(attrVO.getReferConfig(), UIFormReferVO.class);
@@ -1614,7 +1631,7 @@
                    showFieldInSource = textFields.get(0);
                }
                referFieldMap.put(attrVO.getId(), referTableNick + "." + showFieldInSource);
                selectFieldList.add(referTableNick + "." + showFieldInSource + " as " + referShowField);
                finalSelectFieldList.add(referTableNick + "." + showFieldInSource + " as " + referShowField);
            });
        }
        R<BtmTypeVO> allAttributeByBtmId = btmTypeClient.getDefaultAttrByBtmId(btmType);
@@ -1658,11 +1675,12 @@
                }
            });
            andCondtionMap.forEach((k, v) -> {
                andSql.add(getConditionSql(k.toLowerCase(), v, referFieldMap, attrVOMap, btmType));
         Map<String, CodeClassifyTemplateAttrVO> finalAttrVOMap = attrVOMap;
         andCondtionMap.forEach((k, v) -> {
                andSql.add(getConditionSql(k.toLowerCase(), v, referFieldMap, finalAttrVOMap, btmType));
            });
            orConditionMap.forEach((k, v) -> {
                orSql.add(getConditionSql(k.toLowerCase(), v, referFieldMap, attrVOMap, btmType));
                orSql.add(getConditionSql(k.toLowerCase(), v, referFieldMap, finalAttrVOMap, btmType));
            });
        }
        //组合起来
@@ -2100,7 +2118,7 @@
//      CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid());
        CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid());
        //找业务类型,然后使用主键去获取数据库里的数据
        List<BaseModel> cbos = selectByTypeAndOid(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), orderDTO.getOid());
        List<BaseModel> cbos = selectByTypeAndOid(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), orderDTO.getOid());
        if (CollectionUtils.isEmpty(cbos)) {
            throw new VciBaseException(DATA_OID_NOT_EXIST);
@@ -2154,7 +2172,7 @@
//      cbo.getData().putAll(orderDTO.getData());
        cbo.setLastModifyTime(new Date());
        cbo.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId()));
        updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), Collections.singletonList(cbo));
        updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), Collections.singletonList(cbo));
        batchSaveSelectChar(templateVO, Collections.singletonList(cbo));
    }
@@ -2179,7 +2197,7 @@
        oidCollection.stream().forEach(oids -> {
            Map<String, String> conditionMap = new HashMap<>();
//         conditionMap.put("oid", QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oids.toArray(new String[0])) + ")");
            List<BaseModel> cbos = selectByTypeAndOid(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), oids);
            List<BaseModel> cbos = selectByTypeAndOid(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), oids);
//            boService.queryCBO(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), conditionMap);
            cboList.addAll(cbos);
        });
@@ -2205,10 +2223,10 @@
//      batchCBO.getDeleteCbos().addAll(cboList);
//      WebUtil.setPersistence(false);
//      batchCBO.copyFromOther(
        productCodeService.recycleCode(classifyFullInfo.getCurrentClassifyVO().getBtmtypeid(), deleteBatchDTO.getOidList());
        productCodeService.recycleCode(classifyFullInfo.getCurrentClassifyVO().getBtmTypeId(), deleteBatchDTO.getOidList());
//      baseMapper.deleteBatchIds(cboList);
        //使用传入的业务类型查询表
        R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getCurrentClassifyVO().getBtmtypeid()));
        R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getCurrentClassifyVO().getBtmTypeId()));
        if (!listR.isSuccess() || listR.getData().size() == 0) {
            throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
        }
@@ -2275,10 +2293,10 @@
        //4. 查询的时候,直接使用codeclsfpath来查询
        CodeClassifyVO topClassifyVO = classifyService.getTopClassifyVO(codeClassifyOid);
        CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(templateOid);
        if (topClassifyVO == null || StringUtils.isBlank(topClassifyVO.getBtmtypeid())) {
        if (topClassifyVO == null || StringUtils.isBlank(topClassifyVO.getBtmTypeId())) {
            throw new VciBaseException("当前主题库分类没有顶层分类,或者顶层分类没有设置业务类型");
        }
        String btmTypeId = topClassifyVO.getBtmtypeid();
        String btmTypeId = topClassifyVO.getBtmTypeId();
        if (StringUtils.isBlank(btmTypeId)) {
            return new DataGrid<>("这个分类所属顶层分类没有添加业务类型");
        }
@@ -2345,7 +2363,7 @@
            throw new VciBaseException(DATA_OID_NOT_EXIST);
        }
        List<BaseModel> cboList = selectByTypeAndOid(topClassifyFullInfo.getTopClassifyVO().getBtmtypeid(), VciBaseUtil.array2String(orderDTOMap.keySet().toArray(new String[0])));
        List<BaseModel> cboList = selectByTypeAndOid(topClassifyFullInfo.getTopClassifyVO().getBtmTypeId(), VciBaseUtil.array2String(orderDTOMap.keySet().toArray(new String[0])));
//      cboOidMap.put("oid",QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(orderDTOMap.keySet().toArray(new String[0])) + ")");
//      List<ClientBusinessObject> cboList = boService.queryCBO(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), cboOidMap);
        if (CollectionUtils.isEmpty(cboList)) {
@@ -2401,7 +2419,7 @@
            batchSaveSelectChar(firstTemplateVO, cboList);
        });
//      boService.persistenceBatch(batchCBO);
        updateBatchByBaseModel(topClassifyFullInfo.getTopClassifyVO().getBtmtypeid(), updateList);
        updateBatchByBaseModel(topClassifyFullInfo.getTopClassifyVO().getBtmTypeId(), updateList);
        return R.success("操作成功!");
    }
@@ -2577,7 +2595,7 @@
    public CodeRuleVO getCodeRuleByClassifyOid(String codeClassifyOid) {
        VciBaseUtil.alertNotNull(codeClassifyOid, "分类的主键");
        CodeClassifyVO classifyVO = classifyService.getObjectByOid(codeClassifyOid);
        String codeRuleOid = classifyVO.getCoderuleoid();
        String codeRuleOid = classifyVO.getCodeRuleOid();
        if (StringUtils.isBlank(codeRuleOid)) {
            //往上找
            CodeClassifyFullInfoBO fullInfo = classifyService.getClassifyFullInfo(codeClassifyOid);
@@ -2597,8 +2615,8 @@
    public CodeRuleVO getCodeRuleByClassifyFullInfo(CodeClassifyFullInfoBO fullInfoBO) {
        //往上找
        String codeRuleOid = "";
        if (StringUtils.isNotBlank(fullInfoBO.getCurrentClassifyVO().getCoderuleoid())) {
            codeRuleOid = fullInfoBO.getCurrentClassifyVO().getCoderuleoid();
        if (StringUtils.isNotBlank(fullInfoBO.getCurrentClassifyVO().getCodeRuleOid())) {
            codeRuleOid = fullInfoBO.getCurrentClassifyVO().getCodeRuleOid();
        } else {
            if (CollectionUtils.isEmpty(fullInfoBO.getParentClassifyVOs())) {
                //说明已经是最高层级,
@@ -2608,8 +2626,8 @@
            //从最高的level开始获取
            for (int i = 0; i < parentClassifyVOList.size(); i++) {
                CodeClassifyVO record = parentClassifyVOList.get(i);
                if (StringUtils.isNotBlank(record.getCoderuleoid())) {
                    codeRuleOid = record.getCoderuleoid();
                if (StringUtils.isNotBlank(record.getCodeRuleOid())) {
                    codeRuleOid = record.getCodeRuleOid();
                    break;
                }
            }
@@ -2632,7 +2650,7 @@
        CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(templateOid);
        //为了防止模板上的业务类型与分类上不对应
        CodeClassifyVO topClassifyVO = classifyService.getTopClassifyVO(templateVO.getCodeclassifyoid());
        String btmId = topClassifyVO.getBtmtypeid();
        String btmId = topClassifyVO.getBtmTypeId();
        //查询数据
        Map<String, String> conditionMap = new HashMap<>();
        conditionMap.put("t.oid", oid);
@@ -2858,38 +2876,43 @@
        List<UITableFieldVO> fieldVOList = new ArrayList<>();
        Map<String, String> comboxOrReferFieldMap = new HashMap<>();
        templateVO.getAttributes().forEach(attrVO -> {
            UITableFieldVO tableFieldVO = templateAttr2TableField(attrVO, forEdit);
            if ("combox".equalsIgnoreCase(tableFieldVO.getFieldType())) {
                comboxOrReferFieldMap.put(tableFieldVO.getSortField(), tableFieldVO.getField());
            }
            if ("refer".equalsIgnoreCase(tableFieldVO.getFieldType())) {
                comboxOrReferFieldMap.put(tableFieldVO.getSortField(), tableFieldVO.getField());
            }
            if (StringUtils.isNotBlank(tableFieldVO.getEdit())) {
                tableDefineVO.setHasEditor(true);
            }
            fieldVOList.add(tableFieldVO);
        });
      if (Func.isNotEmpty(templateVO.getAttributes())) {
         templateVO.getAttributes().forEach(attrVO -> {
            UITableFieldVO tableFieldVO = templateAttr2TableField(attrVO, forEdit);
            if ("combox".equalsIgnoreCase(tableFieldVO.getFieldType())) {
               comboxOrReferFieldMap.put(tableFieldVO.getSortField(), tableFieldVO.getField());
            }
            if ("refer".equalsIgnoreCase(tableFieldVO.getFieldType())) {
               comboxOrReferFieldMap.put(tableFieldVO.getSortField(), tableFieldVO.getField());
            }
            if (StringUtils.isNotBlank(tableFieldVO.getEdit())) {
               tableDefineVO.setHasEditor(true);
            }
            fieldVOList.add(tableFieldVO);
         });
      }
        List<List<UITableFieldVO>> cols = new ArrayList<>();
        cols.add(fieldVOList);
        tableDefineVO.setCols(cols);
        Map<String, UITableFieldVO> fieldVOMap = fieldVOList.stream().collect(Collectors.toMap(s -> s.getField().toLowerCase(Locale.ROOT), t -> t));
        //查询属性
        List<CodeClassifyTemplateAttrVO> queryAttrVOs = templateVO.getAttributes().stream().filter(s -> BooleanEnum.TRUE.getValue().equalsIgnoreCase(s.getQueryAttrFlag())).collect(Collectors.toList());
        if (!CollectionUtils.isEmpty(queryAttrVOs)) {
            List<UITableFieldVO> queryFieldVOs = new ArrayList<>();
            queryAttrVOs.stream().forEach(attrVO -> {
                String attrId = attrVO.getId().toLowerCase(Locale.ROOT);
                attrId = comboxOrReferFieldMap.getOrDefault(attrId, attrVO.getId()).toLowerCase(Locale.ROOT);
                if (fieldVOMap.containsKey(attrId)) {
                    queryFieldVOs.add(fieldVOMap.get(attrId));
                }
            });
            tableDefineVO.setQueryColumns(queryFieldVOs);
        }
        //高级属性
        List<CodeClassifyTemplateAttrVO> seniorQueryAttrVOs = templateVO.getAttributes().stream().filter(s -> BooleanEnum.TRUE.getValue().equalsIgnoreCase(s.getSeniorQueryAttrFlag())).collect(Collectors.toList());
      List<CodeClassifyTemplateAttrVO> seniorQueryAttrVOs = null;
      if (Func.isNotEmpty(templateVO.getAttributes())) {
         //查询属性
         List<CodeClassifyTemplateAttrVO> queryAttrVOs = templateVO.getAttributes().stream().filter(s -> BooleanEnum.TRUE.getValue().equalsIgnoreCase(s.getQueryAttrFlag())).collect(Collectors.toList());
         if (!CollectionUtils.isEmpty(queryAttrVOs)) {
            List<UITableFieldVO> queryFieldVOs = new ArrayList<>();
            queryAttrVOs.stream().forEach(attrVO -> {
               String attrId = attrVO.getId().toLowerCase(Locale.ROOT);
               attrId = comboxOrReferFieldMap.getOrDefault(attrId, attrVO.getId()).toLowerCase(Locale.ROOT);
               if (fieldVOMap.containsKey(attrId)) {
                  queryFieldVOs.add(fieldVOMap.get(attrId));
               }
            });
            tableDefineVO.setQueryColumns(queryFieldVOs);
         }
         //高级属性
         seniorQueryAttrVOs = templateVO.getAttributes().stream().filter(s -> BooleanEnum.TRUE.getValue().equalsIgnoreCase(s.getSeniorQueryAttrFlag())).collect(Collectors.toList());
      }
        if (!CollectionUtils.isEmpty(seniorQueryAttrVOs)) {
            List<UITableFieldVO> queryFieldVOs = new ArrayList<>();
            seniorQueryAttrVOs.stream().forEach(attrVO -> {
@@ -3379,7 +3402,7 @@
        String lcstatusSql = "";
        if (StringUtils.isNotBlank(baseQueryObject.getConditionMap().get("lcstatus"))) {
            lcstatusSql = "lcstatus =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lcstatus"));
            lcstatusSql = "and lcstatus =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lcstatus"));
        }
//        String where = "";
@@ -3392,7 +3415,7 @@
        List<Map> maps = commonsMapper.selectBySql("select * from ( select rownum rn, t.* from (select * from " + listR.getData().get(0).getTableName() + SPACE
                + (StringUtils.isNotBlank(listR.getData().get(0).getRevisionRuleId()) ? (" where lastr = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastr").toString())
                + " and lastv =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and" : "where") + SPACE + "1=1"
                + " and lastv =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and" : "where") + SPACE + "1=1 "
                + lcstatusSql + namesql + codesql + ") t where rownum <=" + num1 + ") where rn >=" + num2
        );
        List<BaseModel> baseModels = new ArrayList<>();
@@ -3436,7 +3459,7 @@
        }
        int total = commonsMapper.queryCountBySql("select count(*) from " + listR.getData().get(0).getTableName() + SPACE
                + (StringUtils.isNotBlank(listR.getData().get(0).getRevisionRuleId()) ? (" where lastr = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastr").toString())
                + "and lastv = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and" : "where") + SPACE + "1=1"
                + "and lastv = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and" : "where") + SPACE + "1=1 "
                + lcstatusSql + namesql + codesql
        );
        IPage<BaseModel> objectDataGrid = new Page<>();