package market.Mes.Rolling.Plan.mapper;
import java.util.List;

import market.Mes.Rolling.Plan.vo.PlnRollingPlan;

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

import com.hnshituo.orm.GenericMapper;

public interface PlnRollingPlanMapper extends GenericMapper<PlnRollingPlan,Object> {
	
	@Update ("update PLN_ROLLING_PLAN set status =#{plp.status} where rl_plan_no=#{plp.rl_plan_no}")
	void doUpdate(@Param("plp")PlnRollingPlan plp);

	@Update ("update PLN_ROLLING_PLAN set mat_quantity = nvl(mat_quantity,0) + #{mat_quantity} , mat_weight = nvl(mat_weight,0) + #{mat_weight} where rl_plan_no=#{rl_plan_no}")
	void doUpdatePlaned(PlnRollingPlan plp);

	@Delete("delete from PLN_ROLLING_PLAN t where t.rl_plan_no = #{rl_plan_no}")
	void doDeleteRlPlanNo(PlnRollingPlan pp);

	@Update(" update PLN_ROLLING_PLAN set plan_seq = #{param1.plan_seq} where rl_plan_no = #{param1.rl_plan_no} and plan_seq = #{param2}")
	int doUpdateSeq(PlnRollingPlan pln, Integer i);
	
	Integer doCount1(String v_mch_code, String v_entry_coil_no);
	
	PlnRollingPlan doQuery1(String v_mch_code, String v_entry_coil_no);
	
	Integer doCount2(String v_mch_code, String string);

	Long doCount3(String v_mch_code, String string);

	Long doCount4(String v_mch_code, Long v_plan_seq);

	List<PlnRollingPlan> doQuery2(String v_mch_code, Long v_plan_seq);

	Integer doCount5(String v_mch_code, String string);

	Integer doCount6(String v_mch_code, String v_plan_no, String v_entry_coil_no);
	
}
