今天去了fjjrzyjsxy做系统维护工作,主要解决了两大问题:一个是补助月报的修正,由于老出现改完后当场可以过后又不行的情况,后面直接把那个补助月报的T-SQL修正代码形成一个快捷方式放到桌面上,叫黄老师以后如果报表有错,直接执行那个快捷方式,这样就省了我们不少麻烦,因为那T-SQL代码都是自动执行的,不要输入任何参数,只要有错,就可执行,但只针对当月报表。二是解决了开户发卡时,学(工)号没办法自动形成问题。主要是在T_customers表中做了一个触发器问题解决!
附:
/*补助月报表信息纠正T-SQL代码*/
declare @k int, @k1 int,@k2 int,@month datetime,@subsidyFare money,@cardtype tinyint,@subsidyFare1 money,@subsidyFare2 money
select top 1 @month=month from t_subsidymonth order by month desc /*获取当月补助的月份*/
deallocate k
declare k cursor for select cardtype from t_subsidymonth where month=@month
open k
fetch next from k into @cardtype
while (@@fetch_status=0)
begin /*以下为修正T_subsidymonth表信息代码,以未发算已发为原则*/
select @k=count(*),@subsidyFare=isnull(sum(subsidy),0) from t_subsidypre where cardtype=@cardtype and month=@month /*统计当月补助计划人数及金额,以t_subsidypre帐本为准*/
if exists(select * from t_subsidymonth where plancount=@k and plansubsidy=@subsidyFare and month=@month and cardtype=@cardtype) /*判断当月补助计划数及金额是否正确*/
begin
select @k1=count(*),@subsidyFare1=sum(subsidy) from t_subsidymonthplan where cardtype=@cardtype and month=@month /*统计当月补助未发人数及金额*/
if @subsidyFare1 is null
begin
set @subsidyFare1=0
end
set @k2=@k-@k1
set @subsidyFare2=@subsidyFare-@subsidyFare1
update t_subsidymonth set putoutcount=@k2,putoutsubsidy=@subsidyFare2 where cardtype=@cardtype and month=@month /*当月已发人数及金额=当月补助计划人数及金额-当月补助未发人数及金额*/
print str(@cardtype)+'类卡更改当月的补助信息完成!'
end
else
begin
print str(@cardtype)+'类卡计划总数不一致!'
end
select @k=count(*),@subsidyFare=sum(subsidy) from t_subsidynotputout where cardtype=@cardtype and month<@month /*统计前期补助未发人数及金额*/
select @k1=planprecount,@subsidyFare1=planpre from t_subsidymonth where cardtype=@cardtype and month=@month /*统计当月前期补助计划人数及金额*/
set @k2=@k1-@k
set @subsidyFare2=@subsidyFare1-@subsidyFare
if @subsidyFare2 is null
begin
set @subsidyFare2=0
end
update t_subsidymonth set putoutprecount=@k2,putoutpre=@subsidyFare2 where cardtype=@cardtype and month=@month /*当月前期已发人数及金额=当月前期补助计划人数及金额-前期补助未发人数及金额*/
print str(@cardtype)+'类卡更改当月的前期补助信息完成!'
fetch next from k into @cardtype
end
close k
deallocate k
/*自动形成学(工)号的触发器*/
CREATE TRIGGER tr_outid ON T_Customers
FOR INSERT
AS
update T_customers set T_customers.outid=i.customerid from inserted as I where T_customers.customerid= i.customerid
分享到:
相关推荐
Linux运维-04-日志分析-日志监控ELK-day02-ELK日志系统生产案例-06-filebeat收集日
Splunk作为一款成熟的商业化日志处理分析产品无论在功能上还是用户体验上都是令人满意的,因splunk-7.2.3-06d57c595b80-linux-2.6-x86_64.rpm包过大超出了上传的权限范围,故将该安装包放在百度云中,下载地址在splunk-...
Linux运维-04-日志分析-日志监控ELK-day03-生产案例及Git版本控制-06-版本控制系统简介.mp4
Linux运维-04-日志分析-日志监控ELK-day02-ELK日志系统生产案例-05-EFK实现.mp4
Linux运维-04-日志分析-日志监控ELK-day02-ELK日志系统生产案例-08-filebeat日志过
Linux运维-04-日志分析-日志监控ELK-day02-ELK日志系统生产案例-07-收集nginx日
Linux运维-04-日志分析-日志监控ELK-day01-ELK概述与elasticsearch部署06-ES集.mp4
Linux运维-04-日志分析-日志监控ELK-day02-ELK日志系统生产案例-13-geoip插件.mp4
Linux运维-04-日志分析-日志监控ELK-day02-ELK日志系统生产案例-12-grok插件.mp4
Linux运维-04-日志分析-日志监控ELK-day02-ELK日志系统生产案例-10-json插件.mp4
Linux运维-04-日志分析-日志监控ELK-day02-ELK日志系统生产案例-01-kibana安装.mp4
Linux运维-04-日志分析-日志监控ELK-day02-ELK日志系统生产案例-09-tcp输入插件.mp4
Linux运维-04-日志分析-日志监控ELK-day02-ELK日志系统生产案例-04-kibana创建可视