1.能力广场应用广场bug修复,返回结果增加查询结果总数
2.算法广场和gis广场查询接口重写,增加按区市筛选条件,赶回结果增加查询结果总数
This commit is contained in:
parent
a6620a396a
commit
5cdad40773
|
@ -671,4 +671,11 @@ public class ResourceController {
|
|||
return new Result<>().ok(resourceService.getPotentialList());
|
||||
}
|
||||
|
||||
@PostMapping("/getSquareList")
|
||||
@ApiOperation("/算法广场获取算法或Gis列表")
|
||||
@LogOperation("/算法广场获取算法或Gis列表")
|
||||
public Result getSquareList(@RequestBody JSONObject jsonObject) {
|
||||
return new Result().ok(resourceService.getSquareList(jsonObject));
|
||||
}
|
||||
|
||||
}
|
|
@ -205,4 +205,11 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
|
|||
List<Map> getPotentialList(@Param("halfMonthDay") String halfMonthDay, @Param("monthDay") String monthDay);
|
||||
|
||||
List<Map> getStarList();
|
||||
|
||||
Integer selectAppListCount(@Param("type") Integer type, @Param("area") String area);
|
||||
|
||||
List<Map> getSquareList(@Param("type") String type, @Param("deptType") Integer deptType, @Param("area") String area,
|
||||
@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
|
||||
|
||||
Integer getSquareListCount(@Param("type") String type, @Param("deptType") Integer deptType, @Param("area") String area);
|
||||
}
|
|
@ -157,4 +157,6 @@ public interface ResourceService extends CrudService<ResourceEntity, ResourceDTO
|
|||
Object getStarList();
|
||||
|
||||
Object getPotentialList();
|
||||
|
||||
Object getSquareList(JSONObject jsonObject);
|
||||
}
|
|
@ -1494,12 +1494,16 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
|
||||
@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;
|
||||
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;
|
||||
return new HashMap() {{
|
||||
put("appList",maps);
|
||||
put("total", resourceDao.selectAppListCount(type, area));
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2410,4 +2414,18 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
return potentialList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getSquareList(JSONObject jsonObject) {
|
||||
Integer deptType = jsonObject.getInteger("deptType");
|
||||
String area = jsonObject.getString("area");
|
||||
String type = jsonObject.getString("type");
|
||||
Integer pageNum = jsonObject.getInteger("pageNum");
|
||||
Integer pageSize = jsonObject.getInteger("pageSize");
|
||||
Integer i = (pageNum - 1) * pageSize;
|
||||
return new HashMap() {{
|
||||
put("list", resourceDao.getSquareList(type, deptType, area, i, pageSize));
|
||||
put("total", resourceDao.getSquareListCount(type, deptType, area));
|
||||
}};
|
||||
}
|
||||
|
||||
}
|
|
@ -2164,4 +2164,75 @@
|
|||
|
||||
ORDER BY fireNum DESC, create_date DESC LIMIT 10
|
||||
</select>
|
||||
|
||||
<select id="selectAppListCount" resultType="java.lang.Integer">
|
||||
SELECT IFNULL(COUNT(1), 0)
|
||||
FROM
|
||||
tb_data_resource tdr
|
||||
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
||||
LEFT JOIN sys_region sr ON sd.district = sr.id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND MATCH (tdr.type) AGAINST ( '应用资源' IN BOOLEAN MODE)
|
||||
AND tdr.del_flag = 0
|
||||
<if test=" type != null and type != ''">
|
||||
AND sd.type = #{type}
|
||||
</if>
|
||||
<if test=" area != null and area != ''">
|
||||
AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, '$[*].attrType' ), 'attrType', 'attrValue' ) ) ) LIKE CONCAT( '%', #{area}, '%' )
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getSquareList" resultType="java.util.Map">
|
||||
SELECT
|
||||
tdr.id,
|
||||
tdr.`name`,
|
||||
tdr.dept_id,
|
||||
sd.NAME AS "deptName",
|
||||
sd.sort AS "deptSort",
|
||||
sd.type AS "deptType",
|
||||
sr.sort AS "regionSort",
|
||||
IFNULL( tdr.visitor, 0 ) AS visitor
|
||||
FROM
|
||||
tb_data_resource tdr
|
||||
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
||||
LEFT JOIN sys_region sr ON sd.district = sr.id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND MATCH ( tdr.type ) AGAINST ( '组件服务' IN BOOLEAN MODE )
|
||||
AND tdr.del_flag = 0
|
||||
AND tdr.id IN ( SELECT data_resource_id FROM tb_data_attr WHERE attr_type = '组件类型' AND attr_value = #{type} AND del_flag = 0 )
|
||||
<if test = " deptType != null and deptType != ''">
|
||||
AND sd.type = #{deptType}
|
||||
</if>
|
||||
<if test = " area != null and area != ''">
|
||||
AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, '$[*].attrType' ), 'attrType', '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
|
||||
</select>
|
||||
|
||||
<select id="getSquareListCount" resultType="java.lang.Integer">
|
||||
SELECT IFNULL(COUNT(1), 0) FROM tb_data_resource tdr
|
||||
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
||||
LEFT JOIN sys_region sr ON sd.district = sr.id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND MATCH ( tdr.type ) AGAINST ( '组件服务' IN BOOLEAN MODE )
|
||||
AND tdr.del_flag = 0
|
||||
AND tdr.id IN ( SELECT data_resource_id FROM tb_data_attr WHERE attr_type = '组件类型' AND attr_value = #{type} AND del_flag = 0 )
|
||||
<if test = " deptType != null and deptType != ''">
|
||||
AND sd.type = #{deptType}
|
||||
</if>
|
||||
<if test = " area != null and area != ''">
|
||||
AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, '$[*].attrType' ), 'attrType', 'attrValue' ) ) ) LIKE CONCAT( '%', #{area}, '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue