package com.jeequan.jeepay.db.entity;

import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.jeequan.jeepay.core.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 服务商信息表
 * </p>
 *
 * @author [mybatis plus generator]
 * @since 2022-03-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_package_order")
public class PackageOrder extends BaseModel {

    public static LambdaQueryWrapper<PackageOrder> gw(){
        return new LambdaQueryWrapper<>();
    }

    private static final long serialVersionUID=1L;


    /**
     * id
     */
    @TableId
    private String id;

    private String packageId;

    /**
     * 产品ID
     */
    private String productId;
    private String mchNo;

    private String stateDesc;

    private String appId;
    /**
     * 状态 0-未开通 1-审核中 2-审核失败 3-已开通 4-已取消
     */
    private Integer state;

    /**
     * 费用规则，json字符串
     */
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private JSONArray costRule;

    /**
     * 联系人姓名
     */
    private String contactsName;

    /**
     * 联系人电话
     */
    private String contactsTel;


    /**
     * 划线总价，元
     */
    private BigDecimal price;

    /**
     * 订单金额  元
     */
    private BigDecimal actualPrice;

    /**
     * 实付总价，默认是0，元
     */
    private BigDecimal pracPrice;

    /**
     * 支付凭证图片地址
     */
    private String payImg;

    /**
     * 备注
     */
    private String remark;

    /**
     * 产品或方案，0:产品；1:方案
     */
    private Integer packageOrProduct;


    /**
     * 特殊资质信息，json字符串
     */
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private JSONArray specialCertificationText;

    /**
     * 创建时间
     */
    private Date createdAt;

    /**
     * 创建人
     */
    private Long createdUid;

    /**
     * 更新时间
     */
    private Date updatedAt;

    @TableField(exist = false)
    private List<ProductInfo> productInfo;

    @TableField(exist = false)
    private String name;

    @TableField(exist = false)
    private String productOrPackageName;

    @TableField(exist = false)
    private String productName;

    @TableField(exist = false)
    private Date firstDate;

    @TableField(exist = false)
    private Date lastDate;

    @TableField(exist = false)
    private String mchName;

    @TableField(exist = false)
    private String appName;

    @TableField(exist = false)
    private Long remainingDays;

    @TableField(exist = false)
    private List<String> mchInfoList;

    @TableField(exist = false)
    private Long mchUserContactsTel;
}
