select_engine_sqlserver: 用于sqlsql select 生成器

View source: R/040-sqlserver.R

select_engine_sqlserverR Documentation

用于sqlsql select 生成器

Description

用于sqlsql select 生成器

Usage

select_engine_sqlserver(
  fieldName_vec_simple,
  table_name,
  fieldName_caption_simple = NULL,
  fieldName_vec_aggr = NULL,
  fieldName_caption_aggr = NULL,
  fun_vec_aggr = NULL,
  fieldName_vec_where = NULL,
  comparerSig_vec_where = NULL,
  filterValue_vec_where = NULL,
  comboCondition_logi_vec_where = NULL,
  fieldName_vec_groupBy = NULL,
  fieldName_vec_orderBy = NULL,
  asc_vec_orderBy = NULL
)

Arguments

fieldName_vec_simple

普通字段列表

table_name

表名称

fieldName_caption_simple

普通字段标题

fieldName_vec_aggr

聚合字段列表

fieldName_caption_aggr

字段字段列表

fun_vec_aggr

聚合函数

fieldName_vec_where

行过滤字段列表

comparerSig_vec_where

行比较符

filterValue_vec_where

行比值值

comboCondition_logi_vec_where

多行连接

fieldName_vec_groupBy

分组字段

fieldName_vec_orderBy

排序字段列表

asc_vec_orderBy

字段升降排序

Value

返回值

Examples

select_engine_sqlserver();
#test 01 只显示字段列表--------
# select  FVOUCHERGROUPNO,FYEAR,FPERIOD,FBILLNO from T_GL_VOUCHER
fieldName_vec_simple <-c('FVOUCHERGROUPNO','FYEAR','FPERIOD','FBILLNO');
table_name ='T_GL_VOUCHER';
simpleFieldCombiner_sqlserver(fieldName_vec_simple);

test01 <- select_engine_sqlserver(fieldName_vec_simple =fieldName_vec_simple ,
                                 table_name = table_name
);
test01;
#test 02 显示字段列表及别名--------
# select    FVOUCHERGROUPNO as 凭证字号  ,  FYEAR as 会计年度  ,  FPERIOD as 会计期间  ,
# FBILLNO as 凭证号      from  T_GL_VOUCHER

fieldName_vec_simple <-c('FVOUCHERGROUPNO','FYEAR','FPERIOD','FBILLNO');
table_name ='T_GL_VOUCHER';
fieldName_caption_simple <-c('凭证字号','会计年度','会计期间','凭证号');

test02 <- select_engine_sqlserver(fieldName_vec_simple =fieldName_vec_simple ,
                                 fieldName_caption_simple = fieldName_caption_simple,
                                 table_name = table_name
);
test02;
#test 03 显示字段列表及别名,显示行过滤--------
# select    FVOUCHERGROUPNO as 凭证字号  ,  FYEAR as 会计年度  ,
# FPERIOD as 会计期间  ,  FBILLNO as 凭证号      from  T_GL_VOUCHER
# where   FDATE = '2018-10-09' and
# FVOUCHERGROUPID = 1 and  FACCOUNTBOOKID = 100032
fieldName_vec_simple <-c('FVOUCHERGROUPNO','FYEAR','FPERIOD','FBILLNO');
table_name ='T_GL_VOUCHER';
fieldName_caption_simple <-c('凭证字号','会计年度','会计期间','凭证号');
fieldName_vec_where = c('FDATE','FVOUCHERGROUPID','FACCOUNTBOOKID');
comparerSig_vec_where = c('=','=','=');
filterValue_vec_where = c("'2018-10-09'","1","100032");
comboCondition_logi_vec_where = c('and','and','and');
test03 <- select_engine_sqlserver(fieldName_vec_simple =fieldName_vec_simple ,
                                 fieldName_vec_where = fieldName_vec_where,
                                 comparerSig_vec_where = comparerSig_vec_where,
                                 filterValue_vec_where = filterValue_vec_where,
                                 comboCondition_logi_vec_where =comboCondition_logi_vec_where ,
                                 fieldName_caption_simple = fieldName_caption_simple,
                                 table_name = table_name
);
test03;
#test 04 显示字段列表及别名,显示行过滤,字段排序--------
# select    FVOUCHERGROUPNO as 凭证字号  ,
# FYEAR as 会计年度  ,  FPERIOD as 会计期间  ,
# FBILLNO as 凭证号      from  T_GL_VOUCHER
# where   FDATE = '2018-10-09' and  FVOUCHERGROUPID = 1
# and  FACCOUNTBOOKID = 100032
# order by  FVOUCHERGROUPNO asc , FBILLNO desc
fieldName_vec_simple <-c('FVOUCHERGROUPNO','FYEAR','FPERIOD','FBILLNO');
table_name ='T_GL_VOUCHER';
fieldName_caption_simple <-c('凭证字号','会计年度','会计期间','凭证号');
fieldName_vec_where = c('FDATE','FVOUCHERGROUPID','FACCOUNTBOOKID');
comparerSig_vec_where = c('=','=','=');
filterValue_vec_where = c("'2018-10-09'","1","100032");
comboCondition_logi_vec_where = c('and','and','and');
fieldName_vec_orderBy = c('FVOUCHERGROUPNO','FBILLNO')
asc_vec_orderBy = c(T,F)
test04 <- select_engine_sqlserver(fieldName_vec_simple =fieldName_vec_simple ,
                                 fieldName_vec_orderBy = fieldName_vec_orderBy,
                                 asc_vec_orderBy = asc_vec_orderBy,
                                 fieldName_vec_where = fieldName_vec_where,
                                 comparerSig_vec_where = comparerSig_vec_where,
                                 filterValue_vec_where = filterValue_vec_where,
                                 comboCondition_logi_vec_where =comboCondition_logi_vec_where ,
                                 fieldName_caption_simple = fieldName_caption_simple,
                                 table_name = table_name
);
test04;
test05 <-select_engine_sqlserver(fieldName_vec_simple = c('FVOUCHERGROUPID'),
fieldName_vec_where = 'FVOUCHERGROUPID',
comparerSig_vec_where = '<>',
filterValue_vec_where = '1',
comboCondition_logi_vec_where = 'and',
fieldName_vec_groupBy = 'FVOUCHERGROUPID',
fieldName_vec_orderBy = 'FVOUCHERGROUPID',
asc_vec_orderBy = F,
fun_vec_aggr = c('count','sum'),
fieldName_vec_aggr = c("FBILLNO","FPRINTTIMES"),
fieldName_caption_aggr =c("bill_count","sum_print"),
table_name = 'T_GL_VOUCHER'

)
test05;

takewiki/tsda documentation built on Oct. 23, 2023, 3:28 a.m.