package market.Qms.metallurgy.mapper;
import java.util.List;

import market.Qms.metallurgy.vo.ComMscProcess;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.hnshituo.orm.GenericMapper;

public interface ComMscProcessMapper extends GenericMapper<ComMscProcess,Object> {
	@Select("select (nvl(max(to_number(substr(a.index_seq,-6))),0)+1) from  COM_MSC_PROCESS a where a.MSC=#{msc} and a.MSC_PLINE=#{mscPline}")
	public long GetMaxNo(@Param("msc")String msc,@Param("mscPline")String mscPline);
	
	public void UpdateProcess(ComMscProcess process);
	
	@Update("update COM_MSC_PROCESS a set a.validflag='1' where a.msc=#{msc}")
	public void SubmitA(@Param("msc") String msc);
	
	@Update("update COM_MSC_PROCESS a set a.validflag='0' where a.msc=#{msc}")
	public void SubmitD(@Param("msc") String msc);
	
	@Delete("delete from COM_MSC_PROCESS where msc=#{msc} and msc_pline=#{msc_plie}")
	public void deletemsc(@Param("msc")String msc,@Param("msc_plie")String msc_plie);
	
	public List<ComMscProcess> doFindProcess(@Param("msc")String msc,@Param("msc_pline")String msc_pline);
	
	@Update("update COM_MSC_PROCESS a set a.validflag='0' where a.msc=#{msc} and msc_pline=#{msc_pline}")
	public void UpdateZf(@Param("msc")String msc,@Param("msc_pline")String msc_pline);
	
	@Update("update COM_MSC_PROCESS a set a.validflag='1' where a.msc=#{msc} and msc_pline=#{msc_pline}")
	public void UpdateHf(@Param("msc")String msc,@Param("msc_pline")String msc_pline);

	@Delete("delete from COM_MSC_PROCESS where guid=#{guid}")
	public void deleteByGuid(@Param("guid")String guid);
}
