package com.community.huiju.dao;

import com.community.huiju.model.ToUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

@Mapper
public interface ToUserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(ToUser record);

    int insertSelective(ToUser record);

    ToUser selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(ToUser record);

    int updateByPrimaryKey(ToUser record);

    ToUser selectByLoginName(@Param(value = "loginName") String loginName);

    List<ToUser> userList(@Param("loginName") String loginName, @Param("userName") String userName);

    /**
     * 查询创建人或者修改人
     * @param createUser
     * @return
     */
    String selectByIdUserName(Integer createUser);

    List<ToUser> selectUser(@Param("id") Integer id);

    /**
     * 查询多个角色
     * @return
     */
    List<ToUser>  selectRole(@Param("id") Integer id);
	
	List<Map<String, Object>> getPermission(@Param("userId") Integer userId);
    
    List<Map<String, Object>> selectByPermissionList(@Param("array") List<String> parentIdList);
}