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

namespace Core.XgMes.Server.JGKC.RollManager
{
	/// <summary>
	/// CPButtressQuery 的摘要说明。
	/// </summary>
	public class CPButtressQuery : Core.Mes.ServerFrameWork.IComponent
	{
		public CPButtressQuery()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		public override int maxValue
		{
			get
			{
				return 10;
			}
		}
		public override int minValue
		{
			get
			{
				return 5;
			}
		}
		public ReturnObject CPBuressQuery(string _Where)
		{
			try
			{
				string strOut="";
				string strSql="SELECT A.BAHCT_NUMBER,A.COIL_NO_ID,C.CREATETIME,C.OLD_SAMPL_NO,A.STL_GRD,A.PCTIME,a.CREATOR,"+
					"A.DEVLMT_DTIME,(a.zslab_ply||'*'||a.zslab_width||'*'||a.zslab_length)gg,A.ZSLAB_NUM,A.ZSLAB_WEIGHT,A.SX_BIAOZHUN,"+
					"C.NOW_BUTTRESS,B.AREA,A.ORD_NO,A.TOT_DEC_GRD,"+
					"A.SPM_CRK_CD1,A.CREATETIME TIMENAME,A.REM,C.REMARK "+
                    "FROM KCJ3_TURNOFFLIST_ZW A,KCJ3_TURNOFFBUTTRESSLIST_ZW B," +
                    "KCJ3_TURNOFFMOVEBUTTRESSLIST_Z C WHERE A.COIL_NO_ID=B.COIL_NO_ID  " +
                    "AND B.COIL_NO_ID=C.COIL_NO_ID AND A.COIL_NO_ID LIKE 'R%' AND A.STORAGESTATUS='501602' AND ISVALID='1' " + _Where;
				DataSet ds=this.DBManager.ExecuteQuery(strSql,out strOut);
				if(ds!=null&&ds.Tables.Count==1)
				{
					ds.Tables[0].TableName="KCJ3_TURNOFFLIST";
					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());
			}
		}
	}
}
