Merge pull request '3' (#7) from cqq into develop

develop
prxhap34i 1 month ago
commit 9ca130cb58

@ -9,9 +9,9 @@ import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.entity.view.YonghuView; import com.entity.view.YonghuView;
/**
* Dao /*
* * Dao
* @author * @author
*/ */
public interface YonghuDao extends BaseMapper<YonghuEntity> { public interface YonghuDao extends BaseMapper<YonghuEntity> {

@ -21,325 +21,332 @@ import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.enums.IdType;
/** /**
* *
* yonghu
* *
* @author * @author
* @email * @email
*/ */
@TableName("yonghu") @TableName("yonghu") // 指定对应的数据库表名
public class YonghuEntity<T> implements Serializable { public class YonghuEntity<T> implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L; // 序列化版本UID
/**
*
*/
public YonghuEntity() {
public YonghuEntity() { }
}
public YonghuEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/** /**
* *
* BeanUtils
* @param t
*/ */
@TableId(type = IdType.AUTO) public YonghuEntity(T t) {
@TableField(value = "id") try {
BeanUtils.copyProperties(this, t); // 使用BeanUtils进行属性拷贝
} catch (IllegalAccessException | InvocationTargetException e) {
// 打印异常堆栈
e.printStackTrace();
}
}
/**
* ID
*
*/
@TableId(type = IdType.AUTO) // 主键自增
@TableField(value = "id") // 对应数据库字段名
private Integer id; private Integer id;
/** /**
* * /
*
*/ */
@TableField(value = "username") @TableField(value = "username") // 对应数据库字段名
private String username; private String username;
/** /**
* *
*
*/ */
@TableField(value = "password") @TableField(value = "password") // 对应数据库字段名
private String password; private String password;
/** /**
* *
*/ */
@TableField(value = "yonghu_name") @TableField(value = "yonghu_name") // 对应数据库字段名
private String yonghuName; private String yonghuName;
/** /**
* *
*
*/ */
@TableField(value = "yonghu_photo") @TableField(value = "yonghu_photo") // 对应数据库字段名
private String yonghuPhoto; private String yonghuPhoto;
/** /**
* *
*/ */
@TableField(value = "yonghu_phone") @TableField(value = "yonghu_phone") // 对应数据库字段名
private String yonghuPhone; private String yonghuPhone;
/** /**
* *
*/ */
@TableField(value = "yonghu_id_number") @TableField(value = "yonghu_id_number") // 对应数据库字段名
private String yonghuIdNumber; private String yonghuIdNumber;
/** /**
* *
*/ */
@TableField(value = "yonghu_email") @TableField(value = "yonghu_email") // 对应数据库字段名
private String yonghuEmail; private String yonghuEmail;
/** /**
* *
* 使
*/ */
@TableField(value = "sex_types") @TableField(value = "sex_types") // 对应数据库字段名
private Integer sexTypes; private Integer sexTypes;
/** /**
* *
*/ */
@TableField(value = "new_money") @TableField(value = "new_money") // 对应数据库字段名
private Double newMoney; private Double newMoney;
/** /**
* *
* 1-2-
*/ */
@TableField(value = "yonghu_delete") @TableField(value = "yonghu_delete") // 对应数据库字段名
private Integer yonghuDelete; private Integer yonghuDelete;
/** /**
* *
* yyyy-MM-dd HH:mm:ss
*/ */
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // 日期格式化
@DateTimeFormat @DateTimeFormat // 日期格式
@TableField(value = "create_time",fill = FieldFill.INSERT) @TableField(value = "create_time",fill = FieldFill.INSERT) // 插入时自动填充
private Date createTime; private Date createTime;
// ================ getter和setter方法 ================
/** /**
* * ID
*/ * @return id ID
*/
public Integer getId() { public Integer getId() {
return id; return id;
} }
/** /**
* * ID
*/ * @param id ID
*/
public void setId(Integer id) { public void setId(Integer id) {
this.id = id; this.id = id;
} }
/** /**
* * /
*/ * @return username
*/
public String getUsername() { public String getUsername() {
return username; return username;
} }
/** /**
* * /
*/ * @param username
*/
public void setUsername(String username) { public void setUsername(String username) {
this.username = username; this.username = username;
} }
/** /**
* *
*/ * @return password
*/
public String getPassword() { public String getPassword() {
return password; return password;
} }
/** /**
* *
*/ * @param password
*/
public void setPassword(String password) { public void setPassword(String password) {
this.password = password; this.password = password;
} }
/** /**
* *
*/ * @return yonghuName
*/
public String getYonghuName() { public String getYonghuName() {
return yonghuName; return yonghuName;
} }
/** /**
* *
*/ * @param yonghuName
*/
public void setYonghuName(String yonghuName) { public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName; this.yonghuName = yonghuName;
} }
/** /**
* *
*/ * @return yonghuPhoto
*/
public String getYonghuPhoto() { public String getYonghuPhoto() {
return yonghuPhoto; return yonghuPhoto;
} }
/** /**
* *
*/ * @param yonghuPhoto
*/
public void setYonghuPhoto(String yonghuPhoto) { public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto; this.yonghuPhoto = yonghuPhoto;
} }
/** /**
* *
*/ * @return yonghuPhone
*/
public String getYonghuPhone() { public String getYonghuPhone() {
return yonghuPhone; return yonghuPhone;
} }
/** /**
* *
*/ * @param yonghuPhone
*/
public void setYonghuPhone(String yonghuPhone) { public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone; this.yonghuPhone = yonghuPhone;
} }
/** /**
* *
*/ * @return yonghuIdNumber
*/
public String getYonghuIdNumber() { public String getYonghuIdNumber() {
return yonghuIdNumber; return yonghuIdNumber;
} }
/** /**
* *
*/ * @param yonghuIdNumber
*/
public void setYonghuIdNumber(String yonghuIdNumber) { public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber; this.yonghuIdNumber = yonghuIdNumber;
} }
/** /**
* *
*/ * @return yonghuEmail
*/
public String getYonghuEmail() { public String getYonghuEmail() {
return yonghuEmail; return yonghuEmail;
} }
/** /**
* *
*/ * @param yonghuEmail
*/
public void setYonghuEmail(String yonghuEmail) { public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail; this.yonghuEmail = yonghuEmail;
} }
/** /**
* *
*/ * @return sexTypes
*/
public Integer getSexTypes() { public Integer getSexTypes() {
return sexTypes; return sexTypes;
} }
/** /**
* *
*/ * @param sexTypes
*/
public void setSexTypes(Integer sexTypes) { public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes; this.sexTypes = sexTypes;
} }
/** /**
* *
*/ * @return newMoney
*/
public Double getNewMoney() { public Double getNewMoney() {
return newMoney; return newMoney;
} }
/** /**
* *
*/ * @param newMoney
*/
public void setNewMoney(Double newMoney) { public void setNewMoney(Double newMoney) {
this.newMoney = newMoney; this.newMoney = newMoney;
} }
/** /**
* *
*/ * @return yonghuDelete (1-2-)
*/
public Integer getYonghuDelete() { public Integer getYonghuDelete() {
return yonghuDelete; return yonghuDelete;
} }
/** /**
* *
*/ * @param yonghuDelete (1-2-)
*/
public void setYonghuDelete(Integer yonghuDelete) { public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete; this.yonghuDelete = yonghuDelete;
} }
/** /**
* *
*/ * @return createTime
*/
public Date getCreateTime() { public Date getCreateTime() {
return createTime; return createTime;
} }
/** /**
* *
*/ * @param createTime
*/
public void setCreateTime(Date createTime) { public void setCreateTime(Date createTime) {
this.createTime = createTime; this.createTime = createTime;
} }
/**
* toString
* @return
*/
@Override @Override
public String toString() { public String toString() {
return "Yonghu{" + return "Yonghu{" +
"id=" + id + "id=" + id +
", username=" + username + ", username=" + username +
", password=" + password + ", password=" + password +
", yonghuName=" + yonghuName + ", yonghuName=" + yonghuName +
", yonghuPhoto=" + yonghuPhoto + ", yonghuPhoto=" + yonghuPhoto +
", yonghuPhone=" + yonghuPhone + ", yonghuPhone=" + yonghuPhone +
", yonghuIdNumber=" + yonghuIdNumber + ", yonghuIdNumber=" + yonghuIdNumber +
", yonghuEmail=" + yonghuEmail + ", yonghuEmail=" + yonghuEmail +
", sexTypes=" + sexTypes + ", sexTypes=" + sexTypes +
", newMoney=" + newMoney + ", newMoney=" + newMoney +
", yonghuDelete=" + yonghuDelete + ", yonghuDelete=" + yonghuDelete +
", createTime=" + createTime + ", createTime=" + createTime +
"}"; "}";
} }
} }

@ -1,10 +1,14 @@
package com.entity.model; package com.entity.model;
// 导入用户实体类
import com.entity.YonghuEntity; import com.entity.YonghuEntity;
// 导入MyBatis-Plus的表名注解
import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.annotations.TableName;
// 导入Jackson的日期格式化注解
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date; import java.util.Date;
// 导入Spring的日期格式化注解
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
@ -16,252 +20,239 @@ import java.io.Serializable;
* ModelAndView model * ModelAndView model
*/ */
public class YonghuModel implements Serializable { public class YonghuModel implements Serializable {
// 序列化版本号,用于保证序列化和反序列化的兼容性
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* *
*/ */
private Integer id; private Integer id;
/** /**
* *
*/ */
private String username; private String username;
/** /**
* *
*/ */
private String password; private String password;
/** /**
* *
*/ */
private String yonghuName; private String yonghuName;
/** /**
* *
*/ */
private String yonghuPhoto; private String yonghuPhoto;
/** /**
* *
*/ */
private String yonghuPhone; private String yonghuPhone;
/** /**
* *
*/ */
private String yonghuIdNumber; private String yonghuIdNumber;
/** /**
* *
*/ */
private String yonghuEmail; private String yonghuEmail;
/** /**
* *
*/ */
private Integer sexTypes; private Integer sexTypes;
/** /**
* *
*/ */
private Double newMoney; private Double newMoney;
/** /**
* *
* 01
*/ */
private Integer yonghuDelete; private Integer yonghuDelete;
/** /**
* *
*/ */
// 用于JSON序列化时将日期格式化为指定的格式这里指定为中国时区格式为yyyy-MM-dd HH:mm:ss
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat // 用于Spring MVC接收表单数据时将字符串类型的日期转换为Date类型
@DateTimeFormat
private Date createTime; private Date createTime;
/** /**
* *
*/ */
public Integer getId() { public Integer getId() {
return id; return id;
} }
/** /**
* *
*/ */
public void setId(Integer id) { public void setId(Integer id) {
this.id = id; this.id = id;
} }
/** /**
* *
*/ */
public String getUsername() { public String getUsername() {
return username; return username;
} }
/** /**
* *
*/ */
public void setUsername(String username) { public void setUsername(String username) {
this.username = username; this.username = username;
} }
/** /**
* *
*/ */
public String getPassword() { public String getPassword() {
return password; return password;
} }
/** /**
* *
*/ */
public void setPassword(String password) { public void setPassword(String password) {
this.password = password; this.password = password;
} }
/** /**
* *
*/ */
public String getYonghuName() { public String getYonghuName() {
return yonghuName; return yonghuName;
} }
/** /**
* *
*/ */
public void setYonghuName(String yonghuName) { public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName; this.yonghuName = yonghuName;
} }
/** /**
* *
*/ */
public String getYonghuPhoto() { public String getYonghuPhoto() {
return yonghuPhoto; return yonghuPhoto;
} }
/** /**
* *
*/ */
public void setYonghuPhoto(String yonghuPhoto) { public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto; this.yonghuPhoto = yonghuPhoto;
} }
/** /**
* *
*/ */
public String getYonghuPhone() { public String getYonghuPhone() {
return yonghuPhone; return yonghuPhone;
} }
/** /**
* *
*/ */
public void setYonghuPhone(String yonghuPhone) { public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone; this.yonghuPhone = yonghuPhone;
} }
/** /**
* *
*/ */
public String getYonghuIdNumber() { public String getYonghuIdNumber() {
return yonghuIdNumber; return yonghuIdNumber;
} }
/** /**
* *
*/ */
public void setYonghuIdNumber(String yonghuIdNumber) { public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber; this.yonghuIdNumber = yonghuIdNumber;
} }
/** /**
* *
*/ */
public String getYonghuEmail() { public String getYonghuEmail() {
return yonghuEmail; return yonghuEmail;
} }
/** /**
* *
*/ */
public void setYonghuEmail(String yonghuEmail) { public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail; this.yonghuEmail = yonghuEmail;
} }
/** /**
* *
*/ */
public Integer getSexTypes() { public Integer getSexTypes() {
return sexTypes; return sexTypes;
} }
/** /**
* *
*/ */
public void setSexTypes(Integer sexTypes) { public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes; this.sexTypes = sexTypes;
} }
/** /**
* *
*/ */
public Double getNewMoney() { public Double getNewMoney() {
return newMoney; return newMoney;
} }
/** /**
* *
*/ */
public void setNewMoney(Double newMoney) { public void setNewMoney(Double newMoney) {
this.newMoney = newMoney; this.newMoney = newMoney;
} }
/** /**
* *
*/ */
public Integer getYonghuDelete() { public Integer getYonghuDelete() {
return yonghuDelete; return yonghuDelete;
} }
/** /**
* *
*/ */
public void setYonghuDelete(Integer yonghuDelete) { public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete; this.yonghuDelete = yonghuDelete;
} }
/** /**
* *
*/ */
public Date getCreateTime() { public Date getCreateTime() {
return createTime; return createTime;
} }
/** /**
* *
*/ */
public void setCreateTime(Date createTime) { public void setCreateTime(Date createTime) {
this.createTime = createTime; this.createTime = createTime;
} }
}
}

@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
* *
* *
@ -18,9 +19,10 @@ import java.util.Date;
public class YonghuView extends YonghuEntity implements Serializable { public class YonghuView extends YonghuEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* /**
*/ *
*/
private String sexValue; private String sexValue;
@ -40,15 +42,17 @@ public class YonghuView extends YonghuEntity implements Serializable {
/**
* /**
*/ *
*/
public String getSexValue() { public String getSexValue() {
return sexValue; return sexValue;
} }
/**
* /**
*/ *
*/
public void setSexValue(String sexValue) { public void setSexValue(String sexValue) {
this.sexValue = sexValue; this.sexValue = sexValue;
} }

@ -6,14 +6,16 @@ import com.entity.YonghuEntity;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
/** /**
* *
*/ */
public interface YonghuService extends IService<YonghuEntity> { public interface YonghuService extends IService<YonghuEntity> {
/** /**
* @param params * @param params
* @return * @return
*/ */
PageUtils queryPage(Map<String, Object> params); PageUtils queryPage(Map<String, Object> params);
} }
Loading…
Cancel
Save