package market.Mes.Rolling.Performance.mapper;
import java.util.HashMap;
import java.util.List;

import market.Mes.Lengthwise.Performance.vo.MesCrSlittingWrkSum;
import market.Mes.Lengthwise.Performance.vo.MesPrdDetailReport;
import market.Mes.Rolling.Performance.vo.MesRcmD;
import market.Mes.Rolling.Performance.vo.MesRcmDPass;
import market.Mes.Rolling.Performance.vo.MesRcmM;
import market.Mes.Rolling.Performance.vo.PlnRollingView;

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

import com.hnshituo.orm.GenericMapper;

@SuppressWarnings("rawtypes")
public interface MesRcmMMapper extends GenericMapper<MesRcmM,Object> {

	List<PlnRollingView> doQueryWeb(String memo1);

	List<MesCrSlittingWrkSum> doQueryWrkWeb(String memo1, String memo2, String memo3, String memo4);

	List<PlnRollingView> doQueryWeb2(String memo1, String startTime,
			String endTime, String memo2, String memo3);

	List<MesRcmM> doQueryWeb3(String memo1, String memo2, String memo3);

	Integer doquery(String v_process_no);
	
	// 反写虚拟物料号
	@Update(" update MES_RCM_M set material_no_vt = #{material_no_vt} where material_no = #{material_no}")
	void updatebymaterial_no(MesRcmM mcd);

	void doDelete(String memo1, String process_no);

	Integer doCount1(String v_rejected_coil_no, String schedule_no,
			String material_no_vt, String material_no);

	void doUpdate(MesRcmM mcm);

	void doUpdate2(MesRcmM mes);
	
	List<MesRcmDPass> doQueryWeb3_pass(String memo1, String memo2, String memo3);

	List<HashMap> doQueryMesCrWeb1(int i, int j, MesRcmD object,
			String startTime, String endTime, String swhere, String memo2);

	List<HashMap> doQueryMesCrWeb2(int i, int j, MesRcmD object,
			String startTime, String endTime, String swhere, String memo2);

	long doQueryMesCrWebCount1(MesRcmD object, String startTime,
			String endTime, String memo2, String swhere);

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

	void doDelete1(String rl_plan_no, String entry_coil_no);
	
	Integer doCount2(String v_reject_coil_no, String schedule_no,
			String material_no);

	@Select("select to_char(to_date(#{tc_time}, 'yyyymmdd'),  'yyyy-mm-dd') from dual ")
	String doQueryDate(String tc_time);

	List<MesPrdDetailReport> doPrdDetailWeb_rcm(MesPrdDetailReport object, String memo1,
			String startTime, String endTime, String startTime2,
			String endTime2, String memo2, String memo3, String memo4,
			String memo5);

	
	List<HashMap> doProductionWrkReport(MesRcmM object);

	List<HashMap> doProductionSteelReport(MesRcmM object);

	List<HashMap> doQueryWeb_zhiliang(MesRcmM mes, String startTime,
			String endTime, String string, String string2);

	List<HashMap> doQueryWebTrc(String memo1, String memo2);

	List<MesRcmDPass> doQueryWeb3_Pass_jians(String memo1, String memo2, String memo3);
	
	//20201125 获取所有轧机子卷重量
	@Select("select sum(t.coil_act_wgt) from mes_rcm_d t where t.process_no = #{process_no}")
	public Double doQueryMesRcmDSumWgt(@Param("process_no")String process_no);
	
	@Select("select m.material_no from mes_rcm_m m left join mes_rcm_d d on m.process_no = d.process_no where d.COIL_NO = #{coilNo}")
	String findM (@Param("coilNo") String coilNo);
	
	@Select("select * from MES_RCM_D where COIL_NO = #{coilNo}")
	MesRcmD findD (@Param("coilNo") String coilNo);

}
