質問編集履歴
1
不要な文字の削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -122,9 +122,81 @@
|
|
122
122
|
|
123
123
|
|
124
124
|
|
125
|
-
|
126
|
-
|
127
|
-
```
|
125
|
+
```
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
### 追加情報
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
修正依頼いただき誠にありがとうございます。説明不足で申し訳ございません。
|
136
|
+
|
137
|
+
repに関しては、
|
138
|
+
|
139
|
+
@Autowired
|
140
|
+
|
141
|
+
DeploymentRepository rep;
|
142
|
+
|
143
|
+
になります。
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
### 該当のRepository
|
148
|
+
|
149
|
+
```
|
150
|
+
|
151
|
+
@Repository
|
152
|
+
|
153
|
+
public interface DeploymentRepository extends JpaRepository<DeploymentEntity, Long> {
|
154
|
+
|
155
|
+
public Optional<DeploymentEntity> findById(int i);
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
@Query(value = "SELECT * FROM m_deployment WHERE delete_flag=0", nativeQuery = true)
|
160
|
+
|
161
|
+
ArrayList<DeploymentEntity> findDeploymentByDeleteFlag();
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
public Optional<DeploymentEntity> findByDeploymentName(String depNmae);
|
166
|
+
|
167
|
+
}
|
168
|
+
|
169
|
+
```
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
### テーブルDDL
|
174
|
+
|
175
|
+
create table m_deployment (
|
176
|
+
|
177
|
+
deployment_id INT AUTO_INCREMENT not null comment '部署ID'
|
178
|
+
|
179
|
+
, deployment_name VARCHAR(50) UNIQUE not null comment '部署名'
|
180
|
+
|
181
|
+
, register_date DATETIME comment '登録日'
|
182
|
+
|
183
|
+
, register_id INT comment '登録者ID'
|
184
|
+
|
185
|
+
, edit_date DATETIME comment '編集日'
|
186
|
+
|
187
|
+
, editer_id INT comment '編集者ID'
|
188
|
+
|
189
|
+
, delete_flag INT comment '削除フラグ'
|
190
|
+
|
191
|
+
, delete_date DATETIME comment '削除日'
|
192
|
+
|
193
|
+
, deleter_id INT comment '削除者ID'
|
194
|
+
|
195
|
+
, sort_num INT comment '並び順'
|
196
|
+
|
197
|
+
, constraint m_deployment_PKC primary key (deployment_id)
|
198
|
+
|
199
|
+
) comment '部署テーブル' ;
|
128
200
|
|
129
201
|
|
130
202
|
|