|
@ -7,9 +7,7 @@ |
|
|
<if test="roleName != null"> |
|
|
<if test="roleName != null"> |
|
|
role_name = #{roleName}, |
|
|
role_name = #{roleName}, |
|
|
</if> |
|
|
</if> |
|
|
<if test="priority != null"> |
|
|
|
|
|
priority = #{priority}, |
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test="fatherId != null"> |
|
|
<if test="fatherId != null"> |
|
|
father_id = #{fatherId}, |
|
|
father_id = #{fatherId}, |
|
|
</if> |
|
|
</if> |
|
@ -46,18 +44,18 @@ |
|
|
</where> |
|
|
</where> |
|
|
</select> |
|
|
</select> |
|
|
<select id="selectByFatherId" resultType="com.example.demo.domain.vo.coin.RoleVo"> |
|
|
<select id="selectByFatherId" resultType="com.example.demo.domain.vo.coin.RoleVo"> |
|
|
SELECT id,role_name,priority FROM role |
|
|
|
|
|
|
|
|
SELECT id,role_name FROM role |
|
|
<where> |
|
|
<where> |
|
|
father_id = #{id} |
|
|
father_id = #{id} |
|
|
</where> |
|
|
</where> |
|
|
ORDER BY priority desc |
|
|
|
|
|
|
|
|
ORDER BY update_time desc |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 插入角色信息 --> |
|
|
<!-- 插入角色信息 --> |
|
|
<insert id="addRole" parameterType="com.example.demo.domain.vo.coin.RoleVo" useGeneratedKeys="true" keyProperty="id"> |
|
|
<insert id="addRole" parameterType="com.example.demo.domain.vo.coin.RoleVo" useGeneratedKeys="true" keyProperty="id"> |
|
|
INSERT INTO role |
|
|
INSERT INTO role |
|
|
(role_name,father_id, market) |
|
|
(role_name,father_id, market) |
|
|
VALUES (#{roleName}, #{priority}, #{fatherId}, #{market}) |
|
|
|
|
|
|
|
|
VALUES (#{roleName}, #{fatherId}, #{market}) |
|
|
</insert> |
|
|
</insert> |
|
|
|
|
|
|
|
|
<!-- 删除 role_menu 表中对应角色的数据 --> |
|
|
<!-- 删除 role_menu 表中对应角色的数据 --> |
|
|