package market.Mes.Pickle.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.Pickle.Performance.vo.MesPlmD;
import market.Mes.Pickle.Performance.vo.MesPlmDPar;
import market.Mes.Pickle.Performance.vo.MesPlmM;
import market.Mes.Pickle.Performance.vo.PlnPlmView;

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 MesPlmMMapper extends GenericMapper<MesPlmM, Object> {

	// 反写虚拟物料号
	@Update(" update MES_PLM_M set material_no_vt = #{material_no_vt} where material_no = #{material_no}")
	void updatebymaterial_no(MesPlmM mcd);
	
	List<PlnPlmView> doQueryWeb(String memo1);

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

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

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

	Integer doquery(String v_process_no);
	
	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(MesPlmM mcm);

	void doUpdate2(MesPlmM mes);

	void doUpdate3(MesPlmM mes);

	List<MesPlmDPar> doQueryWeb3_pass(String memo1, String memo2, String memo3);

	void doDelete1(String pc_plan_no, String v_material_no);

	List<String> doQueryWebMaterialno(String machine_code);

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

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

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

	List<HashMap> doQueryWeb_zhiliang(MesPlmM mes, String startTime, String endTime, String memo1, String memo2);
	
	public List<HashMap> doQueryplmWeb(MesPlmM mes, String startTime, String endTime, String memo1, String memo2);

	List<HashMap> doProductionWrkReport(MesPlmM object);

	List<HashMap> doProductionSteelReport(MesPlmM object);

	List<MesPrdDetailReport> doPrdDetailWeb_plm(MesPrdDetailReport object, String memo1,
			String startTime, String endTime, String startTime2,
			String endTime2, String memo2, String memo3, String memo4,
			String memo5);
	
	@Select("select m.material_no from mes_plm_m m left join mes_plm_d d on m.process_no = d.process_no where d.COIL_NO = #{coilNo}")
	String findM (@Param("coilNo") String coilNo);
	
	@Select("select * from MES_PLM_D where COIL_NO = #{coilNo}")
	MesPlmD findD (@Param("coilNo") String coilNo);
	
	@Select("select count(1) from sso.SYS_USER where ORG_CODE = '2020091817520000004' and USER_NAME = #{username}")
	int getUserOrg (@Param("username") String username);
}
