增加用户版本
diff --git a/convert-shisu-test.json b/convert-shisu-test.json
new file mode 100644
index 0000000..b02b7d1
--- /dev/null
+++ b/convert-shisu-test.json
@@ -0,0 +1,228 @@
+[
+ {
+ "desc": "账户信息表",
+ "name": "T_ACCOUNT",
+ "action": "truncate",
+ "src_sql": "select (case when a.account_id is null then ''
+ else '1'||substr(a.account_id,8) end) accno,
+ a.cut_name,'2001',a.password,a.customer_id,a.card_id,a.purse_id,
+ '' singlemaxamt,'' daycostmaxamt,'' daycostamt,'' cardmaxbal,
+ a.current_state,(case when a.current_state=1 then c.deposit_fee
+ else 0 end) foregift,
+ 0 ydaybal,a.last_bala,a.last_freebala,a.last_frozebala,0 subsidybal,
+ 0 subsidyno,a.card_balance,a.consume_count,0 dpscnt,a.consume_count paycnt,
+ 0 termid,'' transtime,0 lastsubsidyamt,0 lastsubsidyno,0 lastbala,
+ 0 lastcardcnt,0 lastdpscnt,0 lastpaycnt,'' lasttransdate,'' lastaccdate,
+ a.open_date,a.close_date from ykt_cur.t_aif_account a left join
+ ykt_cur.t_pif_card c on a.card_id=c.card_id where a.act_type=1",
+ "dest_column": "ACCNO, ACCNAME, SUBJNO, ACCPWD, CUSTID, CARDNO, PURSENO, SINGLEMAXAMT,
+ DAYCOSTMAXAMT,DAYCOSTAMT, CARDMAXBAL, STATUS, FOREGIFT, YDAYBAL,
+ BALANCE, AVAILBAL, FROZEBAL, SUBSIDYBAL, SUBSIDYNO, CARDBAL, CARDCNT,
+ DPSCNT, PAYCNT, TERMID, TRANSTIME, LASTSUBSIDYAMT, LASTSUBSIDYNO,
+ LASTCARDBAL, LASTCARDCNT, LASTDPSCNT, LASTPAYCNT, LASTTRANSDATE,
+ LASTACCDATE, OPENDATE, CLOSEDATE",
+ "post_exec":["update t_syskey set keyval=(select max(to_number(substr(accno,2)))
+ from t_account) where keycode='CARDACCNO'",
+ "update t_account set balance=balance+60, availbal=AVAILBAL+60, foregift=120
+ where accno='1' || substr('1000000000192778', 8) "]
+ },
+ {
+ "name": "T_INNERACC",
+ "action": "truncate",
+ "desc": "内部账户表",
+ "src_sql": "select (case when a.account_id='1011' then '1001'
+ when a.account_id='1021' then '1002'
+ when a.account_id='1031' then '112101'
+ when a.account_id='1041' then '112102'
+ when a.account_id='1051' then '112103'
+ when a.account_id='2051' then '2002'
+ when a.account_id='2061' then '220299'
+ when a.account_id='2071' then '2203'
+ when a.account_id='5011' then '6002'
+ when a.account_id='5021' then '6005'
+ when a.account_id='5051' then '6003'
+ when a.account_id='5041' then '6006'
+ when a.account_id='5071' then '6001'
+ else a.account_id end) account_id,
+ a.cut_name, (case when a.account_id='1011' then '1001'
+ when a.account_id='1021' then '1002'
+ when a.account_id='1031' then '112101'
+ when a.account_id='1041' then '112102'
+ when a.account_id='1051' then '112103'
+ when a.account_id='2051' then '2002'
+ when a.account_id='2061' then '220299'
+ when a.account_id='2071' then '2203'
+ when a.account_id='5011' then '6002'
+ when a.account_id='5021' then '6005'
+ when a.account_id='5051' then '6003'
+ when a.account_id='5041' then '6006'
+ when a.account_id='5071' then '6001'
+ else a.account_id end) subno,
+ 0 ,last_BALA,(CASE WHEN SUBSTR(A.ACCOUNT_ID,1,1)='1' THEN 1
+ ELSE 2 END) BALFLAG,
+ '','' from (select rtrim(a.account_id) account_id,a.last_bala,
+ a.cut_name from ykt_cur.t_aif_account a where a.act_type=7 and
+ a.account_id not in ('1122','2031','2041','1071')) a",
+ "dest_column": "ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE, BALFLAG, LASTTRANSDATE,
+ LASTACCDATE",
+ "remark": "导入内部账户,并更新错误的借贷标志",
+ "post_exec": ["update t_inneracc set balance=abs(balance),ydaybal=abs(ydaybal),
+ balflag=1 where accno in ('6201','6202')",
+ "update t_syspara set paraval=:bala_date where paraid=2",
+ "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE,
+ BALFLAG, LASTTRANSDATE, LASTACCDATE)
+ values ('112201', '易支付充值款', '112201', 0, 0, 1, null, null)",
+ "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE,
+ BALFLAG, LASTTRANSDATE, LASTACCDATE)
+ values ('112299', '其他应收款', '112299', 0, 0, 1, null, null)",
+ "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE,
+ BALFLAG, LASTTRANSDATE, LASTACCDATE)
+ values ('6004', '搭伙费收入', '6004', 0, 0, 2, null, null)",
+ "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE,
+ BALFLAG, LASTTRANSDATE, LASTACCDATE)
+ values ('2006', '水控存款', '2006', 0, 0, 2, null, null)",
+ "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE,
+ BALFLAG, LASTTRANSDATE, LASTACCDATE)
+ values ('220201', '批量销户应付款', '220201', 0, 0, 2, null, null)",
+ "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE,
+ BALFLAG, LASTTRANSDATE, LASTACCDATE)
+ values ('6201', '营业外支出', '6201', 0, 0, 1, null, null)",
+ "insert into T_INNERACC (ACCNO, ACCNAME, SUBJNO, YDAYBAL, BALANCE,
+ BALFLAG, LASTTRANSDATE, LASTACCDATE)
+ values ('6202', '商户提成支出', '6202', 0, 0, 1, null, null)"
+ ]
+ },
+ {
+ "name": "T_SHOPACC",
+ "action": "truncate",
+ "desc": "商户账户表",
+ "src_sql": "select (case when a.account_id is null then ''
+ else '2'||substr(a.account_id,8) end) accno,
+ s.shop_id shopid,a.cut_name,'2004',a.password,a.current_state,
+ 0 ydaybal,a.last_bala,a.last_freebala,a.last_frozebala,'' lasttransdate,
+ '' lastaccdate, a.open_date,a.close_date from
+ ykt_cur.t_aif_account a left join ykt_cur.t_cif_shop s on
+ a.customer_id=s.cut_id where a.act_type=2 and s.shop_id is not null
+ order by s.shop_id",
+ "dest_column": "ACCNO, SHOPID, ACCNAME, SUBJNO, ACCPWD, STATUS, YDAYBAL, BALANCE,
+ AVAILBAL, FROZEBAL, LASTTRANSDATE, LASTACCDATE, OPENDATE, CLOSEDATE",
+ "post_exec": ["update t_syskey set keyval=(select max(to_number(substr(accno,2)))
+ from t_shopacc) where keycode='SHOPACCNO'"]
+ },
+ {
+ "name": "T_RPTACCBAL",
+ "action": "truncate",
+ "desc": "账户结算表",
+ "src_sql": "select :tx_date,'2001',(case when a.account_id is null then ''
+ else '1'||substr(a.account_id,8) end) accno,
+ 2 ,last_bala from ykt_cur.t_aif_account a where act_type=1
+ union all
+ select :tx_date,'2004',(case when a.account_id is null then ''
+ else '2'||substr(a.account_id,8) end) accno,
+ 2,last_bala from ykt_cur.t_aif_account a where act_type=2
+ union all
+ select :tx_date, (case when a.account_id='1011' then '1001'
+ when a.account_id='1021' then '1002'
+ when a.account_id='1031' then '112101'
+ when a.account_id='1041' then '112102'
+ when a.account_id='1051' then '112103'
+ when a.account_id='2051' then '2002'
+ when a.account_id='2061' then '220299'
+ when a.account_id='2071' then '2203'
+ when a.account_id='5011' then '6002'
+ when a.account_id='5021' then '6005'
+ when a.account_id='5051' then '6003'
+ when a.account_id='5041' then '6006'
+ when a.account_id='5071' then '6001'
+ else rtrim(a.account_id) end) subno,
+ (case when a.account_id='1011' then '1001'
+ when a.account_id='1021' then '1002'
+ when a.account_id='1031' then '112101'
+ when a.account_id='1041' then '112102'
+ when a.account_id='1051' then '112103'
+ when a.account_id='2051' then '2002'
+ when a.account_id='2061' then '220299'
+ when a.account_id='2071' then '2203'
+ when a.account_id='5011' then '6002'
+ when a.account_id='5021' then '6005'
+ when a.account_id='5051' then '6003'
+ when a.account_id='5041' then '6006'
+ when a.account_id='5071' then '6001'
+ else rtrim(a.account_id) end) account_id,
+ (case when substr(a.account_id,1,1)='1' then 1 else 2 end) flag,
+ last_bala from ykt_cur.t_aif_account a where act_type=7 and
+ a.account_id not in ('1122','2031','2041','1071')",
+ "dest_column": "ACCDATE, SUBJNO, ACCNO, BALFLAG, BALANCE",
+ "remark": "导入内部账户报表,并更新错误的借贷标志",
+ "post_exec": ["update t_rptaccbal set balance=abs(balance),balflag=1
+ where accno in ('6201','6202')",
+ // "insert into t_rptaccbal(accdate,subjno,accno,balflag,balance)
+ // select :tx_date,s.subjno,s.subjno,
+ // (case when substr(s.subjno,1,1)='1' then 1
+ // else 2 end) flag1,0
+ // from t_subject s left join t_rptaccbal b on
+ // (s.subjno=b.subjno and b.accdate=:tx_date)
+ // where b.accdate is null",
+ "insert into t_rptaccbal(accdate,subjno,accno,balflag,balance)
+ select :tx_date,s.subjno,s.subjno,2,0 from t_rptsubjbal s
+ where s.subjno in (2001,2004,2202,2006,220201,6004)
+ and s.accdate=:tx_date",
+ "insert into t_rptaccbal(accdate,subjno,accno,balflag,balance)
+ select :tx_date,s.subjno,s.subjno,1,0 from t_rptsubjbal s
+ where s.subjno in (6201,6202)
+ and s.accdate=:tx_date",
+ "update t_rptaccbal set balance=balance+60 where
+ accno='1' || substr('1000000000192778', 8) and accdate=:tx_date"]
+ },
+ {
+ "name": "T_RPTSUBJBAL",
+ "action": "truncate",
+ "desc": "科目结算表",
+ "src_sql": "select :tx_date,'2001',2 ,sum(last_bala),0,0,2,sum(last_bala)
+ from ykt_cur.t_aif_account a where act_type=1
+ union all
+ select :tx_date,'2004',2,sum(last_bala),0,0,2,sum(last_bala)
+ from ykt_cur.t_aif_account a where act_type=2
+ union all select :tx_date,
+ (case when a.account_id='1011' then '1001'
+ when a.account_id='1021' then '1002'
+ when a.account_id='1031' then '112101'
+ when a.account_id='1041' then '112102'
+ when a.account_id='1051' then '112103'
+ when a.account_id='2051' then '2002'
+ when a.account_id='2061' then '220299'
+ when a.account_id='2071' then '2203'
+ when a.account_id='5011' then '6002'
+ when a.account_id='5021' then '6005'
+ when a.account_id='5051' then '6003'
+ when a.account_id='5041' then '6006'
+ when a.account_id='5071' then '6001'
+ when a.account_id='2081' then '2202'
+ else rtrim(a.account_id) end) subno,
+ (case when substr(a.account_id,1,1)='1' then 1
+ else 2 end) flag1,
+ sum(last_bala),0,0,
+ (case when substr(a.account_id,1,1)='1' then 1
+ else 2 end) flag2,sum(last_bala) from
+ ykt_cur.t_aif_account a where act_type=7 and
+ a.account_id not in ('1122','2031','2041','1071')
+ group by a.account_id",
+ "dest_column": "ACCDATE, SUBJNO, BEGINBALFLAG, BEGINBAL, DRAMT, CRAMT,
+ ENDBALFLAG, ENDBAL",
+ "post_exec" : ["insert into t_rptsubjbal(ACCDATE, SUBJNO, BEGINBALFLAG, BEGINBAL,
+ DRAMT, CRAMT, ENDBALFLAG, ENDBAL)
+ select :tx_date, subjno, 1,
+ (select sum(beginbal) from t_rptsubjbal t where accdate=:tx_date
+ and t.subjno like s.subjno || '__'),
+ 0,0,1,
+ (select sum(endbal) from t_rptsubjbal t where accdate=:tx_date
+ and t.subjno like s.subjno || '__') from t_subject s
+ where subjno in ('1121','2202')",
+ "update t_rptsubjbal set beginbalflag=1,endbalflag=1 where
+ subjno in ('6201','6202')",
+ "update t_rptsubjbal set beginbal=beginbal+60, endbal=endbal+60
+ where accdate=:tx_date and subjno='2001'",
+ "delete from t_servicelog"],
+ "remark": "生成结算科目数据"
+ }
+]