Commit 33c2fcc4 authored by 赵啸非's avatar 赵啸非

修改统计查询结果

parent 976ae872
......@@ -43,10 +43,9 @@ public class AttendanceStatDaoImpl extends BaseCRUDDaoMybatis<AttendanceStatEnti
RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
list = this.getSqlSession().selectList(this.getSqlId("getListExt"), params, rowBounds);
}
pageInfo.setTotalResult(count);
result.setPageInfo(pageInfo);
result.setList((List)list);
result.setList(list);
} else {
if (pageInfo.getPrePageResult() == -1) {
list = this.getSqlSession().selectList(this.getSqlId("getListExt"), params);
......
......@@ -46,7 +46,10 @@ public class AttendanceSummaryQuery {
private Integer dayOfWeek;
private Integer summaryType;
/**
* 正常缺勤类型等,['正常', '迟到', '早退', '请假', '旷工', '出差', '加班', '调休', '补签', '其他']
*/
private List<String> summaryTypeList;
private List<Long> staffIdList;
......
......@@ -679,11 +679,16 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
if (pageInfo == null) {
pageInfo = new PageInfo(10);
}
if(!ObjectUtils.isEmpty(params.getSummaryTypeList())){
pageInfo = new PageInfo(-1);
}
Result<AttendanceStatEntity> result = dao.getListExt(params, pageInfo);
if (CollectionUtils.isNotEmpty(result.getList())) {
//todo 循环查询改造
List<Long> staffIdList = result.getList().parallelStream().map(AttendanceStatEntity::getStaffId).collect(Collectors.toList());
params.setStaffIdList(staffIdList);
if(!ObjectUtils.isEmpty(staffIdList)){
params.setStaffIdList(staffIdList);
}
Map<Long, List<AttendanceStaffStatEntity>> staffGroupCollect = attendanceStaffStatService.getListExt(params).parallelStream().collect(Collectors.groupingBy(AttendanceStaffStatEntity::getStaffId));
Iterator<AttendanceStatEntity> iterator = result.getList().iterator();
......@@ -692,6 +697,8 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
List<AttendanceStaffStatEntity> statEntities = staffGroupCollect.get(item.getStaffId());
if (CollectionUtils.isNotEmpty(statEntities)) {
item.setAttendanceStaffStatEntities(statEntities);
}else {
iterator.remove();
}
}
......
......@@ -19,5 +19,12 @@
</foreach>
</if>
<if test="summaryTypeList != null and summaryTypeList.size>0">
AND s.attendanceSummary REGEXP
<foreach collection="summaryTypeList" open="'" close="'" index="index" item="item" separator="|">
#{item}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment