|
@@ -962,6 +962,36 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
return mapper.selectScreenDetailVOList(model);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public int selectCountByPosition(String positionCode) {
|
|
|
+ return mapper.selectCountByPosition(positionCode);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Map<String, String>> selectCountByPositionGroupBySbType(String positionCode) {
|
|
|
+ Weekend<SbPosition> weekend = new Weekend<>(SbPosition.class);
|
|
|
+ weekend.weekendCriteria().andLike(SbPosition::getCode, positionCode + "%");
|
|
|
+ List<SbPosition> sbPositions = sbPositionMapper.selectByExample(weekend);
|
|
|
+ List<String> positionIds = sbPositions.stream().map(SbPosition::getId).collect(Collectors.toList());
|
|
|
+ List<SbInfoVO> sbInfoVOS = mapper.selectVOList(new SbInfoDTO().setPositionIds(positionIds));
|
|
|
+ List<Map<String, String>> result = new ArrayList<>();
|
|
|
+ if(CollectionUtil.isNotEmpty(sbInfoVOS)) {
|
|
|
+ Map<String, Long> stringStringMap = sbInfoVOS.stream().collect(Collectors.groupingBy(SbInfoVO::getTypeId, Collectors.counting()));
|
|
|
+ List<SbType> typeList = sbTypeMapper.selectAll();
|
|
|
+ for (SbType type : typeList) {
|
|
|
+ Long num = stringStringMap.get(type.getId());
|
|
|
+ if (num != null) {
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("typeId", type.getId());
|
|
|
+ map.put("typeName", type.getName());
|
|
|
+ map.put("num", num.toString());
|
|
|
+ result.add(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<SbInfoVO> selectVOList(SbInfoDTO model) {
|
|
|
return mapper.selectVOList(model);
|