package com.gameloft9.demo.dataaccess.dao.system;

import com.gameloft9.demo.dataaccess.model.system.SysRoleTest;
import com.gameloft9.demo.dataaccess.model.system.SysUserRoleTest;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysUserRoleTestMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SYS_USER_ROLE_TEST
     *
     * @mbggenerated Mon Dec 04 14:08:33 CST 2017
     */
    int deleteByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SYS_USER_ROLE_TEST
     *
     * @mbggenerated Mon Dec 04 14:08:33 CST 2017
     */
    int insert(SysUserRoleTest record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SYS_USER_ROLE_TEST
     *
     * @mbggenerated Mon Dec 04 14:08:33 CST 2017
     */
    int insertSelective(SysUserRoleTest record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SYS_USER_ROLE_TEST
     *
     * @mbggenerated Mon Dec 04 14:08:33 CST 2017
     */
    SysUserRoleTest selectByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SYS_USER_ROLE_TEST
     *
     * @mbggenerated Mon Dec 04 14:08:33 CST 2017
     */
    int updateByPrimaryKeySelective(SysUserRoleTest record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SYS_USER_ROLE_TEST
     *
     * @mbggenerated Mon Dec 04 14:08:33 CST 2017
     */
    int updateByPrimaryKey(SysUserRoleTest record);

    /**
     * 根据用户id获取角色列表
     * @param userId 用户id
     * */
    List<String> getRoleNamesByUserId(@Param("userId") String userId);

    /**
     * 根据用户id获取角色列表
     * @param userId 用户id
     * */
    List<SysRoleTest> getRolesByUserId(@Param("userId") String userId);

    /**
     * 根据角色id获取用户数
     * @param roleId 角色id
     * */
    int countByRoleId(@Param("roleId") String roleId);

    /**
     * 批量插入
     * @param list 记录列表
     * */
    int batchInsert(@Param("list") List<SysUserRoleTest> list);

    /**
     * 根据用户id删除
     * @param userId 用户id
     * */
    int deleteByUserId(@Param("userId") String userId);
}