package com.blueland.bpm.engine.config.dao;

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

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.blueland.bpm.common.base.BaseIbatis3Dao;
import com.blueland.bpm.common.page.Page;
import com.blueland.bpm.engine.config.model.ProcessInfoConfig;


@Repository
public class ProcessInfoConfigDao extends BaseIbatis3Dao<ProcessInfoConfig,String>{
	
	@Override
	public String getIbatisMapperNamesapce() {
		return "ProcessInfoConfig";
	}
	public Page<List<ProcessInfoConfig>> findConfigPage(ProcessInfoConfig params){
		return pageQuery(getIbatisMapperNamesapce()+".findConfigPage",params);
	}
	/**
	 * 获取所有满足要求的procDefId以供导出zip
	 * @param params
	 * @return
	 */
	public List<String> getAllProcessIdForExport(ProcessInfoConfig params){
		return this.getSqlSessionTemplate().selectList(getIbatisMapperNamesapce()+".getAllProcessIdForExport",params);
	}
	public ProcessInfoConfig getLinkId(String processDefId){
		Map params=new HashMap();
		params.put("processDefId", processDefId);
		return this.getSqlSessionTemplate().selectOne(getIbatisMapperNamesapce()+".getLinkId", params);
	}
	
	public Page<List<ProcessInfoConfig>> findConfigAndModelPage(ProcessInfoConfig params){
		return pageQuery(getIbatisMapperNamesapce()+".findConfigAndModelPage",params);
	}
}
