package com.jpsoft.shinestar.modules.base.dao;

import java.util.List;

import com.jpsoft.shinestar.modules.base.entity.IconInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.jpsoft.shinestar.modules.base.entity.PersonRoleIcon;
import java.util.Map;
import com.jpsoft.shinestar.modules.common.dto.Sort;

@Repository
public interface PersonRoleIconDAO {
	int insert(PersonRoleIcon entity);
	int update(PersonRoleIcon entity);
	int exist(String id);
	PersonRoleIcon get(String id);
	int delete(String id);
	List<PersonRoleIcon> list();
	List<PersonRoleIcon> search(Map<String, Object> searchParams, List<Sort> sortList);

    List<PersonRoleIcon> findByPersonRoleId(String personRoleId);

    List<PersonRoleIcon> findByPersonRoleIdAndCommonStatus(@Param("personRoleId") String personRoleId, @Param("commonStatus") boolean commonStatus);

    List<IconInfo> findCommonByPersonRoleId(String personRoleId);

	List<IconInfo> findDefaultIconByPersonRoleId(String personRoleId);

    int deleteCommonByPersonRoleId(String personRoleId);

	int deleteDefaultIconByPersonRoleId(String personRoleId);

    PersonRoleIcon findByPersonRoleIdAndIconId(@Param("personRoleId")String personRoleId, @Param("iconId")String iconId);

    List<PersonRoleIcon> findByIconName(String iconName);
}