package market.Pms.Demand.mapper;
import java.util.List;

import market.Pms.Demand.vo.PurDemandMat;

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

import com.hnshituo.orm.GenericMapper;

public interface PurDemandMatMapper extends GenericMapper<PurDemandMat,Object> {
	
	//采购需求申报、部门领导审批。资材备件汇总的总查询
	public List<PurDemandMat> doQueryPurDemandMat(PurDemandMat pdm,String condition);

	public String findMaxDemandNo(String demand_no);
	
	//撤销个人申报
	@Update("update pur_demand_mat t set t.apply_man=null,t.apply_time=null,t.state='-1' where t.demand_no = #{demand_no}")
	public void doChangePurDemandMatState0(@Param("demand_no")String demand_no);
	
	//撤销部门组织审批
	@Update("update pur_demand_mat t set t.org_man=null,t.org_time=null,t.state='0' where t.demand_no = #{demand_no}")
	public void doChangePurDemandMatState1(@Param("demand_no")String demand_no);
	
	//撤销资材备件审批
	@Update("update pur_demand_mat t set t.mat_man=null,t.mat_time=null,t.state='1' where t.demand_no = #{demand_no}")
	public void doChangePurDemandMatState2(@Param("demand_no")String demand_no);
	
	//撤销紫菜备件领导审批
	@Update("update pur_demand_mat t set t.lead_man=null,t.lead_man=null,t.state='2' where t.demand_no = #{demand_no}")
	public void doChangePurDemandMatState3(@Param("demand_no")String demand_no);
	
	//撤销总经理审批
	@Update("update pur_demand_mat t set t.manage_man=null,t.manage_time=null,t.state='3' where t.demand_no = #{demand_no}")
	public void doChangePurDemandMatState4(@Param("demand_no")String demand_no);
}
