Pārlūkot izejas kodu

汇总导出bug fix

hanwenjie 3 gadi atpakaļ
vecāks
revīzija
0f9101d571

+ 1 - 7
code/sapparent/sapservice/src/main/java/org/fouram/mapper/SapCheckReportMapper.xml

@@ -11,13 +11,7 @@
 				and a.name like CONCAT(CONCAT('%', #{name}),'%')
 			</if>
 			<if test="departId != null and departId != ''">
-				and (c.firstDepartId=#{departId} or c.secondDepartId=#{departId})
-			</if>
-			<if test="departIds != null and departIds.size() > 0">
-				and c.firstDepartId in
-				<foreach collection="departIds" item="depId" separator="," open="(" close=")">
-					#{depId}
-				</foreach>
+				and (c.firstDepartId in (${departId}) or c.secondDepartId in (${departId}))
 			</if>
 			group by c.firstDepartName,c.secondDepartName, c.userId, c.name
 			union all

+ 3 - 6
code/sapparent/sapservice/src/main/java/org/fouram/service/SapCheckReportService.java

@@ -1,7 +1,5 @@
 package org.fouram.service;
 
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
@@ -62,11 +60,10 @@ public class SapCheckReportService extends BaseService {
 		if (StringUtils.isNotBlank(departId) && departId.endsWith(",")) {
 			departId = departId.substring(0, departId.length() - 1);
 		}
-		Map<String, Object> pd = Maps.newHashMap();
+		Map<String, String> pd = Maps.newHashMap();
 		pd.put("startDate", startDate);
 		pd.put("endDate", endDate);
-//		pd.put("departId", departId);
-		pd.put("departIds",StringUtils.isNotBlank(departId)? new ArrayList<>(Arrays.asList(departId.split(","))):new ArrayList<>());
+		pd.put("departId", departId);
 		pd.put("name", name);
 
 		List<String> days = DateUtil.getSubDateList(startDate, endDate);
@@ -102,7 +99,7 @@ public class SapCheckReportService extends BaseService {
 	}
 
 	@SuppressWarnings("unchecked")
-	private List<Map<String, Object>> getReportDayResult(Map<String, Object> param, List<String> subDays)
+	private List<Map<String, Object>> getReportDayResult(Map<String, String> param, List<String> subDays)
 			throws Exception {
 		param.put("reportDaySql", getReportDaySql(subDays));
 		param.put("reportDayRemarkSql", getReportRemarkDaySql(subDays));