117 lines
4.6 KiB
C++
117 lines
4.6 KiB
C++
/*********************************************************************
|
|
*
|
|
* 文 件: PapRcvGenSQL.h 用于产生插入数据时的主键部分
|
|
*
|
|
* 版权所有: Shanghai Baosight Software Co., Ltd.
|
|
*
|
|
* 概述:
|
|
* :
|
|
* :
|
|
*
|
|
* 版本历史
|
|
* 1.0 2010-09-02 echo_li 增加注释
|
|
*
|
|
*********************************************************************/
|
|
#ifndef _PapRcvGenSQL_H
|
|
#define _PapRcvGenSQL_H
|
|
|
|
#include <dao/MaterialInfo.h>
|
|
#include <log4cplus/LOG.h>
|
|
//#include <cda/PmgDefine.h>
|
|
|
|
#include <common/UserConst.h>
|
|
|
|
|
|
#define CN_MAX_SIZE_WHERE 200 //Where条件
|
|
|
|
//插入更新标志
|
|
struct S_INS_UPD_PARAMS{
|
|
int log; // for T_PDI_LO table
|
|
int ord; // for T_PDI_OR table
|
|
char rollId[20]; // for T_ROL_DATA
|
|
char plantType[4]; // for roll data table
|
|
char planNo[10]; //for scheduleheader table added by fxd 20081007
|
|
short defSid; //for EntryDefet table added by liliang 20100730
|
|
};
|
|
|
|
/*********************************************************************
|
|
* 类 名: PapRcvGenSQL
|
|
* 版权所有: Shanghai Baosight Software Co., Ltd.
|
|
* 类 职 责:获取插入主键与更新条件
|
|
*
|
|
*
|
|
* 版本历史
|
|
* 1.0 2010-04-29 echo_li 初次建立
|
|
*
|
|
*********************************************************************/
|
|
namespace baosight{
|
|
class PapRcvGenSQL
|
|
{
|
|
public:
|
|
PapRcvGenSQL(void);
|
|
virtual ~PapRcvGenSQL(void);
|
|
|
|
private:
|
|
|
|
public:
|
|
|
|
static char stmt1[CN_MAX_SIZE_WHERE]; //主键部分
|
|
static char stmtVal[CN_MAX_SIZE_WHERE]; //主键值部分
|
|
static S_INS_UPD_PARAMS insUpdParams; // Parameters for insert and update WM 010709
|
|
static MAT_STRUCTURE material;
|
|
public:
|
|
/**********************************************************************
|
|
* 概述: 获取插入时的主键
|
|
* 函数名: GetInsertStmt
|
|
* 返回值: char*
|
|
* 参数列表: 参数类型 取值范围 描述
|
|
* eventNo: int 事件号
|
|
* tabName: string 表名
|
|
* count: int * 第几次插入
|
|
* stmtVal: char * 主键值
|
|
*
|
|
* 版本历史
|
|
* 1.0 2010-09-02 echo_li 增加注释
|
|
*
|
|
**********************************************************************/
|
|
static string GetInsertStmtByMU( const string& table, const string& partcolumn, const string& partvalue, const string& key, const string& kval);
|
|
static string GetUpdateStmtByMU( const string& table, const string& partvalue, const string& where);
|
|
static string GetDeleteStmtByMU( const string& table, const string& where);
|
|
static string GetInsertSingle( const string& table, const string& partcolumn, const string& partvalue);
|
|
static string GetUpdateSingle( const string& table, const string& value, const vector<string>& pkcolumn, const vector<string>& pkvalue);
|
|
|
|
static string InsertDataPH( const string& table, const string& partcolumn, const string& partvalue);
|
|
static string InsertDataLO( const string& table, const string& partcolumn, const string& partvalue);
|
|
static string InsertDataOR( const string& table, const string& partcolumn, const string& partvalue);
|
|
|
|
static string InsertPrimDataPH1( const string& table, const string& partcolumn, const string& partvalue);
|
|
static string InsertPrimDataPH2( const string& table, const string& partcolumn, const string& partvalue);
|
|
static string InsertPrimDataLO1( const string& table, const string& partcolumn, const string& partvalue);
|
|
static string InsertPrimDataLO2( const string& table, const string& partcolumn, const string& partvalue);
|
|
static string InsertPrimDataOR1( const string& table, const string& partcolumn, const string& partvalue);
|
|
static string InsertPrimDataOR2( const string& table, const string& partcolumn, const string& partvalue);
|
|
|
|
static string UpdatePrimDataPH( const string& table, const string& partvalue);
|
|
static string UpdatePrimDataLO( const string& table, const string& partvalue);
|
|
static string UpdatePrimDataOR( const string& table, const string& partvalue);
|
|
|
|
static string InsertMultiPH( const string& table, const string& partcolumn, const string& partvalue, int seq);
|
|
static string InsertMultiLO( const string& table, const string& partcolumn, const string& partvalue, int seq);
|
|
static string InsertMultiOR( const string& table, const string& partcolumn, const string& partvalue, int seq);
|
|
|
|
static string DeleteMultiPH( const string& table);
|
|
static string DeleteMultiLO( const string& table);
|
|
static string DeleteMultiOR( const string& table);
|
|
|
|
static string CutLastComma( const string& input);
|
|
|
|
|
|
|
|
private:
|
|
|
|
};
|
|
}
|
|
#endif //_PapRcvGenSQL_H
|
|
|
|
|