Rename table t_element to t_func

This commit is contained in:
2023-11-30 23:03:42 +08:00
parent 4fcbceb149
commit cdb6339787
31 changed files with 132 additions and 132 deletions

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="top.fatweb.api.mapper.permission.ElementMapper">
<resultMap id="elementMap" type="element">
<id property="id" column="element_id"/>
<result property="name" column="element_name"/>
<result property="parentId" column="element_parent_id"/>
<result property="menuId" column="element_menu_id"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="top.fatweb.api.mapper.permission.FuncMapper">
<resultMap id="funcMap" type="func">
<id property="id" column="func_id"/>
<result property="name" column="func_name"/>
<result property="parentId" column="func_parent_id"/>
<result property="menuId" column="func_menu_id"/>
</resultMap>
</mapper>

View File

@@ -5,6 +5,6 @@
<id property="id" column="operation_id"/>
<result property="name" column="operation_name"/>
<result property="code" column="operation_code"/>
<result property="elementId" column="operation_element_id"/>
<result property="funcId" column="operation_func_id"/>
</resultMap>
</mapper>

View File

@@ -34,20 +34,20 @@
tmn.url as menu_url,
tmn.parent_id as menu_parent_id,
tmn.module_id as menu_module_id,
te.id as element_id,
te.name as element_name,
te.parent_id as element_parent_id,
te.menu_id as element_menu_id,
tf.id as func_id,
tf.name as func_name,
tf.parent_id as func_parent_id,
tf.menu_id as func_menu_id,
t.id as operation_id,
t.name as operation_name,
t.code as operation_code,
t.element_id as operation_element_id
t.func_id as operation_func_id
from (select * from t_role where deleted = 0) as t_role
left join (select * from t_power_role where deleted = 0) as tpr on t_role.id = tpr.role_id
left join t_power tp on tp.id = tpr.power_id
left join t_module tm on tp.id = tm.id
left join t_menu tmn on tp.id = tmn.id
left join t_element te on tp.id = te.id
left join t_func tf on tp.id = tf.id
left join t_operation t on tp.id = t.id
<where>
<foreach collection="roleIds" item="item" index="index" open="and t_role.id in (" separator="," close=")"
@@ -72,20 +72,20 @@
tmn.url as menu_url,
tmn.parent_id as menu_parent_id,
tmn.module_id as menu_module_id,
te.id as element_id,
te.name as element_name,
te.parent_id as element_parent_id,
te.menu_id as element_menu_id,
tf.id as func_id,
tf.name as func_name,
tf.parent_id as func_parent_id,
tf.menu_id as func_menu_id,
t.id as operation_id,
t.name as operation_name,
t.code as operation_code,
t.element_id as operation_element_id
t.func_id as operation_func_id
from (select * from t_role where deleted = 0) as t_role
left join (select * from t_power_role where deleted = 0) as tpr on t_role.id = tpr.role_id
left join t_power tp on tp.id = tpr.power_id
left join t_module tm on tp.id = tm.id
left join t_menu tmn on tp.id = tmn.id
left join t_element te on tp.id = te.id
left join t_func tf on tp.id = tf.id
left join t_operation t on tp.id = t.id
where t_role.id = #{id}
</select>
@@ -103,7 +103,7 @@
<resultMap id="roleWithPowerMap" type="role" extends="roleMap">
<collection property="modules" resultMap="top.fatweb.api.mapper.permission.ModuleMapper.moduleMap"/>
<collection property="menus" resultMap="top.fatweb.api.mapper.permission.MenuMapper.menuMap"/>
<collection property="elements" resultMap="top.fatweb.api.mapper.permission.ElementMapper.elementMap"/>
<collection property="funcs" resultMap="top.fatweb.api.mapper.permission.FuncMapper.funcMap"/>
<collection property="operations" resultMap="top.fatweb.api.mapper.permission.OperationMapper.operationMap"/>
</resultMap>
</mapper>

View File

@@ -32,14 +32,14 @@
tm.name as menu_name,
tm.url as menu_url,
tm.parent_id as menu_parent_id,
te.id as element_id,
te.name as element_name,
te.parent_id as element_parent_id,
te.menu_id as element_menu_id,
tf.id as func_id,
tf.name as func_name,
tf.parent_id as func_parent_id,
tf.menu_id as func_menu_id,
t.id as operation_id,
t.name as operation_name,
t.code as operation_code,
t.element_id as operation_element_id
t.func_id as operation_func_id
from t_user
left join (select * from t_user_info where deleted = 0) as tui on t_user.id = tui.user_id
left join (select * from t_user_group where deleted = 0) as tug on t_user.id = tug.user_id
@@ -52,7 +52,7 @@
left join t_power as tp on tp.id = tpr.power_id
left join t_module as tmo on tp.id = tmo.id
left join t_menu as tm on tp.id = tm.id
left join t_element as te on tp.id = te.id
left join t_func as tf on tp.id = tf.id
left join t_operation as t on tp.id = t.id
where t_user.deleted = 0
and t_user.username = #{username};
@@ -276,7 +276,7 @@
<result property="password" column="user_password"/>
<collection property="modules" resultMap="top.fatweb.api.mapper.permission.ModuleMapper.moduleMap"/>
<collection property="menus" resultMap="top.fatweb.api.mapper.permission.MenuMapper.menuMap"/>
<collection property="elements" resultMap="top.fatweb.api.mapper.permission.ElementMapper.elementMap"/>
<collection property="funcs" resultMap="top.fatweb.api.mapper.permission.FuncMapper.funcMap"/>
<collection property="operations" resultMap="top.fatweb.api.mapper.permission.OperationMapper.operationMap"/>
</resultMap>