📄 cms636.sqc
字号:
/******************************************************************** ** 源码文件名称 : cms636.SQC ** 所属子系统 : CMS ** 当前文件版本 : 1.0.0.0 ** 作 者 : xuliang ** 版本创建日期 : 2005/01/08 ** 功能描述 : 制卡文件查询 ** 修改记录 : ** 修改人 修改日期 修改日期*********************************************************************/#include "sysdefine.h"#include <stdio.h>#include "pubcom.h"#include "funcapi.h"#include "code.h"#include "attrdef.h"#include "cmscode.h"#include "cmsmkfile.h"#include "cmshismkfile.h"EXEC SQL INCLUDE SQLCA;/********************************************************* 函数名称: cms216036** 功能描述:制卡文件查询** 输入参数:** acBeginDate ---- 起始日期** acEndDate ---- 终止日期 ** 输出参数:** ** 返回结果: ** 作 者 : xuliang ** 版本创建日期 : 2005/01/08** 修改记录 :** 修改人 修改日期 修改位置*******************************************************/int cms216036(pstPubcom)struct pubcom *pstPubcom;{ EXEC SQL BEGIN DECLARE SECTION; EXEC SQL END DECLARE SECTION; FILE *fp; /* 文件指针 */ char acBeginDate[ DATE_LEN + 1 ]; /* 起始日期 */ char acEndDate[ DATE_LEN + 1 ]; /* 终止日期 */ char acCardNo[ CARDNO_LEN + 1 ]; /* 卡号 */ char acTableName[PRDCODE_LEN + 1]; /* 表名称 */ char acFileName[FILENAME_LEN + 1]; /* 文件名称 */ char acSelStr[ CONDITION_LEN + 1 ]; char acWhrStr[ CONDITION_LEN + 1 ]; struct cmsmkfile stCmsmkfile; /* 卡片制卡文件 */ struct cmshismkfile stCmshismkfile; /* 卡片制卡文件历史表 */ sprintf( g_acTrcMsg,"制卡文件查询开始"); TRCLOG4 memset( acBeginDate, 0x00, sizeof( acBeginDate ) ); memset( acEndDate, 0x00, sizeof( acEndDate ) ); memset( acCardNo, 0x00, sizeof( acCardNo ) ); memset( acFileName, 0x00, sizeof( acFileName ) ); memset( acTableName, 0x00, sizeof( acTableName ) ); memset( acSelStr,0x00, sizeof( acSelStr ) ); memset( acWhrStr,0x00, sizeof( acWhrStr ) ); memset( &stCmsmkfile, 0x00, sizeof( struct cmsmkfile ) ); memset( &stCmshismkfile, 0x00, sizeof( struct cmshismkfile ) ); /* 取数据字典 */ getstring( "BeginDate1", acBeginDate ); getstring( "EndDate1", acEndDate); getstring( "CardNo", acCardNo ); sprintf( g_acTrcMsg,"BeginDate1[%s]EndDate1[%s]CardNo[%s]",acBeginDate,acEndDate,acCardNo); TRCLOG3 if(GenSqlCmd( "216036" , acSelStr ) ) { ERRLOG goto Exit; } sprintf( acWhrStr," where 1=1 " ) ; if ( strcmp ( acBeginDate, INITDATE ) ) { sprintf( acWhrStr+strlen(acWhrStr), " and makedate >= '%s'", acBeginDate ); } if ( strcmp ( acEndDate, INITDATE ) ) { sprintf( acWhrStr+strlen(acWhrStr), " and makedate <= '%s'", acEndDate ); } if ( strlen ( acCardNo ) > 0 ) { sprintf( acWhrStr+strlen(acWhrStr), " and cardno = '%s'", acCardNo ); } sprintf( acWhrStr+strlen(acWhrStr)," union %s from cmshismkfile where 1=1 ", acSelStr ) ; if ( strcmp ( acBeginDate, INITDATE ) ) { sprintf( acWhrStr+strlen(acWhrStr), " and makedate >= '%s'", acBeginDate ); } if ( strcmp ( acEndDate, INITDATE ) ) { sprintf( acWhrStr+strlen(acWhrStr), " and makedate <= '%s'", acEndDate ); } if ( strlen ( acCardNo ) > 0 ) { sprintf( acWhrStr+strlen(acWhrStr), " and cardno = '%s'", acCardNo ); } sprintf( acWhrStr+strlen(acWhrStr), " ORDER BY makedate, cardno, serseqno DESC" ); strcpy( acTableName, "cms636" ); sprintf(acFileName, "%s%s%s", acTableName, pstPubcom->acBrc,pstPubcom->acTeller); fp = (FILE *)BeginFile( pstPubcom, acFileName ); if ( fp == NULL ) { strcpy( g_acRspMsg, "打开文件句柄出错!" ); pubCrtRspInfo( ); ERRLOG goto Exit; } /*组织查询字典*/ if(GetInqDict( fp , "216036" ) ) { ERRLOG goto Exit; } /* 准备数据 */ sprintf( g_acTrcMsg, "%s%s" ,acSelStr,acWhrStr); TRCLOG3 if( DBSelect( "cmsmkfile", acSelStr ,acWhrStr , fp ) ) { ERRLOG goto Exit; } /* 出口赋值 */ Exit: EndFile( fp ); if( !strcmp( g_acRspCode, RSP_OK ) ) { SetInqFormid(pstPubcom, "216036") ; sprintf( g_acTrcMsg,"制卡文件查询正常结束"); TRCLOG4 return SUCCESS; } else { sprintf( g_acTrcMsg,"制卡文件查询查询失败"); TRCLOG4 return FAILED ; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -