Closed GoogleCodeExporter closed 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
是这样用的呀!
Original comment by songjie8...@gmail.com
on 30 Jul 2009 at 2:02
如果某个周期的记录已经统计过了,就不需要再统计了,直��
�从表period_sum中提取结果就行了
ps:该功能可以考虑在某个固定时间运行~
Original comment by rcom10002
on 30 Jul 2009 at 2:17
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
最好也能更新到f3s.sql文件上,并生成MODEL上传到SVN上,谢谢~~
目前还没找到HIBERNATE执行DML语句的文件,望能告诉一下,再��
�谢谢~~
Original comment by songjie8...@gmail.com
on 31 Jul 2009 at 3:05
该任务完成!
Original comment by songjie8...@gmail.com
on 2 Aug 2009 at 12:48
终了
Original comment by songjie8...@gmail.com
on 2 Aug 2009 at 12:50
统计结果的日期格式为yyyy年mm月dd日
对于TITLE字段,设置内容需要为:积分统计(yyyy年mm月dd日 至
yyyy年mm月dd日)
Original comment by rcom10002
on 2 Aug 2009 at 2:02
将功能菜单“积分统计”的功能转移至“积分结算报表”,��
�删除菜单“积分统计”
Original comment by rcom10002
on 2 Aug 2009 at 2:04
fixed
Original comment by songjie8...@gmail.com
on 3 Aug 2009 at 3:53
Original issue reported on code.google.com by
rcom10002
on 30 Jul 2009 at 5:31