门户搜索修改
This commit is contained in:
parent
ba2cf96791
commit
939864d0f6
|
@ -53,7 +53,7 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
|
||||||
*/
|
*/
|
||||||
Long countAllDept();
|
Long countAllDept();
|
||||||
|
|
||||||
List<Map<String, Object>> selectGroupByDeptId();
|
List<Map<String, Object>> selectGroupByDeptId(@Param("type") String type);
|
||||||
|
|
||||||
Integer selectTypeCountByDept(String type);
|
Integer selectTypeCountByDept(@Param("deptType") String deptType, @Param("resourceType") String resourceType);
|
||||||
}
|
}
|
|
@ -289,17 +289,17 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
HashMap<String, Object> resourceMap = new HashMap<>();
|
HashMap<String, Object> resourceMap = new HashMap<>();
|
||||||
resourceMap.put("type", "全部能力目录");
|
resourceMap.put("type", "全部能力目录");
|
||||||
QueryWrapper<ResourceEntity> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ResourceEntity> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("del_flag", 0);
|
queryWrapper.eq("del_flag", 0).eq("type", jsonObject.getString("type"));
|
||||||
resourceMap.put("total", resourceDao.selectCount(queryWrapper));
|
resourceMap.put("total", resourceDao.selectCount(queryWrapper));
|
||||||
//resourceMap.put("dataList", resourceDao.selectList(queryWrapper));
|
//resourceMap.put("dataList", resourceDao.selectList(queryWrapper));
|
||||||
resultList.add(resourceMap);
|
resultList.add(resourceMap);
|
||||||
List<Map<String, Object>> typeMapList = resourceDao.selectGroupByDeptId();
|
List<Map<String, Object>> typeMapList = resourceDao.selectGroupByDeptId(jsonObject.getString("type"));
|
||||||
Map<String, List<Map<String, Object>>> listMap = typeMapList.stream()
|
Map<String, List<Map<String, Object>>> listMap = typeMapList.stream()
|
||||||
.collect(Collectors.groupingBy(m -> m.get("type").toString()));
|
.collect(Collectors.groupingBy(m -> m.get("type").toString()));
|
||||||
listMap.entrySet().stream().forEach(item -> {
|
listMap.entrySet().stream().forEach(item -> {
|
||||||
HashMap<Object, Object> map = new HashMap<>();
|
HashMap<Object, Object> map = new HashMap<>();
|
||||||
map.put("type", item.getKey());
|
map.put("type", item.getKey());
|
||||||
map.put("total", resourceDao.selectTypeCountByDept(item.getKey()));
|
map.put("total", resourceDao.selectTypeCountByDept(item.getKey(), jsonObject.getString("type")));
|
||||||
map.put("dataList", item.getValue());
|
map.put("dataList", item.getValue());
|
||||||
resultList.add(map);
|
resultList.add(map);
|
||||||
});
|
});
|
||||||
|
|
|
@ -328,7 +328,7 @@
|
||||||
sd.id AS "deptId"
|
sd.id AS "deptId"
|
||||||
FROM
|
FROM
|
||||||
sys_dept sd
|
sys_dept sd
|
||||||
LEFT JOIN ( SELECT dept_id, COUNT( id ) AS "deptCount" FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 GROUP BY dept_id ) tdr ON sd.id = tdr.dept_id
|
LEFT JOIN ( SELECT dept_id, COUNT( id ) AS "deptCount" FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 AND type = #{type} GROUP BY dept_id ) tdr ON sd.id = tdr.dept_id
|
||||||
) temp1
|
) temp1
|
||||||
WHERE
|
WHERE
|
||||||
1 = 1
|
1 = 1
|
||||||
|
@ -350,14 +350,14 @@
|
||||||
IFNULL( tdr.deptCount, 0 ) AS "deptCount"
|
IFNULL( tdr.deptCount, 0 ) AS "deptCount"
|
||||||
FROM
|
FROM
|
||||||
sys_dept sd
|
sys_dept sd
|
||||||
LEFT JOIN ( SELECT dept_id, COUNT( id ) AS "deptCount" FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 GROUP BY dept_id ) tdr ON sd.id = tdr.dept_id
|
LEFT JOIN ( SELECT dept_id, COUNT( id ) AS "deptCount" FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 AND type = #{resourceType} GROUP BY dept_id ) tdr ON sd.id = tdr.dept_id
|
||||||
) temp1
|
) temp1
|
||||||
WHERE
|
WHERE
|
||||||
1 = 1
|
1 = 1
|
||||||
AND temp1.deptCount != 0
|
AND temp1.deptCount != 0
|
||||||
) temp2
|
) temp2
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
AND temp2.type = #{type}
|
AND temp2.type = #{deptType}
|
||||||
GROUP BY
|
GROUP BY
|
||||||
temp2.type
|
temp2.type
|
||||||
</select>
|
</select>
|
||||||
|
|
Loading…
Reference in New Issue