|
@ -11,12 +11,12 @@ import java.util.List; |
|
|
@Repository |
|
|
@Repository |
|
|
public interface RoleMapper { |
|
|
public interface RoleMapper { |
|
|
|
|
|
|
|
|
@Insert("INSERT INTO role (name, authority, createTime, updateTime) VALUES" + |
|
|
@Insert("INSERT INTO user_role (name, authority, createTime, updateTime) VALUES" + |
|
|
"('${name}', '${authority}', '${createTime}', '${updateTime}')") |
|
|
"('${name}', '${authority}', '${createTime}', '${updateTime}')") |
|
|
int add(Role role); |
|
|
int add(Role role); |
|
|
|
|
|
|
|
|
@Update(value = {" <script>" + |
|
|
@Update(value = {" <script>" + |
|
|
"UPDATE role " + |
|
|
"UPDATE user_role " + |
|
|
"SET updateTime='${updateTime}' " + |
|
|
"SET updateTime='${updateTime}' " + |
|
|
"<if test=\"name != null\">, name='${name}'</if>" + |
|
|
"<if test=\"name != null\">, name='${name}'</if>" + |
|
|
"<if test=\"authority != null\">, authority='${authority}'</if>" + |
|
|
"<if test=\"authority != null\">, authority='${authority}'</if>" + |
|
@ -24,12 +24,12 @@ public interface RoleMapper { |
|
|
" </script>"}) |
|
|
" </script>"}) |
|
|
int update(Role role); |
|
|
int update(Role role); |
|
|
|
|
|
|
|
|
@Delete("DELETE FROM role WHERE id != 1 and id=#{id}") |
|
|
@Delete("DELETE FROM user_role WHERE id != 1 and id=#{id}") |
|
|
int delete(int id); |
|
|
int delete(int id); |
|
|
|
|
|
|
|
|
@Select("select * FROM role WHERE id=#{id}") |
|
|
@Select("select * FROM user_role WHERE id=#{id}") |
|
|
Role selectById(int id); |
|
|
Role selectById(int id); |
|
|
|
|
|
|
|
|
@Select("select * FROM role") |
|
|
@Select("select * FROM user_role") |
|
|
List<Role> selectAll(); |
|
|
List<Role> selectAll(); |
|
|
} |
|
|
} |
|
|