package com.palmnest.service.repair;

import com.palmnest.model.Element;
import com.palmnest.model.User;
import com.palmnest.model.repair.UserRepairType;
import com.palmnest.service.GenericManager;

import java.util.List;

public interface UserRepairTypeManager extends GenericManager<UserRepairType, Long> {

	List<User> findByRole(Long repairTypeId, Long roleId);

	List<User> findBy(Long repairTypeId, Integer orgId);

	List<User> findBy(Long repairTypeId);

	List<User> findBy(Long repairTypeId, Long roleId);

	List<Element> findByUser(Long userId);

	List<Element> findByUser(Long userId, Long roleId);

	UserRepairType findBy(Long userId, Long repairTypeId, Long roleId);

	UserRepairType findByRepair(Long userId, Long repairTypeId);

	List<UserRepairType> findByUserAndRole(Long userId, Long roleId);

	int removeByUser(Long userId, Long roleId);

	/**
	 * 删除该角色下所有的记录
	 *
	 * @param roleId
	 * @return
	 */
	int removeByRoleId(Long roleId);
}
