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

import java.util.List;

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

@Repository
public interface ProcessActivityDAO {
	int insert(ProcessActivity entity);
	int update(ProcessActivity entity);

	int exist(String id);
	ProcessActivity get(String id);
	int delete(String id);
	List<ProcessActivity> list();
	List<ProcessActivity> findByTemplate(String templateId);
	List<ProcessActivity> findByTemplateId(@Param("templateId") String templateId, @Param("personRoleId")String personRoleId);
	List<ProcessActivity> search(Map<String,Object> searchParams,List<Sort> sortList);
	ProcessActivity findByActivityOrder(int activityOrder);
    List<ProcessActivity> findByActivityOrderProcessTemplateId(String personRoleId,int activityOrder, String processTemplateId);

	List<ProcessActivity> findByTemplateIdAndRoleId(String processTemplateId, String personRoleId);

    List<ProcessActivity> findByTemplateIdAndRoleIdAndCondition(String processTemplateId, String personRoleId, String condition);
}