增加能力置顶字段
This commit is contained in:
parent
f45e3ea2f4
commit
2ccc878eda
|
@ -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();
|
|
@ -128,7 +128,8 @@
|
||||||
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
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
|
@ -184,6 +185,9 @@
|
||||||
</if>
|
</if>
|
||||||
<if test="orderField != null and orderField !=''">
|
<if test="orderField != null and orderField !=''">
|
||||||
ORDER BY ${orderField} ${orderType}
|
ORDER BY ${orderField} ${orderType}
|
||||||
|
<if test="orderField == 'pin_top'">
|
||||||
|
, pin_top_time DESC
|
||||||
|
</if>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -397,7 +401,8 @@
|
||||||
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
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
|
@ -443,6 +448,9 @@
|
||||||
</if>
|
</if>
|
||||||
<if test="orderField != null and orderField !=''">
|
<if test="orderField != null and orderField !=''">
|
||||||
ORDER BY ${orderField} ${orderType}
|
ORDER BY ${orderField} ${orderType}
|
||||||
|
<if test="orderField == 'pin_top'">
|
||||||
|
, pin_top_time DESC
|
||||||
|
</if>
|
||||||
LIMIT ${pageNum}, ${pageSize}
|
LIMIT ${pageNum}, ${pageSize}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
@ -570,7 +578,8 @@
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
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",
|
sd.NAME AS "deptName",
|
||||||
IFNULL( tdr.deptCount, 0 ) AS "deptCount",
|
IFNULL( tdr.deptCount, 0 ) AS "deptCount",
|
||||||
sd.id AS "deptId",
|
sd.id AS "deptId",
|
||||||
|
@ -601,7 +610,8 @@
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
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( tdr.deptCount, 0 ) AS "deptCount"
|
||||||
FROM
|
FROM
|
||||||
sys_dept sd
|
sys_dept sd
|
||||||
|
@ -639,7 +649,8 @@
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
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( tdr.deptCount, 0) AS "deptCount",
|
||||||
IFNULL(sr.name, '暂无该地区') AS "districtName"
|
IFNULL(sr.name, '暂无该地区') AS "districtName"
|
||||||
FROM
|
FROM
|
||||||
|
|
Loading…
Reference in New Issue