Merge remote-tracking branch 'origin/m-endo' into y-nakano
This commit is contained in:
@@ -74,6 +74,11 @@
|
|||||||
<artifactId>spring-boot-starter-webmvc-test</artifactId>
|
<artifactId>spring-boot-starter-webmvc-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.example</groupId>
|
||||||
|
<artifactId>HelloSpring</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -1,5 +1,101 @@
|
|||||||
package com.example.demo.entity;
|
package com.example.demo.entity;
|
||||||
|
|
||||||
|
import java.security.Timestamp;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
|
import org.hibernate.annotations.Audited.Table;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "borrow_books")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class Borrow_booksEntity {
|
public class Borrow_booksEntity {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 申請ID
|
||||||
|
* */
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "id_request", nullable = false)
|
||||||
|
private Integer idRequest;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 申請者ID
|
||||||
|
* */
|
||||||
|
@Column(name = "id_applicant", nullable = false)
|
||||||
|
private Integer idApplicant;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 蔵書ID
|
||||||
|
* */
|
||||||
|
@Column(name = "id_book", nullable = false)
|
||||||
|
private Integer idBook;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 申請日
|
||||||
|
* */
|
||||||
|
@Column(name = "date_request", nullable = false)
|
||||||
|
private Date dateRequest;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ステータス
|
||||||
|
* */
|
||||||
|
@Column(name = "status", nullable = false)
|
||||||
|
private char 返却済 = 0;
|
||||||
|
private char 承認待 = 1;
|
||||||
|
private char 貸出中 = 2;
|
||||||
|
private char 却下 = 9;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 承認者
|
||||||
|
* */
|
||||||
|
@Column(name = "id_approval", nullable = true)
|
||||||
|
private Integer idApproval;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 承認日
|
||||||
|
* */
|
||||||
|
@Column(name = "date_approval", nullable = true)
|
||||||
|
private Date dateApproval;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 貸出日
|
||||||
|
* */
|
||||||
|
@Column(name = "date_borrow", nullable = false)
|
||||||
|
private Date dateBorrow;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 返却予定日
|
||||||
|
* */
|
||||||
|
@Column(name = "date_scheduled_return", nullable = false)
|
||||||
|
private Date dateScheduledReturn;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 返却日
|
||||||
|
* */
|
||||||
|
@Column(name = "date_return", nullable = true)
|
||||||
|
private Date dateReturn;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 更新者
|
||||||
|
* */
|
||||||
|
@Column(name = "id_update", nullable = false)
|
||||||
|
private Integer idUpdate;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 更新日
|
||||||
|
* */
|
||||||
|
@Column(name = "date_update", nullable = false)
|
||||||
|
private Timestamp dateUpdate;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,140 @@
|
|||||||
package com.example.demo.entity;
|
package com.example.demo.entity;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
|
import org.springframework.data.annotation.LastModifiedDate;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EmployeeテーブルのEntity
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "employee")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
|
||||||
public class EmployeeEntity {
|
public class EmployeeEntity {
|
||||||
|
/**
|
||||||
|
* 社員ID
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "id_employee", nullable = false)
|
||||||
|
private Integer idEmployee;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社員名
|
||||||
|
*/
|
||||||
|
@Column(name = "nm_employee", nullable = false)
|
||||||
|
private String nmEmployee;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社員よみ
|
||||||
|
*/
|
||||||
|
@Column(name = "kn_employee", nullable = false)
|
||||||
|
private String knEmployee;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* メールアドレス
|
||||||
|
*/
|
||||||
|
@Column(name = "mail_address", nullable = false)
|
||||||
|
private String MailAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* パスワード
|
||||||
|
*/
|
||||||
|
@Column(name = "password", nullable = false)
|
||||||
|
private String Password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理者フラグ
|
||||||
|
*/
|
||||||
|
@Column(name = "flg_admin", nullable = false)
|
||||||
|
private Character FlgAdmin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退職者フラグ
|
||||||
|
*/
|
||||||
|
@Column(name = "flg_retirement", nullable = false)
|
||||||
|
private Character FlgRetirement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新者
|
||||||
|
*/
|
||||||
|
@Column(name = "id_update", nullable = false)
|
||||||
|
private Integer IdUpdate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新日
|
||||||
|
*/
|
||||||
|
@Column(name = "date_update", nullable = false)
|
||||||
|
@LastModifiedDate
|
||||||
|
private Integer DateUpdate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public static EmployeeEntity convertForm(Employee employee) {
|
||||||
|
// return new EmployeeEntity(
|
||||||
|
// employee.getIdEmployee(),
|
||||||
|
// employee.getnmEmployee(),
|
||||||
|
// employee.getknEmployee(),
|
||||||
|
// employee.getMailAddress(),
|
||||||
|
// employee.getPassword(),
|
||||||
|
// employee.getFlgAdmin(),
|
||||||
|
// employee.getFlgRetirement(),
|
||||||
|
// employee.getIdUpdate(),
|
||||||
|
// employee.getDateUpdate());
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public static EmployeeEntity convertFrom(SearchConditionEmployee searchConditionEmployee) {
|
||||||
|
// EmployeeEntity employeeEntity = new EmployeeEntity();
|
||||||
|
//
|
||||||
|
// employeeEntity.setIdEmployee(searchConditionEmployee.getIdEmployee());
|
||||||
|
// employeeEntity.setNmEmployee(searchConditionEmployee.getNmEmployee());
|
||||||
|
// employeeEntity.setKnEmployee(searchConditionEmployee.getKnEmployee());
|
||||||
|
// employeeEntity.setMailAddress(searchConditionEmployee.getMailAddress());
|
||||||
|
//
|
||||||
|
// return employeeEntity;
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public static Employee createEmployee(EmployeeEntity employeeEntity) {
|
||||||
|
// return new Employee(
|
||||||
|
// employeeEntity.getIdEmployee(),
|
||||||
|
// employeeEntity.getNmEmployee(),
|
||||||
|
// employeeEntity.getKnEmployee(),
|
||||||
|
// employeeEntity.getMailAddress(),
|
||||||
|
// employeeEntity.getPassword(),
|
||||||
|
// employeeEntity.getFlgAdmin(),
|
||||||
|
// employeeEntity.getFlgRetirement(),
|
||||||
|
// employeeEntity.getIdUpdate(),
|
||||||
|
// employeeEntity.getDateUpdate());
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public static List<Employee> createEmployeeList(List<EmployeeEntity> employeeEntityList) {
|
||||||
|
// return employeeEntityList.stream().map(EmployeeEntity::createEmployee).toList();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public LoginUser createLoginUser() {
|
||||||
|
// getIdEmployee(),
|
||||||
|
// getNmEmployee(),
|
||||||
|
// getKnEmployee(),
|
||||||
|
// getMailAddress(),
|
||||||
|
// getPassword(),
|
||||||
|
// getFlgAdmin(),
|
||||||
|
// getFlgRetirement(),
|
||||||
|
// getIdUpdate(),
|
||||||
|
// getDateUpdate());
|
||||||
|
//}
|
||||||
|
//}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.example.demo.repository;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.example.demo.entity.Book_collectionEntity;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface Book_CollectionRepository extends JpaRepository<Book_collectionEntity, Integer> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.example.demo.repository;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.example.demo.entity.Borrow_booksEntity;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface Borrow_BooksRepository extends JpaRepository<Borrow_booksEntity, Integer> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.example.demo.repository;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.example.demo.entity.EmployeeEntity;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface EmployeeRepository extends JpaRepository<EmployeeEntity, Integer> {
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user