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

import market.Qms.metallurgy.vo.ComMscStdPic;

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 ComMscStdPicMapper extends GenericMapper<ComMscStdPic, String> {
    
	@Select("select 'PICN'||to_char(nvl(max(to_number(substr(a.pic,-6))),0)+1,'fm099999') from  com_msc_std_pic a WHERE SUBSTR (pic, 0, 4) ='PICN'")
	public String getMax();
	
	@Select("select 'PICG'||to_char(nvl(max(to_number(substr(a.pic,-6))),0)+1,'fm099999') from  com_msc_std_pic a WHERE SUBSTR (pic, 0, 4) ='PICG'")
	public String getMaxs();
	
	@Update("UPDATE COM_MSC_STD_PIC SET VALIDFLAG =1,DELETE_NAME = NULL,DELETE_TIME = NULL WHERE pic = #{pic}")
	public void updatepic(@Param("pic") String pic);
	
	
	@Update("UPDATE COM_MSC_STD_PHY SET VALIDFLAG =1,DELETE_NAME = NULL,DELETE_TIME = NULL WHERE pic = #{pic}")
	public void updatephy(@Param("pic") String pic);
	
	@Update("update COM_MSC_STD_PIC a set a.validflag=0 where a.msc=#{msc}")
	public void updateZf(@Param("msc") String msc);
	
	@Update("update COM_MSC_STD_PIC a set a.validflag=1 where a.msc=#{msc}")
	public void updateHf(@Param("msc") String msc);
	
	@Update("update COM_MSC_STD_PIC a set a.validflag=2 where a.msc=#{msc} and validflag!=0")
	public void Submission(@Param("msc") String msc);
	
	@Update("update COM_MSC_STD_PIC a set a.validflag=3 where a.msc=#{msc} and validflag!=0")
	public void Submit(@Param("msc") String msc);
	
	@Update("update COM_MSC_STD_PIC a set a.validflag=1 where a.msc=#{msc} and validflag!=0")
	public void SubmitA(@Param("msc") String msc);
	
	public List<ComMscStdPic> doFindPic(@Param("msc")String msc,@Param("psc")String psc,@Param("val")String val);

	public List<ComMscStdPic> doFindPicByzl(ComMscStdPic pic);
	
	public List<ComMscStdPic> doFindPicBySql(String process_code,String customer_code,String prod_code_nk,String steel_code_nk,String delivery_state_code);

	public List<ComMscStdPic> findByPage(String validflag, String prod_code_nk, String steel_code_nk,
			String delivery_state_code, String std_code_nk, String std_type, Object object, Object object2);

	public List<ComMscStdPic> findByPageNk(String validflag, String prod_name_nk, String steel_name_nk,
			String delivery_state_desc, String process_desc, String customer_name, String std_type, Integer pageSize,
			Integer pageIndex);

	
}