fix: 移动端仪表板排序和pc端不一致

This commit is contained in:
fit2cloud-chenyw 2024-01-24 17:05:20 +08:00
parent eb4a81c92a
commit e04a3c5838

View File

@ -3,17 +3,15 @@
<mapper namespace="io.dataease.ext.MobileDirMapper"> <mapper namespace="io.dataease.ext.MobileDirMapper">
<select id="query" resultType="io.dataease.mobile.entity.PanelEntity"> <select id="query" resultType="io.dataease.mobile.entity.PanelEntity">
SELECT SELECT id,
id, NAME AS text,
NAME AS text, pid,
pid, node_type AS `type`
node_type AS `type` FROM panel_group g,
FROM (SELECT GET_V_AUTH_MODEL_ID_P_USE_MOBILE(#{userId}, 'panel') cids) t
panel_group g, WHERE g.pid = #{pid}
( SELECT GET_V_AUTH_MODEL_ID_P_USE_MOBILE ( #{userId}, 'panel' ) cids ) t AND FIND_IN_SET(g.id, cids)
WHERE ORDER BY g.panel_sort desc, CONVERT(g.name using gbk)
g.pid = #{pid}
AND FIND_IN_SET( g.id, cids )
</select> </select>
<select id="queryWithName" resultType="io.dataease.mobile.entity.PanelEntity"> <select id="queryWithName" resultType="io.dataease.mobile.entity.PanelEntity">
@ -26,35 +24,34 @@
panel_group g, panel_group g,
( SELECT GET_V_AUTH_MODEL_ID_P_USE_MOBILE ( #{userId}, 'panel' ) cids ) t ( SELECT GET_V_AUTH_MODEL_ID_P_USE_MOBILE ( #{userId}, 'panel' ) cids ) t
WHERE WHERE
FIND_IN_SET( g.id, cids ) FIND_IN_SET( g.id, cids )
<if test="name != null"> <if test="name != null">
and name like CONCAT('%', #{name, jdbcType=VARCHAR}, '%') and name like CONCAT('%', #{name, jdbcType=VARCHAR}, '%')
</if> </if>
ORDER BY g.panel_sort desc, CONVERT(g.name using gbk)
</select> </select>
<select id="idsWithUser" resultType="java.lang.String"> <select id="idsWithUser" resultType="java.lang.String">
select a.auth_source select a.auth_source
from sys_auth a from sys_auth a
left join sys_auth_detail d on a.id = d.auth_id left join sys_auth_detail d on a.id = d.auth_id
where where a.auth_target_type = 'user'
a.auth_target_type = 'user' and and a.auth_target = #{userId}
a.auth_target = #{userId} and and a.auth_source_type = 'panel'
a.auth_source_type = 'panel' and and d.privilege_type = 1
d.privilege_type = 1 and and d.privilege_value = 1
d.privilege_value = 1
</select> </select>
<select id="idsWithDept" resultType="java.lang.String"> <select id="idsWithDept" resultType="java.lang.String">
select a.auth_source select a.auth_source
from sys_auth a from sys_auth a
left join sys_auth_detail d on a.id = d.auth_id left join sys_auth_detail d on a.id = d.auth_id
where where a.auth_target_type = 'dept'
a.auth_target_type = 'dept' and and a.auth_target = #{deptId}
a.auth_target = #{deptId} and and a.auth_source_type = 'panel'
a.auth_source_type = 'panel' and and d.privilege_type = 1
d.privilege_type = 1 and and d.privilege_value = 1
d.privilege_value = 1
</select> </select>
<select id="idsWithRoles" resultType="java.lang.String"> <select id="idsWithRoles" resultType="java.lang.String">
@ -62,20 +59,16 @@
from sys_auth a from sys_auth a
left join sys_auth_detail d on a.id = d.auth_id left join sys_auth_detail d on a.id = d.auth_id
where where
a.auth_target_type = 'role' and a.auth_target_type = 'role' and
a.auth_target in a.auth_target in
<foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'> <foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'>
#{roleId} #{roleId}
</foreach> </foreach>
and and
a.auth_source_type = 'panel' and a.auth_source_type = 'panel' and
d.privilege_type = 1 and d.privilege_type = 1 and
d.privilege_value = 1 d.privilege_value = 1
</select> </select>
</mapper> </mapper>