代码提交

This commit is contained in:
huangzj
2023-10-09 16:36:34 +08:00
parent 0ba019fad7
commit 3faf9a39d5
3 changed files with 19 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ import java.util.List;
public interface CsEventUserPOMapper extends BaseMapper<CsEventUserPO> {
Integer queryEventCount(@Param("csEventUserQueryParam") CsEventUserQueryParam csEventUserQueryParam);
List<EventDetailVO> queryUserEventList(@Param("csEventUserQueryParam") CsEventUserQueryParam csEventUserQueryParam);
List<EventDetailVO> queryUserEventList(@Param("csEventUserQueryParam") CsEventUserQueryParam csEventUserQueryParam, @Param("devIds") List<String> devIds);
Page<EventDetailVO> queryEventpage(Page<EventDetailVO> returnpage, @Param("csEventUserQueryPage") CsEventUserQueryPage csEventUserQueryPage, @Param("devIds") List<String> devIds);
}

View File

@@ -46,6 +46,10 @@
#{item}
</foreach>
</if>
and b.device_id in
<foreach collection="devIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="csEventUserQueryParam!=null and csEventUserQueryParam.type != null and csEventUserQueryParam.type !=''">
AND b.type =#{ csEventUserQueryParam.type}

View File

@@ -88,7 +88,20 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
// List<String> collect = data.stream().map(DictData::getCode).collect(Collectors.toList());
// csEventUserQueryParam.setTarget(collect);
// }
List<EventDetailVO> list = this.getBaseMapper().queryUserEventList(csEventUserQueryParam);
List<String> deviceId = new ArrayList<>();
List<CsLedgerVO> data = csLedgerFeignClient.getDeviceTree().getData();
List<String> collect = data.stream().map(CsLedgerVO::getChildren).
flatMap(Collection::stream).
map(CsLedgerVO::getChildren).
flatMap(Collection::stream).
map(CsLedgerVO::getId).
collect(Collectors.toList());
if (CollectionUtils.isEmpty(collect)){
return new ArrayList<>();
}
List<EventDetailVO> list = this.getBaseMapper().queryUserEventList(csEventUserQueryParam,collect);
// 主要用于统计不关心详情,详情重分页查询获取
// list.forEach(temp->{
// DevDetailDTO devDetail = csLedgerFeignClient.queryDevDetail(temp.getDeviceId()).getData();