1.创建实体类
package com.bdqn.pojo;
import java.util.Date;
import java.util.List;
/**
* @author Guo
* @create 2021-12-23 14:28
* 用户表单实体类
*/
public class Smbms_User {
//私有化创建数据库属性
private Integer id;
private String userCode;
private String userName;
private String userPassword;
private Integer gender;
private Date birthday;
private String phone;
private String address;
private Integer userRole;
private Integer createdBy;
private Date creationDate;
private Integer modifyBy;
private Date modifyDate;
private String idPicPath;
private String workPicPath;
/* //第一种方式,实体类里面添加一个字段角色名称
private String roleName;
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}*/
//第二种方式,添加用户角色的类型属性
private Smbms_Role role;
public Smbms_Role getRole() {
return role;
}
public void setRole(Smbms_Role role) {
this.role = role;
}
//添加供应商地址属性
private List<Smbms_Address> addressList;
public List<Smbms_Address> getAddressList() {
return addressList;
}
public void setAddressList(List<Smbms_Address> addressList) {
this.addressList = addressList;
}
@Override
public String toString() {
return "Smbms_User{" +
"id=" + id +
", userCode='" + userCode + '\'' +
", userName='" + userName + '\'' +
", userPassword='" + userPassword + '\'' +
", gender=" + gender +
", birthday=" + birthday +
", phone='" + phone + '\'' +
", address='" + address + '\'' +
", userRole=" + userRole +
", createdBy=" + createdBy +
", creationDate=" + creationDate +
", modifyBy=" + modifyBy +
", modifyDate=" + modifyDate +
", idPicPath='" + idPicPath + '\'' +
", workPicPath='" + workPicPath + '\'' +