package com.bohuikeji.frame.module.admin.entity.sys;

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.TableQueryField;
import com.bohuikeji.frame.module.admin.component.StaticComponent;
import com.bohuikeji.frame.module.admin.entity.TFranchiseeInformation;
import com.bohuikeji.frame.module.admin.entity.web.block.DateBlock;
import com.bohuikeji.frame.module.admin.entity.web.block.SelectBlock;
import com.bohuikeji.frame.module.admin.annotation.TableShowField;
import com.bohuikeji.frame.module.admin.annotation.TableNewField;
import com.bohuikeji.frame.module.admin.base.EntityBase;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * <p>
 * 用户信息表
 * </p>
 *
 * @author 10552
 * @since 2019-08-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="SysUser对象", description="用户信息表")
public class SysUser extends EntityBase<SysUser> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "系统用户id")
    @TableId(value = "user_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField(show = false,required = false,add = false)
    private Integer userId;

    @ApiModelProperty(value = "用户姓名")
    @TableField("user_name")
    @TableShowField("用户姓名")
    @TableQueryField(show = false)
    @TableNewField
    private String userName;

    @ApiModelProperty(value = "用户角色")
    @TableField("role_id")
    @TableShowField("用户角色")
    @TableQueryField(like = false)
    @TableKeyField(table = "sys_role",key = SysRole.class,keyShowFields = {"role_name"},where = "role_status='正常' and role_id in (##ROLE_AUTH##)")
    @TableNewField(block = SelectBlock.class)
    private Integer roleId;

    @ApiModelProperty(value = "用户密码")
    @TableField("user_pwd")
    @TableShowField("用户密码")
    @TableNewField()
    private String userPwd="123456";

    @ApiModelProperty(value = "用户手机号")
    @TableField("user_phone")
    @TableShowField("用户账号")
    @TableQueryField(show = false)
    @TableNewField
    private String userPhone;


    @ApiModelProperty(value = "用户的头像")
    @TableField("user_pic")
    private String userPic="https://tourism.nos-eastchina1.126.net/users/timg.jpg";

    @ApiModelProperty(value = "创建用户时间")
    @TableField("user_create_time")
    @TableShowField("创建用户时间")
    @TableQueryField(like = false,block = DateBlock.class,sort = 0)
    private LocalDateTime userCreateTime=LocalDateTime.now();

    @ApiModelProperty(value = "用户状态")
    @TableField("user_status")
    @TableShowField("用户状态")
    @TableQueryField(like = false)
    @TableNewField(options = {"正常","禁用"})
    private String userStatus="正常";

    @ApiModelProperty(value = "所属加盟商的id")
    @TableField("fran_id")
    @TableShowField("所属加盟商")
    @TableQueryField(like = false)
    @TableKeyField(table = "t_franchisee_information",keyShowFields = {"fran_name"},where = "fran_id in(##FRAN_IDS##)",key = TFranchiseeInformation.class)
    @TableNewField(block = SelectBlock.class)
    private Integer franId;

    @ApiModelProperty(value = "商户账户")
    @TableField("customer_id")
    @TableShowField(value = "商户账户")
    @TableQueryField(like = false)
    @TableNewField(block = SelectBlock.class,edit = false)
    private Integer customerId;


}
