package com.emergency.avenue.storage.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

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

@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "车辆运力管理表")
public class VehicleCapacityManagement extends Model<VehicleCapacityManagement> {

	private static final long serialVersionUID = 1L;

	@TableId(type = IdType.AUTO)
	@Schema(description = "主键ID，自增")
	private Long id;

	@Schema(description = "住址")
	private String address;


	@Schema(description = "核定载人数")
	private Integer approvedPassengerCapacity;


	@Schema(description = "品牌型号")
	private String brandModel;


	@Schema(description = "发证日期")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd")
	private LocalDate certificateIssueDate;

	@Schema(description = "发证机关")
	private String certificateIssuingAuthority;


	@Schema(description = "创建时间")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private LocalDateTime createTime;


	@Schema(description = "驾驶证号")
	private String drivingLicenseNumber;


	@Schema(description = "发动机号码")
	private String engineNumber;


	@Schema(description = "总质量")
	private BigDecimal grossMass; // 假设这里使用BigDecimal来表示可能的小数质量


	@Schema(description = "检验有效期")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd")
	private LocalDate inspectionValidityPeriod;


	@Schema(description = "车牌颜色")
	private String licensePlateColor;

	@TableField(condition= SqlCondition.LIKE)
	@Schema(description = "车牌号")
	private String licensePlateNumber;


	@Schema(description = "外廓尺寸")
	private String outerDimensions; // 假设这里使用String来表示尺寸，具体类型可以根据实际情况调整


	@Schema(description = "注册日期")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd")
	private LocalDate registrationDate;


	@Schema(description = "整备质量")
	private BigDecimal unladenMass; // 假设这里使用BigDecimal来表示可能的小数质量

	@Schema(description = "使用性质")
	private String usageNature;


	@Schema(description = "车辆识别代号")
	private String vehicleIdentificationNumber;


	@Schema(description = "车辆所有人")
	private String vehicleOwner;


	@Schema(description = "车辆类型")
	private String vehicleType;

	@Schema(description = "车架号")
	private String vin;

}
