New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoBa; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.mybatis.envm.Deleted; |
| | | import com.dy.common.mybatis.envm.Disabled; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.Max; |
| | | import jakarta.validation.constraints.Min; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import lombok.*; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | /** |
| | | * 农户实体 |
| | | */ |
| | | @TableName(value="ba_client", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "农户实体") |
| | | public class BaClient implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202311141539001L; |
| | | |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Long id ; |
| | | |
| | | /** |
| | | * 外键,指向行政区 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @Schema(description = "所在县ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotEmpty(message = "所在县不能为空") //不能为空也不能为null |
| | | public Long countyId; |
| | | |
| | | /** |
| | | * 外键,指向行政区 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @Schema(description = "所在镇ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotEmpty(message = "所在镇不能为空") //不能为空也不能为null |
| | | public Long townId; |
| | | |
| | | /** |
| | | * 外键,指向行政区 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @Schema(description = "所在村ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotEmpty(message = "所在村不能为空") //不能为空也不能为null |
| | | public Long villageId; |
| | | |
| | | /** |
| | | * 外键,指向片区 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @Schema(description = "所在片区ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotEmpty(message = "所在片区不能为空") //不能为空也不能为null |
| | | public Long blockId; |
| | | |
| | | /** |
| | | * 外键,指向分水房 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @Schema(description = "所在分水房ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotEmpty(message = "所在分水房不能为空") //不能为空也不能为null |
| | | public Long divideId; |
| | | |
| | | /** |
| | | * 外键,指向农户类型 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @Schema(description = "农户类型ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotEmpty(message = "农户类型不能为空") //不能为空也不能为null |
| | | public Long typeId; |
| | | |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | @Schema(description = "农户姓名", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotEmpty(message = "农户姓名不能为空") //不能为空也不能为null |
| | | @Length(message = "农户姓名不大于{max}字,不小于{min}字", min = 1, max = 25) |
| | | public String name; |
| | | |
| | | /** |
| | | * 编号 |
| | | */ |
| | | @Schema(description = "农户编号(系统自动生成)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer num; |
| | | |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | @Schema(description = "农户手机号", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotEmpty(message = "农户手机号不能为空") //不能为空也不能为null |
| | | @Length(message = "农户手机号必须{max}位数据", min = 11, max = 11) |
| | | public String phone; |
| | | |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | @Schema(description = "农户身份证号", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotEmpty(message = "农户身份证号不能为空") //不能为空也不能为null |
| | | @Length(message = "农户身份证号必须{max}位数据", min = 18, max = 18) |
| | | public String idcard; |
| | | |
| | | /** |
| | | * 种植面积 |
| | | */ |
| | | @Schema(description = "农户种植面积", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | public Double area; |
| | | |
| | | /** |
| | | * 县名称+镇名称+村名称,不可填写,自动生成 |
| | | */ |
| | | @Schema(description = "县名称+镇名称+村名称,form表单中不存在,只在查询显示中有效", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public String district; |
| | | |
| | | /** |
| | | * 街道+门牌号 |
| | | */ |
| | | @Schema(description = "街道+门牌号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "地址不大于{max}字,不小于{min}字", min = 1, max = 50) |
| | | public String address; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "备注不大于{max}字,不小于{min}字", min = 1, max = 50) |
| | | public String remark; |
| | | |
| | | |
| | | /** |
| | | * 是否禁用 0:否,1:是 |
| | | */ |
| | | @Schema(description = "是否禁用", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Max(message = "是否禁用只能0或1", value = 1) |
| | | @Min(message = "是否禁用只能0或1",value = 0) |
| | | public Disabled disabled; |
| | | |
| | | /** |
| | | * 是否删除: 0表示未删除 1表示删除. |
| | | */ |
| | | @Schema(description = "删除标识,form表单中不存在,只在查询显示中有效", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Deleted deleted; |
| | | |
| | | @TableField(exist = false) |
| | | @Schema(description = "所在片区名称,form表单中不存在,只在查询显示中有效") |
| | | public String blockName ; |
| | | |
| | | @TableField(exist = false) |
| | | @Schema(description = "所属农户类型名称,form表单中不存在,只在查询显示中有效") |
| | | public String typeName ; |
| | | |
| | | } |