rcom10002 / ccgclient

Automatically exported from code.google.com/p/ccgclient
0 stars 1 forks source link

积分统计 #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
统计出当前玩家以及当前玩家下属的玩家

统计内容为在某一期间段内:
玩家参加的游戏次数、获胜次数、获胜积分、失败次数、失��
�积分、平局次数、平局积分、总次
数、总积分、总系统分、开始统计时间、结束统计时间

玩家范围为当前玩家,当前玩家下属玩家

统计结果存放于period_sum

Original issue reported on code.google.com by rcom10002 on 30 Jul 2009 at 5:31

GoogleCodeExporter commented 9 years ago
select user_id, 
       total_sum.times total_times, 
       total_sum.scores total_scores, 
       win_sum.times win_times, 
       win_sum.scores win_scores, 
       lose_sum.times lose_times, 
       lose_sum.scores lose_scores, 
       draw_sum.times draw_times, 
       draw_sum.scores draw_scores
  from player_profile left outer join (
select profile_id, count(score) times, sum(score) scores 
  from player_score
 group by profile_id
) total_sum on player_profile.profile_id = total_sum.profile_id left outer join 
(
select profile_id, count(score) times, sum(score) scores 
  from player_score
 where score > 0
 group by profile_id
) win_sum on player_profile.profile_id = win_sum.profile_id left outer join (
select profile_id, count(score) times, sum(score) scores 
  from player_score
 where score < 0
 group by profile_id
) lose_sum on player_profile.profile_id = lose_sum.profile_id left outer join (
select profile_id, count(score) times, sum(score) scores
  from player_score
 where score = 0
 group by profile_id
) draw_sum on player_profile.profile_id = draw_sum.profile_id

Original comment by rcom10002 on 30 Jul 2009 at 1:58

GoogleCodeExporter commented 9 years ago
是这样用的呀!

Original comment by songjie8...@gmail.com on 30 Jul 2009 at 2:02

GoogleCodeExporter commented 9 years ago
如果某个周期的记录已经统计过了,就不需要再统计了,直��
�从表period_sum中提取结果就行了

ps:该功能可以考虑在某个固定时间运行~

Original comment by rcom10002 on 30 Jul 2009 at 2:17

GoogleCodeExporter commented 9 years ago
drop table if exists PERIODLY_SUM;

create table PERIODLY_SUM
(
   PERIODLY_ID          VARCHAR(100) not null,
   PROFILE_ID           VARCHAR(100),
   NUMBER               VARCHAR(100),
   TITLE                VARCHAR(100) not null,
   START_DATE           DATE not null,
   END_DATE             DATE not null,
   WIN_TIMES            INT not null,
   WIN_SCORES           INT not null,
   LOSE_TIMES           INT not null,
   LOSE_SCORES          INT not null,
   DRAW_TIMES           INT not null,
   DRAW_SCORES          INT not null,
   TOTAL_TIMES          INT not null,
   TOTAL_SCORES         INT not null,
   TOTAL_SYSTEM_SCORE   INT not null,
   STATUS               TINYINT,
   CREATE_TIME          DATETIME,
   CREATE_BY            VARCHAR(100),
   UPDATE_TIME          DATETIME,
   UPDATE_BY            VARCHAR(100),
   primary key (PERIODLY_ID)
)
type = InnoDB;

alter table PERIODLY_SUM add constraint FK_PERIODLY_SUM_TO_PLAYER_PROFILE 
foreign 
key (PROFILE_ID)
      references PLAYER_PROFILE (PROFILE_ID) on delete restrict on update restrict;

Original comment by rcom10002 on 30 Jul 2009 at 11:51

GoogleCodeExporter commented 9 years ago
最好也能更新到f3s.sql文件上,并生成MODEL上传到SVN上,谢谢~~
目前还没找到HIBERNATE执行DML语句的文件,望能告诉一下,再��
�谢谢~~

Original comment by songjie8...@gmail.com on 31 Jul 2009 at 3:05

GoogleCodeExporter commented 9 years ago
该任务完成!

Original comment by songjie8...@gmail.com on 2 Aug 2009 at 12:48

GoogleCodeExporter commented 9 years ago
终了

Original comment by songjie8...@gmail.com on 2 Aug 2009 at 12:50

GoogleCodeExporter commented 9 years ago
统计结果的日期格式为yyyy年mm月dd日
对于TITLE字段,设置内容需要为:积分统计(yyyy年mm月dd日 至 
yyyy年mm月dd日)

Original comment by rcom10002 on 2 Aug 2009 at 2:02

GoogleCodeExporter commented 9 years ago
将功能菜单“积分统计”的功能转移至“积分结算报表”,��
�删除菜单“积分统计”

Original comment by rcom10002 on 2 Aug 2009 at 2:04

GoogleCodeExporter commented 9 years ago
fixed

Original comment by songjie8...@gmail.com on 3 Aug 2009 at 3:53