eis/inc/cda/RollDAO.h

289 lines
10 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*********************************************************************
*
* 文 件: RollDAO.h 轧辊模块访问数据库的功能接口
*
* 版权所有: Shanghai Baosight Software Co., Ltd.
*
* 概述://TODO请添加本文件包含功能详细描述
* //TODO
* //TODO
*
* 版本历史
* 1.0 2010-07-26 tonny //TODO请添加本次主要修改内容
* %USER%
*********************************************************************/
#ifndef _ROLLDAO_H_
#define _ROLLDAO_H_
#include <common/BasicStruct.h>
#include <map>
#include <vector>
#include <string>
#include <cda/RollDefine.h>
#include <log4cplus/LOG.h>
#include <cda/LstDAO.h>
#include <glob/ShiftMag.h>
#include <base/TCMTime.h>
#include "dbinc/T_ROL_DATA.h"
#include "dbinc/T_ROL_HISTORY.h"
#include "dbinc/T_PDO_PH.h"
using namespace std;
#define ROLLONLINE "I"
#define ROLLNEXT "N"
#define ROLLNEW "P"
#define ROLLUSED "R"
#define WORKROLL "W"
#define MIDDLEROLL "M"
#define BACKUPROLL "B"
#define TOPPOSTION "U"
#define BOTPOSTION "L"
namespace baosight
{
class RollDAO
{
public:
RollDAO(string dbName = "DB2 9.7"){ m_databaseName = dbName ; }
/**********************************************************************
* 概述: 轧机换全部辊
* 函数名: WriteChangeAllRoll
* 返回值: int //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
*
* 版本历史
* 1.0 2010-07-26 tonny //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual int WriteChangeAllRoll();
virtual int LoadNewRoll(string rollNo);
virtual int UnLoadOldRoll(string rollNo);
/**********************************************************************
* 概述: //TODO:请添加函数描述
* 函数名: WriteChangeWorkRoll
* 返回值: int //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
*
* 版本历史
* 1.0 2010-07-26 tonny //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual int WriteChangeWorkRoll( int standno = 1);
virtual int WriteChangeMidRoll( int standno = 1);
virtual int WriteChangeBurRoll( int standno = 1);
virtual int WriteChangeBurUpRoll( int standno = 1);
virtual int WriteChangeBurDnRoll( int standno = 1);
/**********************************************************************
* 概述: Next中的工作辊成对插入机架
* 函数名: InsertWorkRoll
* 返回值: int //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
*
* 版本历史
* 1.0 2010-07-26 tonny //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual int InsertWorkRoll( int standno = 1);
virtual int InsertMidRoll( int standno = 1);
virtual int InsertBurUpRoll( int standno = 1);
virtual int InsertBurDnRoll( int standno = 1);
virtual int InsertBurRoll( int standno = 1);
virtual int InsertWorkRoll( const string&);
virtual int InsertMidRoll( const string&);
virtual int InsertBurRoll( const string&);
/**********************************************************************
* 概述: Current中的工作辊成对抽出机架
* 函数名: InsertWorkRoll
* 返回值: int //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
*
* 版本历史
* 1.0 2010-07-26 tonny //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual int ExtractWorkRoll( int standno = 1);
virtual int ExtractMidRoll( int standno = 1);
virtual int ExtractBurUpRoll( int standno = 1);
virtual int ExtractBurDnRoll( int standno = 1);
virtual int ExtractBurRoll( int standno = 1);
virtual int ExtractWorkRoll( const string&);
virtual int ExtractMidRoll( const string&);
virtual int ExtractBurRoll( const string&);
/**********************************************************************
* 概述: 更新轧辊统计数据
* 函数名: WriteRollProdData
* 返回值: int //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* data : [IN/OUT] const RollProdData & //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2010-07-26 tonny //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual int WriteRollProdData(const RollProdData& data);
/**********************************************************************
* 概述: 根据MU_CODE读取轧制累计数据
* 函数名: ReadRollProdData
* 返回值: int
* 参数列表: 参数类型 取值范围 描述
* muCode: const MU_CODE &
* data: RollProdData &
*
* 版本历史
* 1.0 2010-08-19 echo_li 初次建立
*
**********************************************************************/
virtual int ReadRollProdData(const MU_CODE& muCode,RollProdData& data);
/**********************************************************************
* 概述: 改变轧辊状态为 当前状态
* 函数名: ChangeRollStatus
* 返回值: int //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* rollNo : [IN/OUT] string //TODO:参数取值范围 <//TODO:参数描述>
* status : [IN/OUT] string //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2010-08-13 tonny //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual int ChangeRollStatus(string rollNo,string status);
/**********************************************************************
* 概述: 改变轧辊状态为 当前状态
* 函数名: ChangeRollStand
* 返回值: int //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* rollNo : [IN/OUT] string //TODO:参数取值范围 <//TODO:参数描述>
* stand : [IN/OUT] int //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2010-08-13 tonny //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual int ChangeRollStand(string rollNo, int stand);
/**********************************************************************
* 概述: 根据轧辊号去读取轧辊数据
* 函数名: GetRollData
* 返回值: int //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* rollno : [IN/OUT] string //TODO:参数取值范围 <//TODO:参数描述>
* data : [IN/OUT] RollInfo & //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2010-08-12 tonny //TODO请添加本次主要修改内容
**********************************************************************/
virtual int GetRollData(string rollno,RollInfo& data);
/**********************************************************************
* 概述: read roll data from db by rollType,status,standNo
* 函数名: GetRollData
* 返回值: int //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* rollType : [IN/OUT] string //TODO:参数取值范围 <//TODO:参数描述>
* status : [IN/OUT] char //TODO:参数取值范围 <//TODO:参数描述>
* standNo : [IN/OUT] int //TODO:参数取值范围 <//TODO:参数描述>
* rolldata : [IN/OUT] VecRoll & //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2010-08-12 tonny //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual int GetRollData(string rollType,string pos,string status ,int standNo,VecRoll& rolldata);
virtual int CopyRoll(string srcRollNo,string destRollNo);
virtual int DelRoll( string RollNo);
virtual string ToString(){ return m_databaseName ;}
protected:
/**********************************************************************
* 概述: Set current rolls status to 'R' and set next rolls status to 'I'
* 函数名: WriteChangeRoll2Db
* 返回值: int //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* lineSql : [IN/OUT] string //TODO:参数取值范围 <//TODO:参数描述>
* prepareSql : [IN/OUT] string //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2010-08-12 tonny //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual int WriteChangeRoll2Db(string lineSql,string prepareSql);
/**********************************************************************
* 概述: Set next rolls status to 'P' and set waiting rolls status to 'N'
* 函数名: WritePrepareRoll2Db
* 返回值: int //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* lineSql : [IN/OUT] string //TODO:参数取值范围 <//TODO:参数描述>
* prepareSql : [IN/OUT] string //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2010-08-12 tonny //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual int WritePrepareRoll2Db(string nextSql,string prepareSql);
/**********************************************************************
* 概述: Set next rolls status to 'R' and set waiting rolls status to 'N'
* 函数名: WritePrepareRoll2Db
* 返回值: int //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* lineSql : [IN/OUT] string //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2010-08-12 tonny //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual int SetCurrentRoll2R( string lineSql);
/**********************************************************************
* 概述: Set next rolls status to 'R' and set waiting rolls status to 'N'
* 函数名: SetNextRoll2I
* 返回值: int //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* prepareSql : [IN/OUT] string //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2010-08-12 tonny //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual int SetNextRoll2I( string prepareSql);
private:
string m_databaseName;
};
};
#endif