<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è)置級(jí)別
    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 閱讀(167) 評(píng)論(0)  編輯  收藏

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


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

    常用鏈接

    留言簿(5)

    隨筆分類

    隨筆檔案

    搜索

    •  

    最新評(píng)論

    閱讀排行榜

    評(píng)論排行榜

    主站蜘蛛池模板: 国产国产人免费人成成免视频 | 日本特黄特色aa大片免费| 大胆亚洲人体视频| 成人片黄网站色大片免费观看cn| 亚洲AV无码精品色午夜果冻不卡 | ww4545四虎永久免费地址| 亚洲国产精品无码久久一区二区| 51在线视频免费观看视频| 亚洲综合激情六月婷婷在线观看| 精品久久久久久无码免费| 精品亚洲麻豆1区2区3区| 99久久99热精品免费观看国产| 久久精品国产亚洲av麻豆图片| 99久久国产热无码精品免费 | 久久亚洲国产成人精品性色| 成人毛片18女人毛片免费96| 天堂亚洲国产中文在线| 亚洲а∨天堂久久精品| 白白色免费在线视频| 日韩在线a视频免费播放| 国产免费高清69式视频在线观看| 亚洲日本国产精华液| 亚洲黄片手机免费观看| WWW国产成人免费观看视频| 亚洲精品视频在线免费| 夜色阁亚洲一区二区三区| 日本视频一区在线观看免费| 在线视频网址免费播放| 亚洲AV无码专区国产乱码不卡| 亚洲高清最新av网站| 无码中文在线二区免费| 免费观看男人吊女人视频| 国产偷国产偷亚洲高清人| 亚洲另类小说图片| 久久91亚洲人成电影网站| 国产一区二区三区在线免费| 91免费播放人人爽人人快乐| 免费观看男人吊女人视频| 国产免费A∨在线播放| 国产成人va亚洲电影| 亚洲午夜成人精品无码色欲|