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 lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 商户门店表
 * </p>
 *
 * @author [mybatis plus generator]
 * @since 2021-12-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "t_mch_store", autoResultMap = true)
public class MchStore extends com.jeequan.jeepay.core.entity.MchStore {

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

    private static final long serialVersionUID=1L;

    // 蚂蚁店铺创建状态(与支付宝一致): 0-未创建; 99-已完结; -1-失败; 031-已提交审核
    public final static String ALIPAY_SHOP_STATUS_NOT_EXISTS = "0";
    public final static String ALIPAY_SHOP_STATUS_SUCCESS = "99";
    public final static String ALIPAY_SHOP_STATUS_FAIL = "-1";
    public final static String ALIPAY_SHOP_STATUS_AUDITING = "031";

    /**
     * 门店ID
     */
    @TableId(value = "store_id")
    private String storeId;

    /**
     * 门店名称
     */
    private String storeName;

    /**
     * 商户号
     */
    private String mchNo;

    /**
     * 服务商号
     */
    private String agentNo;

    /**
     * 绑定应用ID
     */
    private String bindAppId;

    /**
     * 商户号（原进件单号）
     */
    private String mchApplyId;

    /**
     * 顶级服务商号
     */
    private String topAgentNo;

    /**
     * 服务商号
     */
    private String isvNo;

    /**
     * 是否默认: 0-否、 1-是（api接口未显式指定门店则使用默认门店下单）
     */
    private Byte defaultFlag;

    /**
     * 经度
     */
    private String lng;

    /**
     * 纬度
     */
    private String lat;

    /**
     * 门头照
     */
    private String storeOuterImg;

    /**
     * 内景照
     */
    private String storeInnerImg;

    /**
     * 门店Logo
     */
    private String storeLogo;

    /**
     * 省市县编码 (非必填， 放在外层用作搜索方便)
     */
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private JSONArray areaCode;

    /**
     * 联系人手机号
     */
    private String contactPhone;

    /**
     * 所在地址
     */
    private String address;

    /**
     * 蚂蚁店铺ID
     */
    private String alipayShopId;

    /**
     * 蚂蚁店铺申请单ID
     */
    private String alipayShopCreateId;

    /**
     * 蚂蚁店铺创建状态(与支付宝一致): 0-未创建; 99-已完结; -1-失败; 031-已提交审核
     */
    private String alipayShopStatus;

    /**
     * 会员充值规则id，对应t_member_recharge_rule表
     */
    private String ruleId;

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

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

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

    /**
     * 渠道简称
     */
    @TableField(exist = false)
    private String isvShortName;

    /**
     * 商户名称
     */
    @TableField(exist = false)
    private String mchApplyName;


    /**
     * 绑定应用ID名称
     */
    @TableField(exist = false)
    private String bindAppIdName;

    /**
     * 绑定设备数量
     */
    @TableField(exist = false)
    private Integer deviceNumber;

    /**
     * 用户名称
     */
    @TableField(exist = false)
    private String mchUserName;

    /**
     * 用户电话
     */
    @TableField(exist = false)
    private String mchUserPhone;

    @TableField(exist = false)
    private String mchServiceName;

    @TableField(exist = false)
    private String mchServicePhone;

    @TableField(exist = false)
    private Date firstDate;

    @TableField(exist = false)
    private Date lastDate;

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

    @TableField(exist = false)
    private String ifName;

    @TableField(exist = false)
    private String ifCode;

    @TableField(exist = false)
    private String isvName;

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

    /**
     * 结算类型
     */
    @TableField(exist = false)
    private String settleType;

    @TableField(exist = false)
    private Byte isBind;
}
