• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

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

EveryDB2のデータベースを読み込んでWinFormでGUI表示するサンプル


Commit MetaInfo

Revisionf8acc5d752cbb824c20f3eacd57030b749281695 (tree)
Zeit2021-06-05 05:23:52
Autoryoshy <yoshy@user...>
Commiteryoshy

Log Message

temp_20210605_0523

Ändern Zusammenfassung

Diff

--- a/App/Adaptor/Gateway/ViewModel/Dto/UmaRaceRowDto.cs
+++ b/App/Adaptor/Gateway/ViewModel/Dto/UmaRaceRowDto.cs
@@ -43,11 +43,15 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
4343
4444 public string GradeName => CodeHelper.GetInstance().GetGradeName(Race, "?");
4545
46- public string CourseName => CodeHelper.GetInstance().GetTurfDurtName(Race?.Trackcd, "?") + Race?.Kyori;
46+ public string TurfDirtName => CodeHelper.GetInstance().GetTurfDurtName(Race?.Trackcd, "?");
47+
48+ public string CourseName => TurfDirtName + Race?.Kyori;
4749
4850 public string NinkiFormatted => FormatHelper.SuppressZeroLeading(Ninki);
4951
50- public string SyussoTosuFormatted => FormatHelper.SuppressZeroLeading(Race.Syussotosu);
52+ public string TosuFormatted => FormatHelper.FormatTosu(Race);
53+
54+ public string BabaJyotaiFormatted => FormatHelper.FormatBabaJyotai(Race);
5155
5256 public string KakuteiJyuniFormatted => FormatHelper.SuppressZeroLeading(Kakuteijyuni);
5357
--- a/App/Adaptor/Gateway/ViewModel/Dto/UmaSummaryRowDto.cs
+++ b/App/Adaptor/Gateway/ViewModel/Dto/UmaSummaryRowDto.cs
@@ -97,12 +97,20 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
9797 {
9898 get
9999 {
100- if (Konso?.Bataijyu != null)
100+ if (!string.IsNullOrEmpty(Konso?.Bataijyu) && (Konso.Bataijyu != "0000"))
101101 {
102102 return Konso.BataijyuFormatted;
103103 }
104- if (Zenso?.Bataijyu != null)
104+
105+ if (!string.IsNullOrEmpty(Zenso?.Bataijyu))
105106 {
107+ if ( string.IsNullOrEmpty(Konso?.Bataijyu) || (Konso?.Bataijyu == "0000") )
108+ {
109+ Konso.Bataijyu = Zenso.Bataijyu;
110+ Konso.Zogensa = null;
111+ return Konso.Bataijyu;
112+ }
113+
106114 return Zenso.BataijyuFormatted;
107115 }
108116
--- a/App/Presentation/View/MainWindow.cs
+++ b/App/Presentation/View/MainWindow.cs
@@ -208,6 +208,11 @@ namespace UmaTest.App.Presentation.View
208208 },
209209 new DataGridViewTextBoxColumn
210210 {
211+ DataPropertyName = "Zenso.BabaJyotaiFormatted",
212+ Name = "前走馬場",
213+ },
214+ new DataGridViewTextBoxColumn
215+ {
211216 DataPropertyName = "Zenso.NinkiFormatted",
212217 Name = "前走人気",
213218 },
@@ -288,6 +293,11 @@ namespace UmaTest.App.Presentation.View
288293 },
289294 new DataGridViewTextBoxColumn
290295 {
296+ DataPropertyName = "NisoMae.BabaJyotaiFormatted",
297+ Name = "前々走馬場",
298+ },
299+ new DataGridViewTextBoxColumn
300+ {
291301 DataPropertyName = "NisoMae.NinkiFormatted",
292302 Name = "前々走人気",
293303 },
@@ -481,6 +491,7 @@ namespace UmaTest.App.Presentation.View
481491 dataGridView1.Columns["間隔"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
482492
483493 dataGridView1.Columns["前走G"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
494+ dataGridView1.Columns["前走馬場"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
484495 dataGridView1.Columns["前走人気"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
485496 dataGridView1.Columns["前走通過順位"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
486497 dataGridView1.Columns["前走着順"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
@@ -491,6 +502,7 @@ namespace UmaTest.App.Presentation.View
491502 dataGridView1.Columns["前走間隔"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
492503
493504 dataGridView1.Columns["前々走G"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
505+ dataGridView1.Columns["前々走馬場"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
494506 dataGridView1.Columns["前々走人気"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
495507 dataGridView1.Columns["前々走通過順位"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
496508 dataGridView1.Columns["前々走着順"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
@@ -555,11 +567,16 @@ namespace UmaTest.App.Presentation.View
555567 },
556568 new DataGridViewTextBoxColumn
557569 {
558- DataPropertyName = "SyussoTosuFormatted",
570+ DataPropertyName = "TosuFormatted",
559571 Name = "頭数",
560572 },
561573 new DataGridViewTextBoxColumn
562574 {
575+ DataPropertyName = "BabaJyotaiFormatted",
576+ Name = "馬場",
577+ },
578+ new DataGridViewTextBoxColumn
579+ {
563580 DataPropertyName = "WakubanFormatted",
564581 Name = "枠番",
565582 },
@@ -605,23 +622,23 @@ namespace UmaTest.App.Presentation.View
605622 },
606623 new DataGridViewTextBoxColumn
607624 {
608- DataPropertyName = "AvgHaronTimeMinus3Formatted",
609- Name = "平均-3F",
625+ DataPropertyName = "AvgHaronTimeMinus3DevFormatted",
626+ Name = "平均-3F ペース",
610627 },
611628 new DataGridViewTextBoxColumn
612629 {
613- DataPropertyName = "AvgHaronTimeMinus3DevFormatted",
614- Name = "平均-3F ペース",
630+ DataPropertyName = "HaronTimeL3DevFormatted",
631+ Name = "上3F指数",
615632 },
616633 new DataGridViewTextBoxColumn
617634 {
618- DataPropertyName = "HaronTimeL3Formatted",
619- Name = "上3F",
635+ DataPropertyName = "AvgHaronTimeMinus3Formatted",
636+ Name = "平均-3F",
620637 },
621638 new DataGridViewTextBoxColumn
622639 {
623- DataPropertyName = "HaronTimeL3DevFormatted",
624- Name = "上3F指数",
640+ DataPropertyName = "HaronTimeL3Formatted",
641+ Name = "上3F",
625642 },
626643 new DataGridViewTextBoxColumn
627644 {
@@ -674,6 +691,7 @@ namespace UmaTest.App.Presentation.View
674691
675692 dataGridView2.Columns["G"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
676693 dataGridView2.Columns["頭数"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
694+ dataGridView2.Columns["馬場"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
677695 dataGridView2.Columns["枠番"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
678696 dataGridView2.Columns["馬番"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
679697 dataGridView2.Columns["人気"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
--- a/Infra/Helper/CodeHelper.cs
+++ b/Infra/Helper/CodeHelper.cs
@@ -15,6 +15,7 @@ namespace UmaTest.Infra.Helper
1515 public static readonly string GRADE_CODE = "2003";
1616 public static readonly string JYOKEN_CODE = "2007";
1717 public static readonly string TRACK_CODE = "2009";
18+ public static readonly string BABA_JYOTAI_CODE = "2010";
1819
1920 public static readonly string SEX_CODE = "2202";
2021
--- a/Infra/Helper/FormatHelper.cs
+++ b/Infra/Helper/FormatHelper.cs
@@ -106,7 +106,7 @@ namespace UmaTest.Infra.Helper
106106
107107 public static string FormatTimeSSF(string time3)
108108 {
109- return time3.Length == 3
109+ return time3?.Length == 3
110110 ? time3 != "000" && time3 != "999"
111111 ? $"{time3.Substring(0, 2)}.{time3.Substring(2, 1)}"
112112 : "-"
@@ -115,7 +115,7 @@ namespace UmaTest.Infra.Helper
115115
116116 public static string FormatTimeMSSF(string time4)
117117 {
118- return time4.Length == 4
118+ return time4?.Length == 4
119119 ? time4 != "0000"
120120 ? $"{time4.Substring(0, 1)}:{time4.Substring(1, 2)}.{time4.Substring(3, 1)}"
121121 : "-"
@@ -124,7 +124,7 @@ namespace UmaTest.Infra.Helper
124124
125125 public static string FormatTimeHHMM(string time4)
126126 {
127- return time4.Length == 4
127+ return time4?.Length == 4
128128 ? time4 != "0000"
129129 ? $"{time4.Substring(0, 2)}:{time4.Substring(2, 2)}"
130130 : "-"
@@ -305,7 +305,7 @@ namespace UmaTest.Infra.Helper
305305
306306 public static string ToNumber(string value)
307307 {
308- return ToNumber(value, value.Length, 0);
308+ return !string.IsNullOrEmpty(value) ? ToNumber(value, value.Length, 0) : string.Empty;
309309 }
310310
311311 public static string ToNumber(string value, int length, int digits)
@@ -340,5 +340,55 @@ namespace UmaTest.Infra.Helper
340340
341341 return Math.Round((number / pow10s[digits]), digits, MidpointRounding.AwayFromZero).ToString(digitFormats[digits]);
342342 }
343+
344+ public static string FormatBabaJyotai(NRace race)
345+ {
346+ if (race == null)
347+ {
348+ return "-";
349+ }
350+
351+ string sibaJyotai = CodeHelper.GetInstance().GetName(CodeHelper.BABA_JYOTAI_CODE, race.Sibababacd, string.Empty);
352+ string dirtJyotai = CodeHelper.GetInstance().GetName(CodeHelper.BABA_JYOTAI_CODE, race.Dirtbabacd, string.Empty);
353+
354+ string turfDirtName = CodeHelper.GetInstance().GetTurfDurtName(race.Trackcd, string.Empty);
355+
356+ switch(turfDirtName)
357+ {
358+ case "芝":
359+ return sibaJyotai;
360+ case "ダ":
361+ return dirtJyotai;
362+ case "芝ダ":
363+ return !string.IsNullOrEmpty(sibaJyotai) && !string.IsNullOrEmpty(dirtJyotai) ? sibaJyotai + "・" + dirtJyotai : string.Empty;
364+ }
365+
366+ return string.Empty;
367+ }
368+
369+ public static string FormatTosu(NRace race)
370+ {
371+ if (race == null)
372+ {
373+ return "-";
374+ }
375+
376+ string syussoTosuu = SuppressZeroLeading(race?.Syussotosu);
377+
378+ if ( !string.IsNullOrEmpty(syussoTosuu) && (syussoTosuu != "-") )
379+ {
380+ return syussoTosuu;
381+ }
382+
383+ string torokuTosuu = SuppressZeroLeading(race?.Torokutosu);
384+
385+ if ( !string.IsNullOrEmpty(torokuTosuu) && (torokuTosuu != "-") )
386+ {
387+ return torokuTosuu;
388+ }
389+
390+ return string.Empty;
391+ }
392+
343393 }
344394 }
--- a/Resources/Sql/uma_race_stddev2.sql
+++ b/Resources/Sql/uma_race_stddev2.sql
@@ -1,5 +1,6 @@
1+create table app_uma_race_stddev as
12 with v_uma_race_base1 as (
2-select distinct
3+select
34 r.jyocd
45 , r.year
56 , r.monthday
@@ -11,7 +12,7 @@ select distinct
1112 when '702' then 'N'
1213 when '703' then 'M'
1314 else case
14- when jyokencd5 = '000' then '-'
15+ when jyokencd5 <= '000' then '-'
1516 when jyokencd5 <= '005' then '1'
1617 when jyokencd5 <= '010' then '2'
1718 when jyokencd5 <= '016' then '3'
@@ -21,19 +22,21 @@ select distinct
2122 else r.gradecd
2223 end as gradecd
2324 , r.syubetucd
25+ , ur.time
26+ , ur.harontimel3
2427 from
2528 n_uma_race ur
2629 inner join n_race r
2730 using (year, jyocd, kaiji, nichiji, racenum)
28-where
29- ur.kettonum in ('1985104409')
3031 ), v_uma_race_base2 as (
31-select distinct
32+select
3233 ur.jyocd
3334 , ur.kyori
3435 , ur.trackcd
3536 , ur.gradecd
3637 , ur.syubetucd
38+ , ur.time
39+ , ur.harontimel3
3740 , coalesce(max(c.kaishudate)
3841 filter (where c.kaishudate <= ur.year || ur.monthday)
3942 over (partition by ur.jyocd, ur.kyori, ur.trackcd, ur.gradecd, ur.syubetucd)
@@ -43,37 +46,85 @@ from
4346 v_uma_race_base1 ur
4447 inner join n_course c
4548 using(jyocd, kyori, trackcd)
49+), v_uma_race_base3 as (
50+select
51+ ur.jyocd
52+ , to_number(ur.kyori, '0000') as kyori
53+ , ur.trackcd
54+ , ur.gradecd
55+ , ur.syubetucd
56+ , ur.kaishudate
57+ , case ur.time
58+ when '0000' then null
59+ when ' ' then null
60+ else to_number(substring(ur.time, 1, 1), '0') * 600
61+ + to_number(substring(ur.time, 2, 2), '00') * 10
62+ + to_number(substring(ur.time, 4, 1), '0')
63+ end as time
64+ , case ur.harontimel3
65+ when '000' then null
66+ when '999' then null
67+ when ' ' then null
68+ else to_number(substring(ur.harontimel3, 1, 2), '00') * 10
69+ + to_number(substring(ur.harontimel3, 3, 1), '0')
70+ end as harontimel3
71+from
72+ v_uma_race_base2 ur
73+), v_uma_race as (
74+select
75+ ur.jyocd
76+ , ur.kyori
77+ , ur.trackcd
78+ , ur.gradecd
79+ , ur.syubetucd
80+ , ur.kaishudate
81+ , ur.time
82+ , ur.harontimel3
83+ , case ur.harontimel3
84+ when null then null
85+ else (ur.time - ur.harontimel3) * 600 / (ur.kyori - 600)
86+ end as avgharontimeminus3
87+from
88+ v_uma_race_base3 ur
4689 )
47-SELECT ur.*, r.*, vur.*, urdev.*
48-FROM n_uma_race ur
49-INNER JOIN n_race r USING(year, jyocd, kaiji, nichiji, racenum)
50-LEFT JOIN n_uma u USING(kettonum)
51-LEFT JOIN v_uma_race_base2 vur
52- ON r.jyocd = vur.jyocd
53-AND r.kyori = vur.kyori
54-AND r.trackcd = vur.trackcd
55-AND vur.gradecd = case r.gradecd
56- when '' then case r.jyokencd5
57- when '701' then 'N'
58- when '702' then 'N'
59- when '703' then 'M'
60- else case
61- when r.jyokencd5 = '000' then null
62- when r.jyokencd5 <= '005' then '1'
63- when r.jyokencd5 <= '010' then '2'
64- when r.jyokencd5 <= '016' then '3'
65- else 'OP'
66- end
67- end
68- else r.gradecd
69- end
70-AND r.syubetucd = vur.syubetucd
71-LEFT JOIN app_uma_race_stddev urdev
72- ON vur.jyocd = urdev.jyocd
73-AND vur.kyori = urdev.kyori
74-AND vur.trackcd = urdev.trackcd
75-AND vur.gradecd = urdev.gradecd
76-AND vur.syubetucd = urdev.syubetucd
77-AND vur.kaishudate = urdev.kaishudate
78-WHERE ur.kettonum in ('1985104409')
79-ORDER BY ur.kettonum, ur.year desc, ur.monthday desc
\ No newline at end of file
90+select
91+ ur.jyocd
92+ , to_char(ur.kyori, 'FM0000') as kyori
93+ , ur.trackcd
94+ , ur.gradecd
95+ , ur.syubetucd
96+ , ur.kaishudate
97+ , count(ur.time) as cnt
98+ , min(ur.time) as time_min
99+ , max(ur.time) as time_max
100+ , round(avg(ur.time), 2) as time_avg
101+ , round(stddev(ur.time), 2) as time_dev
102+ , min(ur.harontimel3) as harontimel3_min
103+ , max(ur.harontimel3) as harontimel3_max
104+ , round(avg(ur.harontimel3), 2) as harontimel3_avg
105+ , round(stddev(ur.harontimel3), 2) as harontimel3_dev
106+ , round(min(ur.avgharontimeminus3), 2) as avgharontimeminus3_min
107+ , round(max(ur.avgharontimeminus3), 2) as avgharontimeminus3_max
108+ , round(avg(ur.avgharontimeminus3), 2) as avgharontimeminus3_avg
109+ , round(stddev(ur.avgharontimeminus3), 2) as avgharontimeminus3_dev
110+from
111+ v_uma_race ur
112+group by
113+ ur.jyocd
114+ , ur.kyori
115+ , ur.trackcd
116+ , ur.kaishudate
117+ , ur.gradecd
118+ , ur.syubetucd
119+order by
120+ ur.jyocd
121+ , ur.kyori
122+ , ur.trackcd
123+ , ur.gradecd
124+ , ur.syubetucd
125+ , ur.kaishudate
126+;
127+alter table app_uma_race_stddev add constraint pk_app_uma_race_stddev primary key (jyocd, kyori, trackcd, gradecd, syubetucd, kaishudate)
128+;
129+drop table app_uma_race_stddev
130+;