• R/O
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版43 (tree)
时间2016-03-24 18:23:12
作者ckoshien

Log Message

選手一覧の取得方法を外部SQLに変更、それに伴いロジック・画面改修

更改概述

差异

--- trunk/JCBLScore/src/main/resources/cx/myhome/ckoshien/sql/TeamDate.sql (nonexistent)
+++ trunk/JCBLScore/src/main/resources/cx/myhome/ckoshien/sql/TeamDate.sql (revision 43)
@@ -0,0 +1,15 @@
1+select
2+ *
3+from player p
4+inner join
5+(SELECT
6+ t.team_id as team_id,
7+ t.team_name as team_name,
8+ t.short_name as short_name,
9+ max(game_date) as last_join_date
10+ FROM team t
11+ inner join result r on t.team_id=r.team_id
12+ inner join game g on r.game_id=g.game_id
13+group by team_id
14+order by last_join_date desc) team_date
15+on p.team_id=team_date.team_id;
\ No newline at end of file
--- trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/action/PlayerAction.java (revision 42)
+++ trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/action/PlayerAction.java (revision 43)
@@ -12,6 +12,7 @@
1212 import org.seasar.struts.annotation.Execute;
1313
1414 import cx.myhome.ckoshien.dto.BattingResultDto;
15+import cx.myhome.ckoshien.dto.PlayerDto;
1516 import cx.myhome.ckoshien.dto.TeamBattingResultDto;
1617 import cx.myhome.ckoshien.dto.TeamPitchingResultDto;
1718 import cx.myhome.ckoshien.entity.Player;
@@ -35,7 +36,7 @@
3536 public PlayerForm playerForm;
3637
3738 public List<Team> teamList;
38- public List<Player> playerList;
39+ public List<PlayerDto> playerList;
3940 public Player player;
4041 @Resource
4142 public BattingSumService battingSumService;
--- trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/action/GameSummaryAction.java (revision 42)
+++ trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/action/GameSummaryAction.java (revision 43)
@@ -21,6 +21,7 @@
2121
2222 import cx.myhome.ckoshien.dto.BattingResultDto;
2323 import cx.myhome.ckoshien.dto.GameListDto;
24+import cx.myhome.ckoshien.dto.PlayerDto;
2425 import cx.myhome.ckoshien.entity.BattingSum;
2526 import cx.myhome.ckoshien.entity.Game;
2627 import cx.myhome.ckoshien.entity.League;
@@ -49,7 +50,7 @@
4950 @Resource
5051 public PlayerService playerService;
5152 public List<Team> teamList;
52-public List<Player> playerList;
53+public List<PlayerDto> playerList;
5354 @Resource
5455 public GameService gameService;
5556 public Game game;
--- trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/logic/GameSummaryLogic.java (revision 42)
+++ trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/logic/GameSummaryLogic.java (revision 43)
@@ -8,6 +8,7 @@
88 import javax.annotation.Resource;
99
1010 import cx.myhome.ckoshien.dto.GameListDto;
11+import cx.myhome.ckoshien.dto.PlayerDto;
1112 import cx.myhome.ckoshien.entity.BattingSum;
1213 import cx.myhome.ckoshien.entity.Game;
1314 import cx.myhome.ckoshien.entity.Pitching;
@@ -183,7 +184,7 @@
183184 }
184185 }
185186
186- public BattingSum convert2BattingSum(BattingSumForm battingSumForm,BattingSum battingSum,List<Player> playerList,int i){
187+ public BattingSum convert2BattingSum(BattingSumForm battingSumForm,BattingSum battingSum,List<PlayerDto> playerList,int i){
187188 battingSum.playerId=Integer.parseInt(battingSumForm.playerId.get(i));
188189 //空文字の場合0と解釈
189190 if(battingSumForm.tpa.get(i)==""){
--- trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/service/PlayerService.java (revision 42)
+++ trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/service/PlayerService.java (revision 43)
@@ -1,11 +1,20 @@
11 package cx.myhome.ckoshien.service;
22
3+import cx.myhome.ckoshien.dto.BattingResultDto;
4+import cx.myhome.ckoshien.dto.PlayerDto;
35 import cx.myhome.ckoshien.entity.Player;
6+
7+import java.util.ArrayList;
8+import java.util.Date;
9+import java.util.HashMap;
410 import java.util.List;
11+import java.util.Map;
12+
513 import javax.annotation.Generated;
614
715 import static cx.myhome.ckoshien.entity.PlayerNames.*;
816 import static org.seasar.extension.jdbc.operation.Operations.*;
17+import static org.seasar.extension.jdbc.parameter.Parameter.date;
918
1019 /**
1120 * {@link Player}のサービスクラスです。
@@ -14,7 +23,9 @@
1423 @Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.ServiceModelFactoryImpl"}, date = "2014/12/09 16:58:09")
1524 public class PlayerService extends AbstractService<Player> {
1625
17- /**
26+ public List<PlayerDto> playerList;
27+
28+ /**
1829 * 識別子でエンティティを検索します。
1930 *
2031 * @param id
@@ -30,9 +41,14 @@
3041 *
3142 * @return エンティティのリスト
3243 */
33- public List<Player> findAllOrderById() {
34- return select().innerJoin(team()).orderBy(asc(teamId())).getResultList();
35- }
44+// public List<Player> findAllOrderById() {
45+// return select().innerJoin(team()).orderBy(asc(teamId())).getResultList();
46+// }
47+ public List<PlayerDto> findAllOrderById(){
48+ playerList=new ArrayList<PlayerDto>();
49+ playerList=jdbcManager.selectBySqlFile(PlayerDto.class, "cx.myhome.ckoshien.sql.TeamDate.sql").getResultList();
50+ return playerList;
51+ }
3652
3753 public Player findByLoginId(String loginId) {
3854 return select().where("loginId=?", loginId).getSingleResult();
--- trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/dto/PlayerDto.java (nonexistent)
+++ trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/dto/PlayerDto.java (revision 43)
@@ -0,0 +1,8 @@
1+package cx.myhome.ckoshien.dto;
2+
3+import cx.myhome.ckoshien.entity.Player;
4+
5+public class PlayerDto extends Player{
6+ public String shortName;
7+
8+}
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property