package cn.pluss.platform.roleInfo.impl;

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

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.pluss.platform.entity.RoleInfo;
import cn.pluss.platform.entity.UserInfo;
import cn.pluss.platform.roleInfo.RoleInfoService;
import cn.pluss.platform.mapper.RoleInfoMapper;

@Transactional
@Service("roleInfoService")
public class RoleInfoServiceImpl extends ServiceImpl<RoleInfoMapper, RoleInfo> implements RoleInfoService{

	 private static final Logger logger = LoggerFactory.getLogger( RoleInfoServiceImpl.class);


    @Autowired
	  private RoleInfoMapper roleInfoMapper;

    @Override
    public RoleInfo queryRoleInfo(RoleInfo roleInfo){
        return roleInfoMapper.queryRoleInfo(roleInfo);
    }

    @Override
    public List<RoleInfo> queryRoleInfoList(RoleInfo roleInfo){
        return roleInfoMapper.queryRoleInfoList(roleInfo);
    }
    @Override
    public void saveRoleInfo(RoleInfo roleInfo){
          roleInfoMapper.saveRoleInfo(roleInfo);
    }
    @Override
    public void updateRoleInfo(RoleInfo roleInfo){
        roleInfoMapper.updateRoleInfo(roleInfo);
    }
    @Override
    public void deleteRoleInfo(RoleInfo roleInfo){
        roleInfoMapper.deleteRoleInfo(roleInfo);
    }
    @Override
    public List<RoleInfo> queryRoleInfoPage(Map map){
        return roleInfoMapper.queryRoleInfoPage(map);
    }
    @Override
    public Integer queryRoleInfoPageCount(Map map){
        return roleInfoMapper.queryRoleInfoPageCount(map);
    }
    @Override
    public void saveRoleInfoBatch(List<RoleInfo> roleInfoList) {
         roleInfoMapper.saveRoleInfoBatch(roleInfoList);
    }

	@Override
	public List<RoleInfo> getRoleNames(String loginName) {
		// TODO Auto-generated method stub
		return roleInfoMapper.getRoleNames(loginName);
	}

	@Override
	public List<RoleInfo> getRolesByUser(UserInfo userInfo) {
		// TODO Auto-generated method stub
		return roleInfoMapper.getRoleNames(userInfo);
	}
}

