package com.gxwebsoft.common.system.param;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.gxwebsoft.common.core.annotation.QueryField;
import com.gxwebsoft.common.core.annotation.QueryType;
import com.gxwebsoft.common.core.web.BaseParam;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

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

/**
 * 用户查询参数
 *
 * @author WebSoft
 * @since 2021-08-29 20:35:09
 */
@Data
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@Schema(description = "用户查询参数")
public class UserParam extends BaseParam {
    private static final long serialVersionUID = 1L;

    @Schema(description = "用户id")
    @QueryField(type = QueryType.EQ)
    private Integer userId;

    @Schema(description = "用户类型, 0普通用户 10企业用户")
    private Integer type;

    @Schema(description = "账号")
    private String username;

    @Schema(description = "昵称")
    private String nickname;

    @Schema(description = "用户编码")
    private String userCode;

    @Schema(description = "第三方系统用户ID")
    private Integer uid;

    @Schema(description = "性别(字典)")
    @QueryField(type = QueryType.EQ)
    private String sex;

    @Schema(description = "手机号")
    private String phone;

    @Schema(description = "登录密码")
    private String password;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "邮箱是否验证, 0否, 1是")
    @QueryField(type = QueryType.EQ)
    private Integer emailVerified;

    @Schema(description = "别名")
    private String alias;

    @Schema(description = "真实姓名")
    private String realName;

    @Schema(description = "身份证号")
    private String idCard;

    @Schema(description = "出生日期")
    private String birthday;

    @Schema(description = "年龄")
    private Integer age;

    @Schema(description = "可用余额")
    private BigDecimal balance;

    @Schema(description = "机构id")
    @QueryField(type = QueryType.EQ)
    private Integer organizationId;

    @Schema(description = "机构id合集")
    @TableField(exist = false)
    private Set<Integer> organizationIds;

    @Schema(description = "用户分组ID")
    @QueryField(type = QueryType.EQ)
    private Integer groupId;

    @Schema(description = "注册来源客户端")
    @QueryField(type = QueryType.EQ)
    private String platform;

    @Schema(description = "是否下线会员")
    private Integer offline;

    @Schema(description = "上级机构ID")
    @QueryField(type = QueryType.IN)
    private Integer parentId;

    @Schema(description = "状态, 0正常, 1冻结")
    @QueryField(type = QueryType.EQ)
    private Integer status;

    @Schema(description = "审核状态: 0待审核, 1已通过, 2已拒绝（前端传值决定注册是否走审核流程）")
    @QueryField(type = QueryType.EQ)
    private Integer auditStatus;

    @Schema(description = "是否查询待处理审核用户(待审核0/被驳回2)")
    @TableField(exist = false)
    private Boolean auditPending;

    @Schema(description = "是否删除, 0否, 1是")
    @TableLogic
    private Integer deleted;

    @Schema(description = "角色id")
    @TableField(exist = false)
    private Integer roleId;

    @Schema(description = "角色标识")
    @TableField(exist = false)
    private String roleCode;

    @Schema(description = "所在省份")
    private String province;

    @Schema(description = "所在城市")
    private String city;

    @Schema(description = "所在辖区")
    private String region;

    @Schema(description = "详细地址")
    private String address;

    @Schema(description = "行业类型(父级)")
    private String industryParent;

    @Schema(description = "行业类型(子级)")
    private String industryChild;

    @Schema(description = "关注数")
    private Integer followers;

    @Schema(description = "粉丝数")
    private Integer fans;

    @Schema(description = "获赞数")
    private Integer likes;

    @Schema(description = "评论数")
    private Integer commentNumbers;

    @Schema(description = "择偶区域")
    @TableField(exist = false)
    private String cityMate;

    @Schema(description = "机构名称")
    @TableField(exist = false)
    private String organizationName;

    @Schema(description = "公司名称")
    @TableField(exist = false)
    private String companyName;

    @Schema(description = "公司名称")
    private String customerName;

    @Schema(description = "专家角色")
    private Integer expertType;

    @Schema(description = "性别名称")
    @TableField(exist = false)
    private String sexName;

    @Schema(description = "推荐状态")
    @TableField(exist = false)
    private Integer recommend;

    @Schema(description = "搜索关键字")
    @TableField(exist = false)
    private String keywords;

    @Schema(description = "会员等级")
    @TableField(exist = false)
    private Integer gradeId;

    @Schema(description = "按角色搜索")
    @TableField(exist = false)
    private String roleIds;

    @Schema(description = "用户类型 sys系统用户 org机构职员 member商城会员 ")
    @TableField(exist = false)
    private String userType;

    @Schema(description = "支付宝授权码")
    @TableField(exist = false)
    private String authCode;

    @Schema(description = "微信凭证code")
    @TableField(exist = false)
    private String code;

    @Schema(description = "推荐人ID")
    @QueryField(type = QueryType.IN)
    private Integer refereeId;

    @Schema(description = "租户ID")
    private Integer tenantId;

    @Schema(description = "二维码类型")
    @TableField(exist = false)
    private String codeType;

    @Schema(description = "二维码内容 填网址扫码后可跳转")
    @TableField(exist = false)
    private String codeContent;

    @Schema(description = "是否内部职员")
    @TableField(exist = false)
    private Boolean isStaff;

    @Schema(description = "是否管理员")
    @TableField(exist = false)
    private Boolean isAdmin;

    @Schema(description = "是否开发者")
    @TableField(exist = false)
    private Boolean isDeveloper;

    @Schema(description = "是否企业管理员")
    private Integer isOrganizationAdmin;

    @Schema(description = "最后结算时间")
    @TableField(exist = false)
    private Date settlementTime;

    @Schema(description = "模板id")
    private Integer templateId;

    @Schema(description = "报餐时间")
    @TableField(exist = false)
    private String deliveryTime;

    @Schema(description = "用户ID集合")
    @TableField(exist = false)
    private Set<Integer> userIds;

    @Schema(description = "用户手机号码集合")
    @TableField(exist = false)
    private Set<String> phones;

    @Schema(description = "用户身份证集合")
    @TableField(exist = false)
    private Set<String> idCards;

    @Schema(description = "是否查询用户详细资料表")
    @TableField(exist = false)
    private Boolean showProfile;

    @Schema(description = "微信openid")
    @TableField(exist = false)
    private String openid;

    @Schema(description = "微信公众号openid")
    private String officeOpenid;

    @Schema(description = "unionid")
    private String unionid;

    @Schema(description = "是否查询超级管理员")
    @QueryField(type = QueryType.EQ)
    private Boolean isSuperAdmin;

    @Schema(description = "不验证手机号码真实性")
    @TableField(exist = false)
    private Boolean notVerifyPhone;

    @Schema(description = "可管理的商户")
    @QueryField(type = QueryType.LIKE)
    private String merchants;

    @Schema(description = "商户ID")
    @QueryField(type = QueryType.EQ)
    private Long merchantId;

    @Schema(description = "商户名称")
    @QueryField(type = QueryType.EQ)
    private String merchantName;

    @Schema(description = "商户LOGO")
    @QueryField(type = QueryType.EQ)
    private String merchantAvatar;

    @Schema(description = "工业园区")
    @TableField(exist = false)
    private String park;

    @Schema(description = "是否已安装")
    @TableField(exist = false)
    private Boolean installed;

    @Schema(description = "微信小程序解密数据")
    @TableField(exist = false)
    private String encryptedData;

    @Schema(description = "微信小程序解密向量")
    @TableField(exist = false)
    private String iv;

    @Schema(description = "微信小程序会话密钥")
    @TableField(exist = false)
    private String sessionKey;

    @Schema(description = "场景类型")
    @TableField(exist = false)
    private String sceneType;
}
