package com.bohuikeji.delivery.backstage.entity.rental;

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.bohuikeji.frame.module.admin.annotation.TableNewField;
import com.bohuikeji.frame.module.admin.annotation.TableQueryField;
import com.bohuikeji.frame.module.admin.annotation.TableShowField;
import com.bohuikeji.frame.module.admin.base.EntityBase;
import com.bohuikeji.frame.module.admin.entity.vo.AddressVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

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

/**
 * 租车记录表
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="TRentalCarOrder对象", description="租车订单表")
@TableName("t_rental_car_order")
public class TRentalCarOrder extends EntityBase<TRentalCarOrder> {

    @ApiModelProperty(value = "租车id")
    @TableId(value = "rental_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField(show = false)
    private Integer rentalId;

    @ApiModelProperty(value = "租车订单号")
    @TableField("rental_order_num")
    @TableQueryField(show = false)
    @TableShowField(value = "租车订单号")
    @TableNewField
    private String rentalOrderNum;

    @ApiModelProperty(value = "下单人id")
    @TableField("player_id")
    @TableQueryField(show = false)
    @TableShowField(value = "下单人id")
    @TableNewField
    private Integer playerId;

    @ApiModelProperty(value = "下单人手机号")
    @TableField("player_phone")
    @TableQueryField(show = false)
    @TableShowField(value = "下单人手机号")
    @TableNewField
    private String playerPhone;

    @ApiModelProperty(value = "取车地址")
    @TableField("take_address")
    @TableQueryField(show = false)
    @TableShowField(value = "取车地址")
    @TableNewField
    private AddressVo takeAddress;

    @ApiModelProperty(value = "还车地址")
    @TableField("still_address")
    @TableQueryField(show = false)
    @TableShowField(value = "还车地址")
    @TableNewField
    private AddressVo stillAddress;

    @ApiModelProperty(value = "租车订单创建时间")
    @TableField("rental_order_time")
    @TableQueryField(show = false)
    @TableShowField(value = "租车订单创建时间")
    @TableNewField
    private LocalDateTime rentalOrderTime;

    @ApiModelProperty(value = "取车时间")
    @TableField("take_car_time")
    @TableQueryField(show = false)
    @TableShowField(value = "取车时间")
    @TableNewField
    private String takeCarTime;

    @ApiModelProperty(value = "还车时间")
    @TableField("still_car_time")
    @TableQueryField(show = false)
    @TableShowField(value = "还车时间")
    @TableNewField
    private String stillCarTime;

    @ApiModelProperty(value = "租车间隔（天/小时）")
    @TableField("rental_car_interval")
    @TableQueryField(show = false)
    @TableShowField(value = "租车间隔（天/小时）")
    @TableNewField
    private String rentalCarInterval;

    @ApiModelProperty(value = "车辆id")
    @TableField("car_config_id")
    @TableQueryField(show = false)
    @TableShowField(value = "车辆id")
    @TableNewField
    private Integer carConfigId;

    @ApiModelProperty(value = "租车预估金额")
    @TableField("rental_expect_price")
    @TableQueryField(show = false)
    @TableShowField(value = "租车预估金额")
    @TableNewField
    private BigDecimal rentalExpectPrice=new BigDecimal("0.00").setScale(2, BigDecimal.ROUND_DOWN);

    @ApiModelProperty(value = "租车实际金额")
    @TableField("rental_fact_price")
    @TableQueryField(show = false)
    @TableShowField(value = "租车实际金额")
    @TableNewField
    private BigDecimal rentalFactPrice=new BigDecimal("0.00").setScale(2, BigDecimal.ROUND_DOWN);

    @ApiModelProperty(value = "接单人/单位")
    @TableField("receiv_id")
    @TableQueryField(show = false)
    @TableShowField(value = "接单人/单位")
    @TableNewField
    private Integer receivId;

    @ApiModelProperty(value = "租车订单状态")
    @TableField("rental_order_status")
    @TableQueryField(show = false)
    @TableShowField(value = "租车订单状态")
    @TableNewField
    private String rentalOrderStatus;

    @ApiModelProperty(value = "司车服务")
    @TableField("is_driver")
    @TableQueryField(show = false)
    @TableShowField(value = "司车服务")
    @TableNewField
    private Boolean isDriver;

    @ApiModelProperty(value = "是否异地换车")
    @TableField("is_return")
    @TableQueryField(show = false)
    @TableShowField(value = "是否异地换车")
    @TableNewField
    private Boolean isReturn;

    @ApiModelProperty(value = "下单渠道")
    @TableField("order_channel")
    @TableShowField(value = "下单渠道")
    @TableQueryField(like = false)
    @TableNewField(edit = false,add = false,required = false)
    private String orderChannel;

    @ApiModelProperty(value = "请求标识")
    @TableField(exist = false) //不为数据库字段
    private String type;

}
