From 1f2566489ee6e435f4d464f8b33d9d214fdf139f Mon Sep 17 00:00:00 2001
From: yuxc <653031404@qq.com>
Date: 星期三, 02 八月 2023 17:40:02 +0800
Subject: [PATCH] 1、解决通用查询时map字段重复问题。

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
index 1a3e472..038f48c 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
@@ -1489,6 +1489,12 @@
 		conditionMap.put("codeclsfpath","*" + exportAttrDTO.getCodeClassifyOid() + "*");
 		conditionMap.put("lastr", "1");
 		conditionMap.put("lastv", "1");
+
+		String countSql = "select count(*) from " + VciBaseUtil.getTableName(btmTypeId) +" where 1=1" +
+			" and lastr = '1'" +
+			" and lastv='1'" +
+			" and codeclsfpath like '%" + exportAttrDTO.getCodeClassifyOid() + "%'";
+
 		//鍏堟煡璇㈡�绘暟
 		int total = 0;
 		if(exportAttrDTO.getEndPage()!=null && exportAttrDTO.getEndPage()>0
@@ -1502,10 +1508,11 @@
 				thisPage.setOrder(exportAttrDTO.getOrder());
 				thisPage.addDefaultDesc("createTime");
 
-				//total += boService.queryCount(btmTypeId, conditionMap);
+				total += commonsMapper.queryCountBySql(countSql);
 			}
 		}else{
-			//total=boService.queryCount(btmTypeId, conditionMap);
+
+			total = commonsMapper.queryCountBySql(countSql);
 		}
 		List<String> selectFieldList = new ArrayList<>();
 		if(!CollectionUtils.isEmpty(exportAttrDTO.getAttrIdIndexMap())){
@@ -2184,7 +2191,7 @@
 		String tableName ="";
 		try {
 			R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(templateVO.getBtmTypeId());
-			if(r.getCode()!=200) {
+			if(!r.isSuccess()) {
 				throw new Throwable(r.getMsg());
 			}
 			BtmTypeVO btmTypeVO = r.getData();
@@ -3292,7 +3299,7 @@
 		String tableName ="";
 		try {
 			R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(templateVO.getBtmTypeId());
-			if(r.getCode()!=200) {
+			if(!r.isSuccess()) {
 				throw new Throwable(r.getMsg());
 			}
 			BtmTypeVO btmTypeVO = r.getData();
@@ -4289,4 +4296,5 @@
 			}
 		}
 	}
+
 }

--
Gitblit v1.9.3