能力广场和能力集市资源排序按指定方式排序修改

门户首页最新,最热查询排除知识库
This commit is contained in:
dinggang 2022-08-16 10:26:47 +08:00
parent 42d7d1a27c
commit 408baba4af
2 changed files with 37 additions and 37 deletions

View File

@ -683,7 +683,10 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
public Object selectNewest(JSONObject jsonObject) { public Object selectNewest(JSONObject jsonObject) {
IPage<ResourceEntity> page = new Page<>(jsonObject.getIntValue("pageNum"), jsonObject.getIntValue("pageSize")); IPage<ResourceEntity> page = new Page<>(jsonObject.getIntValue("pageNum"), jsonObject.getIntValue("pageSize"));
QueryWrapper<ResourceEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<ResourceEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(StringUtils.isNotBlank(jsonObject.getString("type")), "type", jsonObject.getString("type")).eq("del_flag", ResourceEntityDelFlag.NORMAL.getFlag()).orderByDesc("create_date"); queryWrapper.eq(StringUtils.isNotBlank(jsonObject.getString("type")), "type", jsonObject.getString("type"))
.eq("del_flag", ResourceEntityDelFlag.NORMAL.getFlag())
.ne("type", "知识库")
.orderByDesc("create_date");
return resourceDao.selectPage(page, queryWrapper); return resourceDao.selectPage(page, queryWrapper);
} }
@ -1067,7 +1070,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
} }
@Override @Override
//@Cacheable(value = SELECT_DTO_PAGE_SPECIAL_TOTAL_KEY, key = "#p0") @Cacheable(value = SELECT_DTO_PAGE_SPECIAL_TOTAL_KEY, key = "#p0")
public List<Map> selectDTOPageSpecilTotal(ResourceDTO resourceDTO) { public List<Map> selectDTOPageSpecilTotal(ResourceDTO resourceDTO) {
return resourceDao.selectDTOPageSpecilTotal(resourceDTO); return resourceDao.selectDTOPageSpecilTotal(resourceDTO);
} }

View File

@ -106,6 +106,7 @@
tdr.visitor, tdr.visitor,
tdr.pin_top, tdr.pin_top,
tdr.pin_top_time, tdr.pin_top_time,
tdr.dept_id,
sd.type AS "deptType", sd.type AS "deptType",
sd.sort AS "deptSort", sd.sort AS "deptSort",
sr.sort AS "regionSort", sr.sort AS "regionSort",
@ -138,8 +139,7 @@
AND user_id = #{dto.creator} AND user_id = #{dto.creator}
GROUP BY id) taa2 ON tdr.id = taa2.resource_id GROUP BY id) taa2 ON tdr.id = taa2.resource_id
LEFT JOIN ( SELECT resource_id, COUNT( approve_status ) approve_status FROM t_ability_application WHERE 1 = 1 LEFT JOIN ( SELECT resource_id, COUNT( approve_status ) approve_status FROM t_ability_application WHERE 1 = 1
AND del_flag = 0 AND user_id = #{dto.creator} AND approve_status = '通过' GROUP BY resource_id ) taa3 ON tdr.id AND del_flag = 0 AND user_id = #{dto.creator} AND approve_status = '通过' GROUP BY resource_id ) taa3 ON tdr.id =
=
taa3.resource_id taa3.resource_id
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
LEFT JOIN sys_region sr ON sd.district = sr.id LEFT JOIN sys_region sr ON sd.district = sr.id
@ -271,12 +271,12 @@
WHERE WHERE
1 = 1 1 = 1
AND tdr.del_flag = 0 AND tdr.del_flag = 0
AND tdr.type != '知识库'
AND tdr.type != '赋能案例'
<if test="type != null and type != ''"> <if test="type != null and type != ''">
<!-- AND tdr.type LIKE CONCAT('%',#{type},'%') -->
AND MATCH (tdr.type) AGAINST ( #{type} IN BOOLEAN MODE) AND MATCH (tdr.type) AGAINST ( #{type} IN BOOLEAN MODE)
</if> </if>
<if test="name != null and name != ''"> <if test="name != null and name != ''">
<!--AND tdr.name LIKE CONCAT('%',#{name},'%') -->
AND MATCH (tdr.name) AGAINST ( #{name} IN BOOLEAN MODE) AND MATCH (tdr.name) AGAINST ( #{name} IN BOOLEAN MODE)
</if> </if>
ORDER BY ${orderFiled} ${orderType} ORDER BY ${orderFiled} ${orderType}
@ -424,8 +424,7 @@
AND user_id = #{dto.creator} AND user_id = #{dto.creator}
GROUP BY id) taa2 ON tdr.id = taa2.resource_id GROUP BY id) taa2 ON tdr.id = taa2.resource_id
LEFT JOIN ( SELECT resource_id, COUNT( approve_status ) approve_status FROM t_ability_application WHERE 1 = 1 LEFT JOIN ( SELECT resource_id, COUNT( approve_status ) approve_status FROM t_ability_application WHERE 1 = 1
AND del_flag = 0 AND user_id = #{dto.creator} AND approve_status = '通过' GROUP BY resource_id ) taa3 ON tdr.id AND del_flag = 0 AND user_id = #{dto.creator} AND approve_status = '通过' GROUP BY resource_id ) taa3 ON tdr.id =
=
taa3.resource_id taa3.resource_id
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
LEFT JOIN sys_region sr ON sd.district = sr.id LEFT JOIN sys_region sr ON sd.district = sr.id
@ -609,8 +608,7 @@
FROM FROM
( (
SELECT SELECT
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS ( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type",
"type",
sd.NAME AS "deptName", sd.NAME AS "deptName",
IFNULL( tdr.deptCount, 0 ) AS "deptCount", IFNULL( tdr.deptCount, 0 ) AS "deptCount",
sd.id AS "deptId", sd.id AS "deptId",
@ -625,7 +623,7 @@
</if> </if>
GROUP BY dept_id ) tdr ON sd.id = tdr.dept_id GROUP BY dept_id ) tdr ON sd.id = tdr.dept_id
LEFT JOIN sys_region sr ON sd.district = sr.id LEFT JOIN sys_region sr ON sd.district = sr.id
ORDER BY sd.type, sd.sort ORDER BY sd.type, sr.sort, sd.sort
) temp1 ) temp1
WHERE WHERE
1 = 1 1 = 1
@ -644,8 +642,7 @@
FROM FROM
( (
SELECT SELECT
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS ( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type",
"type",
IFNULL( tdr.deptCount, 0 ) AS "deptCount" IFNULL( tdr.deptCount, 0 ) AS "deptCount"
FROM FROM
sys_dept sd sys_dept sd
@ -683,8 +680,7 @@
FROM FROM
( (
SELECT SELECT
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS ( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type",
"type",
IFNULL( tdr.deptCount, 0) AS "deptCount", IFNULL( tdr.deptCount, 0) AS "deptCount",
IFNULL(sr.name, '暂无该地区') AS "districtName" IFNULL(sr.name, '暂无该地区') AS "districtName"
FROM FROM
@ -1514,7 +1510,7 @@
<select id="resourceInstallationOrDataResourceDetails" parameterType="java.util.Map" resultType="java.util.Map"> <select id="resourceInstallationOrDataResourceDetails" parameterType="java.util.Map" resultType="java.util.Map">
SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName
FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id
WHERE a.type = #{resourceType} AND a.del_flag = 0 WHERE a.type = #{resourceType} AND a.del_flag = 0
<if test="id != '0'.toString()"> <if test="id != '0'.toString()">
AND (b.ID = #{id} OR INSTR(b.pids,#{id})) AND (b.ID = #{id} OR INSTR(b.pids,#{id}))
@ -1524,39 +1520,40 @@
</select> </select>
<select id="selectAppList" resultType="java.util.Map"> <select id="selectAppList" resultType="java.util.Map">
SELECT SELECT
tdr.id, tdr.id,
tdr.`name`, tdr.`name`,
sd.name AS "deptName", tdr.dept_id,
sd.sort AS "deptSort", sd.name AS "deptName",
sd.type AS "deptType", sd.sort AS "deptSort",
sr.sort AS "regionSort", sd.type AS "deptType",
tdr.visitor sr.sort AS "regionSort",
tdr.visitor
FROM FROM
tb_data_resource tdr tb_data_resource tdr
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
LEFT JOIN sys_region sr ON sd.district = sr.id LEFT JOIN sys_region sr ON sd.district = sr.id
WHERE WHERE
1 = 1 1 = 1
AND tdr.type = '应用资源' AND tdr.type = '应用资源'
AND tdr.del_flag = 0 AND tdr.del_flag = 0
<if test=" type != null and type != ''"> <if test=" type != null and type != ''">
AND sd.type = #{type} AND sd.type = #{type}
</if> </if>
ORDER BY ORDER BY
sd.type, sr.sort, sd.sort, tdr.dept_id, tdr.visitor DESC, tdr.id DESC sd.type, sr.sort, sd.sort, tdr.dept_id, tdr.visitor DESC, tdr.id DESC
LIMIT ${pageNum}, 9 LIMIT ${pageNum}, 9
</select> </select>
<select id="selectPicByResId" resultType="java.lang.String"> <select id="selectPicByResId" resultType="java.lang.String">
SELECT SELECT
tda.attr_value tda.attr_value
FROM FROM
tb_data_attr tda tb_data_attr tda
LEFT JOIN tb_data_resource tdr ON tda.data_resource_id = tdr.id LEFT JOIN tb_data_resource tdr ON tda.data_resource_id = tdr.id
WHERE WHERE
tda.attr_type = '应用图片' tda.attr_type = '应用图片'
AND tdr.id = #{id} AND tdr.id = #{id}
AND tda.del_flag = 0 AND tda.del_flag = 0
</select> </select>
<select id="selectTypeCountByName" resultType="java.util.Map"> <select id="selectTypeCountByName" resultType="java.util.Map">
SELECT SELECT