no message

This commit is contained in:
2026-10-20 15:49:25 +09:00
parent 6b0fcad592
commit 53485523b0
7 changed files with 140 additions and 21 deletions

View File

@@ -0,0 +1,35 @@
package com.example.demo.controller;
import org.springframework.stereotype.Controller;
@Controller
public class LendingListController {
// @GetMapping("/lendingList")
// public String show(Model model) {
// List<X> x = xservice.getX();
// model.addAttribute("Y", x);
// return "Y";
// }
// HttpSession session;
//
// @Autowired
// public SelectListController(HttpSession session) {
// this.session=session;
// }
// @RequestMapping("/lendingList")
// public String lendList() {
// return "lendingList";
// }
// @RequestMapping(value = lendingList, method = RequestMethod.POST)
// public String select( , Model model) {
// model.addAttribute(
// );
// return lendingList;
//
// }
}

View File

@@ -1,6 +1,6 @@
package com.example.demo.entity; package com.example.demo.entity;
import java.sql.Date; import java.sql.Timestamp;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
@@ -9,10 +9,13 @@ import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import org.springframework.data.annotation.LastModifiedDate;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
//テーブル名
@Table(name = "book_collection") @Table(name = "book_collection")
@Entity @Entity
@Data @Data
@@ -28,28 +31,28 @@ public class Book_collectionEntity {
private Integer idBook; private Integer idBook;
//ISBN //ISBN
@Column(name = "isbn", nullable = false) @Column(name = "isbn", nullable = false, length = 13)
private String isBn; private String isBn;
//書籍名 //書籍名
@Column(name = "nm_book", nullable = false) @Column(name = "nm_book", nullable = false, length = 50)
private String nmBook; private String nmBook;
//書籍名よみ //書籍名よみ
@Column(name = "kn_book", nullable = true) @Column(name = "kn_book", nullable = true, length = 100)
private String knBook; private String knBook;
//出版社 //出版社
@Column(name = "publisher", nullable = true) @Column(name = "publisher", nullable = true, length = 50)
private String pubLisher; private String pubLisher;
//特記事項 //特記事項
@Column(name = "note text", nullable = true) @Column(name = "note text", nullable = true)
private String noteText; private String noteText;
//貸出フラグ //貸出フラグ -> charに変更する
@Column(name = "flg_lending", length = 1, nullable = false) @Column(name = "flg_lending", nullable = false, columnDefinition = "default 0")
private String flgLending; private Character flgLending;
//更新者 //更新者
@Column(name = "id_update", nullable = false) @Column(name = "id_update", nullable = false)
@@ -57,7 +60,8 @@ public class Book_collectionEntity {
//更新日 //更新日
@Column(name = "date_update", nullable = false) @Column(name = "date_update", nullable = false)
private Date dateUpdate; @LastModifiedDate
private Timestamp dateUpdate;
// public static Book_collection convertFrom(Book_collection book_collection) { // public static Book_collection convertFrom(Book_collection book_collection) {
// // 値を既に持ったインスタンスの生成に、コンストラクタを使用するとこうなります。 // // 値を既に持ったインスタンスの生成に、コンストラクタを使用するとこうなります。
@@ -80,7 +84,7 @@ public class Book_collectionEntity {
// employeeEntity.setIdBook(searchConditionEmployee.getIdBook()); // employeeEntity.setIdBook(searchConditionEmployee.getIdBook());
// employeeEntity.setisBn(searchConditionEmployee.getisBn()); // employeeEntity.setisBn(searchConditionEmployee.getisBn());
// employeeEntity.setnmBook(searchConditionEmployee.getnmBook()); // employeeEntity.setnmBook(searchConditionEmployee.getnmBook());
// employeeEntity.setknBook(searchConditionEmployee.knBook()); // employeeEntity.setknBook(searchConditionEmployee.knBook());
// employeeEntity.setpublisher(searchConditionEmployee.getpublisher()); // employeeEntity.setpublisher(searchConditionEmployee.getpublisher());
// employeeEntity.setnoteText(searchConditionEmployee.getnoteText()); // employeeEntity.setnoteText(searchConditionEmployee.getnoteText());

View File

@@ -10,6 +10,7 @@ import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import org.hibernate.annotations.Audited.Table; import org.hibernate.annotations.Audited.Table;
import org.springframework.data.annotation.LastModifiedDate;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
@@ -53,7 +54,7 @@ public class Borrow_booksEntity {
* ステータス * ステータス
* */ * */
@Column(name = "status", nullable = false, columnDefinition = "default 1") @Column(name = "status", nullable = false, columnDefinition = "default 1")
private char status; private Character status;
/* /*
* 承認者 * 承認者
@@ -95,5 +96,6 @@ public class Borrow_booksEntity {
* 更新日 * 更新日
* */ * */
@Column(name = "date_update", nullable = false) @Column(name = "date_update", nullable = false)
@LastModifiedDate
private Timestamp dateUpdate; private Timestamp dateUpdate;
} }

View File

@@ -1,5 +1,7 @@
package com.example.demo.entity; package com.example.demo.entity;
import java.security.Timestamp;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
@@ -35,25 +37,25 @@ public class EmployeeEntity {
/** /**
* 社員名 * 社員名
*/ */
@Column(name = "nm_employee", nullable = false) @Column(name = "nm_employee", nullable = false, length = 50)
private String nmEmployee; private String nmEmployee;
/** /**
* 社員よみ * 社員よみ
*/ */
@Column(name = "kn_employee", nullable = false) @Column(name = "kn_employee", nullable = false, length = 100)
private String knEmployee; private String knEmployee;
/** /**
* メールアドレス * メールアドレス
*/ */
@Column(name = "mail_address", nullable = false) @Column(name = "mail_address", nullable = false, length = 256)
private String MailAddress; private String MailAddress;
/** /**
* パスワード * パスワード
*/ */
@Column(name = "password", nullable = false) @Column(name = "password", nullable = false, length = 256)
private String Password; private String Password;
/** /**
@@ -72,15 +74,14 @@ public class EmployeeEntity {
* 更新者 * 更新者
*/ */
@Column(name = "id_update", nullable = false) @Column(name = "id_update", nullable = false)
private Integer IdUpdate; private Integer idUpdate;
/** /**
* 更新日 * 更新日
*/ */
@Column(name = "date_update", nullable = false) @Column(name = "date_update", nullable = false)
@LastModifiedDate @LastModifiedDate
private Integer DateUpdate; private Timestamp dateUpdate;
} }
// public static EmployeeEntity convertForm(Employee employee) { // public static EmployeeEntity convertForm(Employee employee) {
@@ -137,4 +138,4 @@ public class EmployeeEntity {
// getIdUpdate(), // getIdUpdate(),
// getDateUpdate()); // getDateUpdate());
//} //}
//} //}

View File

@@ -0,0 +1,27 @@
package com.example.demo.service;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.demo.entity.EmployeeEntity;
import com.example.demo.repository.Book_CollectionRepository;
import com.example.demo.repository.Borrow_BooksRepository;
@Service
@Transactional
public class LendingListService {
@Autowired
private Book_CollectionRepository collection;
@Autowired
private Borrow_BooksRepository borrow;
@Autowired
private EmployeeEntity employee;
public List<table> getcollectionWithborrow(){
return collection;
}
}

View File

@@ -0,0 +1,5 @@
package com.example.demo.service;
public class S {
}

View File

@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>貸出中書籍一覧</title>
</head>
<body>
<h1>
<div class="rightSection">
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
</div>
<a href="menu">メニューに戻る</a>
<h1><span>検索結果</span></h1>
</h1>
<thead>
<tr>
<th style="width: 100px;">申請ID</th>
<th style="width: 100px;">申請者名</th>
<th style="width: 100px;">書籍名</th>
<th style="width: 100px;">申請日</th>
<th style="width: 100px;">貸出日</th>
<th style="width: 100px;">返却予定日</th>
<th style="width: 100px;">操作</th>
</tr>
</thead>
<tbody>
<tr th:each="">
<td th:text="${.idRequest}"></td>
<td th:text="${.}"></td>
<td th:text="${.}"></td>
<td th:text="${.dateRequest}"></td>
<td th:text="${.dateBorrow}"></td>
<td th:text="${.dateScheduledReturn}"></td>
<td>
<form action="" method="post" style="display: inline;">
<input name="" th:value="${}" type="hidden">
<input type="submit" value="返却">
</form>
</td>
</tbody>
</body>
</html>