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

namespace Core.XgMes.Server.JGKC.RollManager
{
	/// <summary>
	/// TurnoReport 的摘要说明。
	/// </summary>
	public class TurnoReport : Core.Mes.ServerFrameWork.IComponent
	{
		public TurnoReport()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		public override int maxValue
		{
			get
			{
				return 100;
			}
		}
		public override int minValue
		{
			get
			{
				return 50;
			}
		}
		public ReturnObject StuffQuery(string _Where)
		{
			try
			{
				string strOut="";
				string Sql= "SELECT (CASE WHEN STORAGESTATUS='501002' THEN '在库' ELSE '出库' END)STORAGESTATUS,"+
                            "A.OLD_SAMPL_NO,A.SLAB_NO,A.ORD_NO,B.BUTTRESS, "+
							"A.ORD_SEQ,A.STL_GRD,A.COIL_INDIA,A.COIL_OUTDIA,"+
							"A.COIL_THK,COIL_WTH,A.STOVENO,A.BAHCT_NUMBER,"+
							"CAL_WGT,A.ACT_WGT,A.TOT_DEC_GRD,SX_BIAOZHUN,"+
							"A.CRK_CD1,A.CRK_CD2,A.CRK_CD3,A.CRK_CD4,"+
							"A.CRK_CD5,A.ZLZS_NO,A.REM,A.DEVLMT_DTIME, "+
							"A.SHIP_INVNO,TRANS_CAR_NO,(SELECT NAME_ FROM SCM_BASE_INFO C WHERE C.ID_= A.INCLASSORDER)INCLASSORDER,"+
                            "(SELECT NAME_ FROM SCM_BASE_INFO D WHERE D.ID_=A.INCLASSTEAM)INCLASSTEAM,A.CREATETIME,A.CREATOR,A.INTIME,a.MOVE_TIME,a.MOVE_MAN FROM KCJ3_STUFFLIST A ,KCJ3_STUFFBUTTRESSLIST B  " +
							"WHERE A.OLD_SAMPL_NO=B.OLD_SAMPL_NO"+_Where;
				DataSet ds=this.DBManager.ExecuteQuery(Sql,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());
			}
		}
		public ReturnObject TurnoQuery(string _Where)
		{
			try
			{
				string strOut="";
				string Sql="SELECT (CASE WHEN STORAGESTATUS='501602' THEN '在库' ELSE '出库' END)STORAGESTATUS, "+
							"A.COIL_NO_ID,A.OLD_SAMPL_NO,A.SLAB_NO,A.ORD_NO,B.BUTTRESS, "+
							"A.ORD_SEQ,A.STL_GRD,A.ZSLAB_PLY,A.ZSLAB_WIDTH, "+
							"A.ZSLAB_LENGTH,ZSLAB_NUM,A.STOVENO,A.BAHCT_NUMBER, "+
							"ROUND(A.ZSLAB_WEIGHT*0.001,3)ZSLAB_WEIGHT,A.TOT_DEC_GRD,SX_BIAOZHUN,A.SERIAL_NUMBER, "+
							"A.CRK_CD1,A.CRK_CD2,A.CRK_CD3,A.CRK_CD4, "+
							"A.CRK_CD5,A.ZLZS_NO,A.REM,A.DEVLMT_DTIME, "+
							"A.SHIP_INVNO,TRANS_CAR_NO,(SELECT NAME_ FROM SCM_BASE_INFO C WHERE C.ID_= A.INCLASSORDER)INCLASSORDER, "+
							"(SELECT NAME_ FROM SCM_BASE_INFO D WHERE D.ID_=A.INCLASSTEAM)INCLASSTEAM,A.CREATETIME,A.CREATOR,PCTIME  FROM KCJ3_TURNOFFLIST A ,KCJ3_TURNOFFBUTTRESSLIST B  "+
							"WHERE A.COIL_NO_ID=B.COIL_NO_ID "+_Where; 
				DataSet ds=this.DBManager.ExecuteQuery(Sql,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());
			}
		}
		public ReturnObject TranQuery(string _Where)
		{
			try
			{
				string strOut="";
				string Sql= "SELECT A.OLD_SAMPL_NO,"+
							"A.ORD_NO, "+
							"A.ORD_SEQ, "+
							"(CASE "+
							"WHEN A.STORAGESTATUS = '501002' THEN "+
							" '↑' "+
							"ELSE "+
							"'→' "+
							"END) A1, "+
							"(CASE "+
							"WHEN A.STORAGESTATUS = '501002' AND A.ISPLAN = '0' THEN "+
							"'↑' "+
							"WHEN A.ISPLAN = '1' AND "+
							"(A.STORAGESTATUS = '501002' OR A.STORAGESTATUS = '501001') THEN "+
							"'→' "+
							"WHEN A.ISPLAN = '0' AND A.STORAGESTATUS = '501001' THEN "+
							"'×' "+
							"END) B1, "+
							"NVL((SELECT (CASE "+
							"WHEN B.DOWN_FLAG = '0' THEN "+
							"'↑' "+
							"WHEN B.DOWN_FLAG = '1' THEN "+
							"'→' "+
							"END) "+
							"FROM KCJ3_ZY_PLAN B "+
							"WHERE B.OLD_SAMPL_NO = A.OLD_SAMPL_NO), "+
							"'×') B2, "+
							"NVL((SELECT (CASE "+
							"WHEN C.STOCKTYPE = '0' AND TURNOFFCOLLECT_LOG = '0' THEN "+
							"'↑' "+
							"WHEN C.STOCKTYPE = '1' AND TURNOFFCOLLECT_LOG = '0' THEN "+
							" '↑' "+
							"ELSE "+
							"'→' "+
							"END) AA "+
							"FROM (select * "+
							"from (select row_number() over(partition by OLD_SAMPL_NO order by 1) xh, "+
                            "t.* "+
							"from kcj3_zy_taskdetail t) "+
							"where xh = 1) C "+
							"WHERE C.OLD_SAMPL_NO = A.OLD_SAMPL_NO), "+
							"'×') C1, "+
       
							"NVL((SELECT (CASE "+
							"WHEN C.STOCKTYPE = '0' AND TURNOFFCOLLECT_LOG = '1' THEN "+
							"'→' "+
							"WHEN C.STOCKTYPE = '1' AND TURNOFFCOLLECT_LOG = '1' THEN "+
							"'→' "+
							"ELSE "+
							"'↑' "+
							"END) AA "+
							"FROM (select * "+
							"from (select row_number() over(partition by OLD_SAMPL_NO order by 1) xh, "+
							"t.* "+
                            "from kcj3_zy_taskdetail t) "+
							"where xh = 1) C "+
							"WHERE C.OLD_SAMPL_NO = A.OLD_SAMPL_NO), "+
							"'×') C2, "+
							"NVL((SELECT (CASE "+
							"WHEN D.STORAGESTATUS = '501602' THEN "+
							"'↑' "+
							"WHEN D.STORAGESTATUS = '501601' THEN "+
							"'→' "+
							"END) "+
							"FROM (select * "+
							"from (select row_number() over(partition by OLD_SAMPL_NO order by 1) xh, "+
                            "t.* "+
                            "from KCJ3_TURNOFFLIST t) "+
							"where xh = 1) D "+
							"WHERE D.OLD_SAMPL_NO = A.OLD_SAMPL_NO), "+
							"'×') D1, "+
							"(SELECT PCTIME FROM (select * "+
							"from (select row_number() over(partition by OLD_SAMPL_NO order by 1) xh, "+
                            "t.* "+
							"from KCJ3_ZY_TASKDETAIL t) "+
							"where xh = 1) F WHERE F.OLD_SAMPL_NO = A.OLD_SAMPL_NO)PCTIME, "+
							"(SELECT CREATOR FROM (select * "+
							"from (select row_number() over(partition by OLD_SAMPL_NO order by 1) xh, "+
							"t.* "+
                            "from KCJ3_ZY_TASKDETAIL t) "+
							"where xh = 1) H WHERE H.OLD_SAMPL_NO = A.OLD_SAMPL_NO)CREATOR, "+ 
							"(SELECT CREATOR FROM (select * "+
							"from (select row_number() over(partition by OLD_SAMPL_NO order by 1) xh, "+
							"t.* "+
                            "from KCJ3_TURNOFFLIST t) "+
							"where xh = 1) G WHERE G.OLD_SAMPL_NO = A.OLD_SAMPL_NO)CREATOR1, "+
							"(SELECT CREATETIME FROM (select * "+
							"from (select row_number() over(partition by OLD_SAMPL_NO order by 1) xh, "+
                            "t.* "+
                            "from KCJ3_TURNOFFLIST t) "+
							"where xh = 1) J WHERE J.OLD_SAMPL_NO = A.OLD_SAMPL_NO)CREATETIME "+
							"FROM KCJ3_STUFFLIST A WHERE 1=1 "+_Where; 
				DataSet ds=this.DBManager.ExecuteQuery(Sql,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());
			}
		}

        public ReturnObject Rpt_BJproduct_6_Query(string strTimeFrom, string strTimeTo,  string strK,int day)
        {
            string sqlstr = " ";
            string strOut = "";
            System.Data.DataSet rtndst = new DataSet();
            System.Data.DataSet tmpdst = null;
             sqlstr = "select '01' rowindex, '计划产量' zb, "
                    + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,750 dayall, 750 * "+day+" monall "
                    + " from dual union "
                    + "select '02' rowindex, '剪切产量' zb,  "
                    + " round ((sum(case when b.pclassteam='300301' and b.PCTIME " + strTimeFrom + " then b.ZSLAB_WEIGHT * 0.001 else 0 end)),3) day1,"
                    + " round(sum(case when b.pclassteam='300301' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon1,"
                    + " round(sum(case when b.pclassteam='300302' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day2,"
                    + " round(sum(case when b.pclassteam='300302' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon2,"
                    + " round(sum(case when b.pclassteam='300303' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day3,"
                    + " round(sum(case when b.pclassteam='300303' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon3,"
                    + " round(sum(case when b.pclassteam='300304' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day4,"
                    + " round(sum(case when b.pclassteam='300304' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon4,"
                    + " round(sum(case when b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) dayall,"
                    + " round(sum(case when b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) monall"
                    + " from KCJ3_ZY_TASKDETAIL b,KCJ3_STUFFBUTTRESSLIST a where b.OLD_SAMPL_NO = a.OLD_SAMPL_NO  "
                    + " and b.PCTIME " + strK;
            
            
            tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            if (tmpdst != null)
            {
                rtndst.Merge(tmpdst.Copy());
                tmpdst = null;
            }
            else
            {
                return new ReturnObject(null, strOut);
            }
            sqlstr = " select '03' rowindex, '其中：供薄板' zb,  "
                 + " round ((sum(case when b.pclassteam='300301' and b.PCTIME " + strTimeFrom + " then b.ZSLAB_WEIGHT * 0.001 else 0 end)),3) day1,"
                + " round(sum(case when b.pclassteam='300301' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon1,"
                + " round(sum(case when b.pclassteam='300302' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day2,"
                + " round(sum(case when b.pclassteam='300302' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon2,"
                + " round(sum(case when b.pclassteam='300303' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day3,"
                + " round(sum(case when b.pclassteam='300303' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon3,"
                + " round(sum(case when b.pclassteam='300304' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day4,"
                + " round(sum(case when b.pclassteam='300304' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon4,"
                + " round(sum(case when b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) dayall,"
                + " round(sum(case when b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) monall"
                + " from KCJ3_ZY_TASKDETAIL b,KCJ3_STUFFBUTTRESSLIST a where b.OLD_SAMPL_NO = a.OLD_SAMPL_NO  and b.ord_use_cd = '80700003' "
                + " and b.PCTIME " + strK;
           
            tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            if (tmpdst != null)
            {
                rtndst.Merge(tmpdst.Copy());
                tmpdst = null;
            }
            else
            {
                return new ReturnObject(null, strOut);
            }
            sqlstr = " select '04' rowindex, '其中：内贸产量' zb, "
                + " round ((sum(case when b.pclassteam='300301' and b.PCTIME " + strTimeFrom + " then b.ZSLAB_WEIGHT * 0.001 else 0 end)),3) day1,"
                + " round(sum(case when b.pclassteam='300301' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon1,"
                + " round(sum(case when b.pclassteam='300302' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day2,"
                + " round(sum(case when b.pclassteam='300302' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon2,"
                + " round(sum(case when b.pclassteam='300303' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day3,"
                + " round(sum(case when b.pclassteam='300303' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon3,"
                + " round(sum(case when b.pclassteam='300304' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day4,"
                + " round(sum(case when b.pclassteam='300304' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon4,"
                + " round(sum(case when b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) dayall,"
                + " round(sum(case when b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) monall"
                + " from KCJ3_ZY_TASKDETAIL b,KCJ3_STUFFBUTTRESSLIST a where b.OLD_SAMPL_NO = a.OLD_SAMPL_NO  and b.ord_use_cd = '80700001' "
                + " and b.PCTIME " + strK;
           
            tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            if (tmpdst != null)
            {
                rtndst.Merge(tmpdst.Copy());
                tmpdst = null;
            }
            else
            {
                return new ReturnObject(null, strOut);
            }
            sqlstr = " select '05' rowindex, '其中：外贸产量' zb, "
                 + " round ((sum(case when b.pclassteam='300301' and b.PCTIME " + strTimeFrom + " then b.ZSLAB_WEIGHT * 0.001 else 0 end)),3) day1,"
                + " round(sum(case when b.pclassteam='300301' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon1,"
                + " round(sum(case when b.pclassteam='300302' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day2,"
                + " round(sum(case when b.pclassteam='300302' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon2,"
                + " round(sum(case when b.pclassteam='300303' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day3,"
                + " round(sum(case when b.pclassteam='300303' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon3,"
                + " round(sum(case when b.pclassteam='300304' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day4,"
                + " round(sum(case when b.pclassteam='300304' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon4,"
                + " round(sum(case when b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) dayall,"
                + " round(sum(case when b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) monall"
                + " from KCJ3_ZY_TASKDETAIL b,KCJ3_STUFFBUTTRESSLIST a where b.OLD_SAMPL_NO = a.OLD_SAMPL_NO  and b.ord_use_cd = '80700002' "
                + " and b.PCTIME " + strK;
           
            tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            if (tmpdst != null)
            {
                rtndst.Merge(tmpdst.Copy());
                tmpdst = null;
            }
            else
            {
                return new ReturnObject(null, strOut);
            }
            sqlstr = " select '06' rowindex, '超欠产量' zb, "
                + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
                + " from dual union "
                +" select '07' rowindex, '剪切原料（原料投入量）' zb, "
                + " round ((sum(case when b.STSJBZ='300301' and b.STTIME " + strTimeFrom + " then b.act_wgt * 0.001 else 0 end)),3) day1,"
                + " round(sum(case when b.STSJBZ='300301' and b.STTIME " + strTimeTo + " then  b.act_wgt * 0.001 else 0 end),3) mon1,"
                + " round(sum(case when b.STSJBZ='300302' and b.STTIME " + strTimeFrom + " then  b.act_wgt * 0.001 else 0 end),3) day2,"
                + " round(sum(case when b.STSJBZ='300302' and b.STTIME " + strTimeTo + " then  b.act_wgt * 0.001 else 0 end),3) mon2,"
                + " round(sum(case when b.STSJBZ='300303' and b.STTIME " + strTimeFrom + " then  b.act_wgt * 0.001 else 0 end),3) day3,"
                + " round(sum(case when b.STSJBZ='300303' and b.STTIME " + strTimeTo + " then  b.act_wgt * 0.001 else 0 end),3) mon3,"
                + " round(sum(case when b.STSJBZ='300304' and b.STTIME " + strTimeFrom + " then  b.act_wgt * 0.001 else 0 end),3) day4,"
                + " round(sum(case when b.STSJBZ='300304' and b.STTIME " + strTimeTo + " then  b.act_wgt * 0.001 else 0 end),3) mon4,"
                + " round(sum(case when b.STTIME " + strTimeFrom + " then  b.act_wgt * 0.001 else 0 end),3) dayall,"
                + " round(sum(case when b.STTIME " + strTimeTo + " then  b.act_wgt * 0.001 else 0 end),3) monall"
                + " from KCJ3_ZY_PLAN b, KCJ3_STUFFBUTTRESSLIST a where b.OLD_SAMPL_NO = a.OLD_SAMPL_NO AND b.DOWN_FLAG = '1' AND B.AFFIRLOG ='1' "
                + " and b.STTIME " + strK;
            


            tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            if (tmpdst != null)
            {
                rtndst.Merge(tmpdst.Copy());
                tmpdst = null;
            }
            else
            {
                return new ReturnObject(null, strOut);
            }
            sqlstr = " select '08' rowindex, '入库成品原料消耗' zb, "
               + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
                + " from dual "
                + " union "
                //
                + " select '09' rowindex, '非计划' zb, "
                 + " round ((sum(case when b.pclassteam='300301' and b.PCTIME " + strTimeFrom + " then b.ZSLAB_WEIGHT * 0.001 else 0 end)),3) day1,"
                + " round(sum(case when b.pclassteam='300301' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon1,"
                + " round(sum(case when b.pclassteam='300302' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day2,"
                + " round(sum(case when b.pclassteam='300302' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon2,"
                + " round(sum(case when b.pclassteam='300303' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day3,"
                + " round(sum(case when b.pclassteam='300303' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon3,"
                + " round(sum(case when b.pclassteam='300304' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day4,"
                + " round(sum(case when b.pclassteam='300304' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon4,"
                + " round(sum(case when b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) dayall,"
                + " round(sum(case when b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) monall"
                + " from KCJ3_ZY_TASKDETAIL b where B.ISFJH = '1' "
                + " and b.PCTIME " + strK
                + " UNION select '10' rowindex, '废钢' zb, "
                + " 0.00 day1, 0.00 mon1, 0.00 day2, 0.00 mon2, 0.00 day3, 0.00 mon3, 0.00 day4, 0.00 mon4,0.00 dayall, 0.00 monall "
                + " from dual union "
                + " select '11' rowindex, '成材率(%)' zb, "
                + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
                + " from dual "
                + " union "
                //计划内合格，入库时间
                + " select '12' rowindex, '日历时间' zb, "
                + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
                + " from dual union "
                + " select '13' rowindex, '计划作业时间' zb, "
                + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day1,"
                + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon1, "
                + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day2,"
                + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon2,"
                + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day3,"
                + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon3,"
                + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day4,"
                + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon4,"
                + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) dayall,"
                + " sum(case when PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) monall "
                + " from BJ3_DATAFORRPT a where a.PRODUCTTIME " + strK + " AND A.PRESSLINE ='8055001' "
                + " union "
                + " select '14' rowindex, '实际作业时间' zb, "
               + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day1,"
                + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon1, "
                + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day2,"
                + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon2,"
                + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day3,"
                + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon3,"
                + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day4,"
                + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon4,"
                + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) dayall,"
                + " sum(case when PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) monall "
                + " from BJ3_DATAFORRPT a where a.PRODUCTTIME " + strK + " AND A.PRESSLINE ='8055001' ";
            tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            if (tmpdst != null)
            {
                rtndst.Merge(tmpdst.Copy());
                tmpdst = null;
            }
            else
            {
                return new ReturnObject(null, strOut);
            }
            sqlstr = " select '15' rowindex, '停机时间' zb, "
                + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.FAILURETIME else 0 end) day1,"
                + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.FAILURETIME else 0 end) mon1, "
                + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.FAILURETIME else 0 end) day2,"
                + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.FAILURETIME else 0 end) mon2,"
                + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.FAILURETIME else 0 end) day3,"
                + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.FAILURETIME else 0 end) mon3,"
                + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.FAILURETIME else 0 end) day4,"
                + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.FAILURETIME else 0 end) mon4,"
                + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.FAILURETIME else 0 end) dayall,"
                + " sum(case when PRODUCTTIME " + strTimeTo + " then a.FAILURETIME else 0 end) monall "
                + " from BJ3_DATAFORRPT a where  FAILURTYPE = '2' and a.PRODUCTTIME  " + strK

                + " union "
                + " select '16' rowindex, '故障明细' zb, "
                + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
                + " from dual  "
                + "  union select '17' rowindex, '机械故障时间(1#)' zb, "
                + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day1,"
                + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon1, "
                + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day2,"
                + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon2,"
                + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day3,"
                + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon3,"
                + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day4,"
                + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon4,"
                + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) dayall,"
                + " sum(case when PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) monall "
                + " from BJ_JBGZ a where a.PRODUCTTIME " + strK + " AND A.PLINE ='8055001' and A.GZ_NAME in('0','1') ";
                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }
                sqlstr = " select '18' rowindex, '计划作业时间(2#)' zb, "
                     + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day1,"
                     + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon1, "
                     + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day2,"
                     + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon2,"
                     + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day3,"
                     + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon3,"
                     + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day4,"
                     + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon4,"
                     + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) dayall,"
                     + " sum(case when PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) monall "
                     + " from BJ3_DATAFORRPT a where a.PRODUCTTIME " + strK + " AND A.PRESSLINE ='8055002' "
                     + " union "
                     + " select '19' rowindex, '实际作业时间(2#)' zb, "
                     + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day1,"
                     + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon1, "
                     + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day2,"
                     + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon2,"
                     + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day3,"
                     + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon3,"
                     + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day4,"
                     + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon4,"
                     + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) dayall,"
                     + " sum(case when PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) monall "
                     + " from BJ3_DATAFORRPT a where a.PRODUCTTIME " + strK + " AND A.PRESSLINE ='8055002' "
                     + " union "
                     + " select '20' rowindex, '停机时间(2#)' zb, "
                     + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
                     + " from dual union "
                     + " select '21' rowindex, '故障明细(2#)' zb, "
                     + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
                     + " from dual "
                     + " union "
                    + " select '22' rowindex, '机械故障时间(2#)' zb, "
                    + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day1,"
                + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon1, "
                + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day2,"
                + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon2,"
                + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day3,"
                + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon3,"
                + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day4,"
                + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon4,"
                + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) dayall,"
                + " sum(case when PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) monall "
                + " from BJ_JBGZ a where a.PRODUCTTIME " + strK + " AND A.PLINE ='8055002' and A.GZ_NAME in('0','1') ";
                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }
                sqlstr = " select '23' rowindex, '有效作业率' zb, "
                + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
                + " from dual "
                + " union "
                + " select '24' rowindex, '套材量' zb, "
                + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
                + " from dual "
              

               + " union select '25' rowindex, '热连轧转运板加量' zb, "
            + " sum(case when A.INTIME " + strTimeFrom + " and INCLASSTEAM = '300301' then A.THEORYWEIGHT else 0 end) day1, "
            + " sum(case when A.INTIME " + strTimeTo + " and INCLASSTEAM = '300301' then A.THEORYWEIGHT else 0 end) mon1,  "
            + " sum(case when A.INTIME " + strTimeFrom + " and INCLASSTEAM = '300302' then A.THEORYWEIGHT else 0 end) day2, "
            + " sum(case when A.INTIME " + strTimeTo + " and INCLASSTEAM = '300302' then A.THEORYWEIGHT else 0 end) mon2,  "
            + " sum(case when A.INTIME " + strTimeFrom + " and INCLASSTEAM = '300303' then A.THEORYWEIGHT else 0 end) day3, "
            + " sum(case when A.INTIME " + strTimeTo + " and INCLASSTEAM = '300303' then A.THEORYWEIGHT else 0 end) mon3,  "
            + " sum(case when A.INTIME " + strTimeFrom + " and INCLASSTEAM = '300304' then A.THEORYWEIGHT else 0 end) day4, "
            + " sum(case when A.INTIME " + strTimeTo + " and INCLASSTEAM = '300304' then A.THEORYWEIGHT else 0 end) mon4,  "
            + " sum(case when A.INTIME " + strTimeFrom + " then A.THEORYWEIGHT else 0 end) dayall, "
            + " sum(case when A.INTIME " + strTimeTo + " then A.THEORYWEIGHT else 0 end) monall "
            + " from KCJ_STORAGELIST A,KCJ_STORAGEBUTTRESSLIST b where  A.BILLETID=b.BILLETID(+) AND A.STORAGESTATUS = '501002' AND A.ISVALID = '1'  "
            + " and a.INTIME " + strK;
             tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }

                sqlstr = " select '27' rowindex, '有效作业率2(%)' zb, "
                + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
                + " from dual "
                + " union "
                +" select '26' rowindex, '成品发运量' zb, "
            + " sum(case when A.PICKSTORAGETIME " + strTimeFrom + " and CLASSTEAM = '300301' then  a.ZSLAB_WEIGHT * 0.001 else 0 end) day1, "
            + " sum(case when A.PICKSTORAGETIME " + strTimeTo + " and CLASSTEAM = '300301' then  a.ZSLAB_WEIGHT * 0.001 else 0 end) mon1,  "
            + " sum(case when A.PICKSTORAGETIME " + strTimeFrom + " and CLASSTEAM = '300302' then  a.ZSLAB_WEIGHT * 0.001 else 0 end) day2, "
            + " sum(case when A.PICKSTORAGETIME " + strTimeTo + " and CLASSTEAM = '300302' then  a.ZSLAB_WEIGHT * 0.001 else 0 end) mon2,  "
            + " sum(case when A.PICKSTORAGETIME " + strTimeFrom + " and CLASSTEAM = '300303' then  a.ZSLAB_WEIGHT * 0.001 else 0 end) day3, "
            + " sum(case when A.PICKSTORAGETIME " + strTimeTo + " and CLASSTEAM = '300303' then  a.ZSLAB_WEIGHT * 0.001 else 0 end) mon3,  "
            + " sum(case when A.PICKSTORAGETIME " + strTimeFrom + " and CLASSTEAM = '300304' then  a.ZSLAB_WEIGHT * 0.001 else 0 end) day4, "
            + " sum(case when A.PICKSTORAGETIME " + strTimeTo + " and CLASSTEAM = '300304' then  a.ZSLAB_WEIGHT * 0.001 else 0 end) mon4,  "
            + " sum(case when A.PICKSTORAGETIME " + strTimeFrom + " then  a.ZSLAB_WEIGHT * 0.001 else 0 end) dayall, "
            + " sum(case when A.PICKSTORAGETIME " + strTimeTo + " then  a.ZSLAB_WEIGHT * 0.001 else 0 end) monall "
            + " from KCJ3_TURNOFFSENDLIST a, KCJ3_TURNOFFBUTTRESSLIST B  where   A.COIL_NO_ID=B.COIL_NO_ID and  "
            + "  PICKSTORAGETIME " + strK;

                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }
                sqlstr = " select '28' rowindex, '有效作业率3(%)' zb, "
                + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
                + " from dual "
                + " union "
                + " select '29' rowindex, '计划作业时间(3#)' zb, "
                        + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day1,"
                        + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon1, "
                        + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day2,"
                        + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon2,"
                        + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day3,"
                        + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon3,"
                        + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day4,"
                        + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon4,"
                        + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) dayall,"
                        + " sum(case when PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) monall "
                        + " from BJ3_DATAFORRPT a where a.PRODUCTTIME " + strK + " AND A.PRESSLINE ='8055003' "
                        + " union "
                        + " select '30' rowindex, '实际作业时间(3#)' zb, "
                        + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day1,"
                        + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon1, "
                        + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day2,"
                        + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon2,"
                        + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day3,"
                        + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon3,"
                        + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day4,"
                        + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon4,"
                        + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) dayall,"
                        + " sum(case when PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) monall "
                        + " from BJ3_DATAFORRPT a where a.PRODUCTTIME " + strK + " AND A.PRESSLINE ='8055003' "
                        + " union "
                        + " select '31' rowindex, '停机时间(3#)' zb, "
                        + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
                        + " from dual union "
                        + " select '32' rowindex, '故障明细(3#)' zb, "
                        + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
                        + " from dual "
                        + " union "
                       + " select '33' rowindex, '机械故障时间(3#)' zb, "
                       + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day1,"
                   + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon1, "
                   + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day2,"
                   + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon2,"
                   + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day3,"
                   + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon3,"
                   + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day4,"
                   + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon4,"
                   + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) dayall,"
                   + " sum(case when PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) monall "
                   + " from BJ_JBGZ a where a.PRODUCTTIME " + strK + " AND A.PLINE ='8055003' and A.GZ_NAME in('0','1') ";
                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }
            
            return new ReturnObject(rtndst);
        }
      
        public ReturnObject GetStorageData(System.Collections.ArrayList Select, System.Collections.ArrayList where, System.Collections.ArrayList Group)
        {
            try
            {
                string sql = "";
                string err = "";
                System.Data.DataSet tmpdst = null;
                System.Data.DataSet rtndst = new DataSet();
                for (int i = 0; i < Select.Count; i++)
                {
                    sql = Select[i].ToString() + where[i].ToString() + Group[i].ToString();
                    tmpdst = this.DBManager.ExecuteQuery(sql, out err);
                    if (tmpdst != null && tmpdst.Tables.Count == 1)
                    {
                        tmpdst.Tables[0].TableName = "KCH_TURNOFFLIST_VIEW";
                        rtndst.Merge(tmpdst.Copy());
                        tmpdst = null;
                    }
                }
                if (rtndst.Tables.Count > 0)
                {
                    return new ReturnObject(rtndst);
                }
                else
                {
                    return new ReturnObject(null);
                }
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
                return new ReturnObject(null);
            }
        }


        /// <summary>
        /// 垛位信息查询
        /// </summary>
        /// <param name=" _AreaCode">区域代码</param>
        /// <returns></returns>
        public ReturnObject QueryFJButtress(string _ButtressCode, string _AreaCode, string _ButtressType)
            {
            string strOut = "";

            string sql = "select BUTTRESSCODE from kcj_buttress_zw where isvalid = '1' "
                        + " and buttresstype = '" + _ButtressType + "' ";
            if (_ButtressCode.Length > 0)
            {
                sql += " and buttresscode ='" + _ButtressCode + "'";
            }
            if (_AreaCode.Length > 0)
            {
                sql += " and areacode = '" + _AreaCode + "'";
            }

            //			sql += " order by areacode asc";

            try
            {

                DataSet ds = this.DBManager.ExecuteQuery(sql, out strOut);
                ds.Tables[0].TableName = "KCJ_BUTTRESS";
                return new ReturnObject(ds, strOut);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
                return new ReturnObject(null, "数据库连接错");
            }

        }



        /**********************************************************************************
        **  目的：   热连轧转板加信息统计报表(累加列)
        **  时间：   2010-12-07
        **	作者：   Add by WYB
        **********************************************************************************/

        public ReturnObject RLZTOBZ_Query(string _Select, string _Where,string _Group)
        {
            try
            {



                string Sql = "SELECT " + _Select + " " //

                      + "               SUM(F_WEIGHT)  F_WEIGHT, "
                      + "               SUM(F_COUNT)  F_COUNT, "
                      + "               SUM(J_WEIGHT)  J_WEIGHT, "
                      + "               SUM(J_COUNT)  J_COUNT, "
                      + "               (SUM(F_WEIGHT)-SUM(J_WEIGHT))  W_WEIGHT, "
                      + "               (SUM(F_COUNT)-SUM(J_COUNT))  W_COUNT "
                      + " FROM  (SELECT  (CASE  WHEN  K.MOVE_ST  <>  '0'  THEN  K.ACT_WGT  ELSE  0  END)  F_WEIGHT, "
                      + "                (CASE  WHEN  K.MOVE_ST  <>  '0'  THEN  1  ELSE  0  END)  F_COUNT, "
                      + "                (CASE  WHEN  K.MOVE_ST  =  '1'  THEN  K.ACT_WGT  ELSE  0  END)  J_WEIGHT, "
                      + "                (CASE  WHEN  K.MOVE_ST  =  '1'  THEN  1  ELSE  0  END)  J_COUNT, "
                      + "                (CASE  WHEN  K.MOVE_ST  =  '2'  THEN  K.ACT_WGT  ELSE  0  END)  W_WEIGHT, "
                      + "                (CASE  WHEN  K.MOVE_ST  =  '2'  THEN  1  ELSE  0  END)  W_COUNT,"

                      + "                   K.ORD_SEQ,"
                      + "                   K.ORD_NO ,"
                      + "                   K.STL_GRD,"
                      + "                   K.COIL_THK,"
                      + "                   K.COIL_WTH,"
                      + "                   SERIAL_NUMBER ,K.SHIP_INVNO,"
                      + "                   K.COIL_LEN,"
                      + "                   K.TRANS_CAR_NO,"
                      + "                   K.OLD_SAMPL_NO,"
                      + "                   ''STOVENO,"
                      + "                   K.ACT_WGT,"
                      + "                   K.TOT_DEC_GRD,"
                      + "                   K.MOVE_TIME,"
                      + "                   K.DEVLMT_DTIME ,S.INMAN,S.INTIME "

                      + "                   FROM  tbh07_bj_tranfinfo@LINK_SQ  K, "
                      + "                   (select a.COIL_WTH,A.old_sampl_no, A.ORD_SEQ,A.ORD_NO,A.INMAN,A.INTIME from tbh07_bj_tranfinfo@LINK_SQ K, kcj3_stufflist a "
                      + "                   where K.ORD_NO || K.ORD_SEQ = a.ORD_NO || A.ORD_SEQ AND K.old_sampl_no=A.old_sampl_no and K.MOVE_ST='1') S  WHERE K.ORD_NO || K.ORD_SEQ = S.ORD_NO || S.ORD_SEQ AND K.old_sampl_no=S.old_sampl_no and "
                      + " " + _Where + " )"

                      + "                    " + _Group + "";


                //string Sql = "SELECT  " + _Select + " k.ship_invno" //此字段用来测试，不要时需删除
                //       + " from kcj3_transferinfo k " + _Where + "";

                string err = "";
                System.Data.DataSet dst = this.DBManager.ExecuteQuery(Sql, out err);
                if (dst != null && dst.Tables.Count == 1 && dst.Tables[0].Rows.Count > 0)
                {
                    dst.Tables[0].TableName = "KCJ_INLIST";
                    return new ReturnObject(dst);
                }
                return new ReturnObject(null);
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
                return new ReturnObject(null);
            }
        }
        public ReturnObject getBJZHForQuery(string sqlWhere, string sqlWhere1)
        {
            string strOut = "";
            string strSQLForRollPlan = "";
            try
            {
                string sql = "";
                System.Data.DataSet rtndst = new DataSet();
                System.Data.DataSet tmpdst = null;
                #region "订单信息"
                strSQLForRollPlan = "SELECT A.ORD_NO PACTNO,'' PACTINDEX,A.ORD_NO || A.ORD_SEQ ORDERNO,A.SPEC_STL_GRD STEELCODE,A.ORD_THK HEIGHT,A.ORD_WTH WIDTH,A.ORD_LEN LENGTH,A.ORD_CNT QUANTITY,ROUND(A.ORD_WGT*0.001,3) WEIGHT,ROUND(A.WGT_ACVAL_MIN*0.001,3) ||'~'||ROUND(A.WGT_ACVAL_MAX*0.001,3)  YDZ,TO_NUMBER(NULL) ZDBJKS,"
                                + "(CASE WHEN A.ORD_SEQ_PROG_CD = 'R' THEN '是' ELSE '否' END) ORDERSTATUS,TO_NUMBER(NULL) ZDBJZL,A.ORD_END_DATE CLOSETIME,TO_NUMBER(NULL) HTCKS,"
                                + "TO_NUMBER(NULL) HTCZL,a.ORD_DEVLMT_DATE SENDBEGINDATE,TO_NUMBER(NULL) KCJ_WEIGHT,TO_NUMBER(NULL) KCJ_QUANTITY,"
                                + "TO_NUMBER(NULL) THEORYQUANTITY,"
                                + "TO_NUMBER(NULL) THEORYWEIGHT,NVL(NULL,0) SENDQUANTITY,NVL(NULL,0) SENDWEIGHT,NVL(NULL,0) XJJL_WEIGHT,"
                                + "TO_NUMBER(NULL) KCZ_WEIGHT,TO_NUMBER(NULL) KCZ_QUANTITY,TO_NUMBER(NULL) ZL_QUANTITY,"
                                + "TO_NUMBER(NULL) ZL_WEIGHT,TO_NUMBER(NULL) CL_QUANTITY,TO_NUMBER(NULL) CL_WEIGHT,TO_NUMBER(NULL) HTL,TO_NUMBER(NULL) ZJK_KS,TO_NUMBER(NULL) ZJK_ZL,"
                                + "TO_NUMBER(NULL) M4_QUANTITY,TO_NUMBER(NULL) M4_WEIGHT,TO_NUMBER(NULL) M3_QUANTITY,"
                                + "TO_NUMBER(NULL) M3_WEIGHT,TO_NUMBER(NULL) ZSC_QUANTITY,TO_NUMBER(NULL) ZSC_WEIGHT "
                                + "FROM TBA01_ORD_LINE A,TBA01_ORD_COMM B WHERE A.ORD_NO = B.ORD_NO "
                                + " AND A.ORD_NO IN (SELECT ORD_NO FROM KCJ3_STUFFLIST_ZW WHERE ORD_NO=A.ORD_NO AND ORD_SEQ=A.ORD_SEQ)"
                                + sqlWhere;
                tmpdst = this.DBManager.ExecuteQuery(strSQLForRollPlan, out strOut);
                if (tmpdst != null && tmpdst.Tables.Count == 1 && tmpdst.Tables[0].Rows.Count > 0)
                {
                    tmpdst.Tables[0].PrimaryKey = new System.Data.DataColumn[] { tmpdst.Tables[0].Columns["ORDERNO"] };
                    tmpdst.Tables[0].TableName = "SEL_PACTDETAIL";
                    rtndst.Merge(tmpdst.Copy());
                }
                else
                {
                    return new ReturnObject(null);
                }
                #endregion
                #region "热轧钢卷在库量"
                tmpdst = null;
                //sql = "SELECT SUM(ROUND(B.ACT_WGT * 0.001,3)) KCH_WEIGHT, SUM(1) KCH_QUANTITY, A.ORD_NO || A.ORD_SEQ  ORDERNO  "
                //    + "FROM tbh07_bj_tranfinfo@LINK_SQ B, tba01_ord_line@LINK_SQ A,TBA01_ORD_COMM@LINK_SQ C  "
                //    + "WHERE B.ORD_NO || b.ORD_SEQ  = A.ORD_NO || a.ORD_SEQ  AND A.ORD_NO = C.ORD_NO(+) AND  C.PRDNM_CD IN ('KP','HK') "
                //    + "AND B.MOVE_ST <> '1'  "
                //    + sqlWhere1
                //    + "GROUP BY A.ORD_NO,A.ORD_SEQ ";
                //tmpdst = this.DBManager.ExecuteQuery(sql, out strOut);
                //if (tmpdst != null && tmpdst.Tables.Count == 1)
                //{
                //    tmpdst.Tables[0].PrimaryKey = new System.Data.DataColumn[] { tmpdst.Tables[0].Columns["ORDERNO"] };
                //    tmpdst.Tables[0].TableName = "SEL_PACTDETAIL";
                //    rtndst.Merge(tmpdst.Copy());
                //}
                #endregion
                #region "发运量"
                tmpdst = null;
                sql = "SELECT NVL(ROUND(SUM(B.ZSLAB_WEIGHT*0.001),3), 0) SENDWEIGHT,COUNT(1) SENDQUANTITY,NVL(ROUND(CASE WHEN NVL(SUM(B.XJJL_WEIGHT),0)=0  THEN SUM(CAL_WGT) ELSE SUM(B.XJJL_WEIGHT*0.001) END ,3), 0)XJJL_WEIGHT,A.ORD_NO || A.ORD_SEQ ORDERNO  "
                    + "FROM KCJ3_TURNOFFSENDLIST_ZW B,TBA01_ORD_LINE A,TBA01_ORD_COMM C  "
                    + "WHERE B.ORD_NO || B.ORD_SEQ = A.ORD_NO || A.ORD_SEQ AND B.ISVALID <> '0' AND (B.SENDTYPE='0' OR B.SENDTYPE='1') AND A.ORD_NO = C.ORD_NO(+)   "
                    + " "
                    + sqlWhere1
                    + "GROUP BY A.ORD_NO,A.ORD_SEQ";
                tmpdst = this.DBManager.ExecuteQuery(sql, out strOut);
                if (tmpdst != null && tmpdst.Tables.Count == 1)
                {
                    tmpdst.Tables[0].PrimaryKey = new System.Data.DataColumn[] { tmpdst.Tables[0].Columns["ORDERNO"] };
                    tmpdst.Tables[0].TableName = "SEL_PACTDETAIL";
                    rtndst.Merge(tmpdst.Copy());
                }
                #endregion
                #region "中间库：收集槽"
                tmpdst = null;
                sql = "   SELECT  b.ORD_NO || b.ORD_SEQ ORDERNO,COUNT(1) ZJK_KS,ROUND(SUM(b.ZSLAB_WEIGHT*0.001),3) ZJK_ZL     " +
                    "     FROM  KCJ3_ZY_TASKDETAIL_ZW  B,  TBA01_ORD_LINE  A   ,TBA01_ORD_COMM C " +
                    "   WHERE  A.ORD_NO ||A.ORD_SEQ   =  B.ORD_NO || B.ORD_SEQ  AND A.ORD_NO = C.ORD_NO(+)  " +

                    " 	  AND  b.TURNOFFCOLLECT_LOG  =  '0'   " +

                    sqlWhere1 +
                    " GROUP  BY b.ORD_NO,b.ORD_SEQ ";
                tmpdst = this.DBManager.ExecuteQuery(sql, out strOut);
                if (tmpdst != null && tmpdst.Tables.Count == 1)
                {
                    tmpdst.Tables[0].PrimaryKey = new System.Data.DataColumn[] { tmpdst.Tables[0].Columns["ORDERNO"] };
                    tmpdst.Tables[0].TableName = "SEL_PACTDETAIL";
                    rtndst.Merge(tmpdst.Copy());
                }
                #endregion
                #region "热轧转板加"
                //tmpdst = null;
                //sql = "SELECT SUM(ROUND(B.ACT_WGT * 0.001,3)) ZYDBJKDZL, SUM(1) KCH_QUANTITY, A.ORD_NO || A.ORD_SEQ  ORDERNO  "
                //    + "FROM tbh07_bj_tranfinfo@LINK_SQ B, tba01_ord_line@LINK_SQ A ,TBA01_ORD_COMM@LINK_SQ C  "
                //    + "WHERE B.ORD_NO || b.ORD_SEQ  = A.ORD_NO || a.ORD_SEQ AND A.ORD_NO = C.ORD_NO(+) AND  C.PRDNM_CD IN ('KP','HK')  "
                //    + "AND B.MOVE_ST = '1'  "
                //    + sqlWhere1
                //    + "GROUP BY A.ORD_NO,A.ORD_SEQ ";
                //tmpdst = this.DBManager.ExecuteQuery(sql, out strOut);
                //if (tmpdst != null && tmpdst.Tables.Count == 1)
                //{
                //    tmpdst.Tables[0].PrimaryKey = new System.Data.DataColumn[] { tmpdst.Tables[0].Columns["ORDERNO"] };
                //    tmpdst.Tables[0].TableName = "SEL_PACTDETAIL";
                //    rtndst.Merge(tmpdst.Copy());
                //}
                #endregion
                #region "板加成品量(在库、不在库)"
                tmpdst = null;
                sql = "SELECT ROUND(SUM(B.ZSLAB_WEIGHT * 0.001),3) ZSC_WEIGHT,SUM(1) ZSC_QUANTITY,A.ORD_NO || A.ORD_SEQ ORDERNO,"
                    + "SUM(CASE WHEN B.STORAGESTATUS='501602' THEN 1 ELSE 0 END) THEORYQUANTITY,"
                    + "ROUND(SUM(CASE WHEN B.STORAGESTATUS='501602' THEN ZSLAB_WEIGHT * 0.001 ELSE 0 END),3) THEORYWEIGHT "

                    + "FROM KCJ3_TURNOFFLIST_ZW B,TBA01_ORD_LINE A ,TBA01_ORD_COMM C "
                    + "WHERE B.ORD_NO || B.ORD_SEQ = A.ORD_NO || A.ORD_SEQ    AND A.ORD_NO = C.ORD_NO(+)  "

                    + sqlWhere1
                    + "GROUP BY A.ORD_NO,A.ORD_SEQ ";
                    
                tmpdst = this.DBManager.ExecuteQuery(sql, out strOut);
                if (tmpdst != null && tmpdst.Tables.Count == 1)
                {
                    tmpdst.Tables[0].PrimaryKey = new System.Data.DataColumn[] { tmpdst.Tables[0].Columns["ORDERNO"] };
                    tmpdst.Tables[0].TableName = "SEL_PACTDETAIL";
                    rtndst.Merge(tmpdst.Copy());
                }
                #endregion

                #region "原料量
                tmpdst = null;
                sql = "SELECT  "
                    + "SUM(CASE WHEN b.STORAGESTATUS='501002' THEN  ROUND(b.ACT_WGT  ,3) ELSE 0 END) KCJ_WEIGHT,"
                    + "SUM(CASE WHEN b.STORAGESTATUS='501002' THEN 1 ELSE 0 END) KCJ_QUANTITY,"
                    + "A.ORD_NO || A.ORD_SEQ ORDERNO "
                    + "FROM KCJ3_STUFFLIST_ZW B,TBA01_ORD_LINE A ,TBA01_ORD_COMM C "
                    + "WHERE B.ORD_NO || B.ORD_SEQ = A.ORD_NO || A.ORD_SEQ  AND A.ORD_NO = C.ORD_NO(+) "

                    + sqlWhere1
                    + "GROUP BY A.ORD_SEQ,A.ORD_NO";
                tmpdst = this.DBManager.ExecuteQuery(sql, out strOut);
                if (tmpdst != null && tmpdst.Tables.Count == 1)
                {
                    tmpdst.Tables[0].PrimaryKey = new System.Data.DataColumn[] { tmpdst.Tables[0].Columns["ORDERNO"] };
                    tmpdst.Tables[0].TableName = "SEL_PACTDETAIL";
                    rtndst.Merge(tmpdst.Copy());
                }
                #endregion
                #region "数据计算"
                foreach (System.Data.DataRow row in rtndst.Tables["SEL_PACTDETAIL"].Rows)
                {
                    row.BeginEdit();
                    string zl1, zl2, zl3 = "";
                    if (row["THEORYWEIGHT"].ToString() == "")
                    {
                        zl1 = "0";
                    }
                    else 
                    {
                        zl1 = row["THEORYWEIGHT"].ToString();
                    }
                    if (row["XJJL_WEIGHT"].ToString() == "")
                    {
                        zl2 = "0";
                    }
                    else
                    {
                        zl2 = row["XJJL_WEIGHT"].ToString();
                    }
                    if (row["WEIGHT"].ToString() == "")
                    {
                        zl3 = "0";
                    }
                    else
                    {
                        zl3 = row["WEIGHT"].ToString();
                    }
                    row["ZL_WEIGHT"] = Convert.ToDecimal(zl1) + Convert.ToDecimal(zl2);

                    row["CL_WEIGHT"] = Convert.ToDecimal(zl2) + Convert.ToDecimal(zl1) - Convert.ToDecimal(zl3);
                    if (Convert.ToDecimal(zl3) == 0)
                    {
                        row["HTL"] = 0;
                        
                    }
                    else
                    { row["HTL"] = Math.Round(((Convert.ToDecimal(zl2) + Convert.ToDecimal(zl1)) / (Convert.ToDecimal(zl3))) * 100, 3); }
                    //row["CL_QUANTITY"] = Convert.ToDecimal(row["SENDQUANTITY"]) - Convert.ToDecimal(row["QUANTITY"]);
                    row.EndEdit();
                }

           
               
                rtndst.AcceptChanges();
                return new ReturnObject(rtndst);
                #endregion
            }
            catch (Exception ex)
            {
                strOut = ex.Message;
                return new ReturnObject(null, strOut);
            }
        }
        public ReturnObject getAskQuery(string where)
        {
            try
            {
                string err = "";
                string CSql = "SELECT "
                             + " t.DLIV_DIRNO ASKPLAN_ID,"
                             + " a.ORD_NO PACTNO,"
                             + " c.SM_CFNM STATIONNAME ,"
                             + " d.CUST_NM INCEPTCORPNAME,a.SPEC_STL_GRD STEELCODE, decode(t.DLIV_TP,'T','火车','C','汽车')TRANSTYPE,t.DEPARTURE_CD LOADDOCK,"
                             + " (SELECT G.SM_CFNM FROM TBZ00_COMMCD@LINK_SQ  G WHERE G.LG_CD='A01009' AND G.SM_CD=t.arrival_cd)UNLOADDOCK, (SELECT SUM(ROUND(F.XJJL_WEIGHT * 0.001,3)) FROM KCJ3_TURNOFFSENDLIST F WHERE  T.DLIV_DIRNO= F.PLANVEHICLEID )SENDWEIGHT,(SELECT SUM(ROUND(F.Zslab_Weight * 0.001,3)) FROM KCJ3_TURNOFFSENDLIST F WHERE  T.DLIV_DIRNO= F.PLANVEHICLEID )SENDLL "
                             + " ,t.WEIGHT,e.SM_CFNM CATEGORY ,"
                             + " t.REMARK,"
                             + " t.DLIV_DIR_DATE "
                             + " from TBJ01_DLIV_DIR@LINK_SQ t, tba01_ord_line@LINK_SQ A, tbe02_ord_prc@LINK_SQ b,tbz00_commcd@LINK_SQ c,tbz00_customer@LINK_SQ d,tbz00_commcd@LINK_SQ e "
                             + " where t.ORDERNO = a.ORD_NO||a.ORD_SEQ and a.ORD_NO  = b.ORD_NO  and a.ORD_SEQ=b.ORD_SEQ"
                             + " and    t.DEST_PCD= c.SM_CD(+)   and t.ORD_CUST_CD= d.CUST_CD(+)  and A.ORD_USE_TP = e.SM_CD(+)  "
                             + " and T.ISPLAN='1' AND T.DLIV_PROG_CD='03'   "
                             + where
                             + " ";
               
                System.Data.DataSet tmpdst = this.DBManager.ExecuteQuery(CSql, out err);
                if (tmpdst != null && tmpdst.Tables.Count == 1 && tmpdst.Tables[0].Rows.Count > 0)
                {

                    return new ReturnObject(tmpdst);
                }
                return new ReturnObject(null);
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
                return new ReturnObject(null, 10000, ex.ToString());
            }
        }

        public ReturnObject getAskQuery_Train(string where,string plid)
        {
            try
            {
                string err = "";
                string CSql = "";
                if (plid == "4001PS1")
                {
                    CSql = "SELECT "
                             + " T.ASKPLAN_ID,DECODE(T.CARAFFIRM,'1',1,'2',1,'3',1,0)PLANQUANTITY,"
                             + "(SELECT TO_CHAR(PICKSTORAGETIME,'YYYY-MM-DD') FROM KCJ_TURNOFFSENDLIST WHERE PLANVEHICLEID=T.ASKPLAN_ID AND ISVALID <> '0' AND ROWNUM=1)PICKSTORAGETIME,"
                             + "(SELECT TRAINWAGON_NZ FROM KCJ_TURNOFFSENDLIST WHERE PLANVEHICLEID=T.ASKPLAN_ID AND ISVALID > '0' AND ROWNUM=1)TRAINWAGON_NZ,"
                             + "(SELECT TRAINWAGON FROM KCJ_TURNOFFSENDLIST WHERE PLANVEHICLEID=T.ASKPLAN_ID AND ISVALID > '0' AND ROWNUM=1)TRAINWAGON,"
                             + "(SELECT LISTNUMBER FROM KCJ_TURNOFFSENDLIST WHERE PLANVEHICLEID=T.ASKPLAN_ID AND ISVALID > '0' AND ROWNUM=1)LISTNUMBER,"
                             + "(SELECT COUNT(1) FROM KCJ_TURNOFFSENDLIST WHERE PLANVEHICLEID=T.ASKPLAN_ID AND ISVALID > '0' )KS,"
                             + " T.PACTNO PACTNO,"
                             + " C.STATIONNAME STATIONNAME ,"
                             + " A.INCEPTCORPNAME,T.STEELCODE STEELCODE, G.NAME_ TRANSTYPE, C.LOADDOCK,"
                             + " C.UNLOADDOCK,  "
                             + "(SELECT SUM(ROUND(F.WEIGHT,3)) FROM KCJ_TURNOFFSENDLIST F WHERE  T.ASKPLAN_ID= F.PLANVEHICLEID AND ISVALID > '0' )SENDWEIGHT,"
                             + "(SELECT SUM(ROUND(F.ADDWEIGHT ,3)) FROM KCJ_TURNOFFSENDLIST F WHERE  T.ASKPLAN_ID= F.PLANVEHICLEID AND ISVALID > '0')SENDLL "
                             + " ,t.WEIGHT,D.NAME_ CATEGORY ,"
                             + " t.REMARK,"
                             + " T.PLANDATE DLIV_DIR_DATE  "
                             + " FROM SEL_ASKVEHICLEPLANINFL T, SEL_INCEPTCORPINFO A,SEL_STATIONINFO C,SCM_BASE_INFO D,SCM_BASE_INFO G "
                             + " WHERE INSTR(T.LOADPOSITION, '1009JB') > 0 AND T.INCEPTCORPCODE = A.INCEPTCORPCODE(+)"
                             + " AND T.STATIONCODE = C.STATIONCODE(+) AND T.CARAFFIRM NOT IN ('4', '5', '0') AND T.CATEGORY = D.ID_(+)   "
                             + " AND T.TRANSTYPE = G.ID_(+)  AND T.AFFIRMSTATUS = '1'  "
                             + where
                             + " ";
                }
                else
                {
               
                CSql = "SELECT "
                             + " t.DLIV_DIRNO ASKPLAN_ID,1 PLANQUANTITY,"
                             + "(SELECT TO_CHAR(PICKSTORAGETIME,'YYYY-MM-DD') FROM KCJ3_TURNOFFSENDLIST WHERE PLANVEHICLEID=T.DLIV_DIRNO AND ISVALID <> '0' AND ROWNUM=1)PICKSTORAGETIME,"
                             + "(SELECT TRAINWAGON_NZ FROM KCJ3_TURNOFFSENDLIST WHERE PLANVEHICLEID=T.DLIV_DIRNO AND ISVALID > '0' AND ROWNUM=1)TRAINWAGON_NZ,"
                             + "(SELECT TRAINWAGON FROM KCJ3_TURNOFFSENDLIST WHERE PLANVEHICLEID=T.DLIV_DIRNO AND ISVALID > '0' AND ROWNUM=1)TRAINWAGON,"
                             + "(SELECT LISTNUMBER FROM KCJ3_TURNOFFSENDLIST WHERE PLANVEHICLEID=T.DLIV_DIRNO AND ISVALID > '0' AND ROWNUM=1)LISTNUMBER,"
                             + "(SELECT COUNT(1) FROM KCJ_TURNOFFSENDLIST WHERE PLANVEHICLEID=T.DLIV_DIRNO AND ISVALID > '0' )KS,"
                             + " a.ORD_NO PACTNO,"
                             + " c.SM_CFNM STATIONNAME ,"
                             + " d.CUST_NM INCEPTCORPNAME,a.SPEC_STL_GRD STEELCODE, decode(t.DLIV_TP,'T','火车','C','汽车')TRANSTYPE,t.DEPARTURE_CD LOADDOCK,"
                             + " (SELECT G.SM_CFNM FROM TBZ00_COMMCD@LINK_SQ  G WHERE G.LG_CD='A01009' AND G.SM_CD=t.arrival_cd)UNLOADDOCK, (SELECT SUM(ROUND(F.XJJL_WEIGHT * 0.001,3)) FROM KCJ3_TURNOFFSENDLIST F WHERE  T.DLIV_DIRNO= F.PLANVEHICLEID )SENDWEIGHT,(SELECT SUM(ROUND(F.Zslab_Weight * 0.001,3)) FROM KCJ3_TURNOFFSENDLIST F WHERE  T.DLIV_DIRNO= F.PLANVEHICLEID )SENDLL "
                             + " ,t.WEIGHT,e.SM_CFNM CATEGORY ,"
                             + " t.REMARK,"
                             + " t.DLIV_DIR_DATE "
                             + " from TBJ01_DLIV_DIR@LINK_SQ t, tba01_ord_line@LINK_SQ A, tbe02_ord_prc@LINK_SQ b,tbz00_commcd@LINK_SQ c,tbz00_customer@LINK_SQ d,tbz00_commcd@LINK_SQ e "
                             + " where t.ORDERNO = a.ORD_NO||a.ORD_SEQ and a.ORD_NO  = b.ORD_NO  and a.ORD_SEQ=b.ORD_SEQ"
                             + " and    t.DEST_PCD= c.SM_CD(+)   and t.ORD_CUST_CD= d.CUST_CD(+)  and A.ORD_USE_TP = e.SM_CD(+)  "
                             + " and T.ISPLAN='1' AND T.DLIV_PROG_CD='03'   AND T.DLIV_TP='T'  "
                             + where
                             + " ";
            }

                System.Data.DataSet tmpdst = this.DBManager.ExecuteQuery(CSql, out err);
                if (tmpdst != null )
                {

                    return new ReturnObject(tmpdst);
                }
                return new ReturnObject(null);
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
                return new ReturnObject(null, 10000, ex.ToString());
            }
        }

        public ReturnObject getQuery(string where)
        {
            try
            {
                string err = "";
                string CSql = "SELECT "
                             + " PICKSTORAGETIME,"
                             + " TRAINWAGON_NZ,"
                             + " LISTNUMBER ,"
                             + " PLANVEHICLEID,"
                             + " PICKSTORAGETIME_TRAIN, "
                             + " TRAINWAGON ,"
                             + " PICKSTORAGEMAN_TRAIN,"
                             + " c2n(CLASSORDER)CLASSORDER,c2n(CLASSTEAM)CLASSTEAM,CAL_WGT,XJJL_WEIGHT,c2n(PLINE)PLINE "
                             + " from KCJ3_TURNOFFSNED_TRAIN "
                             + where
                             + " ";

                System.Data.DataSet tmpdst = this.DBManager.ExecuteQuery(CSql, out err);
                if (tmpdst != null )
                {

                    return new ReturnObject(tmpdst);
                }
                return new ReturnObject(null);
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
                return new ReturnObject(null, 10000, ex.ToString());
            }
        }

        public ReturnObject Rpt_Product_6_Query(string strTimeFrom, string strTimeTo, string strK, string strTimeToMouth,string strTimeFromKP, string strTimeToKP, string strKkp, string strTimeToMouthKP)
        {
            string sqlstr = " ";
            string strOut = "";
            System.Data.DataSet rtndst = new DataSet();
            System.Data.DataSet tmpdst = null;
            //sqlstr = " select '01' rowindex, '4米线' zb,  "
            //       + " round(sum(case when b.area = '1#库' and a.INTIME " + strTimeFrom + "  then THEORYWEIGHT  else   0 end),3) YLRKL "
            //       + " from KCJ_STORAGELIST a,KCJ_STORAGEBUTTRESSLIST b WHERE A.BILLETID = B.BILLETID  "
            //       + " and A.INTIME " + strK
            //       + " UNION select '02' rowindex, '3.2米线' zb,  "
            //       + " round(sum(case when b.area = '2#库' and a.INTIME " + strTimeFrom + "  then THEORYWEIGHT  else   0 end),3) YLRKL "
            //       + " from KCJ_STORAGELIST a,KCJ_STORAGEBUTTRESSLIST b WHERE A.BILLETID = B.BILLETID  "
            //       + " and A.INTIME " + strK
            //       + " UNION select '03' rowindex, '特厚板线' zb,  "
            //       + " round(sum(case when b.area = '5#库' and a.INTIME " + strTimeFrom + "  then THEORYWEIGHT  else   0 end),3) YLRKL "
            //       + " from KCJ_STORAGELIST a,KCJ_STORAGEBUTTRESSLIST b WHERE A.BILLETID = B.BILLETID  "
            //       + " and A.INTIME " + strK
            //       + " UNION select '04' rowindex, '合计' zb,  "
            //       + " round(sum(case when  a.INTIME " + strTimeFrom + "  then THEORYWEIGHT  else   0 end),3) YLRKL "
            //       + " from KCJ_STORAGELIST a,KCJ_STORAGEBUTTRESSLIST b WHERE A.BILLETID = B.BILLETID  "
            //       + " and A.INTIME " + strK
            //       + " UNION select '05' rowindex, '月累' zb,  "
            //       + " round(sum(case when a.INTIME " + strTimeTo + " then  THEORYWEIGHT else 0 end),3) YLRKL "
            //       + " from KCJ_STORAGELIST a,KCJ_STORAGEBUTTRESSLIST b WHERE A.BILLETID = B.BILLETID  "
            //       + " and A.INTIME " + strK;

            sqlstr = "   select '01' rowindex, '4米线' zb,SUM(YLRKL)YLRKL, SUM(YLKC)YLKC,SUM(CPKC)CPKC,SUM(CPFY)CPFY,SUM(CL)CL FROM ( select '01' rowindex, '4米线' zb,round(sum(case "
                     +"  when b.area = '1#库' and a.INTIME " + strTimeFrom + "  then THEORYWEIGHT  else   0 end),3) YLRKL, "
                     +"  0 YLKC,0 CPKC,0 CPFY,0 CL from KCJ_STORAGELIST a, KCJ_STORAGEBUTTRESSLIST b "
                     +"  WHERE A.BILLETID = B.BILLETID and A.INTIME " + strK + " union "
                     + " select '01' rowindex,'4米线' zb,0 YLRKL,round(sum(case when b.area = '1#库' and C.SENDBEGINDATE " + strTimeToMouth + " "
                     + " then THEORYWEIGHT else 0 end), 3) YLKC,0 CPKC,0 CPFY,0 CL from KCJ_STORAGELIST a, KCJ_STORAGEBUTTRESSLIST b, SEL_PACTDETAIL C "
                     + " WHERE A.BILLETID = B.BILLETID AND A.ORDERNO = C.ORDERNO AND A.STORAGESTATUS = '501002' "
                     + " and C.SENDBEGINDATE " + strTimeToMouth + " union "
                     + " select '01' rowindex,'4米线' zb,0 YLRKL,0 YLKC,round(sum(case when b.area = '1#库' and  C.SENDBEGINDATE " + strTimeToMouth + " "
                     + " then THEORYWEIGHT else 0 end), 3) CPKC,0 CPFY,0 CL from KCJ_TURNOFFLIST a, KCJ_TURNOFFBUTTRESSLIST b, SEL_PACTDETAIL C "
                     + " WHERE A.BILLETID = B.BILLETID AND A.ORDERNO = C.ORDERNO  AND A.STORAGESTATUS = '501602' and C.SENDBEGINDATE " + strTimeToMouth + ""
                     + " UNION select '01' rowindex,'4米线' zb,0 YLRKL,0 YLKC,0 CPKC,sum(case when a.area = '1#库' and A.CHUENDTIME " + strTimeFrom + " then A.THEORYWEIGHT else 0 end) CPFY,0 CL "
                     + " from KCJ_TURNOFFLIST a where  A.STORAGESTATUS='501601' "
                     + " UNION  select '01' rowindex,'4米线' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,sum(case when b.PROCESS_LINE = '801001' and c.PTIME " + strTimeFrom + " "
                     + " then B.THEORYWEIGHT  else 0 end) CL from KCJ_ZY_TASKDETAIL B,KCJ_TURNOFFLIST C where "
                     + " B.BILLETID=C.BILLETID AND  C.PTIME "+strK+")" ;
            


            tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            if (tmpdst != null)
            {
                rtndst.Merge(tmpdst.Copy());
                tmpdst = null;
            }
            else
            {
                return new ReturnObject(null, strOut);
            }
            sqlstr = "   select '02' rowindex, '3.2米线' zb,SUM(YLRKL)YLRKL, SUM(YLKC)YLKC,SUM(CPKC)CPKC,SUM(CPFY)CPFY,SUM(CL)CL FROM ( select '02' rowindex, '3.2米线' zb,round(sum(case "
               + "       when b.area = '2#库' and a.INTIME " + strTimeFrom + "  then THEORYWEIGHT  else   0 end),3) YLRKL, "
               + "       0 YLKC,0 CPKC,0 CPFY,0 CL from KCJ_STORAGELIST a, KCJ_STORAGEBUTTRESSLIST b "
               + "       WHERE A.BILLETID = B.BILLETID and A.INTIME " + strK + " union "
               + "       select '02' rowindex,'3.2米线' zb,0 YLRKL,round(sum(case when b.area = '2#库' and C.SENDBEGINDATE " + strTimeToMouth + " "
               + "       then THEORYWEIGHT else 0 end), 3) YLKC,0 CPKC,0 CPFY,0 CL from KCJ_STORAGELIST a, KCJ_STORAGEBUTTRESSLIST b, SEL_PACTDETAIL C "
               + "       WHERE A.BILLETID = B.BILLETID AND A.ORDERNO = C.ORDERNO AND A.STORAGESTATUS = '501002' "
               + "       and C.SENDBEGINDATE " + strTimeToMouth + " union "
               + "       select '02' rowindex,'3.2米线' zb,0 YLRKL,0 YLKC,round(sum(case when b.area = '2#库' and  C.SENDBEGINDATE " + strTimeToMouth + " "
               + "       then THEORYWEIGHT else 0 end), 3) CPKC,0 CPFY,0 CL from KCJ_TURNOFFLIST a, KCJ_TURNOFFBUTTRESSLIST b, SEL_PACTDETAIL C "
               + "       WHERE A.BILLETID = B.BILLETID AND A.ORDERNO = C.ORDERNO  AND A.STORAGESTATUS = '501602' and C.SENDBEGINDATE " + strTimeToMouth + ""
               + "       UNION select '02' rowindex,'3.2米线' zb,0 YLRKL,0 YLKC,0 CPKC,sum(case when a.area = '2#库' and A.CHUENDTIME " + strTimeFrom + " then A.THEORYWEIGHT else 0 end) CPFY,0 CL "
               + "       from KCJ_TURNOFFLIST a where  A.STORAGESTATUS='501601' "
               + "       UNION  select '02' rowindex,'3.2米线' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,sum(case when b.PROCESS_LINE = '801002' and c.PTIME " + strTimeFrom + " "
               + "       then B.THEORYWEIGHT  else 0 end) CL from KCJ_ZY_TASKDETAIL B,KCJ_TURNOFFLIST C where "
               + "       B.BILLETID=C.BILLETID AND  C.PTIME " + strK + ")";

            tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            if (tmpdst != null)
            {
                rtndst.Merge(tmpdst.Copy());
                tmpdst = null;
            }
            else
            {
                return new ReturnObject(null, strOut);
            }
            sqlstr = "          select '03' rowindex, '特厚板线' zb,SUM(YLRKL)YLRKL, SUM(YLKC)YLKC,SUM(CPKC)CPKC,SUM(CPFY)CPFY,SUM(CL)CL FROM ( select '03' rowindex, '特厚板线' zb,round(sum(case "
                       + "       when b.area = '5#库' and a.INTIME " + strTimeFrom + "  then THEORYWEIGHT  else   0 end),3) YLRKL, "
                       + "       0 YLKC,0 CPKC,0 CPFY,0 CL from KCJ_STORAGELIST a, KCJ_STORAGEBUTTRESSLIST b "
                       + "       WHERE A.BILLETID = B.BILLETID and A.INTIME " + strK + " union "
                       + "       select '03' rowindex,'特厚板线' zb,0 YLRKL,round(sum(case when b.area = '5#库' and C.SENDBEGINDATE " + strTimeToMouth + " "
                       + "       then THEORYWEIGHT else 0 end), 3) YLKC,0 CPKC,0 CPFY,0 CL from KCJ_STORAGELIST a, KCJ_STORAGEBUTTRESSLIST b, SEL_PACTDETAIL C "
                       + "       WHERE A.BILLETID = B.BILLETID AND A.ORDERNO = C.ORDERNO AND A.STORAGESTATUS = '501002' "
                       + "       and C.SENDBEGINDATE " + strTimeToMouth + " union "
                       + "       select '03' rowindex,'特厚板线' zb,0 YLRKL,0 YLKC,round(sum(case when b.area = '5#库' and  C.SENDBEGINDATE " + strTimeToMouth + " "
                       + "       then THEORYWEIGHT else 0 end), 3) CPKC,0 CPFY,0 CL from KCJ_TURNOFFLIST a, KCJ_TURNOFFBUTTRESSLIST b, SEL_PACTDETAIL C "
                       + "       WHERE A.BILLETID = B.BILLETID AND A.ORDERNO = C.ORDERNO  AND A.STORAGESTATUS = '501602' and C.SENDBEGINDATE " + strTimeToMouth + ""
                       + "       UNION select '03' rowindex,'特厚板线' zb,0 YLRKL,0 YLKC,0 CPKC,sum(case when a.area = '5#库' and A.CHUENDTIME " + strTimeFrom + " then A.THEORYWEIGHT else 0 end) CPFY,0 CL "
                       + "       from KCJ_TURNOFFLIST a where  A.STORAGESTATUS='501601' "
                       + "       UNION  select '03' rowindex,'特厚板线' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,sum(case when b.PROCESS_LINE = '801005' and c.PTIME " + strTimeFrom + " "
                       + "       then B.THEORYWEIGHT  else 0 end) CL from KCJ_ZY_TASKDETAIL B,KCJ_TURNOFFLIST C where "
                       + "       B.BILLETID=C.BILLETID AND  C.PTIME " + strK + ")";



            tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            if (tmpdst != null)
            {
                rtndst.Merge(tmpdst.Copy());
                tmpdst = null;
            }
            else
            {
                return new ReturnObject(null, strOut);
            }

            sqlstr = "          select '04' rowindex, '合计' zb,SUM(YLRKL)YLRKL, SUM(YLKC)YLKC,SUM(CPKC)CPKC,SUM(CPFY)CPFY,SUM(CL)CL FROM ( select '04' rowindex, '合计' zb,round(sum(case "
                      + "       when  a.INTIME " + strTimeFrom + "  then THEORYWEIGHT  else   0 end),3) YLRKL, "
                      + "       0 YLKC,0 CPKC,0 CPFY,0 CL from KCJ_STORAGELIST a, KCJ_STORAGEBUTTRESSLIST b "
                      + "       WHERE A.BILLETID = B.BILLETID and A.INTIME " + strK + " union "
                      + "       select '04' rowindex,'合计' zb,0 YLRKL,round(sum(case when  C.SENDBEGINDATE " + strTimeToMouth + " "
                      + "       then THEORYWEIGHT else 0 end), 3) YLKC,0 CPKC,0 CPFY,0 CL from KCJ_STORAGELIST a, KCJ_STORAGEBUTTRESSLIST b, SEL_PACTDETAIL C "
                      + "       WHERE A.BILLETID = B.BILLETID AND A.ORDERNO = C.ORDERNO AND A.STORAGESTATUS = '501002' "
                      + "       and C.SENDBEGINDATE " + strTimeToMouth + " union "
                      + "       select '04' rowindex,'合计' zb,0 YLRKL,0 YLKC,round(sum(case when   C.SENDBEGINDATE " + strTimeToMouth + " "
                      + "       then THEORYWEIGHT else 0 end), 3) CPKC,0 CPFY,0 CL from KCJ_TURNOFFLIST a, KCJ_TURNOFFBUTTRESSLIST b, SEL_PACTDETAIL C "
                      + "       WHERE A.BILLETID = B.BILLETID AND A.ORDERNO = C.ORDERNO  AND A.STORAGESTATUS = '501602' and C.SENDBEGINDATE " + strTimeToMouth + ""
                      + "       UNION select '04' rowindex,'合计' zb,0 YLRKL,0 YLKC,0 CPKC,sum(case when  A.CHUENDTIME " + strTimeFrom + " then A.THEORYWEIGHT else 0 end) CPFY,0 CL "
                      + "       from KCJ_TURNOFFLIST a where  A.STORAGESTATUS='501601' "
                      + "       UNION  select '04' rowindex,'合计' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,sum(case when  c.PTIME " + strTimeFrom + " "
                      + "       then B.THEORYWEIGHT  else 0 end) CL from KCJ_ZY_TASKDETAIL B,KCJ_TURNOFFLIST C where "
                      + "       B.BILLETID=C.BILLETID AND  C.PTIME " + strK + ")";



            tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            if (tmpdst != null)
            {
                rtndst.Merge(tmpdst.Copy());
                tmpdst = null;
            }
            else
            {
                return new ReturnObject(null, strOut);
            }

            sqlstr = " select '05' rowindex, '月累' zb,SUM(YLRKL)YLRKL, SUM(YLKC)YLKC,SUM(CPKC)CPKC,SUM(CPFY)CPFY,SUM(CL)CL FROM ( select '05' rowindex, '月累' zb,round(sum(case "
             + "       when  a.INTIME " + strK + "  then THEORYWEIGHT  else   0 end),3) YLRKL, "
             + "       0 YLKC,0 CPKC,0 CPFY,0 CL from KCJ_STORAGELIST a, KCJ_STORAGEBUTTRESSLIST b "
             + "       WHERE A.BILLETID = B.BILLETID and A.INTIME " + strK + " union "
             + "       select '05' rowindex,'月累' zb,0 YLRKL,round(sum(case when  C.SENDBEGINDATE " + strTimeToMouth + " "
             + "       then THEORYWEIGHT else 0 end), 3) YLKC,0 CPKC,0 CPFY,0 CL from KCJ_STORAGELIST a, KCJ_STORAGEBUTTRESSLIST b, SEL_PACTDETAIL C "
             + "       WHERE A.BILLETID = B.BILLETID AND A.ORDERNO = C.ORDERNO AND A.STORAGESTATUS = '501002' "
             + "       and C.SENDBEGINDATE " + strTimeToMouth + " union "
             + "       select '05' rowindex,'月累' zb,0 YLRKL,0 YLKC,round(sum(case when   C.SENDBEGINDATE " + strTimeToMouth + " "
             + "       then THEORYWEIGHT else 0 end), 3) CPKC,0 CPFY,0 CL from KCJ_TURNOFFLIST a, KCJ_TURNOFFBUTTRESSLIST b, SEL_PACTDETAIL C "
             + "       WHERE A.BILLETID = B.BILLETID AND A.ORDERNO = C.ORDERNO  AND A.STORAGESTATUS = '501602' and C.SENDBEGINDATE " + strTimeToMouth + ""
             + "       UNION select '05' rowindex,'月累' zb,0 YLRKL,0 YLKC,0 CPKC,sum(case when  A.CHUENDTIME " + strK + " then A.THEORYWEIGHT else 0 end) CPFY,0 CL "
             + "       from KCJ_TURNOFFLIST a where   A.STORAGESTATUS='501601' "
             + "       UNION  select '05' rowindex,'月累' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,sum(case when  c.PTIME " + strK + " "
             + "       then B.THEORYWEIGHT  else 0 end) CL from KCJ_ZY_TASKDETAIL B,KCJ_TURNOFFLIST C where "
             + "       B.BILLETID=C.BILLETID AND  C.PTIME " + strK + ")";



            tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            if (tmpdst != null)
            {
                rtndst.Merge(tmpdst.Copy());
                tmpdst = null;
            }
            else
            {
                return new ReturnObject(null, strOut);
            }


            sqlstr = "   select '06' rowindex, '3#库' zb,SUM(YLRKL)YLRKL, SUM(YLKC)YLKC,SUM(CPKC)CPKC,SUM(CPFY)CPFY,SUM(CL)CL,SUM(GZSJ)GZSJ,SUM(JHSJ-SJSJ)TCSJ,ROUND(CASE WHEN SUM(SJSJ)!=0 THEN ((SUM(SJSJ) - SUM(GZSJ)) / SUM(SJSJ)) * 100 ELSE 0 END ,2)SBZYL,ROUND(CASE WHEN SUM(TRL)!=0 THEN (SUM(JQYL) / SUM(TRL)) * 100 ELSE 0 END ,2) CCL FROM ( select '06' rowindex, '3#库' zb,round(sum(case "
         + "             when a.AREA = '3#库' and a.INTIME " + strTimeFromKP + "  then ROUND(ACT_WGT/1000,2)  else   0 end),3) YLRKL, "
         + "             0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL from KCJ3_STUFFLIST a"
         + "             WHERE  A.INTIME " + strKkp + " union "


         + "             select '06' rowindex, '3#库' zb,0 YLRKL ,round(sum(case when a.AREA = '3#库' and a.INTIME " + strTimeFromKP + "  "
         + "             then ROUND(ACT_WGT/1000,2)  else   0 end),3) YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL  FROM KCJ3_STUFFLIST A  "
         + "             WHERE   A.STORAGESTATUS='501002' AND A.ISVALID='1'  AND A.ORD_NO <>'9999' AND A.INTIME " + strKkp + "  "
         + "             union "


         + "             SELECT '06' rowindex, '3#库' zb,0 YLRKL,0 YLKC,round(sum(case when B.AREA = '3#库' and a.CREATETIME " + strTimeFromKP + " "
         + "             then ROUND(A.ZSLAB_WEIGHT*0.001,3)  else   0 end),3) CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL FROM KCJ3_TURNOFFLIST A ,KCJ3_TURNOFFBUTTRESSLIST B "
         + "             WHERE A.COIL_NO_ID=B.COIL_NO_ID AND A.STORAGESTATUS='501602' AND ISVALID='1' AND A.COIL_NO_ID LIKE 'R%'  AND A.ORD_NO <>'9999' and A.CREATETIME " + strKkp + ""


         + "             UNION select '06' rowindex, '3#库' zb,0 YLRKL,0 YLKC,0 CPKC,ROUND(sum(case when B.AREA = '3#库' and A.PICKSTORAGETIME " + strTimeFrom + " then ROUND(A.ZSLAB_WEIGHT*0.001,3)  else   0 end),3)  CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL "
         + "             FROM KCJ3_TURNOFFSENDLIST A, KCJ3_TURNOFFBUTTRESSLIST B  WHERE A.COIL_NO_ID=B.COIL_NO_ID  AND A.PICKSTORAGETIME " + strKkp + ""


         + "             UNION  select '06' rowindex, '3#库' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,sum(case  when B.AREA = '3#库' and a.PCTIME " + strTimeFromKP + " "
         + "             then ROUND(A.ZSLAB_WEIGHT*0.001,3)  else 0 end) CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL  FROM KCJ3_ZY_TASKDETAIL A ,KCJ3_STUFFBUTTRESSLIST B  "
         + "             where A.OLD_SAMPL_NO=B.OLD_SAMPL_NO and b.AREA='3#库' AND  A.PCTIME " + strKkp + ""

         + "             UNION  select '06' rowindex, '3#库' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,sum(case  when B.PLINE IN('8055003','8055002','8055001') and B.PRODUCTTIME " + strTimeFromKP + " "
         + "             then GZ_XHSJ  else 0 end) GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL  FROM BJ_JBGZ B  "
         + "             where   B.GZ_NAME IN('0','1') AND B.PRODUCTTIME " + strKkp + ""



         + "             UNION  select '06' rowindex, '3#库' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,sum(case  when B.PRESSLINE IN('8055003','8055002','8055001') and B.PRODUCTTIME " + strTimeFromKP + " "
         + "             then PLANTAKETIME  else 0 end) JHSJ,0 SJSJ,0 JQYL,0 TRL  FROM BJ3_DATAFORRPT B  "
         + "             where  B.PRODUCTTIME " + strKkp + ""


         + "             UNION  select '06' rowindex, '3#库' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,sum(case  when B.PRESSLINE IN('8055003','8055002','8055001') and B.PRODUCTTIME " + strTimeFromKP + " "
         + "             then ACTUALTAKETIME  else 0 end) SJSJ,0 JQYL,0 TRL  FROM BJ3_DATAFORRPT B "
         + "             where  B.PRODUCTTIME " + strKkp + ""

         + "             UNION  select '06' rowindex, '3#库' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,round(sum(case  when A.AREA='3#库' and B.PCTIME " + strTimeFromKP + " "
         + "             then b.ZSLAB_WEIGHT * 0.001  else 0 end),3) JQYL,0 TRL  FROM KCJ3_ZY_TASKDETAIL b,KCJ3_STUFFBUTTRESSLIST a where b.OLD_SAMPL_NO = a.OLD_SAMPL_NO  "
         + "             AND   B.PCTIME " + strKkp + ""

         + "             UNION  select '06' rowindex, '3#库' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,round(sum(case  when A.AREA='3#库' and B.STTIME " + strTimeFromKP + " "
         + "             then b.act_wgt * 0.001  else 0 end),3) TRL  FROM KCJ3_ZY_PLAN b, KCJ3_STUFFBUTTRESSLIST a where b.OLD_SAMPL_NO = a.OLD_SAMPL_NO AND b.DOWN_FLAG = '1' AND B.AFFIRLOG ='1'  "
         + "             AND   B.STTIME " + strKkp + ")";



            tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            if (tmpdst != null)
            {
                rtndst.Merge(tmpdst.Copy());
                tmpdst = null;
            }
            else
            {
                return new ReturnObject(null, strOut);
            }


            sqlstr = "   select '07' rowindex, '4#库' zb,SUM(YLRKL)YLRKL, SUM(YLKC)YLKC,SUM(CPKC)CPKC,SUM(CPFY)CPFY,SUM(CL)CL,SUM(GZSJ)GZSJ,SUM(JHSJ-SJSJ)TCSJ,ROUND(CASE WHEN SUM(SJSJ)!=0 THEN ((SUM(SJSJ) - SUM(GZSJ)) / SUM(SJSJ)) * 100 ELSE 0 END ,2)SBZYL,ROUND(CASE WHEN SUM(TRL)!=0 THEN (SUM(JQYL) / SUM(TRL)) * 100 ELSE 0 END ,2) CCL FROM ( select '07' rowindex, '4#库' zb,round(sum(case "
+ "                      when a.AREA = '4#库' and a.INTIME " + strTimeFromKP + "  then ROUND(ACT_WGT/1000,2)  else   0 end),3) YLRKL, "
+ "                      0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL from KCJ3_STUFFLIST a"
+ "                      WHERE  A.INTIME " + strKkp + " union "


+ "                      select '07' rowindex, '4#库' zb,0 YLRKL ,round(sum(case when a.AREA = '4#库' and a.INTIME " + strTimeFromKP + "  "
+ "                      then ROUND(ACT_WGT/1000,2)  else   0 end),3) YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL  FROM KCJ3_STUFFLIST A  "
+ "                      WHERE   A.STORAGESTATUS='501002' AND A.ISVALID='1'  AND A.ORD_NO <>'9999' AND A.INTIME " + strKkp + "  "


+ "                      union "


+ "                      SELECT '07' rowindex, '4#库' zb,0 YLRKL,0 YLKC,round(sum(case when B.AREA = '4#库' and a.CREATETIME " + strTimeFromKP + " "
+ "                      then ROUND(A.ZSLAB_WEIGHT*0.001,3)  else   0 end),3) CPKC,0 CPFY,0 CL ,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL FROM KCJ3_TURNOFFLIST A ,KCJ3_TURNOFFBUTTRESSLIST B "
+ "                      WHERE A.COIL_NO_ID=B.COIL_NO_ID AND A.STORAGESTATUS='501602' AND ISVALID='1' AND A.COIL_NO_ID LIKE 'R%'  AND A.ORD_NO <>'9999' and A.CREATETIME " + strKkp + ""



+ "                      UNION select '07' rowindex, '4#库' zb,0 YLRKL,0 YLKC,0 CPKC,ROUND(sum(case when B.AREA = '4#库' and A.PICKSTORAGETIME " + strTimeFrom + " then ROUND(A.ZSLAB_WEIGHT*0.001,3)  else   0 end),3)  CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL "
+ "                      FROM KCJ3_TURNOFFSENDLIST A, KCJ3_TURNOFFBUTTRESSLIST B  WHERE A.COIL_NO_ID=B.COIL_NO_ID  AND A.PICKSTORAGETIME " + strKkp + ""


+ "                      UNION  select '07' rowindex, '4#库' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,sum(case  when B.AREA = '4#库' and a.PCTIME " + strTimeFromKP + " "
+ "                      then ROUND(A.ZSLAB_WEIGHT*0.001,3)  else 0 end) CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL  FROM KCJ3_ZY_TASKDETAIL A ,KCJ3_STUFFBUTTRESSLIST B  "
+ "                      where A.OLD_SAMPL_NO=B.OLD_SAMPL_NO and b.AREA='4#库' AND  A.PCTIME " + strKkp + ""


+ "                      UNION  select '07' rowindex, '4#库' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,sum(case  when B.PLINE IN('8066001','8066002') and B.PRODUCTTIME " + strTimeFromKP + " "
+ "                      then GZ_XHSJ  else 0 end) GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL  FROM BJ_JBGZ B  "
+ "                      where  B.GZ_NAME IN('0','1') AND B.PRODUCTTIME " + strKkp + ""

+ "                      UNION  select '07' rowindex, '4#库' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,sum(case  when B.PRESSLINE IN('8066001','8066002') and B.PRODUCTTIME " + strTimeFromKP + " "
+ "                      then PLANTAKETIME  else 0 end) JHSJ,0 SJSJ ,0 JQYL,0 TRL FROM BJ3_DATAFORRPT B  "
+ "                      where  B.PRODUCTTIME " + strKkp + ""


+ "                      UNION  select '07' rowindex, '4#库' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,sum(case  when B.PRESSLINE IN('8066001','8066002') and B.PRODUCTTIME " + strTimeFromKP + " "
+ "                      then ACTUALTAKETIME  else 0 end) SJSJ,0 JQYL,0 TRL  FROM BJ3_DATAFORRPT B "
+ "                      where  B.PRODUCTTIME " + strKkp + ""

+ "                      UNION  select '07' rowindex, '4#库' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,round(sum(case  when A.AREA='4#库' and B.PCTIME " + strTimeFromKP + " "
+ "                      then b.ZSLAB_WEIGHT * 0.001  else 0 end),3) JQYL,0 TRL  FROM KCJ3_ZY_TASKDETAIL b,KCJ3_STUFFBUTTRESSLIST a where b.OLD_SAMPL_NO = a.OLD_SAMPL_NO  "
+ "                      AND   B.PCTIME " + strKkp + ""

+ "                      UNION  select '07' rowindex, '4#库' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,round(sum(case  when A.AREA='4#库' and B.STTIME " + strTimeFromKP + " "
+ "                      then b.act_wgt * 0.001  else 0 end),3) TRL  FROM KCJ3_ZY_PLAN b, KCJ3_STUFFBUTTRESSLIST a where b.OLD_SAMPL_NO = a.OLD_SAMPL_NO AND b.DOWN_FLAG = '1' AND B.AFFIRLOG ='1'  "
+ "                      AND   B.STTIME " + strKkp + ")";



            tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            if (tmpdst != null)
            {
                rtndst.Merge(tmpdst.Copy());
                tmpdst = null;
            }
            else
            {
                return new ReturnObject(null, strOut);
            }


            sqlstr = "   select '08' rowindex, '合计' zb,SUM(YLRKL)YLRKL, SUM(YLKC)YLKC,SUM(CPKC)CPKC,SUM(CPFY)CPFY,SUM(CL)CL,SUM(GZSJ)GZSJ,SUM(JHSJ-SJSJ)TCSJ,ROUND(CASE WHEN SUM(SJSJ)!=0 THEN ((SUM(SJSJ) - SUM(GZSJ)) / SUM(SJSJ)) * 100 ELSE 0 END ,2)SBZYL,ROUND(CASE WHEN SUM(TRL)!=0 THEN (SUM(JQYL) / SUM(TRL)) * 100 ELSE 0 END ,2) CCL FROM ( select '08' rowindex, '合计' zb,round(sum(case "
    + "                  when  a.INTIME " + strTimeFromKP + "  then ROUND(ACT_WGT/1000,2)  else   0 end),3) YLRKL, "
    + "                  0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL from KCJ3_STUFFLIST a"
    + "                  WHERE  A.INTIME " + strKkp + " union "


    + "                  select '08' rowindex, '合计' zb,0 YLRKL ,round(sum(case when  a.INTIME " + strTimeFromKP + "  "
    + "                  then ROUND(ACT_WGT/1000,2)  else   0 end),3) YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL  FROM KCJ3_STUFFLIST A  "
    + "                  WHERE   A.STORAGESTATUS='501002' AND A.ISVALID='1'  AND A.ORD_NO <>'9999' AND A.INTIME " + strKkp + "  "
    + "                  union "



    + "                  select '08' rowindex, '合计' zb,0 YLRKL,0 YLKC,round(sum(case when  a.CREATETIME " + strTimeFromKP + " "
    + "                  then ROUND(A.ZSLAB_WEIGHT*0.001,3)  else   0 end),3) CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL FROM KCJ3_TURNOFFLIST A ,KCJ3_TURNOFFBUTTRESSLIST B "
    + "                  WHERE A.COIL_NO_ID=B.COIL_NO_ID AND A.STORAGESTATUS='501602' AND ISVALID='1' AND A.COIL_NO_ID LIKE 'R%'  AND A.ORD_NO <>'9999' and A.CREATETIME " + strKkp + ""


    + "                  UNION select '08' rowindex, '合计' zb,0 YLRKL,0 YLKC,0 CPKC,ROUND(sum(case when  A.PICKSTORAGETIME " + strTimeFrom + " then ROUND(A.ZSLAB_WEIGHT*0.001,3)  else   0 end),3)  CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL "
    + "                  FROM KCJ3_TURNOFFSENDLIST A, KCJ3_TURNOFFBUTTRESSLIST B  WHERE A.COIL_NO_ID=B.COIL_NO_ID  AND A.PICKSTORAGETIME " + strKkp + ""

    + "                  UNION  select '08' rowindex, '合计' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,sum(case  when  a.PCTIME " + strTimeFromKP + " "
    + "                  then ROUND(A.ZSLAB_WEIGHT*0.001,3)  else 0 end) CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL  FROM KCJ3_ZY_TASKDETAIL A ,KCJ3_STUFFBUTTRESSLIST B  "
    + "                  where A.OLD_SAMPL_NO=B.OLD_SAMPL_NO  AND  A.PCTIME " + strKkp + ""

    + "                  UNION  select '08' rowindex, '合计' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,sum(case  when   B.PRODUCTTIME " + strTimeFromKP + " "
    + "                  then GZ_XHSJ  else 0 end) GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL  FROM BJ_JBGZ B  "
    + "                  where  B.GZ_NAME IN('0','1') AND B.PRODUCTTIME " + strKkp + ""

    + "                  UNION  select '08' rowindex, '合计' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,sum(case  when  B.PRODUCTTIME " + strTimeFromKP + " "
    + "                  then PLANTAKETIME  else 0 end) JHSJ,0 SJSJ,0 JQYL,0 TRL  FROM BJ3_DATAFORRPT B  "
    + "                  where  B.PRODUCTTIME " + strKkp + ""


    + "                  UNION  select '08' rowindex, '合计' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,sum(case  when  B.PRODUCTTIME " + strTimeFromKP + " "
    + "                  then ACTUALTAKETIME  else 0 end) SJSJ,0 JQYL,0 TRL  FROM BJ3_DATAFORRPT B "
    + "                  where  B.PRODUCTTIME " + strKkp + ""


    + "                  UNION  select '08' rowindex, '合计' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,round(sum(case  when  B.PCTIME " + strTimeFromKP + " "
    + "                  then b.ZSLAB_WEIGHT * 0.001  else 0 end),3) JQYL ,0 TRL FROM KCJ3_ZY_TASKDETAIL b,KCJ3_STUFFBUTTRESSLIST a where b.OLD_SAMPL_NO = a.OLD_SAMPL_NO  "
    + "                  AND   B.PCTIME " + strKkp + ""

    + "                  UNION  select '08' rowindex, '合计' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,round(sum(case  when  B.STTIME " + strTimeFromKP + " "
    + "                  then b.act_wgt * 0.001  else 0 end),3) TRL  FROM KCJ3_ZY_PLAN b, KCJ3_STUFFBUTTRESSLIST a where b.OLD_SAMPL_NO = a.OLD_SAMPL_NO AND b.DOWN_FLAG = '1' AND B.AFFIRLOG ='1'  "
    + "                  AND   B.STTIME " + strKkp + ")";



            tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            if (tmpdst != null)
            {
                rtndst.Merge(tmpdst.Copy());
                tmpdst = null;
            }
            else
            {
                return new ReturnObject(null, strOut);
            }


            sqlstr = "   select '09' rowindex, '月累' zb,SUM(YLRKL)YLRKL, SUM(YLKC)YLKC,SUM(CPKC)CPKC,SUM(CPFY)CPFY,SUM(CL)CL,SUM(GZSJ)GZSJ,SUM(JHSJ-SJSJ)TCSJ,ROUND(CASE WHEN SUM(SJSJ)!=0 THEN ((SUM(SJSJ) - SUM(GZSJ)) / SUM(SJSJ)) * 100 ELSE 0 END ,2)SBZYL,ROUND(CASE WHEN SUM(TRL)!=0 THEN (SUM(JQYL) / SUM(TRL)) * 100 ELSE 0 END ,2) CCL FROM ( select '09' rowindex, '月累' zb,round(sum(case "
+ "                      when  a.INTIME " + strKkp + "  then ROUND(ACT_WGT/1000,2)  else   0 end),3) YLRKL, "
+ "                      0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL from KCJ3_STUFFLIST a"
+ "                      WHERE  A.INTIME " + strKkp + " union "



+ "                      select '09' rowindex, '月累' zb,0 YLRKL ,round(sum(case when  a.INTIME " + strKkp + "  "
+ "                      then ROUND(ACT_WGT/1000,2)  else   0 end),3) YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL  FROM KCJ3_STUFFLIST A  "
+ "                      WHERE   A.STORAGESTATUS='501002' AND A.ISVALID='1'  AND A.ORD_NO <>'9999' AND A.INTIME " + strKkp + "  "
+ "                      union "



+ "                     select '09' rowindex, '月累' zb,0 YLRKL,0 YLKC,round(sum(case when  a.CREATETIME " + strKkp + " "
+ "                     then ROUND(A.ZSLAB_WEIGHT*0.001,3)  else   0 end),3) CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL FROM KCJ3_TURNOFFLIST A ,KCJ3_TURNOFFBUTTRESSLIST B "
+ "                     WHERE A.COIL_NO_ID=B.COIL_NO_ID AND A.STORAGESTATUS='501602' AND ISVALID='1' AND A.COIL_NO_ID LIKE 'R%'  AND A.ORD_NO <>'9999' and A.CREATETIME " + strKkp + ""



+ "                     UNION select '09' rowindex, '月累' zb,0 YLRKL,0 YLKC,0 CPKC,ROUND(sum(case when  A.PICKSTORAGETIME " + strKkp + " then ROUND(A.ZSLAB_WEIGHT*0.001,3)  else   0 end),3)  CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL "
+ "                     FROM KCJ3_TURNOFFSENDLIST A, KCJ3_TURNOFFBUTTRESSLIST B  WHERE A.COIL_NO_ID=B.COIL_NO_ID  AND A.PICKSTORAGETIME " + strKkp + ""


+ "                     UNION  select '09' rowindex, '月累' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,sum(case  when  a.PCTIME " + strKkp + " "
+ "                     then ROUND(A.ZSLAB_WEIGHT*0.001,3)  else 0 end) CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL  FROM KCJ3_ZY_TASKDETAIL A ,KCJ3_STUFFBUTTRESSLIST B  "
+ "                     where A.OLD_SAMPL_NO=B.OLD_SAMPL_NO  AND  A.PCTIME " + strKkp + ""


+ "                     UNION  select '09' rowindex, '月累' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,sum(case  when   B.PRODUCTTIME " + strKkp + " "
+ "                     then GZ_XHSJ  else 0 end) GZSJ,0 JHSJ,0 SJSJ,0 JQYL,0 TRL  FROM BJ_JBGZ B  "
+ "                     where  B.GZ_NAME IN('0','1') AND B.PRODUCTTIME " + strKkp + ""

+ "                     UNION  select '09' rowindex, '月累' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,sum(case  when  B.PRODUCTTIME " + strKkp + " "
+ "                     then PLANTAKETIME  else 0 end) JHSJ,0 SJSJ,0 JQYL,0 TRL  FROM BJ3_DATAFORRPT B  "
+ "                     where  B.PRODUCTTIME " + strKkp + ""


+ "                     UNION  select '09' rowindex, '月累' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,sum(case  when  B.PRODUCTTIME " + strKkp + " "
+ "                     then ACTUALTAKETIME  else 0 end) SJSJ,0 JQYL,0 TRL  FROM BJ3_DATAFORRPT B "
+ "                     where  B.PRODUCTTIME " + strKkp + ""


+ "                     UNION  select '09' rowindex, '月累' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,round(sum(case  when B.PCTIME " + strKkp + " "
+ "                     then b.ZSLAB_WEIGHT * 0.001  else 0 end),3) JQYL,0 TRL  FROM KCJ3_ZY_TASKDETAIL b,KCJ3_STUFFBUTTRESSLIST a where b.OLD_SAMPL_NO = a.OLD_SAMPL_NO  "
+ "                     AND   B.PCTIME " + strKkp + ""

+ "                    UNION  select '09' rowindex, '月累' zb, 0 YLRKL, 0 YLKC,0 CPKC,0 CPFY,0 CL,0 GZSJ,0 JHSJ,0 SJSJ,0 JQYL,round(sum(case  when  B.STTIME " + strKkp + " "
+ "                    then b.act_wgt * 0.001  else 0 end),3) TRL  FROM KCJ3_ZY_PLAN b, KCJ3_STUFFBUTTRESSLIST a where b.OLD_SAMPL_NO = a.OLD_SAMPL_NO AND b.DOWN_FLAG = '1' AND B.AFFIRLOG ='1'  "
+ "                    AND   B.STTIME " + strKkp + ")";



            tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            if (tmpdst != null)
            {
                rtndst.Merge(tmpdst.Copy());
                tmpdst = null;
            }
            else
            {
                return new ReturnObject(null, strOut);
            }

            //sqlstr = "  select '10' rowindex, '故障时间（1#）',sum() zb select '10' rowindex, '1#' zb,"
            //        + "round ((sum(case when  and b.PRODUCTTIME " + strTimeFrom + " then b.FAILURETIME else 0 end)),3) GZSJ,"
            //        + "round(sum(case when  and b.PRODUCTTIME " + strTimeTo + " then  b.FAILURETIME else 0 end),3) mon1,"
            //        + "from BJ3_DATAFORRPT b where b.pressline='8055001'"
            //        + "and b.PCTIME "+strK+" union "
            //        +" select '10' rowindex, '1#' zb,"
            //        + "round ((sum(case when  and b.PRODUCTTIME " + strTimeFrom + " then b.FAILURETIME else 0 end)),3) GZSJ,"
            //        + "round(sum(case when  and b.PRODUCTTIME " + strTimeTo + " then  b.FAILURETIME else 0 end),3) mon1,"
            //        + "from BJ3_DATAFORRPT b where b.pressline='8055002'"
            //        + "and b.PCTIME "+strK+" union "
            //        + " select '10' rowindex, '1#' zb,"
            //        + "round ((sum(case when  and b.PRODUCTTIME " + strTimeFrom + " then b.FAILURETIME else 0 end)),3) GZSJ,"
            //        + "round(sum(case when  and b.PRODUCTTIME " + strTimeTo + " then  b.FAILURETIME else 0 end),3) mon1,"
            //        + "from BJ3_DATAFORRPT b where b.pressline='8055003'"
            //        + "and b.PCTIME "+strK+"" ;




            //tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            //if (tmpdst != null)
            //{
            //    rtndst.Merge(tmpdst.Copy());
            //    tmpdst = null;
            //}
            //else
            //{
            //    return new ReturnObject(null, strOut);
            //}
        //    sqlstr = " select '08' rowindex, '入库成品原料消耗' zb, "
        //       + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
        //        + " from dual "
        //        + " union "
        //        //
        //        + " select '09' rowindex, '非计划' zb, "
        //         + " round ((sum(case when b.pclassteam='300301' and b.PCTIME " + strTimeFrom + " then b.ZSLAB_WEIGHT * 0.001 else 0 end)),3) day1,"
        //        + " round(sum(case when b.pclassteam='300301' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon1,"
        //        + " round(sum(case when b.pclassteam='300302' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day2,"
        //        + " round(sum(case when b.pclassteam='300302' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon2,"
        //        + " round(sum(case when b.pclassteam='300303' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day3,"
        //        + " round(sum(case when b.pclassteam='300303' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon3,"
        //        + " round(sum(case when b.pclassteam='300304' and b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) day4,"
        //        + " round(sum(case when b.pclassteam='300304' and b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) mon4,"
        //        + " round(sum(case when b.PCTIME " + strTimeFrom + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) dayall,"
        //        + " round(sum(case when b.PCTIME " + strTimeTo + " then  b.ZSLAB_WEIGHT * 0.001 else 0 end),3) monall"
        //        + " from KCJ3_ZY_TASKDETAIL b where B.ISFJH = '1' "
        //        + " and b.PCTIME " + strK
        //        + " UNION select '10' rowindex, '废钢' zb, "
        //        + " 0.00 day1, 0.00 mon1, 0.00 day2, 0.00 mon2, 0.00 day3, 0.00 mon3, 0.00 day4, 0.00 mon4,0.00 dayall, 0.00 monall "
        //        + " from dual union "
        //        + " select '11' rowindex, '成材率(%)' zb, "
        //        + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
        //        + " from dual "
        //        + " union "
        //        //计划内合格，入库时间
        //        + " select '12' rowindex, '日历时间' zb, "
        //        + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
        //        + " from dual union "
        //        + " select '13' rowindex, '计划作业时间' zb, "
        //        + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day1,"
        //        + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon1, "
        //        + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day2,"
        //        + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon2,"
        //        + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day3,"
        //        + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon3,"
        //        + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day4,"
        //        + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon4,"
        //        + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) dayall,"
        //        + " sum(case when PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) monall "
        //        + " from BJ3_DATAFORRPT a where a.PRODUCTTIME " + strK + " AND A.PRESSLINE ='8055001' "
        //        + " union "
        //        + " select '14' rowindex, '实际作业时间' zb, "
        //       + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day1,"
        //        + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon1, "
        //        + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day2,"
        //        + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon2,"
        //        + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day3,"
        //        + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon3,"
        //        + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day4,"
        //        + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon4,"
        //        + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) dayall,"
        //        + " sum(case when PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) monall "
        //        + " from BJ3_DATAFORRPT a where a.PRODUCTTIME " + strK + " AND A.PRESSLINE ='8055001' ";
        //    tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
        //    if (tmpdst != null)
        //    {
        //        rtndst.Merge(tmpdst.Copy());
        //        tmpdst = null;
        //    }
        //    else
        //    {
        //        return new ReturnObject(null, strOut);
        //    }
        //    sqlstr = " select '15' rowindex, '停机时间' zb, "
        //        + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.FAILURETIME else 0 end) day1,"
        //        + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.FAILURETIME else 0 end) mon1, "
        //        + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.FAILURETIME else 0 end) day2,"
        //        + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.FAILURETIME else 0 end) mon2,"
        //        + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.FAILURETIME else 0 end) day3,"
        //        + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.FAILURETIME else 0 end) mon3,"
        //        + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.FAILURETIME else 0 end) day4,"
        //        + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.FAILURETIME else 0 end) mon4,"
        //        + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.FAILURETIME else 0 end) dayall,"
        //        + " sum(case when PRODUCTTIME " + strTimeTo + " then a.FAILURETIME else 0 end) monall "
        //        + " from BJ3_DATAFORRPT a where  FAILURTYPE = '2' and a.PRODUCTTIME  " + strK

        //        + " union "
        //        + " select '16' rowindex, '故障明细' zb, "
        //        + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
        //        + " from dual  "
        //        + "  union select '17' rowindex, '机械故障时间(1#)' zb, "
        //        + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day1,"
        //        + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon1, "
        //        + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day2,"
        //        + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon2,"
        //        + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day3,"
        //        + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon3,"
        //        + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day4,"
        //        + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon4,"
        //        + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) dayall,"
        //        + " sum(case when PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) monall "
        //        + " from BJ_JBGZ a where a.PRODUCTTIME " + strK + " AND A.PLINE ='8055001' and A.GZ_NAME in('0','1') ";
        //    tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
        //    if (tmpdst != null)
        //    {
        //        rtndst.Merge(tmpdst.Copy());
        //        tmpdst = null;
        //    }
        //    else
        //    {
        //        return new ReturnObject(null, strOut);
        //    }
        //    sqlstr = " select '18' rowindex, '计划作业时间(2#)' zb, "
        //         + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day1,"
        //         + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon1, "
        //         + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day2,"
        //         + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon2,"
        //         + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day3,"
        //         + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon3,"
        //         + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day4,"
        //         + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon4,"
        //         + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) dayall,"
        //         + " sum(case when PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) monall "
        //         + " from BJ3_DATAFORRPT a where a.PRODUCTTIME " + strK + " AND A.PRESSLINE ='8055002' "
        //         + " union "
        //         + " select '19' rowindex, '实际作业时间(2#)' zb, "
        //         + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day1,"
        //         + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon1, "
        //         + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day2,"
        //         + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon2,"
        //         + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day3,"
        //         + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon3,"
        //         + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day4,"
        //         + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon4,"
        //         + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) dayall,"
        //         + " sum(case when PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) monall "
        //         + " from BJ3_DATAFORRPT a where a.PRODUCTTIME " + strK + " AND A.PRESSLINE ='8055002' "
        //         + " union "
        //         + " select '20' rowindex, '停机时间(2#)' zb, "
        //         + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
        //         + " from dual union "
        //         + " select '21' rowindex, '故障明细(2#)' zb, "
        //         + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
        //         + " from dual "
        //         + " union "
        //        + " select '22' rowindex, '机械故障时间(2#)' zb, "
        //        + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day1,"
        //    + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon1, "
        //    + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day2,"
        //    + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon2,"
        //    + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day3,"
        //    + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon3,"
        //    + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day4,"
        //    + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon4,"
        //    + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) dayall,"
        //    + " sum(case when PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) monall "
        //    + " from BJ_JBGZ a where a.PRODUCTTIME " + strK + " AND A.PLINE ='8055002' and A.GZ_NAME in('0','1') ";
        //    tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
        //    if (tmpdst != null)
        //    {
        //        rtndst.Merge(tmpdst.Copy());
        //        tmpdst = null;
        //    }
        //    else
        //    {
        //        return new ReturnObject(null, strOut);
        //    }
        //    sqlstr = " select '23' rowindex, '有效作业率' zb, "
        //    + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
        //    + " from dual "
        //    + " union "
        //    + " select '24' rowindex, '套材量' zb, "
        //    + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
        //    + " from dual "


        //   + " union select '25' rowindex, '热连轧转运板加量' zb, "
        //+ " sum(case when A.INTIME " + strTimeFrom + " and INCLASSTEAM = '300301' then A.THEORYWEIGHT else 0 end) day1, "
        //+ " sum(case when A.INTIME " + strTimeTo + " and INCLASSTEAM = '300301' then A.THEORYWEIGHT else 0 end) mon1,  "
        //+ " sum(case when A.INTIME " + strTimeFrom + " and INCLASSTEAM = '300302' then A.THEORYWEIGHT else 0 end) day2, "
        //+ " sum(case when A.INTIME " + strTimeTo + " and INCLASSTEAM = '300302' then A.THEORYWEIGHT else 0 end) mon2,  "
        //+ " sum(case when A.INTIME " + strTimeFrom + " and INCLASSTEAM = '300303' then A.THEORYWEIGHT else 0 end) day3, "
        //+ " sum(case when A.INTIME " + strTimeTo + " and INCLASSTEAM = '300303' then A.THEORYWEIGHT else 0 end) mon3,  "
        //+ " sum(case when A.INTIME " + strTimeFrom + " and INCLASSTEAM = '300304' then A.THEORYWEIGHT else 0 end) day4, "
        //+ " sum(case when A.INTIME " + strTimeTo + " and INCLASSTEAM = '300304' then A.THEORYWEIGHT else 0 end) mon4,  "
        //+ " sum(case when A.INTIME " + strTimeFrom + " then A.THEORYWEIGHT else 0 end) dayall, "
        //+ " sum(case when A.INTIME " + strTimeTo + " then A.THEORYWEIGHT else 0 end) monall "
        //+ " from KCJ_STORAGELIST A,KCJ_STORAGEBUTTRESSLIST b where  A.BILLETID=b.BILLETID(+) AND A.STORAGESTATUS = '501002' AND A.ISVALID = '1'  "
        //+ " and a.INTIME " + strK;
        //    tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
        //    if (tmpdst != null)
        //    {
        //        rtndst.Merge(tmpdst.Copy());
        //        tmpdst = null;
        //    }
        //    else
        //    {
        //        return new ReturnObject(null, strOut);
        //    }

        //    sqlstr = " select '27' rowindex, '有效作业率2(%)' zb, "
        //    + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
        //    + " from dual "
        //    + " union "
        //    + " select '26' rowindex, '成品发运量' zb, "
        //+ " sum(case when A.PICKSTORAGETIME " + strTimeFrom + " and CLASSTEAM = '300301' then  a.ZSLAB_WEIGHT * 0.001 else 0 end) day1, "
        //+ " sum(case when A.PICKSTORAGETIME " + strTimeTo + " and CLASSTEAM = '300301' then  a.ZSLAB_WEIGHT * 0.001 else 0 end) mon1,  "
        //+ " sum(case when A.PICKSTORAGETIME " + strTimeFrom + " and CLASSTEAM = '300302' then  a.ZSLAB_WEIGHT * 0.001 else 0 end) day2, "
        //+ " sum(case when A.PICKSTORAGETIME " + strTimeTo + " and CLASSTEAM = '300302' then  a.ZSLAB_WEIGHT * 0.001 else 0 end) mon2,  "
        //+ " sum(case when A.PICKSTORAGETIME " + strTimeFrom + " and CLASSTEAM = '300303' then  a.ZSLAB_WEIGHT * 0.001 else 0 end) day3, "
        //+ " sum(case when A.PICKSTORAGETIME " + strTimeTo + " and CLASSTEAM = '300303' then  a.ZSLAB_WEIGHT * 0.001 else 0 end) mon3,  "
        //+ " sum(case when A.PICKSTORAGETIME " + strTimeFrom + " and CLASSTEAM = '300304' then  a.ZSLAB_WEIGHT * 0.001 else 0 end) day4, "
        //+ " sum(case when A.PICKSTORAGETIME " + strTimeTo + " and CLASSTEAM = '300304' then  a.ZSLAB_WEIGHT * 0.001 else 0 end) mon4,  "
        //+ " sum(case when A.PICKSTORAGETIME " + strTimeFrom + " then  a.ZSLAB_WEIGHT * 0.001 else 0 end) dayall, "
        //+ " sum(case when A.PICKSTORAGETIME " + strTimeTo + " then  a.ZSLAB_WEIGHT * 0.001 else 0 end) monall "
        //+ " from KCJ3_TURNOFFSENDLIST a, KCJ3_TURNOFFBUTTRESSLIST B  where   A.COIL_NO_ID=B.COIL_NO_ID and  "
        //+ "  PICKSTORAGETIME " + strK;

        //    tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
        //    if (tmpdst != null)
        //    {
        //        rtndst.Merge(tmpdst.Copy());
        //        tmpdst = null;
        //    }
        //    else
        //    {
        //        return new ReturnObject(null, strOut);
        //    }
        //    sqlstr = " select '28' rowindex, '有效作业率3(%)' zb, "
        //    + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
        //    + " from dual "
        //    + " union "
        //    + " select '29' rowindex, '计划作业时间(3#)' zb, "
        //            + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day1,"
        //            + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon1, "
        //            + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day2,"
        //            + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon2,"
        //            + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day3,"
        //            + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon3,"
        //            + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) day4,"
        //            + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) mon4,"
        //            + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.PLANTAKETIME else 0 end) dayall,"
        //            + " sum(case when PRODUCTTIME " + strTimeTo + " then a.PLANTAKETIME else 0 end) monall "
        //            + " from BJ3_DATAFORRPT a where a.PRODUCTTIME " + strK + " AND A.PRESSLINE ='8055003' "
        //            + " union "
        //            + " select '30' rowindex, '实际作业时间(3#)' zb, "
        //            + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day1,"
        //            + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon1, "
        //            + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day2,"
        //            + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon2,"
        //            + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day3,"
        //            + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon3,"
        //            + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) day4,"
        //            + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) mon4,"
        //            + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.ACTUALTAKETIME else 0 end) dayall,"
        //            + " sum(case when PRODUCTTIME " + strTimeTo + " then a.ACTUALTAKETIME else 0 end) monall "
        //            + " from BJ3_DATAFORRPT a where a.PRODUCTTIME " + strK + " AND A.PRESSLINE ='8055003' "
        //            + " union "
        //            + " select '31' rowindex, '停机时间(3#)' zb, "
        //            + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
        //            + " from dual union "
        //            + " select '32' rowindex, '故障明细(3#)' zb, "
        //            + " null day1, null mon1, null day2, null mon2, null day3, null mon3, null day4, null mon4,null dayall, null monall "
        //            + " from dual "
        //            + " union "
        //           + " select '33' rowindex, '机械故障时间(3#)' zb, "
        //           + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day1,"
        //       + " sum(case when a.crew='300301' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon1, "
        //       + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day2,"
        //       + " sum(case when a.crew='300302' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon2,"
        //       + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day3,"
        //       + " sum(case when a.crew='300303' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon3,"
        //       + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) day4,"
        //       + " sum(case when a.crew='300304' and PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) mon4,"
        //       + " sum(case when PRODUCTTIME " + strTimeFrom + " then a.GZ_XHSJ else 0 end) dayall,"
        //       + " sum(case when PRODUCTTIME " + strTimeTo + " then a.GZ_XHSJ else 0 end) monall "
        //       + " from BJ_JBGZ a where a.PRODUCTTIME " + strK + " AND A.PLINE ='8055003' and A.GZ_NAME in('0','1') ";
        //    tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
            //if (tmpdst != null)
            //{
            //    rtndst.Merge(tmpdst.Copy());
            //    tmpdst = null;
            //}
            //else
            //{
            //    return new ReturnObject(null, strOut);
            //}

            return new ReturnObject(rtndst);
        }






        public ReturnObject Rpt_ProductSteelNew_6_Query(string strTimeFrom, string strTimeTo, string strK,string strPline)
        {
            string sqlstr = " ";
            string strOut = "";
            System.Data.DataSet rtndst = new DataSet();
            System.Data.DataSet tmpdst = null;
            if (strPline == "4001ZB1")
            {
                sqlstr = "select '01' rowindex, '战略新产品' zb, "
                   + "    null dayall, null monall "
                   + "    from dual union "


                   + "    select '02' rowindex, '调质（Q+T)容器板' zb,  "
                   + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                   + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                   + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                   + "    AND A.XCPLX='调质（Q+T)容器板' AND A.XPLX='战略新产品' AND T.INTIME " + strK + " UNION"


                   + "    select '03' rowindex, '调质（Q+T)高强度结构板' zb,  "
                   + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                   + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                   + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                   + "    AND A.XCPLX='调质（Q+T)高强度结构板' AND A.XPLX='战略新产品' AND T.INTIME " + strK + " UNION "


                   + "    select '04' rowindex, '海工钢（海洋工程结构用钢/超高强度船舶及海洋工程用钢板)' zb, "
                   + "    null dayall, null monall "
                   + "    from dual union "


                   + "    select '05' rowindex, '海洋工程结构用钢' zb,  "
                   + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                   + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                   + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                   + "    AND A.XCPLX='海洋工程结构用钢' AND A.XPLX='战略新产品' AND T.INTIME " + strK + " UNION"


                   + "    select '06' rowindex, '超高强度船舶及海洋工程用钢板' zb,  "
                   + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                   + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                   + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                   + "    AND A.XCPLX='超高强度船舶及海洋工程用钢板' AND A.XPLX='战略新产品' AND T.INTIME " + strK + " ";


                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }
                sqlstr = "select '07' rowindex, '高建板（重点新产品包括厚度≥60mm-100mm的Q345GJB/C/D/E）' zb,  "
                  + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='高建板（重点新产品包括厚度≥60mm-100mm的Q345GJB/C/D/E）' AND A.XPLX='战略新产品' AND T.INTIME " + strK + " UNION"

                  + "    select '08' rowindex, '桥梁板' zb,  "
                  + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='桥梁板' AND A.XPLX='战略新产品' AND T.INTIME " + strK + " UNION "


                  + "    select '09' rowindex, '工程机械用耐磨板' zb,  "
                  + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='工程机械用耐磨板' AND A.XPLX='战略新产品' AND T.INTIME " + strK + " UNION"


                  + "    select '10' rowindex, ' 模具用钢' zb,  "
                  + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX=' 模具用钢' AND A.XPLX='战略新产品' AND T.INTIME " + strK + " ";


                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }


                sqlstr = "    select '11' rowindex, '管线用钢板(战略新产品包括牌号带HIC要求管线钢）' zb,  "
                       + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='管线用钢板(战略新产品包括牌号带HIC要求管线钢）' AND A.XPLX='战略新产品' AND T.INTIME " + strK + " UNION"


                       + "    select '12' rowindex, '高强度结构板' zb,  "
                       + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='高强度结构板' AND A.XPLX='战略新产品' AND T.INTIME " + strK + " UNION "


                       + "    select '13' rowindex, '正火高强度容器板' zb,  "
                       + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='正火高强度容器板' AND A.XPLX='战略新产品' AND T.INTIME " + strK + " ";



                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }


                sqlstr = "      select '14' rowindex, '重点新产品' zb, "
                         + "    null dayall, null monall "
                         + "    from dual union "

                         + "    select '15' rowindex, '船板' zb, "
                         + "    null dayall, null monall "
                         + "    from dual union "

                         + "    select '16' rowindex, '高强度船板' zb,  "
                         + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                         + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                         + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                         + "    AND A.XCPLX='高强度船板' AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"

                         + "    select '17' rowindex, '特厚船板（包括新产品牌号之外厚度>60mm的牌号）' zb,  "
                         + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                         + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                         + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                         + "    AND A.XCPLX='特厚船板（包括新产品牌号之外厚度>60mm的牌号）'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION "


                         + "    select '18' rowindex, '锅容板' zb, "
                         + "    null dayall, null monall "
                         + "    from dual union "

                         + "    select '19' rowindex, '锅炉容器板' zb,  "
                         + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                         + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                         + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                         + "    AND A.XCPLX='锅炉容器板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"


                         + "    select '20' rowindex, '国外容器板（包括厚度>80mm的 (S)A515/A516钢板）' zb,  "
                         + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                         + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                         + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                         + "    AND A.XCPLX='国外容器板（包括厚度>80mm的 (S)A515/A516钢板）'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"


                         + "    select '21' rowindex, '特厚容器板（厚度>80-140mm Q245R、Q345R）' zb,  "
                         + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                         + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                         + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                         + "    AND A.XCPLX='特厚容器板（厚度>80-140mm Q245R、Q345R）'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"


                         + "    select '22' rowindex, '特殊功能容器板（新产品牌号、规格之外的要求HIC、模拟焊后、高温拉伸、抗回火脆性牌号）' zb,  "
                         + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                         + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                         + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                         + "    AND A.XCPLX='特殊功能容器板（新产品牌号、规格之外的要求HIC、模拟焊后、高温拉伸、抗回火脆性牌号）'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"


                         + "    select '23' rowindex, '低温容器板' zb,  "
                         + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                         + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                         + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                         + "    AND A.XCPLX='低温容器板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"


                         + "    select '24' rowindex, '特厚低温容器板（厚度>80-120mm 16MnDR钢板）' zb,  "
                         + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                         + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                         + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                         + "    AND A.XCPLX='特厚低温容器板（厚度>80-120mm 16MnDR钢板）'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " ";


                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }

                sqlstr = "select '25' rowindex, '球罐、水电、船用容器板' zb, "
                       + "    null dayall, null monall "
                       + "    from dual union "


                       + "    select '26' rowindex, ' 球罐用容器板' zb,  "
                       + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX=' 球罐用容器板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"


                       + "    select '27' rowindex, '水电用容器板' zb,  "
                       + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='水电用容器板'  AND A.XPLX='重点新产品'AND T.INTIME " + strK + " UNION "

                       + "    select '28' rowindex, ' 船用容器板' zb,  "
                       + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='船用容器板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"


                       + "    select '29' rowindex, '专用板' zb,  "
                       + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='专用板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"


                       + "    select '30' rowindex, '桥梁板' zb,  "
                       + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='桥梁板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"


                       + "    select '31' rowindex, '高建板（重点新产品包括厚度≥60mm-100mm的Q345GJB/C/D/E）' zb,  "
                       + "     NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='高建板（重点新产品包括厚度≥60mm-100mm的Q345GJB/C/D/E）'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " ";


                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }

                sqlstr = "    select '32' rowindex, '管线用钢板(战略新产品包括牌号带HIC要求管线钢）' zb,  "
                       + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='管线用钢板(战略新产品包括牌号带HIC要求管线钢）'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"


                       + "    select '33' rowindex, '工程机械用耐磨板' zb,  "
                       + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='工程机械用耐磨板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"


                       + "    select '34' rowindex, '耐候板' zb,  "
                       + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='耐候板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"


                       + "    select '35' rowindex, '国外耐候板' zb,  "
                       + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='国外耐候板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"


                       + "    select '36' rowindex, '塑料合金模具板' zb,  "
                       + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='塑料合金模具板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"



                       + "    select '37' rowindex, '工程机械用板' zb,  "
                       + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='工程机械用板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"



                       + "    select '38' rowindex, '圆锯片基材用钢板' zb,  "
                       + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='圆锯片基材用钢板' AND T.INTIME " + strK + " ";


                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }



                sqlstr = "    select '39' rowindex, '调质（Q+T)高强度结构板' zb,  "
                       + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='调质（Q+T)高强度结构板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"


                       + "    select '40' rowindex, '结构板' zb,  "
                       + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='结构板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"


                       + "    select '41' rowindex, '高强度结构板' zb,  "
                       + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='耐候板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"


                       + "    select '42' rowindex, '国外高强度结构板' zb,  "
                       + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='国外高强度结构板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"



                       + "    select '43' rowindex, '合金结构板' zb,  "
                       + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='合金结构板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"



                       + "    select '44' rowindex, '特厚结构板（新产品牌号之外厚度＞100mm的各类结构板）' zb,  "
                       + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='特厚结构板（新产品牌号之外厚度＞100mm的各类结构板）'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"




                       + "    select '45' rowindex, '特殊功能结构板（CTOD)' zb,  "
                       + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='特殊功能结构板（CTOD)'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " UNION"



                       + "    select '46' rowindex, '核电板' zb,  "
                       + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='核电板'  AND A.XPLX='重点新产品' AND T.INTIME " + strK + " ";


                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }

                sqlstr = "select '47' rowindex, '一般新产品' zb, "
                  + "    null dayall, null monall "
                  + "    from dual union "


                  + "    select '48' rowindex, '耐候板' zb,  "
                  + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='耐候板'  AND A.XPLX='一般新产品' AND T.INTIME " + strK + " UNION"


                  + "    select '49' rowindex, '桥梁板' zb,  "
                  + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='桥梁板' AND A.XPLX='一般新产品' AND T.INTIME " + strK + " UNION "

                  + "    select '50' rowindex, '工程机械用板' zb,  "
                  + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='工程机械用板' AND A.XPLX='一般新产品' AND T.INTIME " + strK + " UNION"



                  + "    select '51' rowindex, '碳素结构板' zb,  "
                  + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='碳素结构板' AND A.XPLX='一般新产品' AND T.INTIME " + strK + " UNION"



                  + "    select '52' rowindex, '低合金板' zb,  "
                  + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='低合金板' AND A.XPLX='一般新产品' AND T.INTIME " + strK + " UNION"



                  + "    select '53' rowindex, '合金结构板' zb,  "
                  + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='合金结构板' AND A.XPLX='一般新产品' AND T.INTIME " + strK + " UNION"



                  + "    select '54' rowindex, '薄钢板新工艺正火板（≤12mm N、N+T）' zb,  "
                  + "    NVL(round(sum(case when T.INTIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INTIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='薄钢板新工艺正火板（≤12mm N、N+T）' AND A.XPLX='一般新产品' AND T.INTIME " + strK + " ";


                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }
            }
            else
            {
                sqlstr = "select '01' rowindex, '战略新产品' zb, "
                  + "    null dayall, null monall "
                  + "    from dual union "


                  + "    select '02' rowindex, '调质（Q+T)容器板' zb,  "
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='调质（Q+T)容器板' AND A.XPLX='战略新产品' AND T.INSTORAGETIME " + strK + " UNION"


                  + "    select '03' rowindex, '调质（Q+T)高强度结构板' zb,  "
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='调质（Q+T)高强度结构板' AND A.XPLX='战略新产品' AND T.INSTORAGETIME " + strK + " UNION "


                  + "    select '04' rowindex, '海工钢（海洋工程结构用钢/超高强度船舶及海洋工程用钢板)' zb, "
                  + "    null dayall, null monall "
                  + "    from dual union "


                  + "    select '05' rowindex, '海洋工程结构用钢' zb,  "
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='海洋工程结构用钢' AND A.XPLX='战略新产品' AND T.INSTORAGETIME " + strK + " UNION"


                  + "    select '06' rowindex, '超高强度船舶及海洋工程用钢板' zb,  "
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='超高强度船舶及海洋工程用钢板' AND A.XPLX='战略新产品' AND T.INSTORAGETIME " + strK + " ";


                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }
                sqlstr = "select '07' rowindex, '高建板（重点新产品包括厚度≥60mm-100mm的Q345GJB/C/D/E）' zb,  "
                  + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='高建板（重点新产品包括厚度≥60mm-100mm的Q345GJB/C/D/E）' AND A.XPLX='战略新产品' AND T.INSTORAGETIME " + strK + " UNION"

                  + "    select '08' rowindex, '桥梁板' zb,  "
                  + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='桥梁板' AND A.XPLX='战略新产品' AND T.INSTORAGETIME " + strK + " UNION "


                  + "    select '09' rowindex, '工程机械用耐磨板' zb,  "
                  + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='工程机械用耐磨板' AND A.XPLX='战略新产品' AND T.INSTORAGETIME " + strK + " UNION"


                  + "    select '10' rowindex, ' 模具用钢' zb,  "
                  + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX=' 模具用钢' AND A.XPLX='战略新产品' AND T.INSTORAGETIME " + strK + " ";


                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }


                sqlstr = "    select '11' rowindex, '管线用钢板(战略新产品包括牌号带HIC要求管线钢）' zb,  "
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='管线用钢板(战略新产品包括牌号带HIC要求管线钢）' AND A.XPLX='战略新产品' AND T.INSTORAGETIME " + strK + " UNION"


                       + "    select '12' rowindex, '高强度结构板' zb,  "
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='高强度结构板' AND A.XPLX='战略新产品' AND T.INSTORAGETIME " + strK + " UNION "


                       + "    select '13' rowindex, '正火高强度容器板' zb,  "
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='正火高强度容器板' AND A.XPLX='战略新产品' AND T.INSTORAGETIME " + strK + " ";



                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }


                sqlstr = "      select '14' rowindex, '重点新产品' zb, "
                         + "    null dayall, null monall "
                         + "    from dual union "

                         + "    select '15' rowindex, '船板' zb, "
                         + "    null dayall, null monall "
                         + "    from dual union "

                         + "    select '16' rowindex, '高强度船板' zb,  "
                         + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                         + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                         + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                         + "    AND A.XCPLX='高强度船板' AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"

                         + "    select '17' rowindex, '特厚船板（包括新产品牌号之外厚度>60mm的牌号）' zb,  "
                         + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                         + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                         + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                         + "    AND A.XCPLX='特厚船板（包括新产品牌号之外厚度>60mm的牌号）'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION "


                         + "    select '18' rowindex, '锅容板' zb, "
                         + "    null dayall, null monall "
                         + "    from dual union "

                         + "    select '19' rowindex, '锅炉容器板' zb,  "
                         + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                         + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                         + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                         + "    AND A.XCPLX='锅炉容器板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"


                         + "    select '20' rowindex, '国外容器板（包括厚度>80mm的 (S)A515/A516钢板）' zb,  "
                         + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                         + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                         + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                         + "    AND A.XCPLX='国外容器板（包括厚度>80mm的 (S)A515/A516钢板）'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"


                         + "    select '21' rowindex, '特厚容器板（厚度>80-140mm Q245R、Q345R）' zb,  "
                         + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                         + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                         + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                         + "    AND A.XCPLX='特厚容器板（厚度>80-140mm Q245R、Q345R）'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"


                         + "    select '22' rowindex, '特殊功能容器板（新产品牌号、规格之外的要求HIC、模拟焊后、高温拉伸、抗回火脆性牌号）' zb,  "
                         + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                         + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                         + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                         + "    AND A.XCPLX='特殊功能容器板（新产品牌号、规格之外的要求HIC、模拟焊后、高温拉伸、抗回火脆性牌号）'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"


                         + "    select '23' rowindex, '低温容器板' zb,  "
                         + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                         + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                         + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                         + "    AND A.XCPLX='低温容器板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"


                         + "    select '24' rowindex, '特厚低温容器板（厚度>80-120mm 16MnDR钢板）' zb,  "
                         + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                         + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                         + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                         + "    AND A.XCPLX='特厚低温容器板（厚度>80-120mm 16MnDR钢板）'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " ";


                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
               if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }

                sqlstr = "select '25' rowindex, '球罐、水电、船用容器板' zb, "
                       + "    null dayall, null monall "
                       + "    from dual union "


                       + "    select '26' rowindex, ' 球罐用容器板' zb,  "
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX=' 球罐用容器板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"


                       + "    select '27' rowindex, '水电用容器板' zb,  "
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='水电用容器板'  AND A.XPLX='重点新产品'AND T.INSTORAGETIME " + strK + " UNION "

                       + "    select '28' rowindex, ' 船用容器板' zb,  "
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='船用容器板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"


                       + "    select '29' rowindex, '专用板' zb,  "
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='专用板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"


                       + "    select '30' rowindex, '桥梁板' zb,  "
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='桥梁板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"


                       + "    select '31' rowindex, '高建板（重点新产品包括厚度≥60mm-100mm的Q345GJB/C/D/E）' zb,  "
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "     NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='高建板（重点新产品包括厚度≥60mm-100mm的Q345GJB/C/D/E）'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " ";


                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }

                sqlstr = "    select '32' rowindex, '管线用钢板(战略新产品包括牌号带HIC要求管线钢）' zb,  "
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='管线用钢板(战略新产品包括牌号带HIC要求管线钢）'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"


                       + "    select '33' rowindex, '工程机械用耐磨板' zb,  "
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='工程机械用耐磨板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"


                       + "    select '34' rowindex, '耐候板' zb,  "
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='耐候板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"


                       + "    select '35' rowindex, '国外耐候板' zb,  "
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='国外耐候板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"


                       + "    select '36' rowindex, '塑料合金模具板' zb,  "
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='塑料合金模具板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"



                       + "    select '37' rowindex, '工程机械用板' zb,  "
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='工程机械用板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"



                       + "    select '38' rowindex, '圆锯片基材用钢板' zb,  "
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='圆锯片基材用钢板' AND T.INSTORAGETIME " + strK + " ";


                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }



                sqlstr = "    select '39' rowindex, '调质（Q+T)高强度结构板' zb,  "
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='调质（Q+T)高强度结构板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"


                       + "    select '40' rowindex, '结构板' zb,  "
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='结构板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"


                       + "    select '41' rowindex, '高强度结构板' zb,  "
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='耐候板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"


                       + "    select '42' rowindex, '国外高强度结构板' zb,  "
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='国外高强度结构板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"



                       + "    select '43' rowindex, '合金结构板' zb,  "
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='合金结构板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"



                       + "    select '44' rowindex, '特厚结构板（新产品牌号之外厚度＞100mm的各类结构板）' zb,  "
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='特厚结构板（新产品牌号之外厚度＞100mm的各类结构板）'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"




                       + "    select '45' rowindex, '特殊功能结构板（CTOD)' zb,  "
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='特殊功能结构板（CTOD)'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " UNION"



                       + "    select '46' rowindex, '核电板' zb,  "
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                       + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                       + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                       + "    AND A.XCPLX='核电板'  AND A.XPLX='重点新产品' AND T.INSTORAGETIME " + strK + " ";


                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }

                sqlstr = "select '47' rowindex, '一般新产品' zb, "
                  + "    null dayall, null monall "
                  + "    from dual union "


                  + "    select '48' rowindex, '耐候板' zb,  "
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='耐候板'  AND A.XPLX='一般新产品' AND T.INSTORAGETIME " + strK + " UNION"


                  + "    select '49' rowindex, '桥梁板' zb,  "
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='桥梁板' AND A.XPLX='一般新产品' AND T.INSTORAGETIME " + strK + " UNION "

                  + "    select '50' rowindex, '工程机械用板' zb,  "
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='工程机械用板' AND A.XPLX='一般新产品' AND T.INSTORAGETIME " + strK + " UNION"



                  + "    select '51' rowindex, '碳素结构板' zb,  "
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='碳素结构板' AND A.XPLX='一般新产品' AND T.INSTORAGETIME " + strK + " UNION"



                  + "    select '52' rowindex, '低合金板' zb,  "
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='低合金板' AND A.XPLX='一般新产品' AND T.INSTORAGETIME " + strK + " UNION"



                  + "    select '53' rowindex, '合金结构板' zb,  "
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='合金结构板' AND A.XPLX='一般新产品' AND T.INSTORAGETIME " + strK + " UNION"



                  + "    select '54' rowindex, '薄钢板新工艺正火板（≤12mm N、N+T）' zb,  "
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeFrom + " then  T.THEORYWEIGHT else 0 end),3),0) dayall,"
                  + "    NVL(round(sum(case when T.INSTORAGETIME " + strTimeTo + " then  T.THEORYWEIGHT else 0 end),3),0) monall"
                  + "    FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME AND T.DETERMINANTRESULT='40140101'     "
                  + "    AND A.XCPLX='薄钢板新工艺正火板（≤12mm N、N+T）' AND A.XPLX='一般新产品' AND T.INSTORAGETIME " + strK + " ";


                tmpdst = this.DBManager.ExecuteQuery(sqlstr, out strOut);
                if (tmpdst != null)
                {
                    rtndst.Merge(tmpdst.Copy());
                    tmpdst = null;
                }
                else
                {
                    return new ReturnObject(null, strOut);
                }
            }
            return new ReturnObject(rtndst);
        }

        public ReturnObject GzlistQuery(string _Where)
        {
            try
            {
                string strOut = "";
                string Sql = "SELECT T.BILLETID SERIALNUMBER,T.THEORYWEIGHT WEIGHT,A.STEELNAME,A.XPLX,A.XCPLX FROM KCZ_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME " +
                           " AND T.DETERMINANTRESULT='40140101' " +
                           " " +
                           " " + _Where + "  ";

                DataSet ds = this.DBManager.ExecuteQuery(Sql, out strOut);

                if (ds != null && ds.Tables.Count == 1)
                {
                    ds.Tables[0].TableName = "BJ3_DATAFORRPT";
                    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());
            }
        }


        public ReturnObject GzlistHBQuery(string _Where)
        {
            try
            {
                string strOut = "";
                string Sql = "SELECT T.BILLETID SERIALNUMBER,T.THEORYWEIGHT WEIGHT,A.STEELNAME,A.XPLX,A.XCPLX FROM KCH_TURNOFFLIST T ,SCM_STEEL_NEW A WHERE T.DETERMINANTCARDNUMBER=A.STEELNAME " +
                           " AND T.DETERMINANTRESULT='40140101' " +
                           " " +
                           " " + _Where + "  ";

                DataSet ds = this.DBManager.ExecuteQuery(Sql, out strOut);

                if (ds != null && ds.Tables.Count == 1)
                {
                    ds.Tables[0].TableName = "BJ3_DATAFORRPT";
                    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());
            }
        }


       
	}
}
