SQLSERVER 批量处理
来源:互联网 发布:听打测试软件 编辑:程序博客网 时间:2024/06/07 17:39
select return_periods ,is_finished ,collect_corpus ,collect_interest ,collect_total ,collect_date ,is_fykq_success, * from CHK_collect_plan_info
where lend_info_id =6218 and return_periods=10
select b.cust_name ,b.clew_mob_tel , b.cret_code ,c.is_finished, prop_type ,a.is_loan ,c.is_finished ,f.contract_no,
f.loan_money,c.sett_money ,a.lend_info_id ,b.cust_id ,e.org_name , * from CHK_lend_info a inner join CST_cust b on a.cust_id=b.cust_id
inner join APP_lend_paper
c on a.lend_info_id=c.lend_info_id inner join ORG_org_info e on a.org_id=e.org_id inner join APP_lend_contract f on a.lend_info_id=f.lend_info_id
where b.cust_name like '%叶传兵%'
select return_periods ,is_finished ,collect_corpus ,collect_total ,collect_date ,is_fykq_success, * from CHK_collect_plan_info
where lend_info_id =5833
select d.cust_name ,c.is_dock ,c.invest_affirm_id , * from FRM_match_detail_record a inner join FRM_match_total_record b on a.total_match_id=b.total_match_id
inner join FRM_captial_invest_affirm c on b.invest_affirm_id=c.invest_affirm_id
inner join CST_cust d on c.cust_id=d.cust_id where ISNULL(del_flg ,0)=0 and lend_info_id=6250
select SUM(match_money) from FRM_match_detail_record where lend_info_id=6250 and ISNULL(del_flg ,0)=0
-----------------*********处理任红军6093 收回一期标准版本*************------
-------------脚本开始------------------------
declare @keyId int
declare @lendinfoid int
declare @collectcorups decimal(18,4)
declare @collectinterest decimal(18,4)
declare @payid int
declare @returnperiods int
begin
set @returnperiods=15;
set @lendinfoid=6218
update CHK_collect_plan_info set is_finished=1,receive_corpus=collect_corpus ,receive_interest=collect_interest where
lend_info_id=@lendinfoid and return_periods=@returnperiods
-------------------------添加收回表-------------------------------------
select @keyId = Max_Id+1 from Table_Key where Table_Name='CLN_capital_interest'
select @collectcorups =collect_corpus ,@collectinterest=collect_interest from CHK_collect_plan_info where lend_info_id=@lendinfoid and return_periods=@returnperiods
INSERT INTO [CLN_capital_interest]
([pay_id]
,[lend_info_id]
,[receive_volume]
,[receive_capital]
,[receive_interest]
)VALUES
(@keyId,@lendinfoid,@returnperiods,@collectcorups,@collectinterest)
update Table_Key set max_id=@keyId where Table_Name='CLN_capital_interest'
update CLN_capital_interest set collect_capital=receive_capital ,collect_interest =receive_interest ,receive_total_money=receive_capital+receive_interest
where lend_info_id=@lendinfoid and receive_volume =@returnperiods
--------------添加收回表明细表-------------------
select @payid=pay_id from CLN_capital_interest where lend_info_id=@lendinfoid and receive_volume =@returnperiods
select @keyId = Max_Id+1 from Table_Key where Table_Name='CLN_repay_detail'
INSERT INTO [CLN_repay_detail]
([paper_fee_id]
,[lend_info_id]
,[cost_id]
,[cost_name]
,[collect_money]
,[pay_id]
,[receive_volume]
,[is_recieved]
)VALUES
(@keyId,@lendinfoid,'-500','本金',@collectcorups,@payid,@returnperiods ,1)
update Table_Key set max_id=@keyId where Table_Name='CLN_repay_detail'
---------利息------
select @keyId = Max_Id+1 from Table_Key where Table_Name='CLN_repay_detail'
INSERT INTO [CLN_repay_detail]
([paper_fee_id]
,[lend_info_id]
,[cost_id]
,[cost_name]
,[collect_money]
,[pay_id]
,[receive_volume]
,[is_recieved]
)VALUES
(@keyId,@lendinfoid,'-400','利息',@collectinterest,@payid,@returnperiods ,1)
update Table_Key set max_id=@keyId where Table_Name='CLN_repay_detail'
update CLN_repay_detail set receive_money=collect_money ,statistics_cost_way=2,before_or_after=2,add_date=GETDATE() where lend_info_id=@lendinfoid and receive_volume=@returnperiods
end
-------------------解除债券
--张文栋多出 1913.5900
update FRM_match_detail_record set match_money-= 1913.5900 where match_id=44540
update FRM_match_total_record set match_loan_total_money-=1913.5900 where total_match_id=14409
------------------------------*************处理脚本结束*********************-------------------------------------------
--**************************************************************************************************************
where lend_info_id =6218 and return_periods=10
select b.cust_name ,b.clew_mob_tel , b.cret_code ,c.is_finished, prop_type ,a.is_loan ,c.is_finished ,f.contract_no,
f.loan_money,c.sett_money ,a.lend_info_id ,b.cust_id ,e.org_name , * from CHK_lend_info a inner join CST_cust b on a.cust_id=b.cust_id
inner join APP_lend_paper
c on a.lend_info_id=c.lend_info_id inner join ORG_org_info e on a.org_id=e.org_id inner join APP_lend_contract f on a.lend_info_id=f.lend_info_id
where b.cust_name like '%叶传兵%'
select return_periods ,is_finished ,collect_corpus ,collect_total ,collect_date ,is_fykq_success, * from CHK_collect_plan_info
where lend_info_id =5833
select d.cust_name ,c.is_dock ,c.invest_affirm_id , * from FRM_match_detail_record a inner join FRM_match_total_record b on a.total_match_id=b.total_match_id
inner join FRM_captial_invest_affirm c on b.invest_affirm_id=c.invest_affirm_id
inner join CST_cust d on c.cust_id=d.cust_id where ISNULL(del_flg ,0)=0 and lend_info_id=6250
select SUM(match_money) from FRM_match_detail_record where lend_info_id=6250 and ISNULL(del_flg ,0)=0
-----------------*********处理任红军6093 收回一期标准版本*************------
-------------脚本开始------------------------
declare @keyId int
declare @lendinfoid int
declare @collectcorups decimal(18,4)
declare @collectinterest decimal(18,4)
declare @payid int
declare @returnperiods int
begin
set @returnperiods=15;
set @lendinfoid=6218
update CHK_collect_plan_info set is_finished=1,receive_corpus=collect_corpus ,receive_interest=collect_interest where
lend_info_id=@lendinfoid and return_periods=@returnperiods
-------------------------添加收回表-------------------------------------
select @keyId = Max_Id+1 from Table_Key where Table_Name='CLN_capital_interest'
select @collectcorups =collect_corpus ,@collectinterest=collect_interest from CHK_collect_plan_info where lend_info_id=@lendinfoid and return_periods=@returnperiods
INSERT INTO [CLN_capital_interest]
([pay_id]
,[lend_info_id]
,[receive_volume]
,[receive_capital]
,[receive_interest]
)VALUES
(@keyId,@lendinfoid,@returnperiods,@collectcorups,@collectinterest)
update Table_Key set max_id=@keyId where Table_Name='CLN_capital_interest'
update CLN_capital_interest set collect_capital=receive_capital ,collect_interest =receive_interest ,receive_total_money=receive_capital+receive_interest
where lend_info_id=@lendinfoid and receive_volume =@returnperiods
--------------添加收回表明细表-------------------
select @payid=pay_id from CLN_capital_interest where lend_info_id=@lendinfoid and receive_volume =@returnperiods
select @keyId = Max_Id+1 from Table_Key where Table_Name='CLN_repay_detail'
INSERT INTO [CLN_repay_detail]
([paper_fee_id]
,[lend_info_id]
,[cost_id]
,[cost_name]
,[collect_money]
,[pay_id]
,[receive_volume]
,[is_recieved]
)VALUES
(@keyId,@lendinfoid,'-500','本金',@collectcorups,@payid,@returnperiods ,1)
update Table_Key set max_id=@keyId where Table_Name='CLN_repay_detail'
---------利息------
select @keyId = Max_Id+1 from Table_Key where Table_Name='CLN_repay_detail'
INSERT INTO [CLN_repay_detail]
([paper_fee_id]
,[lend_info_id]
,[cost_id]
,[cost_name]
,[collect_money]
,[pay_id]
,[receive_volume]
,[is_recieved]
)VALUES
(@keyId,@lendinfoid,'-400','利息',@collectinterest,@payid,@returnperiods ,1)
update Table_Key set max_id=@keyId where Table_Name='CLN_repay_detail'
update CLN_repay_detail set receive_money=collect_money ,statistics_cost_way=2,before_or_after=2,add_date=GETDATE() where lend_info_id=@lendinfoid and receive_volume=@returnperiods
end
-------------------解除债券
--张文栋多出 1913.5900
update FRM_match_detail_record set match_money-= 1913.5900 where match_id=44540
update FRM_match_total_record set match_loan_total_money-=1913.5900 where total_match_id=14409
------------------------------*************处理脚本结束*********************-------------------------------------------
--**************************************************************************************************************
0 0
- SQLSERVER 批量处理
- sqlserver 批量处理
- SQLServer批量更新、批量插入
- sqlserver 批量增加数据
- SQLSERVER批量授权
- sqlserver批量新增数据
- SQLServer批量插数据
- SQLServer批量删表
- SQLSERVER和ORACLE批量处理表名和字段名大写
- C# 处理批量插入数据(事物) mysql oracle sqlserver三个版本
- SQLSERVER和ORACLE批量处理表名和字段名大写
- 批量处理
- 批量处理
- 批量处理
- 批量处理
- 批量处理
- sqlserver批量附加 批量分离数据
- sqlserver 批量删除存储过程
- UNIX再学习 -- 函数 system
- Linux同一个环境使用2个jdk
- android studio 手把手教你搭建百度地图
- 解决listview层层嵌套的另外一种思路
- gcc 优化选项 -O1 -O2 -O3 -Os 优先级,-fomit-frame-pointer
- SQLSERVER 批量处理
- 数据库笔记 5
- SpringMVC提高篇(一):常用注解标签
- android 开发笔记 使用Volley框架获取json数据出现中文乱码解决方案
- tomcat中server.xml配置详解
- Arcgis Javascript那些事儿(十二)——geometry service几何服务
- ::
- 乘法逆元
- 手机页面中confirm提示框美化