2005 06 23個人日誌

2021-08-22 01:25:02 字數 2591 閱讀 1357

今天去了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

endset @k2=@k-@k1

set @subsidyfare2=@subsidyfare-@subsidyfare1

update t_subsidymonth set putoutcount=@k2,putoutsubsidy=@subsidyfare2 where cardtype=@cardtype and month=@month /*當月已發人數及金額=當月補助計畫人數及金額-當月補助未發人數及金額*/

print str(@cardtype)+'類卡更改當月的補助資訊完成!'

endelse

begin

print str(@cardtype)+'類卡計畫總數不一致!'

endselect @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

endupdate t_subsidymonth set putoutprecount=@k2,putoutpre=@subsidyfare2 where cardtype=@cardtype and month=@month /*當月前期已發人數及金額=當月前期補助計畫人數及金額-前期補助未發人數及金額*/

print str(@cardtype)+'類卡更改當月的前期補助資訊完成!'

fetch next from k into @cardtype

endclose k

deallocate k

/*自動形成學(工)號的觸發器*/

create trigger tr_outid on t_customers

for insert

asupdate t_customers set t_customers.outid=i.customerid from inserted as i where t_customers.customerid= i.customerid

06 22個人日誌

昨天晚上跟了兩個同事 蘇和張 去吃了面 在麵點王 那裡口味非常不錯,晚上下雨太大,本想等雨停了再走,但等太久,沒辦法,只得大家脫了鞋光著腳丫擠車回家,唉,真很慘,崗頂的橋上有一輛車橫了,呵呵,不過想著大家那個樣就好笑,回到家裡,遇到了一件很心煩的事情,家裡的事情,乙個做人失敗的例子,不好說出口,因此...

06 23個人日誌

昨天晚上回到家,一樣,同往常一樣,沒有區別,我想靜下心來看看一些禪的故事,這裡的故事很有啟發,做乙個人,如果真能那樣靜心對待任何一切,那麼這個世界真得會更燦爛絢麗,想著想著睡覺不著,又看了軟體工程,得出了一些心得,今天空閒下來,我將他寫下來 今天早上起來,心情不知道為什麼那麼煩躁,總想起以前一些事情...

2005 08 29個人日誌

又過了一周了,來上海十多天了,時間真快,了解了上海很多的事物,跟廣州很多的不同,上海人隨和很多,也融洽很多,沒有廣州的冷淡和相互間的冷漠的感情。前一周的工作很困難,天天加班,但也很充實,但最困難的就是每天坐車,唉,上海,能否更方便一點讓我?上海人特別喜歡硬幣,每次我買東西,總能讓我的包裡裝滿了硬幣,...