package com.bohuikeji.delivery.backstage.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.bohuikeji.frame.module.admin.annotation.TableKeyField;
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.web.block.SelectBlock;
import com.bohuikeji.frame.module.admin.serializer.Decimal2Serializer;
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="t_give_detail对象", description="充值钱包赠送本金")
public class TGiveDetail extends EntityBase<TGiveDetail> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "赠金id")
    @TableId(value = "gift_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField()
    private Integer giftId;

    @ApiModelProperty(value = "客户名称")
    @TableField("customer_id")
    @TableShowField(value = "客户名称",show = true)
    @TableNewField(edit = false,block = SelectBlock.class)
    @TableKeyField(table = "t_customer",keyShowFields = {"customer_name"},keyLikeFields = "customer_name")
    @TableQueryField(like = false,sort = 0.1)
    private Integer customerId;

    @ApiModelProperty(value = "加盟商id")
    @TableField("fran_id")
    @TableShowField(value = "所属区域",show = false)
    @TableKeyField(table = "t_franchisee_information",keyShowFields = "fran_name",where = "fran_id in(##FRAN_IDS##)")
    @TableQueryField(like = false)
    @TableNewField(block = SelectBlock.class,edit = false,add = false,show = false)
    private Integer franId;

    @ApiModelProperty(value = "赠金名称")
    @TableField("give_dace")
    @TableShowField("赠金名称")
    @TableNewField(edit = false)
    @TableQueryField(show = false)
    private String giveDace;


    @ApiModelProperty(value = "充值本金")
    @TableField("rech_principal")
    @TableShowField(value = "充值本金")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    @JSONField(serializeUsing = Decimal2Serializer.class)
    private BigDecimal rechPrincipal=new BigDecimal("0.00").setScale(2, BigDecimal.ROUND_DOWN);

    @ApiModelProperty(value = "赠送金额")
    @TableField("gift_amount")
    @TableShowField(value = "赠送金额")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    @JSONField(serializeUsing = Decimal2Serializer.class)
    private BigDecimal giftPmount=new BigDecimal("0.00").setScale(2, BigDecimal.ROUND_DOWN);

    @ApiModelProperty(value = "操作时间")
    @TableField("update_time")
    @TableShowField(value = "操作时间")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    @TableShowField("创建时间")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "使用状态")
    @TableField("give_status")
    @TableShowField("使用状态")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private String giveStatus;
}
