Cheng Tang | eb173e0 | 2013-10-22 16:42:23 +0800 | [diff] [blame] | 1 | /*
|
| 2 | // 配置格式说明:
|
| 3 | // name: 转换目标表名
|
| 4 | // action: 装换前的操作,truncate 表示先执行truncate 操作,none 表示无任何动作
|
| 5 | // desc: 转换规则的描述
|
| 6 | // pre_exec: 执行转换前需要执行一次的 sql 语句,格式如 [ "insert into ....", "delete from ...."],
|
| 7 | // 可以有多条 sql 语句, 这个操作是在原始数据库执行
|
| 8 | // post_exec: 转换完成后需要执行一次的 sql 语句, 格式同 pre_exec, 这个操作是在目标数据库执行
|
| 9 | // src_sql: 转换原始表查询 sql
|
| 10 | // dest_column: 转换目标表 column , src_sql 查询出来的字段与 dest_column 的字段
|
| 11 | */
|
| 12 | [
|
| 13 | {
|
| 14 | "name": "T_DEVICE",
|
| 15 | "action": "truncate",
|
| 16 | "desc": "设备注册表",
|
| 17 | "src_sql": "SELECT T1.DEVICE_ID,T1.DEVICE_NAME,T1.DEVPHY999_ID,T1.DEV999_NO,
|
| 18 | T1.PHYTYPE DEVPHYTYPE,T1.DEVTYPE,'' DEVVERNO,T1.CARDSTR,T2.DEVICE_ID,
|
| 19 | 1 RUNSTATUS,(case when T1.STATE_ID between 1 and 4 then 1
|
| 20 | else 2 end) STATUS,
|
| 21 | T1.PORTCOUNT,T1.PORTNO,T1.JOINMODE,T1.COMADD,nvl(trim(T1.PORT),0),T1.BAUDRATE,
|
| 22 | '' CARDSET,T1.BSHEETVER,T1.LASTTRASERNO,T1.OPERATE_TIME LASTTRANSTIME,
|
| 23 | trim(T1.PUSERNO),0 MAXAMT,T1.SUBSYSTEM_ID,T1.AREA,'' DOORLSTVER,T1.DEV_USAGE,
|
| 24 | '' OPENDATE,'' CLOSEDATE,'' BATCHNO,'' LASTSAVED,'' REMARK FROM
|
| 25 | YKT_CUR.T_PIF_DEVICE T1 LEFT JOIN YKT_CUR.T_PIF_DEVICE T2 ON
|
| 26 | T1.FDEV_ID=T2.DEVICE_ID AND T1.DEVPHY999_ID NOT IN ('FFFFFFFF','00000000')
|
| 27 | AND T2.STATE_ID<5 ORDER BY T1.DEVICE_ID",
|
| 28 | "dest_column": "DEVICEID, DEVICENAME, DEVPHYID,DEVICENO, DEVPHYTYPE, DEVTYPECODE,
|
| 29 | DEVVERNO, CARDPHYTYPE, FDEVICEID,RUNSTATUS, STATUS,SVRPORTCNT,
|
| 30 | SVRPORTNO,COMMTYPE, IP,PORTNO, BAUDRATE, CARDSET,CARDVERNO,
|
| 31 | LASTSEQNO,LASTTRANSTIME,PURSENO, MAXAMT, SYSID,AREACODE,
|
| 32 | DOORLSTVER, DEVUSAGE,OPENDATE, CLOSEDATE, BATCHNO,
|
| 33 | LASTSAVED, REMARK",
|
| 34 | "post_exec": ["update t_syskey set keyval=(select max(deviceid) from t_device)
|
| 35 | where keycode='TERMID'",
|
| 36 | "update t_device x set devphyid=substr(devphyid,1,4)
|
| 37 | || lpad(to_number(substr(devphyid,5,1), 'XX'),2,'0')
|
| 38 | || lpad(to_number(substr(devphyid,6,1), 'XX'),2,'0')
|
| 39 | || substr(devphyid,7,2)
|
| 40 | where x.devphytype=1001 and length(x.devphyid) = 8
|
| 41 | and regexp_like(devphyid, '[A-F0-9]{8}')"]
|
| 42 | },
|
| 43 | {
|
| 44 | "name": "T_CUSTOMER",
|
| 45 | "action": "truncate",
|
| 46 | "desc": "客户信息表",
|
| 47 | "src_sql": "select cut_id,stuemp_no,cut_type,fee_type,cut_state,cut_name,area,
|
| 48 | classdept_no,classdept_name,s_code,class_no,class_no,1 idtype,man_id,
|
| 49 | sex,'' country,nation,'' email,tel,'' mobile, address,'' zipcode,
|
| 50 | '' custattr,substr(in_date,1,8),substr(can_time,1,8),
|
| 51 | substr(reg_time,1,8) opendate,'' closedate,batch_no,1 openflag,
|
| 52 | 0 holdcardcnt,1 useflag,0 eaccflag,'' lastsaved
|
| 53 | from ykt_cur.t_cif_customer",
|
| 54 | "dest_column": "CUSTID, STUEMPNO, CUSTTYPE, FEETYPE, STATUS, CUSTNAME, AREACODE,
|
| 55 | DEPTCODE, DEPTFULLNAME, SPECIALTYCODE, CLASSCODE, CLASSNAME,
|
| 56 | IDTYPE, IDNO, SEX, COUNTRY, NATION, EMAIL, TEL, MOBILE, ADDR,
|
| 57 | ZIPCODE, CUSTATTR, INDATE,OUTDATE, OPENDATE, CLOSEDATE, BATCHNO,
|
| 58 | OPENFLAG, HOLDCARDCNT, USEFLAG, EACCFLAG, LASTSAVED",
|
| 59 | "post_exec": ["update t_customer a set holdcardcnt=(select count(*) from t_card t
|
| 60 | where t.custid=a.custid and t.status=1)",
|
| 61 | "update t_syskey set keyval=(select max(custid) from t_customer)
|
| 62 | where keycode='CUSTID'"]
|
| 63 | },
|
| 64 | {
|
| 65 | "name": "T_CARD",
|
| 66 | "action": "truncate",
|
| 67 | "desc": "卡信息表",
|
| 68 | "src_sql": "select c.card_id,(case when a.account_id is null then '3000000001'
|
| 69 | else '1'||substr(a.account_id,8) end),
|
| 70 | type_id,phytype,(case when c1.fee_type>0 then c1.fee_type
|
| 71 | else c1.cut_type end) feetype,
|
| 72 | c.cosumer_id,c.showid,c.physical_no,c.password,
|
| 73 | (case when c.end_time ='' then '20000101'
|
| 74 | else c.end_time end) expiredate,
|
| 75 | substr(c.state_id,1,1) status,
|
| 76 | (case when substr(c.state_id,2,1)='1' then '1'
|
| 77 | else '0' end) lossflag,
|
| 78 | '' lossdate,'' lossefttime,
|
| 79 | (case when substr(c.state_id,3,1)='1' then '1'
|
| 80 | else '0' end) frozeflag,
|
| 81 | '' frozedate,'0' badflag,'' badtype,'' baddate,'0' lockflag,
|
| 82 | '' lockdate,c.begin_time opendate,'' closedate,'' cardverno,'' lastsaved
|
| 83 | from YKT_CUR.T_PIF_CARD c left join ykt_cur.t_aif_account a on
|
| 84 | c.card_id=a.card_id left join ykt_cur.t_cif_customer c1 on
|
| 85 | c.cosumer_id=c1.cut_id order by c.card_id",
|
| 86 | "dest_column": "CARDNO, ACCNO, CARDTYPE,CARDPHYTYPE, FEETYPE, CUSTID, SHOWCARDNO,
|
| 87 | CARDPHYID, CARDPWD,EXPIREDATE, STATUS, LOSSFLAG, LOSSDATE, LOSSEFTTIME,
|
| 88 | FROZEFLAG, FROZEDATE, BADFLAG, BADTYPE, BADDATE, LOCKFLAG, LOCKDATE,
|
| 89 | OPENDATE, CLOSEDATE, CARDVERNO, LASTSAVED",
|
| 90 | "remark": "导入卡表前更新 begin_time 不能为空",
|
| 91 | "post_exec": ["update t_syskey set keyval=(select max(cardno) from t_card)
|
| 92 | where keycode='CARDNO'",
|
| 93 | "update t_card set cardphytype=20"]
|
| 94 | },
|
| 95 | {
|
| 96 | "name": "T_SHOPACC",
|
| 97 | "action": "truncate",
|
| 98 | "desc": "商户账户表",
|
| 99 | "src_sql": "select (case when a.account_id is null then ''
|
| 100 | else '2'||substr(a.account_id,8) end) accno,
|
| 101 | s.shop_id shopid,a.cut_name,'2004',a.password,a.current_state,
|
| 102 | a.last_bala ydaybal,a.last_bala balance,0,0,'' lasttransdate,
|
| 103 | '' lastaccdate, a.open_date,a.close_date from
|
| 104 | ykt_cur.t_aif_account a left join ykt_cur.t_cif_shop s on
|
| 105 | a.customer_id=s.cut_id where a.act_type=2 and s.shop_id is not null
|
| 106 | order by s.shop_id",
|
| 107 | "dest_column": "ACCNO, SHOPID, ACCNAME, SUBJNO, ACCPWD, STATUS, YDAYBAL, BALANCE,
|
| 108 | AVAILBAL, FROZEBAL, LASTTRANSDATE, LASTACCDATE, OPENDATE, CLOSEDATE",
|
| 109 | "post_exec": ["update t_syskey set keyval=(select max(to_number(substr(accno,2)))
|
| 110 | from t_shopacc) where keycode='SHOPACCNO'"]
|
| 111 | },
|
| 112 | {
|
| 113 | "desc": "商户信息表",
|
| 114 | "name": "T_SHOP",
|
| 115 | "action": "truncate",
|
| 116 | "src_sql":"select t.shop_id,t.dept_id,'' areacode,'' deptcode,t.shop_name shopname,
|
| 117 | (case when t.is_leaf ='1' then 1 else 0 end) shop_type,
|
| 118 | (case when t.is_leaf='1' then 1 else 0 end) accflag ,shop_state,
|
| 119 | (case when a.account_id is null then '' else '2'||substr(a.account_id,8) end) accno,
|
| 120 | t.man,1 idtype,t.man_id,t.tel,'' mobile,'' email,t.address,'' zipcode,
|
| 121 | (case when t.is_getfee='1' then 1 else 0 end) boardfeeflag,'' RAKEOFFTYPE,
|
| 122 | 0, '' DEPOSITAGIO,'' DEPOSITCNT,'' DEPOSITAMT,'' DISCOUNTAMT, '' BANKCODE,
|
| 123 | '' BANKACCNO,'' BANKACCNAME,'' OPENDATE,'' CLOSEDATE,'' USEFLAG
|
| 124 | from ykt_cur.t_cif_shop t left join ykt_cur.t_aif_account a on
|
| 125 | t.cut_id=a.customer_id and t.is_leaf='1'",
|
| 126 | "dest_column": "SHOPID, FSHOPID, AREACODE,DEPTCODE, SHOPNAME, SHOPTYPE,ACCFLAG,
|
| 127 | STATUS, ACCNO, CONTACTMAN, IDTYPE, IDNO, TEL, MOBILE, EMAIL, ADDR,
|
| 128 | ZIPCODE, BOARDFEEFLAG, RAKEOFFTYPE, RAKEOFFRATE, DEPOSITAGIO,DEPOSITCNT,
|
| 129 | DEPOSITAMT, DISCOUNTAMT, BANKCODE, BANKACCNO, BANKACCNAME, OPENDATE,
|
| 130 | CLOSEDATE, USEFLAG",
|
| 131 | "post_exec": ["update t_syskey set keyval=(select max(shopid) from t_shop)
|
| 132 | where keycode='SHOPID'",
|
| 133 | "update t_shop set areacode=11 where rowid in (
|
| 134 | select rowid shop_rowid from t_shop c
|
| 135 | start with c.shopid=11
|
| 136 | connect by prior c.shopid=c.fshopid)",
|
| 137 | "update t_shop set areacode=12 where rowid in (
|
| 138 | select rowid shop_rowid from t_shop c
|
| 139 | start with c.shopid=43
|
| 140 | connect by prior c.shopid=c.fshopid)",
|
| 141 | "update t_shop set areacode=13 where rowid in (
|
| 142 | select rowid shop_rowid from t_shop c
|
| 143 | start with c.shopid=44
|
| 144 | connect by prior c.shopid=c.fshopid)"]
|
| 145 | },
|
| 146 | {
|
| 147 | "name": "T_INNERACC",
|
| 148 | "action": "truncate",
|
| 149 | "desc": "内部账户表",
|
| 150 | "src_sql": "select (case when a.account_id='1011' then '1001'
|
| 151 | when a.account_id='1021' then '1002'
|
| 152 | when a.account_id='1031' then '112101'
|
| 153 | when a.account_id='1041' then '112102'
|
| 154 | when a.account_id='2051' then '2002'
|
| 155 | when a.account_id='2041' then '220299'
|
| 156 | when a.account_id='2071' then '2203'
|
| 157 | when a.account_id='5011' then '6002'
|
| 158 | when a.account_id='5021' then '6005'
|
| 159 | when a.account_id='5041' then '6001'
|
| 160 | when a.account_id='5071' then '6201'
|
| 161 | else a.account_id end) account_id,
|
| 162 | a.cut_name, (case when a.account_id='1011' then '1001'
|
| 163 | when a.account_id='1021' then '1002'
|
| 164 | when a.account_id='1031' then '112101'
|
| 165 | when a.account_id='1041' then '112102'
|
| 166 | when a.account_id='2051' then '2002'
|
| 167 | when a.account_id='2041' then '220299'
|
| 168 | when a.account_id='2071' then '2203'
|
| 169 | when a.account_id='5011' then '6002'
|
| 170 | when a.account_id='5021' then '6005'
|
| 171 | when a.account_id='5041' then '6001'
|
| 172 | when a.account_id='5071' then '6201'
|
| 173 | else a.account_id end) subno,
|
| 174 | 0 ,last_BALA,(CASE WHEN SUBSTR(A.ACCOUNT_ID,1,1)='1' THEN 1
|
| 175 | ELSE 2 END) BALFLAG,
|
| 176 | '','' from (select rtrim(a.account_id) account_id,a.last_bala,
|
| 177 | a.cut_name from ykt_cur.t_aif_account a where a.act_type=7 and
|
| 178 | a.account_id not in ('1122','2031','1071')) a",
|
| 179 | "dest_column": "ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, BALFLAG, LASTTRANSDATE,
|
| 180 | LASTACCDATE",
|
| 181 | "remark": "导入内部账户,并更新错误的借贷标志",
|
| 182 | "post_exec": ["update t_inneracc set balance=abs(balance),ydaybal=abs(ydaybal),
|
| 183 | balflag=1 where accno in ('6201','6202')",
|
| 184 | "update t_syspara set paraval=:bala_date where paraid=2",
|
| 185 | "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, BALFLAG, LASTTRANSDATE, LASTACCDATE)
|
| 186 | values ('112201', '易支付充值款', '112201', 0, 0, 1, null, null)",
|
| 187 | "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, BALFLAG, LASTTRANSDATE, LASTACCDATE)
|
| 188 | values ('112299', '其他应收款', '112299', 0, 0, 1, null, null)",
|
| 189 | "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, BALFLAG, LASTTRANSDATE, LASTACCDATE)
|
| 190 | values ('2006', '水控存款', '2006', 0, 0, 2, null, null)",
|
| 191 | "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, BALFLAG, LASTTRANSDATE, LASTACCDATE)
|
| 192 | values ('220201', '批量销户应付款', '220201', 0, 0, 2, null, null)",
|
| 193 | "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, BALFLAG, LASTTRANSDATE, LASTACCDATE)
|
| 194 | values ('6003', '商户佣金收入', '6003', 0, 0, 2, null, null)",
|
| 195 | "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, BALFLAG, LASTTRANSDATE, LASTACCDATE)
|
| 196 | values ('6004', '搭伙费收入', '6004', 0, 0, 2, null, null)",
|
| 197 | "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, BALFLAG, LASTTRANSDATE, LASTACCDATE)
|
| 198 | values ('6006', '退卡盈余收入', '6006', 0, 0, 2, null, null)",
|
| 199 | "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, BALFLAG, LASTTRANSDATE, LASTACCDATE)
|
| 200 | values ('6202', '商户提成支出', '6202', 0, 0, 1, null, null)"
|
| 201 | ]
|
| 202 | },
|
| 203 | {
|
| 204 | "desc": "账户信息表",
|
| 205 | "name": "T_ACCOUNT",
|
| 206 | "action": "truncate",
|
| 207 | "src_sql": "select (case when a.account_id is null then ''
|
| 208 | else '1'||substr(a.account_id,8) end) accno,
|
| 209 | a.cut_name,'2001',a.password,a.customer_id,a.card_id,a.purse_id,
|
| 210 | '' singlemaxamt,'' daycostmaxamt,'' daycostamt,'' cardmaxbal,
|
| 211 | a.current_state,(case when a.current_state=1 then c.deposit_fee
|
| 212 | else 0 end) foregift,
|
| 213 | 0 ydaybal,a.last_bala,a.last_freebala,a.last_frozebala,0 subsidybal,
|
| 214 | 0 subsidyno,a.card_balance,a.consume_count,0 dpscnt,a.consume_count paycnt,
|
| 215 | 0 termid,'' transtime,0 lastsubsidyamt,0 lastsubsidyno,0 lastbala,
|
| 216 | 0 lastcardcnt,0 lastdpscnt,0 lastpaycnt,'' lasttransdate,'' lastaccdate,
|
| 217 | a.open_date,a.close_date from ykt_cur.t_aif_account a left join
|
| 218 | ykt_cur.t_pif_card c on a.card_id=c.card_id where a.act_type=1 and a.current_state<>2",
|
| 219 | "dest_column": "ACCNO, ACCNAME, SUBJNO, ACCPWD, CUSTID, CARDNO, PURSENO, SINGLEMAXAMT,
|
| 220 | DAYCOSTMAXAMT,DAYCOSTAMT, CARDMAXBAL, STATUS, FOREGIFT, YDAYBAL,
|
| 221 | BALANCE, AVAILBAL, FROZEBAL, SUBSIDYBAL, SUBSIDYNO, CARDBAL, CARDCNT,
|
| 222 | DPSCNT, PAYCNT, TERMID, TRANSTIME, LASTSUBSIDYAMT, LASTSUBSIDYNO,
|
| 223 | LASTCARDBAL, LASTCARDCNT, LASTDPSCNT, LASTPAYCNT, LASTTRANSDATE,
|
| 224 | LASTACCDATE, OPENDATE, CLOSEDATE",
|
| 225 | "post_exec":["update t_syskey set keyval=(select max(to_number(substr(accno,2)))
|
| 226 | from t_account) where keycode='CARDACCNO'",
|
| 227 | "update t_account set balance=balance+:diff_bala,
|
| 228 | availbal=availbal+:diff_bala where accno='1002246656'"]
|
| 229 | },
|
| 230 | {
|
| 231 | "name": "T_SHOPPOS",
|
| 232 | "action": "truncate",
|
| 233 | "desc": "商户设备对应表",
|
| 234 | "src_sql": "select t1.id,t1.device_id,t2.devphy999_id,t1.shop_id,t1.end_time,
|
| 235 | t1.comments,t1.begin_date,t1.end_date,1,'','' from
|
| 236 | ykt_cur.t_cif_shop_pos t1,ykt_cur.t_pif_device t2
|
| 237 | where t1.device_id=t2.device_id",
|
| 238 | "dest_column": "ID, DEVICEID, DEVPHYID, SHOPID, ENDTIME, REMARK, STARTDATE,
|
| 239 | ENDDATE, STATUS, OPERCODE, LASTSAVED",
|
| 240 | "post_exec" : ["update t_shoppos t set t.devphyid=(select x.devphyid from t_device x
|
| 241 | where x.deviceid=t.deviceid)"]
|
| 242 | },
|
| 243 | {
|
| 244 | "name": "T_RPTACCBAL",
|
| 245 | "action": "truncate",
|
| 246 | "desc": "账户结算表",
|
| 247 | "src_sql": "select :tx_date,'2001',(case when a.account_id is null then ''
|
| 248 | else '1'||substr(a.account_id,8) end) accno,
|
| 249 | 2 ,last_bala from ykt_cur.t_aif_account a where act_type=1 and current_state<>2
|
| 250 | union all
|
| 251 | select :tx_date,'2004',(case when a.account_id is null then ''
|
| 252 | else '2'||substr(a.account_id,8) end) accno,
|
| 253 | 2,last_bala from ykt_cur.t_aif_account a where act_type=2 and current_state<>2
|
| 254 | union all
|
| 255 | select :tx_date, (case when a.account_id='1011' then '1001'
|
| 256 | when a.account_id='1021' then '1002'
|
| 257 | when a.account_id='1031' then '112101'
|
| 258 | when a.account_id='1041' then '112102'
|
| 259 | when a.account_id='2041' then '220299'
|
| 260 | when a.account_id='2051' then '2002'
|
| 261 | when a.account_id='2071' then '2203'
|
| 262 | when a.account_id='5011' then '6002'
|
| 263 | when a.account_id='5021' then '6005'
|
| 264 | when a.account_id='5041' then '6001'
|
| 265 | when a.account_id='5071' then '6201'
|
| 266 | else rtrim(a.account_id) end) subno,
|
| 267 | (case when a.account_id='1011' then '1001'
|
| 268 | when a.account_id='1021' then '1002'
|
| 269 | when a.account_id='1031' then '112101'
|
| 270 | when a.account_id='1041' then '112102'
|
| 271 | when a.account_id='2051' then '2002'
|
| 272 | when a.account_id='2041' then '220299'
|
| 273 | when a.account_id='2071' then '2203'
|
| 274 | when a.account_id='5011' then '6002'
|
| 275 | when a.account_id='5021' then '6005'
|
| 276 | when a.account_id='5041' then '6001'
|
| 277 | when a.account_id='5071' then '6201'
|
| 278 | else rtrim(a.account_id) end) account_id,
|
| 279 | (case when substr(a.account_id,1,1)='1' then 1 else 2 end) flag,
|
| 280 | last_bala from ykt_cur.t_aif_account a where act_type=7 and
|
| 281 | a.account_id not in ('1122','2031','1071')",
|
| 282 | "dest_column": "ACCDATE, SUBJNO, ACCNO, BALFLAG, BALANCE",
|
| 283 | "remark": "导入内部账户报表,并更新错误的借贷标志",
|
| 284 | "post_exec": ["update t_rptaccbal set balance=abs(balance),balflag=1
|
| 285 | where accno in ('6201','6202')",
|
| 286 | // "insert into t_rptaccbal(accdate,subjno,accno,balflag,balance)
|
| 287 | // select :tx_date,s.subjno,s.subjno,
|
| 288 | // (case when substr(s.subjno,1,1)='1' then 1
|
| 289 | // else 2 end) flag1,0
|
| 290 | // from t_subject s left join t_rptaccbal b on
|
| 291 | // (s.subjno=b.subjno and b.accdate=:tx_date)
|
| 292 | // where b.accdate is null",
|
| 293 | "insert into t_rptaccbal(accdate,subjno,accno,balflag,balance)
|
| 294 | select :tx_date,s.subjno,s.subjno,2,0 from t_rptsubjbal s
|
| 295 | where s.subjno in (2001,2004,2006,220201,6004)
|
| 296 | and s.accdate=:tx_date",
|
| 297 | "insert into t_rptaccbal(accdate,subjno,accno,balflag,balance)
|
| 298 | select :tx_date,s.subjno,s.subjno,1,0 from t_rptsubjbal s
|
| 299 | where s.subjno in (6202)
|
| 300 | and s.accdate=:tx_date",
|
| 301 | "update t_rptaccbal set balance=balance+1.93 where accdate=:tx_date
|
| 302 | and accno='1002246656'"
|
| 303 | ]
|
| 304 | },
|
| 305 | {
|
| 306 | "name": "T_RPTSUBJBAL",
|
| 307 | "action": "truncate",
|
| 308 | "desc": "科目结算表",
|
| 309 | "src_sql": "select :tx_date,'2001',2 ,sum(last_bala),0,0,2,sum(last_bala)
|
| 310 | from ykt_cur.t_aif_account a where act_type=1 and a.current_state<>2
|
| 311 | union all
|
| 312 | select :tx_date,'2004',2,sum(last_bala),0,0,2,sum(last_bala)
|
| 313 | from ykt_cur.t_aif_account a where act_type=2 and a.current_state<>2
|
| 314 | union all select :tx_date,
|
| 315 | (case when a.account_id='1011' then '1001'
|
| 316 | when a.account_id='1021' then '1002'
|
| 317 | when a.account_id='1031' then '112101'
|
| 318 | when a.account_id='1041' then '112102'
|
| 319 | when a.account_id='2051' then '2002'
|
| 320 | when a.account_id='2041' then '220299'
|
| 321 | when a.account_id='2071' then '2203'
|
| 322 | when a.account_id='5011' then '6002'
|
| 323 | when a.account_id='5021' then '6005'
|
| 324 | when a.account_id='5041' then '6001'
|
| 325 | when a.account_id='5071' then '6201'
|
| 326 | else rtrim(a.account_id) end) subno,
|
| 327 | (case when substr(a.account_id,1,1)='1' then 1
|
| 328 | else 2 end) flag1,
|
| 329 | sum(last_bala),0,0,
|
| 330 | (case when substr(a.account_id,1,1)='1' then 1
|
| 331 | else 2 end) flag2,sum(last_bala) from
|
| 332 | ykt_cur.t_aif_account a where act_type=7 and
|
| 333 | a.account_id not in ('1122','2031','1071')
|
| 334 | group by a.account_id",
|
| 335 | "dest_column": "ACCDATE, SUBJNO, BEGINBALFLAG, BEGINBAL, DRAMT, CRAMT,
|
| 336 | ENDBALFLAG, ENDBAL",
|
| 337 | "post_exec" : ["insert into t_rptsubjbal(ACCDATE, SUBJNO, BEGINBALFLAG, BEGINBAL,
|
| 338 | DRAMT, CRAMT, ENDBALFLAG, ENDBAL)
|
| 339 | select :tx_date, subjno, 1,
|
| 340 | (select nvl(sum(beginbal),0) from t_rptsubjbal t where accdate=:tx_date
|
| 341 | and t.subjno like s.subjno || '__'),
|
| 342 | 0,0,1,
|
| 343 | (select nvl(sum(endbal),0) from t_rptsubjbal t where accdate=:tx_date
|
| 344 | and t.subjno like s.subjno || '__') from t_subject s
|
| 345 | where subjno in ('1121','6202')",
|
| 346 | "insert into t_rptsubjbal(ACCDATE, SUBJNO, BEGINBALFLAG, BEGINBAL,
|
| 347 | DRAMT, CRAMT, ENDBALFLAG, ENDBAL)
|
| 348 | select :tx_date, subjno, 2,
|
| 349 | (select nvl(sum(beginbal),0) from t_rptsubjbal t where accdate=:tx_date
|
| 350 | and t.subjno like s.subjno || '__'),
|
| 351 | 0,0,2,
|
| 352 | (select nvl(sum(endbal),0) from t_rptsubjbal t where accdate=:tx_date
|
| 353 | and t.subjno like s.subjno || '__') from t_subject s
|
| 354 | where subjno in ('2202')",
|
| 355 | "update t_rptsubjbal set beginbalflag=1,endbalflag=1,
|
| 356 | beginbal=abs(beginbal),endbal=abs(endbal) where
|
| 357 | subjno in ('6201','6202')",
|
| 358 | "update t_rptsubjbal set beginbal=beginbal+:diff_bala, endbal=endbal+:diff_bala
|
| 359 | where accdate=:tx_date and subjno='2001'",
|
| 360 | "delete from t_servicelog"],
|
| 361 | "remark": "生成结算科目数据"
|
| 362 | },
|
| 363 | {
|
| 364 | "name": "T_CARDVER",
|
| 365 | "action": "truncate",
|
| 366 | "desc": "卡版本号表",
|
| 367 | "src_sql": " select t.operate_date, 0, 0, t.volume, t.card_id, x.physical_no, c.stuemp_no,
|
| 368 | case when is_ad = 0 then 3
|
| 369 | when is_ad = 1 then 6
|
| 370 | else 3 end ,
|
| 371 | case when t.is_ad = 0 then 1
|
| 372 | when t.is_ad = 1 then 2
|
| 373 | else 0 end , t.state_id
|
| 374 | from t_tif_black_sheet t, t_pif_card x, t_cif_customer c
|
| 375 | where t.card_id = x.card_id and x.cosumer_id = c.cut_id",
|
| 376 | "dest_column": "ACCDATE, TERMID, TERMSEQNO, CARDVERNO, CARDNO, CARDPHYID, STUEMPNO,
|
| 377 | CARDVERTYPE, ADDDELFLAG, STATUS"
|
| 378 | }
|
| 379 | ]
|