Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-08-09 17:11:26 +08:00
commit 4c5d961b65
5 changed files with 54 additions and 0 deletions

View File

@ -573,4 +573,13 @@ public class ResourceController {
public Result<List<Map>> selectDevelopDoc() {
return new Result<List<Map>>().ok(resourceService.selectDevelopDoc());
}
@GetMapping("/selectAppList")
@ApiOperation("能力广场-应用资源列表查询")
@LogOperation("能力广场-应用资源列表查询")
public Result selectAppLis(@RequestParam Map params) {
return new Result<>().ok(resourceService.selectAppList(params));
}
}

View File

@ -170,4 +170,8 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
List<Map<String, Object>> selectDevelopDocResource();
List<Map<String,Object>> resourceInstallationOrDataResourceDetails(Map params);
List<Map> selectAppList(@Param("pageNum") int pageNum, @Param("type") Integer type);
String selectPicByResId(@Param("id") String id);
}

View File

@ -135,4 +135,5 @@ public interface ResourceService extends CrudService<ResourceEntity, ResourceDTO
PageData<Map<String,Object>> resourceInstallationOrDataResourceDetails(Map<String, Object> params);
Object selectAppList(Map params);
}

View File

@ -1469,6 +1469,15 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
return new PageData<>(result, result2.size());
}
@Override
public Object selectAppList(Map params) {
int pageNum = Integer.parseInt(params.get("pageNum").toString());
Integer type = params.containsKey("type") ? Integer.parseInt(params.get("type").toString()) : null;
List<Map> maps = resourceDao.selectAppList((pageNum - 1) * 9, type);
maps.forEach(x -> x.put("pic", resourceDao.selectPicByResId(x.get("id").toString())));
return maps;
}
@Override
public PageData<Map<String, Object>> resourceInfrastructureDetails(Map<String, Object> params) {
List<Map<String, Object>> result;

View File

@ -1477,4 +1477,35 @@
GROUP BY a.dept_id,b.name
ORDER BY a.dept_id,b.name
</select>
<select id="selectAppList" resultType="java.util.Map">
SELECT
tdr.id,
tdr.`name`,
sd.name AS "deptName"
FROM
tb_data_resource tdr
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
WHERE
1 = 1
AND tdr.type = '应用资源'
AND tdr.del_flag = 0
<if test=" type != null and type != ''">
AND sd.type = #{type}
</if>
ORDER BY
tdr.visitor
LIMIT ${pageNum}, 9
</select>
<select id="selectPicByResId" resultType="java.lang.String">
SELECT
tda.attr_value
FROM
tb_data_attr tda
LEFT JOIN tb_data_resource tdr ON tda.data_resource_id = tdr.id
WHERE
tda.attr_type = '应用图片'
AND tdr.id = #{id}
AND tda.del_flag = 0
</select>
</mapper>