package com.steering.pss.plnsaleord.order;

import CoreFS.SA06.CoreReturnObject;
import java.sql.SQLException;
import java.util.ArrayList;

import CoreFS.SA08.CoreXmlSqlParsersFactory;

import com.steering.comm.db.DBCommon;

public class CoreOrderLenPln extends DBCommon {
	

	/**
     * 自动生成长度编码
     */
	public CoreReturnObject GetLenNo() {
		CoreReturnObject cro =  this.getDataBySqlID("CoreOrderLenPln.GetLenNo");
		return cro;
	}
	
	/**
     * 查询是否存在长度描述
     * @param lenDesc 长度编码
     */
	public CoreReturnObject isRepeat(String lenDesc) {
		Object[] obj = new Object[] { lenDesc };
        return this.getDataBySqlID("CoreOrderLenPln.isRepeat",obj);
	}
	
	/**
     * 查询长度描述
     * @param lenNo 长度编码
     */
	public CoreReturnObject doQuery(String lenNo) {
		Object []obj = new Object[]{lenNo};
        return this.getDataBySqlID("CoreOrderLenPln.QUERY",obj);
	}
	
	public CoreReturnObject doQuery1(String lenNo) {
		Object []obj = new Object[]{lenNo};
        return this.getDataBySqlID("CoreOrderLenPln.QUERY1",obj);
	}
	/**
     * 长度修改
     * @param parm 参数
     */
	public CoreReturnObject doUpdate(ArrayList<Object> parm) {
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreOrderLenPln.doUpdate");
		try {
			cro = this.getDao("TgDao").ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	/**
     * 长度修改
     * @param parm 参数
     */
    public CoreReturnObject doupdateLen(ArrayList<Object> parm) {
        CoreReturnObject cro = new CoreReturnObject();
        String strSql = CoreXmlSqlParsersFactory.getSql("CoreOrderLenPln.updateLen");
        try {
            cro = this.getDao("TgDao").ExcuteNonQuery(strSql, parm.toArray());
        } catch (SQLException e) {
            cro = cro.SetErrInfo(e.getMessage());
        }
        return cro;
    }
	/**
     * 新增长度
     * @param parm 参数
     */
	public CoreReturnObject doAdd(ArrayList<Object> parm) {
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreOrderLenPln.doAdd");
		try {
			cro = this.getDao("TgDao").ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	
	/**
     * 专用线基础信息删除或恢复
     * @param plineCodes 产线代码集合
     * @param operator 操作人
     * @param isDelete true删除 false恢复
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
    public CoreReturnObject doDelete(ArrayList<Object> parm) {  	
    	CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreOrderLenPln.doDelete");
		try {
			cro = this.getDao("TgDao").ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	
	
}
