package com.judong.chuanyiserver.dao;

import com.judong.chuanyiserver.entity.Permission;
import com.judong.chuanyiserver.entity.Role;
import com.judong.chuanyiserver.entity.User;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserDao {

    User getUserByNamePass(String userName, String password);

    User getUserById(String userId);

    User getUserByName(String userName);

    Integer addUser(User user);

    Integer addUserRole(String userId, int roleId);

    List<Role> getShareRoleList(String userId, List<Role> roleList);

    List<Role> getNoShareOldRoleList(String userId, List<Role> roleList);

    Integer deleteUserRole(String userId, List<Role> roleList);

    Integer addUserRoleList(String userId, List<Role> roleList);

    List<Role> getRoleListByUserId(String userId);

    Long getUserCount(String userName, Integer state, Integer userType, Integer tombstoneUser);

    List<User> getUserPage(Long startNum, Long limitNum, String userName, Integer state, Integer userType, Integer tombstoneUser);

    Integer deleteUserRoleByUserId(String userId);

    Integer updateUserState(String userId, Integer userState);

    Integer updateLoginState(String userId);

    Integer updateUser(User user);

    User getUserByNameNoId(String userId, String userName);

}
