package com.steering.pss.qcm;

import java.sql.SQLException;
import java.util.ArrayList;
import CoreFS.SA06.CoreReturnObject;
import CoreFS.SA08.CoreXmlSqlParsersFactory;
import CoreFS.SC01.CoreConstantData;

import com.steering.comm.db.DBCommon;

/**
 * 冶金规划管理类
 * @author XJC 2014/11/3
 * @version v1.0
 * @modify
 */
public class CoreFrmProPSCMSC extends DBCommon {
	/**
     * 产品名基础信息查询
     * @return CoreReturnObject 返回 产品一级菜单名。
     */
	public CoreReturnObject getLineListQuery() {
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERY");
	} 
	/**
     * MSC数据状态基础信息查询
     * @return CoreReturnObject 。
     */
	public CoreReturnObject getLineListQueryVALIDFLAG() {
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYVALIDFLAG");
	}  
	/**
     * 查询产品和标准代码基础信息查询
     * @return CoreReturnObject 返回 产品菜单名。
     */
	public CoreReturnObject getLineListQUERYStaPsc(String name) {
		   Object[] params = new Object[] { name};
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYStaPsc",params);
	} 
	/**
     * 查询产品和标准代码基础信息查询
     * @return CoreReturnObject 返回 产品菜单名。
     */
	public CoreReturnObject getLineListQUERYPSCORMSCCOUNT(String name,String codeName) {
		   Object[] params = new Object[] { name,codeName};
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYPSCORMSCCOUNT",params);
	}
	/**
     * 查询MSC代码基础信息查询
     * @return CoreReturnObject 返回 产品菜单名。
     */
	public CoreReturnObject getLineListQUERYStaMsc() { 
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYStaMsc");
	} 
	/** 
     * 冶金规范基础信息查询
     * @return CoreReturnObject 返回 cobx。
     */
	public CoreReturnObject getLineListQueryMSC() {  
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYMSC");
	}
	/**
     * 是否维护内控标准规范基础信息查询
     * @return CoreReturnObject 返回 cobx。
     */
	public CoreReturnObject getLineListQUERYLKAK() {  
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYLKAK");
	}
	/**
     * 查询COM_BASE_INFO,项目菜单。
     * @return CoreReturnObject 返回 cobx。
     */
	public CoreReturnObject getLineListQUERYSCOM_BASE_INFO() {  
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYSCOM_BASE_INFO");
	}
	/**
     * 查询COM_BASE_INFO,项目子菜单
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListQUERYSCOM_BASE_INFO_SORT(String name) {  
		Object[] params = new Object[] { name};
        return this.getDataBySqlID("getLineListQUERYSCOM_BASE_INFO_SORT",params);
	}
	/**
     * 查询单条COM_BASE_INFO,项目主菜单
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListQUERYSCOM_BASE_INFO_SORT_BASE(String name) {  
		Object[] params = new Object[] { name};
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYSCOM_BASE_INFO_SORT_BASE",params);
	}
	/**
     * 查询COM_BASE_INFO,项目子菜单
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListQUERYSCOM_COM_ITEM(String name) {  
		String sql = "SELECT msc, index_seq, item, (SELECT basename FROM com_base_info WHERE basecode = it.item_c)item_c, create_name, create_time, update_name,update_time, delete_name, delete_time, validflag, memo FROM com_msc_item it "+name+" ";
        return this.getData(sql); 	
	} 
	/**
     * 查询全工序代码与描述
     * @return CoreReturnObject  
     */
	public CoreReturnObject getQUERYSCOM_BASE_PRO(String name) {  
		String sql = "SELECT process_code, process_desc, process_id  FROM com_base_process WHERE process_code IN ("+name+") ORDER BY PROCESS_ID";
        return this.getData(sql); 	
	} 
	/**
     * ALPHA 规范基础信息查询
     * @return CoreReturnObject 返回 ALPHA（客户代码）。
     */
	public CoreReturnObject getLineListQuerySTD() {  
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYSTD");
	}
	/**
     * 全工序PROCEES基础信息查询
     * @return CoreReturnObject 返回 ALPHA（客户代码）。
     */
	public CoreReturnObject getLineListQUERYSCOM_MSC_PROCESS(String msc,String msc_pline) {  
		Object[] params = new Object[] { msc,msc_pline,msc,msc_pline};
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYSCOM_MSC_PROCESS",params);
	}
	/**
     * 全工序点STATION基础信息查询
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListQUERYSCOM_MSC_STATION(String process_code,String msc,String msc_pline) {  
		 String sql = " SELECT  ms.msc,ms.msc_pline,bs.station_code, bs.station_desc, bs.station_type, bs.station_id, bs.process_code,"+
				      " bs.process_desc, bs.process_code_c, bs.process_desc_c, ms.COST, ms.choose,"+
				      " ms.return_result, ms.send_checkplan, ms.GROUP_SEQ, bs.create_name, bs.create_time,"+
				      " bs.update_name, bs.update_time, bs.delete_name, bs.delete_time, bs.validflag, ms.memo"+
					  " FROM (select * from com_base_station where process_code IN ("+process_code+")) bs left join com_msc_station ms"+
                      " on  bs.PROCESS_CODE = ms.process_code and bs.station_code = ms.station_code and ms.msc = "+msc+" and ms.msc_pline = "+msc_pline+""+
					  " order by bs.PROCESS_CODE";
        return this.getData(sql);
	}
	/**
     * 查询接箍码或备料码
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListQUERYJGAndMSC(String msc,Boolean flag) {  
		String deletedFlag = flag ? "0" : "";
		Object[] params = new Object[] { msc,deletedFlag};
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYJGAndMSC",params);
	}
	/**
     * 查询全程工序点
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListQUERY_MSC_STATION_DESC(String msc,String msc_pline) {   
		Object[] params = new Object[] { msc,msc_pline};
        return this.getDataBySqlID("CoreFrmProPSCMSC.SELECT_MSC_STATION_DESC",params);
	}
	/**
     * 全工序点PRO基础信息查询
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListSELECTCOM_MSC_PRO_SAVEROW(String msc,String msc_pline,String process_desc) {  
		Object[] params = new Object[] { msc,msc_pline,process_desc};
        return this.getDataBySqlID("CoreFrmProPSCMSC.SELECTCOM_MSC_PRO_SAVEROW",params);
	}
	/**
     * Type 规范类型基础信息查询
     * @return CoreReturnObject 返回 ALPHA（客户代码）。
     */
	public CoreReturnObject getLineListQueryType() {  
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYTYPE");
	}
	/**
     * 冶金规范表基础信息查询
     * @return CoreReturnObject 返回 DataSet（冶金规范数据）。
     */
	public CoreReturnObject getLineListQueryComMsc(String name) {  
		Object[] params = new Object[] { name};
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYCOMMSC",params);
	}
	/**
     * 查询冶金规范表基础信息表状态
     * @return CoreReturnObject 返回 DataSet（冶金规范数据）。
     */
	public CoreReturnObject getLineListQUERYCOM_MSC_PSCRMSC(String name) {  
		Object[] params = new Object[] { name};
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYCOM_MSC_PSCRMSC",params);
	}
	/**
     * 修改UPDATEVALIDFLAG状态 数据
     * @return CoreReturnObject 。
     */
	public CoreReturnObject getLineListUPDATEPSCRMSCIS(ArrayList<Object> parm) {  
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.UPDATEPSCRMSCIS");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 修改UPDATEVALIDFLAG状态 数据
     * @return CoreReturnObject 。
     */
	public CoreReturnObject getLineListUPDATEVALIDFLAG(ArrayList<Object> parm) {  
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.UPDATEVALIDFLAG");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 新增COM_PSC_R_MSC数据
     * @return CoreReturnObject 。
     */
	public CoreReturnObject getLineListInsertPSCRMSC(ArrayList<Object> parm) {  
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.InsertPSCRMSC");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 新增冶金规范表
     * @param parm 参数
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
	public CoreReturnObject getLineListInsertMSC(ArrayList<Object> parm) {
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.InsertMSC");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 修改Com_Msc数据
     * @return CoreReturnObject 。
     */
	public CoreReturnObject getLineListSETUPDATECOMMSC(ArrayList<Object> parm) {  
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.SETUPDATECOMMSC");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 新增冶金规范产线规范表
     * @param parm 参数
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
	public CoreReturnObject getLineListINSERTCOM_MSC_BACKLOG(ArrayList<Object> parm) {
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.INSERTCOM_MSC_BACKLOG");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * Type 冶金规范产线规范表信息查询 
     */
	public CoreReturnObject getLineListQUERYSCOM_MSC_BACKLOGS(String name,String msc_lipen) { 
		Object[] params = new Object[] { name,msc_lipen};
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYSCOM_MSC_BACKLOGS",params);
	}
	/**
     * Type 验证冶金规范产线规范表信息查询 
     */
	public CoreReturnObject getLineListQUERYSCOM_MSC_BACKLOG(String name) { 
		Object[] params = new Object[] { name};
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYSCOM_MSC_BACKLOG",params);
	}
	/**
     * 新增COM_MSC_ITEM项目表数据
     * @param parm 参数
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
	public CoreReturnObject getLineListINSERTCOM_MSC_ITEM(ArrayList<Object> parm) {
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.INSERTCOM_MSC_ITEM");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 新增com_msc_std_cic成分表数据
     * @param parm 参数
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
	public CoreReturnObject getLineListINSERTCOM_MSC_STD_CIC(ArrayList<Object> parm) {
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.INSERTCOM_MSC_STD_CIC");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 新增com_msc_std_cic材质表数据
     * @param parm 参数
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
	public CoreReturnObject getLineListINSERTCOM_MSC_STD_PIC(ArrayList<Object> parm) {
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.INSERTCOM_MSC_STD_PIC");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 查询PRO工序基础表seq
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListSELECTCOM_MSC_PRO_SEQ(String name,String codeName) {  
		Object[] params = new Object[] { name,codeName};
        return this.getDataBySqlID("CoreFrmProPSCMSC.SELECTCOM_MSC_PRO_SEQ",params);
	}
	/**
     * 新增com_msc_pro全工序表
     * @param parm 参数
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
	public CoreReturnObject getLineListINSERTCOM_MSC_PRO(ArrayList<Object> parm) {
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.INSERTCOM_MSC_PRO");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 查询sta工序点基础表
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListSELECTCOM_MSC_STA(String name,String msc_pline) {  
		Object[] params = new Object[] { name,msc_pline};
        return this.getDataBySqlID("CoreFrmProPSCMSC.SELECTCOM_MSC_STA",params);
	}
	/**
     * 查询sta工序点基础表
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListSELECTCOM_MSC_STA_SAVEROW(String name,String msc_pline,String whole_backlog ,String station_code,String station_type) {  
		Object[] params = new Object[] { name,msc_pline,whole_backlog,station_code,station_type};
        return this.getDataBySqlID("CoreFrmProPSCMSC.SELECTCOM_MSC_STA_SAVEROW",params);
	}
	/**
     * 查询com_msc_grade是否有记录。
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListQUERYSCOM_MSC_GRADE_ROWS(String msc,String msc_pline,String grade) {  
		Object[] params = new Object[] { msc,msc_pline,grade};
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYSCOM_MSC_GRADE_ROWS",params);
	}
	/**
     * 根据冶金和产线号查询全程工序与钢种关系
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListQUERYSGRADE_ROWS(String msc,String msc_pline) {  
		Object[] params = new Object[] { msc,msc_pline};
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYSGRADE_ROWS",params);
	}
	/**
     * 根据冶金号查询全程工序与钢种关系
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListQUERYSGRADE_PLINE_ROWS(String msc) {  
		Object[] params = new Object[] { msc};
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYSGRADE_PLINE_ROWS",params);
	}
	/**
     * 新增com_msc_sta工序点表
     * @param parm 参数
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
	public CoreReturnObject getLineListINSERTCOM_MSC_STA(ArrayList<Object> parm) {
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.INSERTCOM_MSC_STA");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 查询全程与钢种关系表COM_MSC_GRADE。
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListQUERYSCOM_MSC_GRADE() {   
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYSCOM_MSC_GRADE");
	}
	/**
     * 新增数据COM_MSC_GRADE表
     * @param parm 参数
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
	public CoreReturnObject getLineListINSERTCOM_MSC_GRADE(ArrayList<Object> parm) {
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.INSERTCOM_MSC_GRADE");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 更新数据COM_MSC_GRADE表
     * @param parm 参数
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
	public CoreReturnObject getLineListUPDATECOM_MSC_GRADE(ArrayList<Object> parm) {
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.UPDATECOM_MSC_GRADE");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 查询COM_BASE_STD 内控标准。
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListQUERYSCOM_BASE_STD_NK() {   
        return this.getDataBySqlID("CoreFrmProPSCMSC.QUERYSCOM_BASE_STD_NK");
	}
	/**
     * 更新数据COM_MSC_BACKLOG表
     * @param parm 参数
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
	public CoreReturnObject getLineListUPDATECOM_MSC_BACKLOG(ArrayList<Object> parm) {
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.UPDATECOM_MSC_BACKLOG");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 更新com_msc_procees成本
     * @return CoreReturnObject  
     */
	public CoreReturnObject UPDATECOM_BASE_PROCESSCOST(ArrayList<Object> parm) {   
		CoreReturnObject cro = new CoreReturnObject();
        String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.UPDATECOM_BASE_PROCESSCOST");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 删除com_msc_procees
     * @return CoreReturnObject  
     */
	public CoreReturnObject DELETE_MSC_PROCESS(ArrayList<Object> parm) {   
        CoreReturnObject cro = new CoreReturnObject();
        String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.DELETE_MSC_PROCESS");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 删除com_msc_station
     * @return CoreReturnObject  
     */
	public CoreReturnObject DELETE_MSC_STATION(ArrayList<Object> parm) {   
        CoreReturnObject cro = new CoreReturnObject();
        String strSql = CoreXmlSqlParsersFactory.getSql("CoreFrmProPSCMSC.DELETE_MSC_STATION");
		try {
			cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 查询冶金规范项目树节点
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListSELECT_MSC_STATION_ITEMCODE(String msc) {  
		Object[] params = new Object[] { msc};
        return this.getDataBySqlID("CoreFrmProPSCMSC.SELECT_MSC_STATION_ITEMCODE",params);
	}
	/**
     * 查询工序树节点
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListSELECT_MSC_STATION_PROCESSDESC(String msc,String msc_lien) {  
		Object[] params = new Object[] { msc,msc_lien,msc,msc_lien,msc,msc_lien};
        return this.getDataBySqlID("CoreFrmProPSCMSC.SELECT_MSC_STATION_PROCESSDESC",params);
	}
	/**
     * 查询钢种树节点xwl
     * @return CoreReturnObject  
     */
	public CoreReturnObject getLineListSELECT_MSC_STATION_GRADECODE(String msc,String msc_lien) {  
		Object[] params = new Object[] { msc,msc_lien};
        return this.getDataBySqlID("CoreFrmProPSCMSC.SELECT_MSC_STATION_GRADECODE",params);
	}


}
