package com.palmnest.dao.repair;

import com.palmnest.dao.GenericDao;
import com.palmnest.model.repair.UserRepairType;

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

/**
 * @author wangxz
 * <p>
 * 2018年5月2日
 */
public interface UserRepairTypeDao extends GenericDao<UserRepairType, Long> {

	public List<UserRepairType> findBy(Long repairTypeId, Long roleId);

	public List<UserRepairType> findBy(Long repairTypeId);

	public List<Map<String, Object>> findBy(Long repairTypeId, Integer orgId);

	public List<UserRepairType> findByUser(Long userId, Long roleId);

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

	UserRepairType findByRepair(Long userId, Long repairTypeId);

	public List<UserRepairType> findByUser(Long userId);

	int removeByUser(Long userId, Long roleId);

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

}
