package org.ta.pddserver.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.ta.pdd.entity.UserRoleEntity;

import java.util.List;

@Mapper
public interface UserRoleMapper extends BaseMapper<UserRoleEntity> {

    @Select("SELECT * FROM `user_role` WHERE `userId` = #{userId};")
    List<UserRoleEntity> findByUserId(@Param("userId") String userId);

    @Delete("DELETE FROM `user_role` WHERE `userId` = #{userId};")
    Integer deleteByUserId(@Param("userId") String userId);
}
