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

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

import market.Mes.Rolling.Performance.vo.IfRoll01L2Pdo;
import market.Mes.Rolling.Performance.vo.MesRcmD;
import market.Mes.Rolling.Performance.vo.MesRcmM;
import market.Mes.Rolling.Performance.vo.MesRcmWgt;

import com.hnshituo.orm.GenericMapper;

public interface MesRcmWgtMapper extends GenericMapper<MesRcmWgt,Object> {
	
	@Select("select t.* from if_roll01_l2_pdo t left join mes_rcm_m m on t.plan_no = m.schedule_no and t.entry_coil_no = m.material_no "
			+ "where t.exit_weight > 00000 and t.msg_time > sysdate - 1 and nvl(m.hand_over_status, '1') != '1' order by t.msg_time")
	public List<IfRoll01L2Pdo> doQueryMesRcmDWgt();
	
	@Select("select t.* from mes_rcm_m t where t.schedule_no = #{schedule_no} and t.material_no = #{material_no}")
	public MesRcmM doQueryMesRcmM(@Param("schedule_no")String schedule_no,@Param("material_no")String material_no);
	
	@Select("select t.* from mes_rcm_d t where t.process_no = #{process_no} and substr(t.coil_no,-1,1) not in ('B','H')")
	public List<MesRcmD> doQueryMesRcmD(@Param("process_no")String process_no);
	
	@Select("select t.* from mes_rcm_wgt t where t.process_no = #{process_no} and substr(t.coil_no,-1,1) not in ('B','H')")
	public List<MesRcmWgt> doQueryMesRcmWgtCount(@Param("process_no")String process_no);
}
