Răsfoiți Sursa

add: 联调改动

caozixuan 10 luni în urmă
părinte
comite
848c39d140

+ 3 - 2
src/main/java/cn/com/qmth/mps/controller/PaperController.java

@@ -129,9 +129,10 @@ public class PaperController extends BaseController {
 						arbitrateMethodStr = getStringVal(arbitrateMethod.getValue());
 					}
 					row.createCell(10, CellType.STRING).setCellValue(arbitrateMethodStr);
-					row.createCell(11, CellType.STRING).setCellValue(getStringVal(vo.getDoubleRate()));
+					Double doubleRate = vo.getDoubleRate();
+					row.createCell(11, CellType.STRING).setCellValue(getStringVal(doubleRate));
 					row.createCell(12, CellType.STRING).setCellValue(getStringVal(vo.getArbitrateThreshold()));
-					row.createCell(13, CellType.STRING).setCellValue("1");
+					row.createCell(13, CellType.STRING).setCellValue(doubleRate == null ? "" : "1");
 					row.createCell(14, CellType.STRING).setCellValue("track");
 					for (int i = 0; i < 15; i++) {
 						row.getCell(i).setCellStyle(style);

+ 1 - 1
src/main/java/cn/com/qmth/mps/service/impl/PaperGroupServiceImpl.java

@@ -240,7 +240,7 @@ public class PaperGroupServiceImpl extends ServiceImpl<PaperGroupDao, PaperGroup
 					throw new StatusException("仲裁阈值未正确设置");
 				}
 			}
-			if (ArbitrateMethod.GROUP_ARBITRATE.equals(arbitrateMethod)){
+			if (!doubleEnable || ArbitrateMethod.GROUP_ARBITRATE.equals(arbitrateMethod)){
 				u.setArbitrateThreshold(null);
 			}
 		}

+ 15 - 7
src/main/resources/mapper/PaperGroupMapper.xml

@@ -3,12 +3,20 @@
 <mapper namespace="cn.com.qmth.mps.dao.PaperGroupDao">
 
 	<select id="findGroupCount" resultType="cn.com.qmth.mps.vo.paper.GroupCountVo">
-		select t.paper_id,count(1) groupCount,MAX(double_enable) AS doubleEnable from mps_paper_group
-		t
-		where 1=2
-		<foreach collection="paperIds" index="index" item="paperId">
-			or t.paper_id=#{paperId}
-		</foreach>
-		group by t.paper_id
+		SELECT
+			t.paper_id,
+			COUNT(1) groupCount,
+			MAX(double_enable) AS doubleEnable
+		FROM
+			mps_paper_group t
+		<where>
+			<if test="paperIds != null and paperIds.size() > 0">
+				AND t.paper_id IN
+				<foreach collection="paperIds" item="paperId" open="(" separator="," close=")">
+					#{paperId}
+				</foreach>
+			</if>
+		</where>
+		GROUP BY t.paper_id
 	</select>
 </mapper>