package com.zksy.WaterSupply.WaterUserInfo.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 用水户信息实体
 */
@Data
@TableName(value = "water_user_info", schema = "app_user")
@ApiModel(
        value = "WaterUserInfo",
        description = "用水户信息对象，包含用水户基础属性"
)
public class WaterUserInfo {

    @ApiModelProperty(
            value = "主键ID",
            example = "0",
            position = 1,
            notes = "数据库自增主键，新增时不需要传入"
    )
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(
            value = "用户编号",
            example = "USER_XX",
            required = true,
            position = 2
    )
    private String userCode;

    @ApiModelProperty(
            value = "用户名称",
            example = "XX用户",
            required = true,
            position = 3
    )
    private String userName;

    @ApiModelProperty(
            value = "用户类型",
            example = "居民",
            position = 4,
            notes = "居民/工业/商业/行政事业"
    )
    private String userType;

    @ApiModelProperty(
            value = "用水地址",
            example = "XX小区XX栋XX单元XX室",
            position = 5
    )
    private String address;

    @ApiModelProperty(value = "WGS84经度", example = "113.12345678")
    private BigDecimal longitude;

    @ApiModelProperty(value = "WGS84纬度", example = "23.12345678")
    private BigDecimal latitude;

    @ApiModelProperty(
            value = "联系人",
            example = "XX",
            position = 6
    )
    private String contactPerson;

    @ApiModelProperty(
            value = "联系电话",
            example = "13800138000",
            position = 7
    )
    private String contactPhone;

    @ApiModelProperty(
            value = "水表编号",
            example = "METER_XX",
            position = 8
    )
    private String meterNumber;

    @ApiModelProperty(
            value = "初始读数",
            example = "0.00",
            position = 9,
            notes = "单位：立方米(m³)"
    )
    private BigDecimal initialReading;

    @ApiModelProperty(
            value = "当前读数",
            example = "125.50",
            position = 10,
            notes = "单位：立方米(m³)"
    )
    private BigDecimal currentReading;

    @ApiModelProperty(
            value = "年用水量",
            example = "180.00",
            position = 11,
            notes = "单位：立方米(m³)"
    )
    private BigDecimal annualWaterConsumption;

    @ApiModelProperty(
            value = "用户状态",
            example = "0",
            allowableValues = "0,1,2",
            position = 12,
            notes = "0正常 1欠费 2停用"
    )
    private String status;

    @ApiModelProperty(
            value = "备注",
            example = "XX区域重要用水户",
            position = 13
    )
    private String remark;

    @ApiModelProperty(
            value = "删除标志",
            example = "0",
            allowableValues = "0,2",
            hidden = true,
            position = 14
    )
    @TableLogic
    private String delFlag;

    @ApiModelProperty(
            value = "创建者",
            example = "admin",
            hidden = true,
            position = 15
    )
    @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT)
    private String createBy;

    @ApiModelProperty(
            value = "创建时间",
            example = "2025-01-01 00:00:00",
            hidden = true,
            position = 16
    )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(
            value = "更新者",
            example = "admin",
            hidden = true,
            position = 17
    )
    @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.UPDATE)
    private String updateBy;

    @ApiModelProperty(
            value = "更新时间",
            example = "2025-01-01 00:00:00",
            hidden = true,
            position = 18
    )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.UPDATE)
    private LocalDateTime updateTime;
}
