From f5fc56c2d17ec4290cc62112717f57f5373299f7 Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Sat, 8 Nov 2025 15:22:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=BA=93=E7=83=AD=E7=82=B9?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xboe/module/course/dao/CourseTagDao.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/module/course/dao/CourseTagDao.java b/servers/boe-server-all/src/main/java/com/xboe/module/course/dao/CourseTagDao.java index c5449bac..56457faf 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/module/course/dao/CourseTagDao.java +++ b/servers/boe-server-all/src/main/java/com/xboe/module/course/dao/CourseTagDao.java @@ -45,7 +45,7 @@ public class CourseTagDao extends BaseDao { "on t.id = r.tag_id AND r.deleted =0 \n" + "where t.deleted =0 and t.is_hot = true and t.status =0 \n" + "GROUP BY t.id\n" + - "order by relation_count desc,t.last_set_hot_time desc"; // 数据库字段为last_set_hot_time + "order by t.last_set_hot_time desc"; // 数据库字段为last_set_hot_time // 创建原生查询并指定结果映射到CourseTag实体 javax.persistence.Query query = entityManager.createNativeQuery(sql, CourseTag.class); @@ -72,11 +72,11 @@ public class CourseTagDao extends BaseDao { "WHERE r.deleted = 0 and c.status =0 " + "AND c.is_hot = true "; // 假设数据库字段为is_hot(与实体属性isHot对应) if (StringUtils.isNotBlank(sysType1)){ - sql += "AND r.sys_type1 = ?1 ORDER BY c.use_count,c.last_set_hot_time DESC"; + sql += "AND r.sys_type1 = ?1 ORDER BY c.last_set_hot_time DESC"; }else if(StringUtils.isNotBlank(sysType2)){ - sql += "AND r.sys_type2 = ?1 ORDER BY c.use_count,c.last_set_hot_time DESC"; + sql += "AND r.sys_type2 = ?1 ORDER BY c.last_set_hot_time DESC"; }else { - sql += "AND r.sys_type3 = ?1 ORDER BY c.use_count,c.last_set_hot_time DESC"; + sql += "AND r.sys_type3 = ?1 ORDER BY c.last_set_hot_time DESC"; } // 创建原生查询并指定结果映射到CourseTag实体 javax.persistence.Query query = entityManager.createNativeQuery(sql, CourseTag.class);