package market.Mes.Lengthwise.Performance.mapper;

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

import market.Mes.Lengthwise.Performance.vo.MesCrSlittingD;
import market.Mes.Lengthwise.Performance.vo.MesCrSlittingDSum;
import market.Mes.Lengthwise.Performance.vo.MesCrSlittingM;
import market.Mes.Lengthwise.Performance.vo.MesQmsView;

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

import com.hnshituo.orm.GenericMapper;

public interface MesCrSlittingDMapper extends GenericMapper<MesCrSlittingD,Object> {

	List<MesCrSlittingDSum> doQuery(MesCrSlittingM oci);

	//int doQueryMaxCount(MesCrSlittingD mc);

	void doDelete(MesCrSlittingD mcsd);

	void doUpdate(MesCrSlittingD mcsd);

	void doUpdateNulls(MesCrSlittingD mcd);

	String doMaterailcoilno(MesCrSlittingD mcsd);
	
	//调用生产计划模块提供的接口获取，未进行综合判定的物料信息
	List<HashMap> doQueryMesCrWeb(int i, int j, MesCrSlittingD object, String startTime,
			String endTime);

	long doQueryMesCrWebCount(MesCrSlittingD object, String startTime,
			String endTime);

	long doQueryMesCrWebCount1(MesCrSlittingD object, String startTime,
			String endTime, String string, String swhere);

	List<HashMap> doQueryMesCrWeb1(int i, int j, MesCrSlittingD object,
			String startTime, String endTime,@Param("swhere") String swhere, String string);

	List<HashMap> doQueryMesCrWeb2(int i, int j, MesCrSlittingD object,
			String startTime, String endTime,@Param("swhere") String swhere, String string);
	List<HashMap>doQueryMesCrWeb3(int i, int j, MesCrSlittingD object,
					String startTime, String endTime,@Param("swhere") String swhere);
	List<HashMap> doQueryMesCrWeb4(int i, int j, MesCrSlittingD object,
					String startTime, String endTime,@Param("swhere") String swhere);

	Integer doQueryD(String v_coil_no);

	Integer doQuery2(String v_coil_no);

	List<MesCrSlittingDSum> doQuery_wgt(MesCrSlittingM object);

	void doUpdateWrk(String process_no, String string, String string2, String string3);

	List<HashMap> doQueryMesCrWeb1_mat(int i, int j, String swhere);

	List<MesQmsView> doQuery3(String memo2);

	List<MesQmsView> doQuery3tpm(String memo2);

	List<MesQmsView> doQuery33mm(String memo2);

	List<MesQmsView> doQuery3Anneal(String memo2);

	String doHeatNo(MesCrSlittingD mcsd);

	List<MesCrSlittingD> doQueryMes(String lw_plan_no);
	
	@Select("select sum(t.coil_act_wgt) from mes_cr_slitting_d t where t.process_no = #{process_no} and substr( t.coil_no,-1,1) not in ('B')")
	Double doQuerySumWeight(@Param("process_no")String process_no);
	
	@Select("select m.material_no from mes_cr_slitting_m m left join mes_cr_slitting_d d on m.process_no = d.process_no where d.COIL_NO = #{coilNo}")
	String findM(@Param("coilNo")String coilNo);
	
	@Select("select * from MES_CR_SLITTING_D where COIL_NO = #{coilNo}")
	MesCrSlittingD findD(@Param("coilNo")String coilNo);
	
}
