From 2ccc878edad4767f46b928a58ce1eda81eb7eabd Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 12 Aug 2022 16:12:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=83=BD=E5=8A=9B=E7=BD=AE?= =?UTF-8?q?=E9=A1=B6=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/V4.6__resource_add_col.sql | 7 +++ .../resources/mapper/resource/ResourceDao.xml | 57 +++++++++++-------- 2 files changed, 41 insertions(+), 23 deletions(-) create mode 100644 renren-admin/src/main/resources/db/V4.6__resource_add_col.sql diff --git a/renren-admin/src/main/resources/db/V4.6__resource_add_col.sql b/renren-admin/src/main/resources/db/V4.6__resource_add_col.sql new file mode 100644 index 00000000..439cd368 --- /dev/null +++ b/renren-admin/src/main/resources/db/V4.6__resource_add_col.sql @@ -0,0 +1,7 @@ +ALTER TABLE `share_platform`.`tb_data_resource` +ADD COLUMN `pin_top` int NULL COMMENT '是否置顶' , +ADD COLUMN `pin_top_time` datetime NULL COMMENT '置顶操作时间'; + +UPDATE tb_data_resource +SET pin_top = 0, +pin_top_time = NOW(); \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index c940b9fc..8159225e 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -128,7 +128,8 @@ AND user_id = #{dto.creator} 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 - 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 LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id WHERE 1 = 1 @@ -184,6 +185,9 @@ ORDER BY ${orderField} ${orderType} + + , pin_top_time DESC + @@ -397,7 +401,8 @@ AND user_id = #{dto.creator} 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 - 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 LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id WHERE 1 = 1 @@ -443,6 +448,9 @@ ORDER BY ${orderField} ${orderType} + + , pin_top_time DESC + LIMIT ${pageNum}, ${pageSize} @@ -570,7 +578,8 @@ FROM ( SELECT - ( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type", + ( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS + "type", sd.NAME AS "deptName", IFNULL( tdr.deptCount, 0 ) AS "deptCount", sd.id AS "deptId", @@ -601,7 +610,8 @@ FROM ( SELECT - ( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type", + ( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS + "type", IFNULL( tdr.deptCount, 0 ) AS "deptCount" FROM sys_dept sd @@ -639,7 +649,8 @@ FROM ( SELECT - ( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type", + ( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS + "type", IFNULL( tdr.deptCount, 0) AS "deptCount", IFNULL(sr.name, '暂无该地区') AS "districtName" FROM @@ -1469,7 +1480,7 @@ \ No newline at end of file