From cca87f9fbd3da147a93d2a6ffa006132209c7583 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 1 Nov 2022 11:30:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=95=B0=E9=87=8F=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResourceServiceImpl.java | 8 +++- .../resources/mapper/resource/ResourceDao.xml | 37 +++++++++++++------ 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index bd3b1c61..8174be81 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -2026,6 +2026,7 @@ public class ResourceServiceImpl extends CrudServiceImpl { + Map index = (Map) x; + int type_index = index.containsKey("type_index") ? (int) index.get("type_index") : Integer.MAX_VALUE; + return type_index; + }).reversed()).collect(Collectors.toList()); } @Override diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 2d2207bc..4039a769 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -1639,7 +1639,22 @@ SELECT - tdr.id, - tdr.NAME, - tdr.create_date + tdr.id, + tdr.NAME, + tdr.create_date FROM - tb_data_resource tdr + tb_data_resource tdr WHERE - 1 = 1 - AND tdr.del_flag = 0 - AND tdr.dept_id = #{deptId} - - AND tdr.name like CONCAT('%', #{key}, '%') - + 1 = 1 + AND tdr.del_flag = 0 + AND tdr.dept_id = #{deptId} + + AND tdr.name like CONCAT('%', #{key}, '%') + ORDER BY create_date DESC