using System;
using System.Data;
using Core.Mes.ServerFrameWork;
using Core.Mes.IBaseInterface;
using System.Collections;

namespace Core.XgMes.Server.JGKC.RollManager
{
	/// <summary>
	/// ButressQuery_YL 的摘要说明。
	/// </summary>
	public class ButressQuery_YL : Core.Mes.ServerFrameWork.IComponent
	{
		public ButressQuery_YL()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		public ReturnObject QueryBuress(string _Where)
		{
			try
			{
				string strOut="";
				string strSql="SELECT A.BAHCT_NUMBER, C.CREATETIME,C.OLD_SAMPL_NO,A.STL_GRD,A.COIL_WTH,"+
							"A.COIL_THK, "+
							"ROUND(A.ACT_WGT,3)ACT_WGT,"+
					"C.NOW_BUTTRESS,B.AREA,A.ORD_NO,A.TOT_DEC_GRD,"+
					"A.SPM_CRK_CD1,A.INTIME,A.REM,C.REMARK "+
					"FROM KCJ3_STUFFLIST_ZW A,KCJ3_STUFFBUTTRESSLIST_ZW B,"+
                    "KCJ3_STUFFMOVEBUTTRESSLIST_ZW C WHERE A.OLD_SAMPL_NO=B.OLD_SAMPL_NO " +
                    "AND B.OLD_SAMPL_NO=C.OLD_SAMPL_NO AND A.OLD_SAMPL_NO LIKE 'R%' AND A.STORAGESTATUS='501002'  AND A.ISVALID='1' " + _Where;
				DataSet ds=this.DBManager.ExecuteQuery(strSql,out strOut);
				if(ds!=null&&ds.Tables.Count==1)
				{
					ds.Tables[0].TableName="KCJ3_STUFFLIST";
					return new ReturnObject(ds,strOut);
				}
				return new ReturnObject(null);
			}
			catch(Exception ex)
			{
				System.Diagnostics.Debug.WriteLine(ex.ToString());
				return new ReturnObject(null,10004,ex.ToString());
			}
		}
	}
}
