<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>


    exec setScores 'test','test'


    alter proc setScores (@userName varchar(120),@password varchar(120))
    as
    begin
    declare @count int
    declare @lastDate datetime
    declare @gid varchar(60)
    declare @sum int
    declare @level varchar(60)
    ---年度變量
    declare @regDate datetime
    declare @yearCount int
    ---函數(shù)主題
    select @gid=Gid from CusUsers where [User_Name]=@userName
    select @count=count(1) from CusUsers where [User_Name]=@userName and User_Pass=@password
    if(@count>0)
    begin
    select @lastDate=gdate from UserScrores where uid=@gid and stype=1 order by gdate desc
    set @lastDate=isnull(@lastDate,getdate()-1)
    if(datediff(day,@lastDate,getdate())>=1)
    begin
    --添加登陸日志
    insert into UserScrores(stype,uid,Scores) select '1',@gid,10

    end
    --年度分設(shè)置
    select @regDate=Gdate from CusUsers where  Gid=@gid
    set @yearCount=datediff(year,@regDate,getdate())
    if(@yearCount>=0)
    begin
    print '10'
    update UserScrores set Scores=50 where uid=@gid and stype=10
    if(@@rowcount<=0)
    insert into UserScrores(stype,uid,Scores) select '10',@gid,50
    end
    else if (@yearCount>=1 and @yearCount<=2)
    begin
    update UserScrores set Scores=50 where uid=@gid and stype=11
    if(@@rowcount<=0)
    insert into UserScrores(stype,uid,Scores) select '11',@gid,50
    end
    else if(@yearCount>=3)
    begin
    update UserScrores set Scores=50 where uid=@gid and stype=12
    if(@@rowcount<=0)
    insert into UserScrores(stype,uid,Scores) select '12',@gid,50
    end

    ---設(shè)置級別
    select @sum=sum(isnull(Scores,0)) from UserScrores where uid=@gid
    select @level=levelMark from LevelTable where @sum between SStart and SEnd
    update CusUsers set ULevel=@level where Gid=@gid
    --設(shè)置結(jié)束
    end

    end

    GO


    select * from LevelTable

    posted on 2010-11-06 18:37 sanmao 閱讀(163) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導(dǎo)航:
     

    常用鏈接

    留言簿(5)

    隨筆分類

    隨筆檔案

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 国产AV无码专区亚洲AV男同| 国产成人在线观看免费网站| 中文字幕亚洲日本岛国片| 亚洲AV无码专区在线厂| 国产一区二区三区无码免费| 亚洲日韩精品无码AV海量| 大地资源在线观看免费高清| 亚洲熟妇无码一区二区三区导航| 毛片免费观看的视频在线| 亚洲精华液一二三产区| 日韩免费高清视频网站| 特级毛片爽www免费版| 亚洲国产成人久久综合碰| 一区二区三区免费看| 九月丁香婷婷亚洲综合色| 91香焦国产线观看看免费| 亚洲精品美女久久久久9999| 免费大片黄在线观看yw| 亚洲人成网站在线在线观看| 亚洲精品成人区在线观看| 有色视频在线观看免费高清在线直播| 亚洲国模精品一区| 午夜免费福利小电影| 亚洲av永久无码精品天堂久久| 大学生a级毛片免费观看| 亚洲.国产.欧美一区二区三区| 亚洲日韩在线观看免费视频| 两个人看的www免费| 亚洲成a人片在线网站| 一本色道久久88综合亚洲精品高清| jizz免费一区二区三区| 久久久久亚洲AV成人片| 成人永久免费高清| 在线免费观看h片| 亚洲色图激情文学| 亚洲综合图色40p| 成年午夜视频免费观看视频| 一二三区免费视频| 亚洲天堂2017无码中文| 久久精品国产精品亚洲| AA免费观看的1000部电影|