package com.blueland.dao;

/**
 * @author 代码自动生成工具
 * @version 1.0
 * @since  
 */
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blueland.model.TPfRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.blueland.bo.Role2userEntity;
import com.blueland.bo.RoleEntity;


@Mapper
public interface RoleDao  extends BaseMapper<TPfRole> {

	List<RoleEntity> getAppRole(Map<String,Object> map);

	Page<RoleEntity> getAppRolePage(@Param("page") Page<RoleEntity> page, @Param("bo") Map<String,Object> map);

	void deleteRole(Map<String, Object> queryParams);

	List<RoleEntity> findRoleUserBy(Map<String, Object> map);
	
	List<RoleEntity> findRolesByUser(@Param("appId")String appId, @Param("userId")String userId);
	
	int findUserId(RoleEntity model, String userId);

	int findUserId(@Param("appId")String appId, @Param("roleId")String roleId,@Param("userId")String userId);

	void saveUser(Role2userEntity role2user);

	int deleteUserId(@Param("appId")String appId, @Param("roleId")String roleId,@Param("userId")String userId);

	int findAppidByRoleId(@Param("appId")String appId, @Param("roleId")String roleId);

	void deluser(@Param("roleId")String roleId, @Param("appId")String appId);
	
	List<RoleEntity> findRoleTenantidByUserid(@Param("userId")String userId);

	List<RoleEntity> findList(@Param("bo")RoleEntity bo);

	Page<RoleEntity> findPage(@Param("page") Page<RoleEntity> page,@Param("bo") RoleEntity entity);

	@InterceptorIgnore(tenantLine = "true")
	List<RoleEntity> findRolesByPostCode(@Param("appId")String appId, @Param("postCode")String postCode);

	List<RoleEntity> findRoleAllByPostCode(@Param("postCode")String postCode);

	List<RoleEntity> findRoleUserByCode(@Param("appId")String appId, @Param("roleId")String roleId, @Param("postCode")String postCode);

	int deleteByPostCode(@Param("appId")String appId, @Param("roleId")String roleId,@Param("postCode")String postCode);

	@InterceptorIgnore(tenantLine = "true")
	void deleteByAppId(@Param("appId") String appId);

	@InterceptorIgnore(tenantLine = "true")
	List<RoleEntity> findListByAppId(@Param("appId")String appId);
}
