@Delete("DELETE FROM user WHERE id != 1 and id=#{id}")
intdelete(intid);
@Select("select user.*, role.id roleID, role.name roleName, role.authority roleAuthority , role.createTime roleCreateTime , role.updateTime roleUpdateTime FROM user, role WHERE user.roleId=role.id and user.username=#{username} AND user.password=#{password}")
@Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority , r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id and u.username=#{username} AND u.password=#{password}")
@Results(id="roleMap",value={
@Result(column="roleID",property="role.id"),
@Result(column="roleName",property="role.name"),
@ -37,15 +37,15 @@ public interface UserMapper {
})
Userselect(Stringusername,Stringpassword);
@Select("select user.*, role.id roleID, role.name roleName, role.authority roleAuthority, role.createTime roleCreateTime , role.updateTime roleUpdateTime FROM user, role WHERE user.roleId=role.id and user.id=#{id}")
@Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority, r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id and u.id=#{id}")
@ResultMap(value="roleMap")
UserselectById(intid);
@Select("select user.*, role.id roleID, role.name roleName, role.authority roleAuthority, role.createTime roleCreateTime , role.updateTime roleUpdateTime FROM user, role WHERE user.roleId=role.id and username=#{username}")
@Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority, r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id and u.username=#{username}")
@ResultMap(value="roleMap")
UsergetUserByUsername(Stringusername);
@Select("select user.*, role.id roleID, role.name roleName, role.authority roleAuthority, role.createTime roleCreateTime , role.updateTime roleUpdateTime FROM user, role WHERE user.roleId=role.id")
@Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority, r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id")