fetch:删除角色
This commit is contained in:
@@ -19,14 +19,34 @@ import java.util.List;
|
||||
*/
|
||||
public interface TsPositionDao extends BaseMapper<TsPosition> {
|
||||
|
||||
/**
|
||||
* 查询岗位绑定的角色ID
|
||||
* @param positionId:岗位ID
|
||||
* @return List<String>:角色ID
|
||||
*/
|
||||
@Select("select role_id from ts_position_role where position_id=#{positionId}")
|
||||
List<String> getRoleId(String positionId);
|
||||
|
||||
/**
|
||||
* 绑定角色
|
||||
* @param positionId:岗位ID
|
||||
* @param roleId:角色ID
|
||||
*/
|
||||
@Insert("insert into ts_position_role (position_id,role_id) values (#{positionId},#{roleId})")
|
||||
void insertRole(String positionId, String roleId);
|
||||
|
||||
/**
|
||||
* 解绑角色
|
||||
* @param positionId:岗位ID
|
||||
* @param roleId:角色ID
|
||||
*/
|
||||
@Delete("delete from ts_position_role where position_id=#{positionId} and role_id=#{roleId}")
|
||||
void deleteRole(String positionId, String roleId);
|
||||
|
||||
/**
|
||||
* 查询岗位绑定的角色信息
|
||||
* @param positionId:岗位ID
|
||||
* @return List<TsRole>
|
||||
*/
|
||||
List<TsRole> getRole(String positionId);
|
||||
}
|
||||
|
||||
+1
@@ -88,6 +88,7 @@ public class TsPositionServiceImpl extends ServiceImpl<TsPositionDao, TsPosition
|
||||
if(tsPositions!=null&&tsPositions.size()>0){
|
||||
return Result.error("该岗位已存在");
|
||||
}
|
||||
tsPosition.setType("2");
|
||||
tsPositionDao.insert(tsPosition);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user