package com.jpsoft.shinestar.modules.sys.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.jpsoft.shinestar.modules.sys.entity.User;
import java.util.Map;
import com.jpsoft.shinestar.modules.common.dto.Sort;

@Repository
public interface UserDAO {
	int insert(User entity);
	int update(User entity);
	int exist(String id);
	User get(String id);
	int delete(String id);
	List<User> list();
	List<User> findByCompanyId(String companyId);
	List<User> findByCompanyList(@Param("searchParams")Map<String,Object> searchParams,@Param("sortList")List<Sort> sortList);
	List<User> search(Map<String,Object> searchParams,List<Sort> sortList);
	User findByUserName(@Param("userName") String userName);
    long hasRole(@Param("userId") String userId,@Param("roleName") String roleName);
    User findByOpenId(String openId);
}