<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)

    隨筆分類

    隨筆檔案

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 成人国产mv免费视频| 无码乱人伦一区二区亚洲| kk4kk免费视频毛片| 亚洲第一AAAAA片| 成全视频免费高清| 久久精品成人免费国产片小草| 亚洲蜜芽在线精品一区| 国产免费观看网站| 69pao强力打造免费高清| 亚洲丰满熟女一区二区哦| 亚洲av无码一区二区三区网站 | 国产成人亚洲综合在线| 午夜亚洲AV日韩AV无码大全| 国产青草视频免费观看97| 97无码人妻福利免费公开在线视频| 久久亚洲国产最新网站| 亚洲国产精品无码专区影院| 好大好硬好爽免费视频| 日韩电影免费观看| 黄页网站在线视频免费| 亚洲电影在线免费观看| 伊人久久大香线蕉亚洲五月天| 天天看片天天爽_免费播放| 亚洲精品免费视频| 一级做受视频免费是看美女| 99亚偷拍自图区亚洲| 亚洲国产女人aaa毛片在线| 亚洲国产成人乱码精品女人久久久不卡| 亚洲日本在线免费观看| 美女无遮挡拍拍拍免费视频| 亚洲av无码兔费综合| 亚洲日本香蕉视频| 久久久久久久久亚洲 | 亚洲精品无码不卡在线播放| 亚洲视频在线一区| 亚洲桃色AV无码| 亚洲av午夜成人片精品电影| 性感美女视频免费网站午夜| 亚洲一区二区三区免费在线观看 | 成年男女男精品免费视频网站| 久久国产精品免费观看|