Remove redundant field power_id

This commit is contained in:
2023-11-15 14:03:01 +08:00
parent c0c033ad77
commit d334a231df
23 changed files with 52 additions and 117 deletions

View File

@@ -4,7 +4,6 @@
<resultMap id="elementMap" type="element">
<id property="id" column="element_id"/>
<result property="name" column="element_name"/>
<result property="powerId" column="element_power_id"/>
<result property="parentId" column="element_parent_id"/>
<result property="menuId" column="element_menu_id"/>
</resultMap>

View File

@@ -5,7 +5,6 @@
<id property="id" column="menu_id"/>
<result property="name" column="menu_name"/>
<result property="url" column="menu_url"/>
<result property="powerId" column="menu_power_id"/>
<result property="parentId" column="menu_parent_id"/>
<result property="moduleId" column="menu_module_id"/>
</resultMap>

View File

@@ -4,6 +4,5 @@
<resultMap id="moduleMap" type="module">
<id property="id" column="module_id"/>
<result property="name" column="module_name"/>
<result property="powerId" column="module_power_id"/>
</resultMap>
</mapper>

View File

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

View File

@@ -29,30 +29,26 @@
t_role.version as role_version,
tm.id as module_id,
tm.name as module_name,
tm.power_id as module_power_id,
tmn.id as menu_id,
tmn.name as menu_name,
tmn.url as menu_url,
tmn.power_id as menu_power_id,
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.power_id as element_power_id,
te.parent_id as element_parent_id,
te.menu_id as element_menu_id,
t.id as operation_id,
t.name as operation_name,
t.code as operation_code,
t.power_id as operation_power_id,
t.element_id as operation_element_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.power_id
left join t_menu tmn on tp.id = tmn.power_id
left join t_element te on tp.id = te.power_id
left join t_operation t on tp.id = t.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_operation t on tp.id = t.id
<where>
<foreach collection="roleIds" item="item" index="index" open="and t_role.id in (" separator="," close=")"
nullable="true">
@@ -71,30 +67,26 @@
t_role.version as role_version,
tm.id as module_id,
tm.name as module_name,
tm.power_id as module_power_id,
tmn.id as menu_id,
tmn.name as menu_name,
tmn.url as menu_url,
tmn.power_id as menu_power_id,
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.power_id as element_power_id,
te.parent_id as element_parent_id,
te.menu_id as element_menu_id,
t.id as operation_id,
t.name as operation_name,
t.code as operation_code,
t.power_id as operation_power_id,
t.element_id as operation_element_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.power_id
left join t_menu tmn on tp.id = tmn.power_id
left join t_element te on tp.id = te.power_id
left join t_operation t on tp.id = t.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_operation t on tp.id = t.id
where t_role.id = #{id}
</select>

View File

@@ -28,21 +28,17 @@
tui.version as user_info_version,
tmo.id as module_id,
tmo.name as module_name,
tmo.power_id as module_power_id,
tm.id as menu_id,
tm.name as menu_name,
tm.url as menu_url,
tm.power_id as menu_power_id,
tm.parent_id as menu_parent_id,
te.id as element_id,
te.name as element_name,
te.power_id as element_power_id,
te.parent_id as element_parent_id,
te.menu_id as element_menu_id,
t.id as operation_id,
t.name as operation_name,
t.code as operation_code,
t.power_id as operation_power_id,
t.element_id as operation_element_id
from t_user
left join (select * from t_user_info where deleted = 0) as tui on t_user.id = tui.user_id
@@ -54,10 +50,10 @@
on tr.id = trg.role_id or tr.id = tur.role_id
left join (select * from t_power_role where deleted = 0) as tpr on tr.id = tpr.role_id
left join t_power as tp on tp.id = tpr.power_id
left join t_module as tmo on tp.id = tmo.power_id
left join t_menu as tm on tp.id = tm.power_id
left join t_element as te on tp.id = te.power_id
left join t_operation as t on tp.id = t.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_operation as t on tp.id = t.id
where t_user.deleted = 0
and t_user.username = #{username};
</select>