Cheng Tang | eb173e0 | 2013-10-22 16:42:23 +0800 | [diff] [blame^] | 1 | [ |
| 2 | { |
| 3 | "desc": "账户信息表", |
| 4 | "name": "T_ACCOUNT", |
| 5 | "action": "truncate", |
| 6 | "src_sql": "select (case when a.account_id is null then '' |
| 7 | else '1'||substr(a.account_id,8) end) accno, |
| 8 | a.cut_name,'2001',a.password,a.customer_id,a.card_id,a.purse_id, |
| 9 | '' singlemaxamt,'' daycostmaxamt,'' daycostamt,'' cardmaxbal, |
| 10 | a.current_state,(case when a.current_state=1 then c.deposit_fee |
| 11 | else 0 end) foregift, |
| 12 | 0 ydaybal,a.last_bala,a.last_freebala,a.last_frozebala,0 subsidybal, |
| 13 | 0 subsidyno,a.card_balance,a.consume_count,0 dpscnt,a.consume_count paycnt, |
| 14 | 0 termid,'' transtime,0 lastsubsidyamt,0 lastsubsidyno,0 lastbala, |
| 15 | 0 lastcardcnt,0 lastdpscnt,0 lastpaycnt,'' lasttransdate,'' lastaccdate, |
| 16 | a.open_date,a.close_date from ykt_cur.t_aif_account a left join |
| 17 | ykt_cur.t_pif_card c on a.card_id=c.card_id where a.act_type=1", |
| 18 | "dest_column": "ACCNO, ACCNAME, SUBJNO, ACCPWD, CUSTID, CARDNO, PURSENO, SINGLEMAXAMT, |
| 19 | DAYCOSTMAXAMT,DAYCOSTAMT, CARDMAXBAL, STATUS, FOREGIFT, YDAYBAL, |
| 20 | BALANCE, AVAILBAL, FROZEBAL, SUBSIDYBAL, SUBSIDYNO, CARDBAL, CARDCNT, |
| 21 | DPSCNT, PAYCNT, TERMID, TRANSTIME, LASTSUBSIDYAMT, LASTSUBSIDYNO, |
| 22 | LASTCARDBAL, LASTCARDCNT, LASTDPSCNT, LASTPAYCNT, LASTTRANSDATE, |
| 23 | LASTACCDATE, OPENDATE, CLOSEDATE", |
| 24 | "post_exec":["update t_syskey set keyval=(select max(to_number(substr(accno,2))) |
| 25 | from t_account) where keycode='CARDACCNO'", |
| 26 | "update t_account set balance=balance+60, availbal=AVAILBAL+60, foregift=120 |
| 27 | where accno='1' || substr('1000000000192778', 8) "] |
| 28 | }, |
| 29 | { |
| 30 | "name": "T_INNERACC", |
| 31 | "action": "truncate", |
| 32 | "desc": "内部账户表", |
| 33 | "src_sql": "select (case when a.account_id='1011' then '1001' |
| 34 | when a.account_id='1021' then '1002' |
| 35 | when a.account_id='1031' then '112101' |
| 36 | when a.account_id='1041' then '112102' |
| 37 | when a.account_id='1051' then '112103' |
| 38 | when a.account_id='2051' then '2002' |
| 39 | when a.account_id='2061' then '220299' |
| 40 | when a.account_id='2071' then '2203' |
| 41 | when a.account_id='5011' then '6002' |
| 42 | when a.account_id='5021' then '6005' |
| 43 | when a.account_id='5051' then '6003' |
| 44 | when a.account_id='5041' then '6006' |
| 45 | when a.account_id='5071' then '6001' |
| 46 | else a.account_id end) account_id, |
| 47 | a.cut_name, (case when a.account_id='1011' then '1001' |
| 48 | when a.account_id='1021' then '1002' |
| 49 | when a.account_id='1031' then '112101' |
| 50 | when a.account_id='1041' then '112102' |
| 51 | when a.account_id='1051' then '112103' |
| 52 | when a.account_id='2051' then '2002' |
| 53 | when a.account_id='2061' then '220299' |
| 54 | when a.account_id='2071' then '2203' |
| 55 | when a.account_id='5011' then '6002' |
| 56 | when a.account_id='5021' then '6005' |
| 57 | when a.account_id='5051' then '6003' |
| 58 | when a.account_id='5041' then '6006' |
| 59 | when a.account_id='5071' then '6001' |
| 60 | else a.account_id end) subno, |
| 61 | 0 ,last_BALA,(CASE WHEN SUBSTR(A.ACCOUNT_ID,1,1)='1' THEN 1 |
| 62 | ELSE 2 END) BALFLAG, |
| 63 | '','' from (select rtrim(a.account_id) account_id,a.last_bala, |
| 64 | a.cut_name from ykt_cur.t_aif_account a where a.act_type=7 and |
| 65 | a.account_id not in ('1122','2031','2041','1071')) a", |
| 66 | "dest_column": "ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, BALFLAG, LASTTRANSDATE, |
| 67 | LASTACCDATE", |
| 68 | "remark": "导入内部账户,并更新错误的借贷标志", |
| 69 | "post_exec": ["update t_inneracc set balance=abs(balance),ydaybal=abs(ydaybal), |
| 70 | balflag=1 where accno in ('6201','6202')", |
| 71 | "update t_syspara set paraval=:bala_date where paraid=2", |
| 72 | "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, |
| 73 | BALFLAG, LASTTRANSDATE, LASTACCDATE) |
| 74 | values ('112201', '易支付充值款', '112201', 0, 0, 1, null, null)", |
| 75 | "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, |
| 76 | BALFLAG, LASTTRANSDATE, LASTACCDATE) |
| 77 | values ('112299', '其他应收款', '112299', 0, 0, 1, null, null)", |
| 78 | "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, |
| 79 | BALFLAG, LASTTRANSDATE, LASTACCDATE) |
| 80 | values ('6004', '搭伙费收入', '6004', 0, 0, 2, null, null)", |
| 81 | "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, |
| 82 | BALFLAG, LASTTRANSDATE, LASTACCDATE) |
| 83 | values ('2006', '水控存款', '2006', 0, 0, 2, null, null)", |
| 84 | "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, |
| 85 | BALFLAG, LASTTRANSDATE, LASTACCDATE) |
| 86 | values ('220201', '批量销户应付款', '220201', 0, 0, 2, null, null)", |
| 87 | "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, |
| 88 | BALFLAG, LASTTRANSDATE, LASTACCDATE) |
| 89 | values ('6201', '营业外支出', '6201', 0, 0, 1, null, null)", |
| 90 | "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, |
| 91 | BALFLAG, LASTTRANSDATE, LASTACCDATE) |
| 92 | values ('6202', '商户提成支出', '6202', 0, 0, 1, null, null)" |
| 93 | ] |
| 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 | 0 ydaybal,a.last_bala,a.last_freebala,a.last_frozebala,'' 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 | "name": "T_RPTACCBAL", |
| 114 | "action": "truncate", |
| 115 | "desc": "账户结算表", |
| 116 | "src_sql": "select :tx_date,'2001',(case when a.account_id is null then '' |
| 117 | else '1'||substr(a.account_id,8) end) accno, |
| 118 | 2 ,last_bala from ykt_cur.t_aif_account a where act_type=1 |
| 119 | union all |
| 120 | select :tx_date,'2004',(case when a.account_id is null then '' |
| 121 | else '2'||substr(a.account_id,8) end) accno, |
| 122 | 2,last_bala from ykt_cur.t_aif_account a where act_type=2 |
| 123 | union all |
| 124 | select :tx_date, (case when a.account_id='1011' then '1001' |
| 125 | when a.account_id='1021' then '1002' |
| 126 | when a.account_id='1031' then '112101' |
| 127 | when a.account_id='1041' then '112102' |
| 128 | when a.account_id='1051' then '112103' |
| 129 | when a.account_id='2051' then '2002' |
| 130 | when a.account_id='2061' then '220299' |
| 131 | when a.account_id='2071' then '2203' |
| 132 | when a.account_id='5011' then '6002' |
| 133 | when a.account_id='5021' then '6005' |
| 134 | when a.account_id='5051' then '6003' |
| 135 | when a.account_id='5041' then '6006' |
| 136 | when a.account_id='5071' then '6001' |
| 137 | else rtrim(a.account_id) end) subno, |
| 138 | (case when a.account_id='1011' then '1001' |
| 139 | when a.account_id='1021' then '1002' |
| 140 | when a.account_id='1031' then '112101' |
| 141 | when a.account_id='1041' then '112102' |
| 142 | when a.account_id='1051' then '112103' |
| 143 | when a.account_id='2051' then '2002' |
| 144 | when a.account_id='2061' then '220299' |
| 145 | when a.account_id='2071' then '2203' |
| 146 | when a.account_id='5011' then '6002' |
| 147 | when a.account_id='5021' then '6005' |
| 148 | when a.account_id='5051' then '6003' |
| 149 | when a.account_id='5041' then '6006' |
| 150 | when a.account_id='5071' then '6001' |
| 151 | else rtrim(a.account_id) end) account_id, |
| 152 | (case when substr(a.account_id,1,1)='1' then 1 else 2 end) flag, |
| 153 | last_bala from ykt_cur.t_aif_account a where act_type=7 and |
| 154 | a.account_id not in ('1122','2031','2041','1071')", |
| 155 | "dest_column": "ACCDATE, SUBJNO, ACCNO, BALFLAG, BALANCE", |
| 156 | "remark": "导入内部账户报表,并更新错误的借贷标志", |
| 157 | "post_exec": ["update t_rptaccbal set balance=abs(balance),balflag=1 |
| 158 | where accno in ('6201','6202')", |
| 159 | // "insert into t_rptaccbal(accdate,subjno,accno,balflag,balance) |
| 160 | // select :tx_date,s.subjno,s.subjno, |
| 161 | // (case when substr(s.subjno,1,1)='1' then 1 |
| 162 | // else 2 end) flag1,0 |
| 163 | // from t_subject s left join t_rptaccbal b on |
| 164 | // (s.subjno=b.subjno and b.accdate=:tx_date) |
| 165 | // where b.accdate is null", |
| 166 | "insert into t_rptaccbal(accdate,subjno,accno,balflag,balance) |
| 167 | select :tx_date,s.subjno,s.subjno,2,0 from t_rptsubjbal s |
| 168 | where s.subjno in (2001,2004,2202,2006,220201,6004) |
| 169 | and s.accdate=:tx_date", |
| 170 | "insert into t_rptaccbal(accdate,subjno,accno,balflag,balance) |
| 171 | select :tx_date,s.subjno,s.subjno,1,0 from t_rptsubjbal s |
| 172 | where s.subjno in (6201,6202) |
| 173 | and s.accdate=:tx_date", |
| 174 | "update t_rptaccbal set balance=balance+60 where |
| 175 | accno='1' || substr('1000000000192778', 8) and accdate=:tx_date"] |
| 176 | }, |
| 177 | { |
| 178 | "name": "T_RPTSUBJBAL", |
| 179 | "action": "truncate", |
| 180 | "desc": "科目结算表", |
| 181 | "src_sql": "select :tx_date,'2001',2 ,sum(last_bala),0,0,2,sum(last_bala) |
| 182 | from ykt_cur.t_aif_account a where act_type=1 |
| 183 | union all |
| 184 | select :tx_date,'2004',2,sum(last_bala),0,0,2,sum(last_bala) |
| 185 | from ykt_cur.t_aif_account a where act_type=2 |
| 186 | union all select :tx_date, |
| 187 | (case when a.account_id='1011' then '1001' |
| 188 | when a.account_id='1021' then '1002' |
| 189 | when a.account_id='1031' then '112101' |
| 190 | when a.account_id='1041' then '112102' |
| 191 | when a.account_id='1051' then '112103' |
| 192 | when a.account_id='2051' then '2002' |
| 193 | when a.account_id='2061' then '220299' |
| 194 | when a.account_id='2071' then '2203' |
| 195 | when a.account_id='5011' then '6002' |
| 196 | when a.account_id='5021' then '6005' |
| 197 | when a.account_id='5051' then '6003' |
| 198 | when a.account_id='5041' then '6006' |
| 199 | when a.account_id='5071' then '6001' |
| 200 | when a.account_id='2081' then '2202' |
| 201 | else rtrim(a.account_id) end) subno, |
| 202 | (case when substr(a.account_id,1,1)='1' then 1 |
| 203 | else 2 end) flag1, |
| 204 | sum(last_bala),0,0, |
| 205 | (case when substr(a.account_id,1,1)='1' then 1 |
| 206 | else 2 end) flag2,sum(last_bala) from |
| 207 | ykt_cur.t_aif_account a where act_type=7 and |
| 208 | a.account_id not in ('1122','2031','2041','1071') |
| 209 | group by a.account_id", |
| 210 | "dest_column": "ACCDATE, SUBJNO, BEGINBALFLAG, BEGINBAL, DRAMT, CRAMT, |
| 211 | ENDBALFLAG, ENDBAL", |
| 212 | "post_exec" : ["insert into t_rptsubjbal(ACCDATE, SUBJNO, BEGINBALFLAG, BEGINBAL, |
| 213 | DRAMT, CRAMT, ENDBALFLAG, ENDBAL) |
| 214 | select :tx_date, subjno, 1, |
| 215 | (select sum(beginbal) from t_rptsubjbal t where accdate=:tx_date |
| 216 | and t.subjno like s.subjno || '__'), |
| 217 | 0,0,1, |
| 218 | (select sum(endbal) from t_rptsubjbal t where accdate=:tx_date |
| 219 | and t.subjno like s.subjno || '__') from t_subject s |
| 220 | where subjno in ('1121','2202')", |
| 221 | "update t_rptsubjbal set beginbalflag=1,endbalflag=1 where |
| 222 | subjno in ('6201','6202')", |
| 223 | "update t_rptsubjbal set beginbal=beginbal+60, endbal=endbal+60 |
| 224 | where accdate=:tx_date and subjno='2001'", |
| 225 | "delete from t_servicelog"], |
| 226 | "remark": "生成结算科目数据" |
| 227 | } |
| 228 | ] |