/resource/selectAppList 接口增加参数 area

This commit is contained in:
wangliwen 2022-09-19 11:06:03 +08:00
parent cda3c4968a
commit 8b8d155bc2
3 changed files with 11 additions and 6 deletions

View File

@ -171,7 +171,7 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
List<Map<String, Object>> resourceInstallationOrDataResourceDetails(Map params);
List<Map> selectAppList(@Param("pageNum") int pageNum, @Param("type") Integer type);
List<Map> selectAppList(@Param("pageNum") int pageNum, @Param("type") Integer type, @Param("area") String area);
String selectPicByResId(@Param("id") String id);

View File

@ -1489,7 +1489,8 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
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);
String area = params.containsKey("area") ? params.get("area").toString() : null;
List<Map> maps = resourceDao.selectAppList((pageNum - 1) * 9, type, area);
maps.forEach(x -> x.put("pic", resourceDao.selectPicByResId(x.get("id").toString())));
return maps;
}

View File

@ -1564,6 +1564,10 @@
<if test=" type != null and type != ''">
AND sd.type = #{type}
</if>
<if test=" area != null and area != ''">
AND JSON_CONTAINS( tdr.info_list, JSON_OBJECT( 'attrType', '应用领域' ))
AND JSON_EXTRACT( tdr.info_list, '$[*].attrValue' ) LIKE CONCAT( '%', #{area}, '%' )
</if>
ORDER BY
sd.type, sr.sort, sd.sort, tdr.dept_id, tdr.visitor DESC, tdr.id DESC
LIMIT ${pageNum}, 9