diff --git a/pom.xml b/pom.xml index f1e7f6a..1936e07 100644 --- a/pom.xml +++ b/pom.xml @@ -221,6 +221,12 @@ qcloudsms 1.0.5 + + + com.alibaba + fastjson + 1.2.62 + diff --git a/src/main/java/com/ccsens/opensource/wxconfigurer/bean/dto/UserDto.java b/src/main/java/com/ccsens/opensource/wxconfigurer/bean/dto/UserDto.java new file mode 100644 index 0000000..0cc009e --- /dev/null +++ b/src/main/java/com/ccsens/opensource/wxconfigurer/bean/dto/UserDto.java @@ -0,0 +1,145 @@ +package com.ccsens.opensource.wxconfigurer.bean.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; + +@Data +public class UserDto { + @Data + @ApiModel + public static class UserSignin{ + @lombok.Data + @ApiModel + public static class Data{ + @ApiModelProperty("用户标识|用户名") + @NotEmpty(message = "identifier is required.") + private String identifier; + @ApiModelProperty("用户凭据|密码") + private String credential; + } + @ApiModelProperty("登录客户端:0-wxmp,1-H5,2-Android,3-IOS,4-WxEnterprise") + @NotNull(message = "client is required.") + private Integer client; + @ApiModelProperty("登录类型:0-wxmp,1-phone,2-email,3-accounts,4-OAUTH2_Wx,5-Wx_H5,6-OAUTH2_WeiBo, 7-Wx_Enterprise") + @NotNull(message = "type is required.") + private Integer type; + @ApiModelProperty("登录信息") + private Data data; + @ApiModelProperty("通知消息") + private String redirect; + } + + @Data + @ApiModel + public static class UpdatePhone{ + @ApiModelProperty("旧手机号") + private String oldPhone; + @ApiModelProperty("密码") + private String password; + @ApiModelProperty("新手机号") + private String newPhone; + @ApiModelProperty("新手机号的验证码") + private String code; + } + + @Data + @ApiModel + public static class Account{ + @ApiModelProperty("用户id") + private Long id; + @ApiModelProperty("用户名") + private String username; + @ApiModelProperty("密码") + private String password; + } + @Data + @ApiModel + public static class UpdatePassword{ + @ApiModelProperty("手机号") + @NotEmpty(message = "手机号不能为空") + @Pattern(regexp="^[1]([3-9])[0-9]{9}$",message="请输入正确的手机号") + private String phone; + @ApiModelProperty("验证码") + @NotEmpty(message = "验证码不能为空.") + private String code; + @ApiModelProperty("密码") + @NotEmpty(message = "密码不能为空") + @Pattern(regexp="^[a-zA-Z0-9._-]{6,20}$",message="密码长度需在6~20之间,不能使用汉字,不能包含特殊字符") + private String password; + } + + //注册 + @Data + @ApiModel + public static class UserSignup{ + @ApiModelProperty("手机号") + @NotEmpty(message = "手机号不能为空") + @Pattern(regexp="^[1]([3-9])[0-9]{9}$",message="请输入正确的手机号") + private String phone; + @ApiModelProperty("验证码") + @NotEmpty(message = "验证码不能为空.") + private String smsCode; + @ApiModelProperty("账号") + @NotEmpty(message = "账号不能为空.") + @Pattern(regexp="^[a-zA-Z0-9._-]{2,20}$",message="账号长度需在2~20之间,不能使用汉字,不能包含特殊字符") + private String account; + @ApiModelProperty("密码") + @NotEmpty(message = "密码不能为空") + @Pattern(regexp="^[a-zA-Z0-9._-]{6,20}$",message="密码长度需在6~20之间,不能使用汉字,不能包含特殊字符") + private String password; + @ApiModelProperty("来源 0:默认注册,1:HT病人注册") + private byte source = 0; + } + //注册 + @Data + @ApiModel + public static class UserSignupSystem{ + @ApiModelProperty("账号") + private String account; + @ApiModelProperty("密码") + private String password; + } + @Data + @ApiModel + public static class WxMergePhone{ + @ApiModelProperty("手机号") + private String phone; + @ApiModelProperty("合并方式 0直接合并 1不合并以前的信息") + private int isMerge; + } + + @Data + @ApiModel + public static class WxBindingPhone{ + @ApiModelProperty("手机号") + private String phone; + @ApiModelProperty("手机验证码") + private String smsCode; + } + + @Data + @ApiModel + public static class WxInfo{ +// @ApiModelProperty("用户id") +// private String userId; + @ApiModelProperty("微信名") + private String nickname; + @ApiModelProperty("微信头像") + private String headImgUrl; + @ApiModelProperty("性别") + private Byte sex; + @ApiModelProperty("省") + private String province; + @ApiModelProperty("市") + private String city; + @ApiModelProperty("国家") + private String country; + @ApiModelProperty("语言") + private String language; + } +} diff --git a/src/main/java/com/ccsens/opensource/wxconfigurer/bean/dto/WxMessageNotice.java b/src/main/java/com/ccsens/opensource/wxconfigurer/bean/dto/WxMessageNotice.java new file mode 100644 index 0000000..32d5886 --- /dev/null +++ b/src/main/java/com/ccsens/opensource/wxconfigurer/bean/dto/WxMessageNotice.java @@ -0,0 +1,32 @@ +package com.ccsens.opensource.wxconfigurer.bean.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: + * @author: whj + * @time: 2020/5/29 15:09 + */ +public class WxMessageNotice { + + /**事件类型*/ + public static final String EVENT = "Event"; + + @Data + @ApiModel("关注公众号") + public static class Subscribe{ + @ApiModelProperty("开发者微信号") + private String ToUserName; + @ApiModelProperty("发送方帐号(一个OpenID)") + private String FromUserName; + @ApiModelProperty("消息创建时间 (整型)") + private String CreateTime; + @ApiModelProperty("消息类型,event") + private String MsgType; + @ApiModelProperty("事件类型,subscribe(订阅)、unsubscribe(取消订阅)") + private String Event; + } + +} diff --git a/src/main/java/com/ccsens/opensource/wxconfigurer/bean/po/SysAuth.java b/src/main/java/com/ccsens/opensource/wxconfigurer/bean/po/SysAuth.java new file mode 100644 index 0000000..728848c --- /dev/null +++ b/src/main/java/com/ccsens/opensource/wxconfigurer/bean/po/SysAuth.java @@ -0,0 +1,128 @@ +package com.ccsens.opensource.wxconfigurer.bean.po; + +import java.io.Serializable; +import java.util.Date; + +public class SysAuth implements Serializable { + private Long id; + + private Long userId; + + private Byte identifyType; + + private String identifier; + + private String credential; + + private String salt; + + private Date createdAt; + + private Date updatedAt; + + private Byte recStatus; + + private Byte registerType; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Byte getIdentifyType() { + return identifyType; + } + + public void setIdentifyType(Byte identifyType) { + this.identifyType = identifyType; + } + + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier == null ? null : identifier.trim(); + } + + public String getCredential() { + return credential; + } + + public void setCredential(String credential) { + this.credential = credential == null ? null : credential.trim(); + } + + public String getSalt() { + return salt; + } + + public void setSalt(String salt) { + this.salt = salt == null ? null : salt.trim(); + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } + + public Byte getRecStatus() { + return recStatus; + } + + public void setRecStatus(Byte recStatus) { + this.recStatus = recStatus; + } + + public Byte getRegisterType() { + return registerType; + } + + public void setRegisterType(Byte registerType) { + this.registerType = registerType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", userId=").append(userId); + sb.append(", identifyType=").append(identifyType); + sb.append(", identifier=").append(identifier); + sb.append(", credential=").append(credential); + sb.append(", salt=").append(salt); + sb.append(", createdAt=").append(createdAt); + sb.append(", updatedAt=").append(updatedAt); + sb.append(", recStatus=").append(recStatus); + sb.append(", registerType=").append(registerType); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/src/main/java/com/ccsens/opensource/wxconfigurer/bean/po/SysAuthExample.java b/src/main/java/com/ccsens/opensource/wxconfigurer/bean/po/SysAuthExample.java new file mode 100644 index 0000000..41dd993 --- /dev/null +++ b/src/main/java/com/ccsens/opensource/wxconfigurer/bean/po/SysAuthExample.java @@ -0,0 +1,831 @@ +package com.ccsens.opensource.wxconfigurer.bean.po; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SysAuthExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SysAuthExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeIsNull() { + addCriterion("identify_type is null"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeIsNotNull() { + addCriterion("identify_type is not null"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeEqualTo(Byte value) { + addCriterion("identify_type =", value, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeNotEqualTo(Byte value) { + addCriterion("identify_type <>", value, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeGreaterThan(Byte value) { + addCriterion("identify_type >", value, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeGreaterThanOrEqualTo(Byte value) { + addCriterion("identify_type >=", value, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeLessThan(Byte value) { + addCriterion("identify_type <", value, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeLessThanOrEqualTo(Byte value) { + addCriterion("identify_type <=", value, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeIn(List values) { + addCriterion("identify_type in", values, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeNotIn(List values) { + addCriterion("identify_type not in", values, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeBetween(Byte value1, Byte value2) { + addCriterion("identify_type between", value1, value2, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeNotBetween(Byte value1, Byte value2) { + addCriterion("identify_type not between", value1, value2, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNull() { + addCriterion("identifier is null"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNotNull() { + addCriterion("identifier is not null"); + return (Criteria) this; + } + + public Criteria andIdentifierEqualTo(String value) { + addCriterion("identifier =", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotEqualTo(String value) { + addCriterion("identifier <>", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThan(String value) { + addCriterion("identifier >", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThanOrEqualTo(String value) { + addCriterion("identifier >=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThan(String value) { + addCriterion("identifier <", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThanOrEqualTo(String value) { + addCriterion("identifier <=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLike(String value) { + addCriterion("identifier like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotLike(String value) { + addCriterion("identifier not like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierIn(List values) { + addCriterion("identifier in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotIn(List values) { + addCriterion("identifier not in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierBetween(String value1, String value2) { + addCriterion("identifier between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotBetween(String value1, String value2) { + addCriterion("identifier not between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andCredentialIsNull() { + addCriterion("credential is null"); + return (Criteria) this; + } + + public Criteria andCredentialIsNotNull() { + addCriterion("credential is not null"); + return (Criteria) this; + } + + public Criteria andCredentialEqualTo(String value) { + addCriterion("credential =", value, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialNotEqualTo(String value) { + addCriterion("credential <>", value, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialGreaterThan(String value) { + addCriterion("credential >", value, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialGreaterThanOrEqualTo(String value) { + addCriterion("credential >=", value, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialLessThan(String value) { + addCriterion("credential <", value, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialLessThanOrEqualTo(String value) { + addCriterion("credential <=", value, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialLike(String value) { + addCriterion("credential like", value, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialNotLike(String value) { + addCriterion("credential not like", value, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialIn(List values) { + addCriterion("credential in", values, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialNotIn(List values) { + addCriterion("credential not in", values, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialBetween(String value1, String value2) { + addCriterion("credential between", value1, value2, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialNotBetween(String value1, String value2) { + addCriterion("credential not between", value1, value2, "credential"); + return (Criteria) this; + } + + public Criteria andSaltIsNull() { + addCriterion("salt is null"); + return (Criteria) this; + } + + public Criteria andSaltIsNotNull() { + addCriterion("salt is not null"); + return (Criteria) this; + } + + public Criteria andSaltEqualTo(String value) { + addCriterion("salt =", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltNotEqualTo(String value) { + addCriterion("salt <>", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltGreaterThan(String value) { + addCriterion("salt >", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltGreaterThanOrEqualTo(String value) { + addCriterion("salt >=", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltLessThan(String value) { + addCriterion("salt <", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltLessThanOrEqualTo(String value) { + addCriterion("salt <=", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltLike(String value) { + addCriterion("salt like", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltNotLike(String value) { + addCriterion("salt not like", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltIn(List values) { + addCriterion("salt in", values, "salt"); + return (Criteria) this; + } + + public Criteria andSaltNotIn(List values) { + addCriterion("salt not in", values, "salt"); + return (Criteria) this; + } + + public Criteria andSaltBetween(String value1, String value2) { + addCriterion("salt between", value1, value2, "salt"); + return (Criteria) this; + } + + public Criteria andSaltNotBetween(String value1, String value2) { + addCriterion("salt not between", value1, value2, "salt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Date value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Date value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Date value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Date value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Date value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Date value1, Date value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Date value1, Date value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNull() { + addCriterion("updated_at is null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNotNull() { + addCriterion("updated_at is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtEqualTo(Date value) { + addCriterion("updated_at =", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotEqualTo(Date value) { + addCriterion("updated_at <>", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThan(Date value) { + addCriterion("updated_at >", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("updated_at >=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThan(Date value) { + addCriterion("updated_at <", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { + addCriterion("updated_at <=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIn(List values) { + addCriterion("updated_at in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotIn(List values) { + addCriterion("updated_at not in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtBetween(Date value1, Date value2) { + addCriterion("updated_at between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { + addCriterion("updated_at not between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNull() { + addCriterion("rec_status is null"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNotNull() { + addCriterion("rec_status is not null"); + return (Criteria) this; + } + + public Criteria andRecStatusEqualTo(Byte value) { + addCriterion("rec_status =", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotEqualTo(Byte value) { + addCriterion("rec_status <>", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThan(Byte value) { + addCriterion("rec_status >", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("rec_status >=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThan(Byte value) { + addCriterion("rec_status <", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThanOrEqualTo(Byte value) { + addCriterion("rec_status <=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusIn(List values) { + addCriterion("rec_status in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotIn(List values) { + addCriterion("rec_status not in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusBetween(Byte value1, Byte value2) { + addCriterion("rec_status between", value1, value2, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { + addCriterion("rec_status not between", value1, value2, "recStatus"); + return (Criteria) this; + } + + public Criteria andRegisterTypeIsNull() { + addCriterion("register_type is null"); + return (Criteria) this; + } + + public Criteria andRegisterTypeIsNotNull() { + addCriterion("register_type is not null"); + return (Criteria) this; + } + + public Criteria andRegisterTypeEqualTo(Byte value) { + addCriterion("register_type =", value, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeNotEqualTo(Byte value) { + addCriterion("register_type <>", value, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeGreaterThan(Byte value) { + addCriterion("register_type >", value, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeGreaterThanOrEqualTo(Byte value) { + addCriterion("register_type >=", value, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeLessThan(Byte value) { + addCriterion("register_type <", value, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeLessThanOrEqualTo(Byte value) { + addCriterion("register_type <=", value, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeIn(List values) { + addCriterion("register_type in", values, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeNotIn(List values) { + addCriterion("register_type not in", values, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeBetween(Byte value1, Byte value2) { + addCriterion("register_type between", value1, value2, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeNotBetween(Byte value1, Byte value2) { + addCriterion("register_type not between", value1, value2, "registerType"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/ccsens/opensource/wxconfigurer/bean/po/SysUser.java b/src/main/java/com/ccsens/opensource/wxconfigurer/bean/po/SysUser.java new file mode 100644 index 0000000..871027d --- /dev/null +++ b/src/main/java/com/ccsens/opensource/wxconfigurer/bean/po/SysUser.java @@ -0,0 +1,205 @@ +package com.ccsens.opensource.wxconfigurer.bean.po; + +import java.io.Serializable; +import java.util.Date; + +public class SysUser implements Serializable { + private Long id; + + private Long gradeId; + + private String avatarUrl; + + private String nickname; + + private Byte gender; + + private String country; + + private String province; + + private String city; + + private String language; + + private String phone; + + private String wechat; + + private String email; + + private Long balance; + + private Date createdAt; + + private Date updatedAt; + + private Byte recStatus; + + private Byte source; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getGradeId() { + return gradeId; + } + + public void setGradeId(Long gradeId) { + this.gradeId = gradeId; + } + + public String getAvatarUrl() { + return avatarUrl; + } + + public void setAvatarUrl(String avatarUrl) { + this.avatarUrl = avatarUrl == null ? null : avatarUrl.trim(); + } + + public String getNickname() { + return nickname; + } + + public void setNickname(String nickname) { + this.nickname = nickname == null ? null : nickname.trim(); + } + + public Byte getGender() { + return gender; + } + + public void setGender(Byte gender) { + this.gender = gender; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country == null ? null : country.trim(); + } + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province == null ? null : province.trim(); + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city == null ? null : city.trim(); + } + + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language == null ? null : language.trim(); + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone == null ? null : phone.trim(); + } + + public String getWechat() { + return wechat; + } + + public void setWechat(String wechat) { + this.wechat = wechat == null ? null : wechat.trim(); + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email == null ? null : email.trim(); + } + + public Long getBalance() { + return balance; + } + + public void setBalance(Long balance) { + this.balance = balance; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } + + public Byte getRecStatus() { + return recStatus; + } + + public void setRecStatus(Byte recStatus) { + this.recStatus = recStatus; + } + + public Byte getSource() { + return source; + } + + public void setSource(Byte source) { + this.source = source; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", gradeId=").append(gradeId); + sb.append(", avatarUrl=").append(avatarUrl); + sb.append(", nickname=").append(nickname); + sb.append(", gender=").append(gender); + sb.append(", country=").append(country); + sb.append(", province=").append(province); + sb.append(", city=").append(city); + sb.append(", language=").append(language); + sb.append(", phone=").append(phone); + sb.append(", wechat=").append(wechat); + sb.append(", email=").append(email); + sb.append(", balance=").append(balance); + sb.append(", createdAt=").append(createdAt); + sb.append(", updatedAt=").append(updatedAt); + sb.append(", recStatus=").append(recStatus); + sb.append(", source=").append(source); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/src/main/java/com/ccsens/opensource/wxconfigurer/bean/po/SysUserExample.java b/src/main/java/com/ccsens/opensource/wxconfigurer/bean/po/SysUserExample.java new file mode 100644 index 0000000..cdb88c5 --- /dev/null +++ b/src/main/java/com/ccsens/opensource/wxconfigurer/bean/po/SysUserExample.java @@ -0,0 +1,1311 @@ +package com.ccsens.opensource.wxconfigurer.bean.po; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SysUserExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SysUserExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andGradeIdIsNull() { + addCriterion("grade_id is null"); + return (Criteria) this; + } + + public Criteria andGradeIdIsNotNull() { + addCriterion("grade_id is not null"); + return (Criteria) this; + } + + public Criteria andGradeIdEqualTo(Long value) { + addCriterion("grade_id =", value, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdNotEqualTo(Long value) { + addCriterion("grade_id <>", value, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdGreaterThan(Long value) { + addCriterion("grade_id >", value, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdGreaterThanOrEqualTo(Long value) { + addCriterion("grade_id >=", value, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdLessThan(Long value) { + addCriterion("grade_id <", value, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdLessThanOrEqualTo(Long value) { + addCriterion("grade_id <=", value, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdIn(List values) { + addCriterion("grade_id in", values, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdNotIn(List values) { + addCriterion("grade_id not in", values, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdBetween(Long value1, Long value2) { + addCriterion("grade_id between", value1, value2, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdNotBetween(Long value1, Long value2) { + addCriterion("grade_id not between", value1, value2, "gradeId"); + return (Criteria) this; + } + + public Criteria andAvatarUrlIsNull() { + addCriterion("avatar_url is null"); + return (Criteria) this; + } + + public Criteria andAvatarUrlIsNotNull() { + addCriterion("avatar_url is not null"); + return (Criteria) this; + } + + public Criteria andAvatarUrlEqualTo(String value) { + addCriterion("avatar_url =", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlNotEqualTo(String value) { + addCriterion("avatar_url <>", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlGreaterThan(String value) { + addCriterion("avatar_url >", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlGreaterThanOrEqualTo(String value) { + addCriterion("avatar_url >=", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlLessThan(String value) { + addCriterion("avatar_url <", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlLessThanOrEqualTo(String value) { + addCriterion("avatar_url <=", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlLike(String value) { + addCriterion("avatar_url like", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlNotLike(String value) { + addCriterion("avatar_url not like", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlIn(List values) { + addCriterion("avatar_url in", values, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlNotIn(List values) { + addCriterion("avatar_url not in", values, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlBetween(String value1, String value2) { + addCriterion("avatar_url between", value1, value2, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlNotBetween(String value1, String value2) { + addCriterion("avatar_url not between", value1, value2, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andNicknameIsNull() { + addCriterion("nickname is null"); + return (Criteria) this; + } + + public Criteria andNicknameIsNotNull() { + addCriterion("nickname is not null"); + return (Criteria) this; + } + + public Criteria andNicknameEqualTo(String value) { + addCriterion("nickname =", value, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameNotEqualTo(String value) { + addCriterion("nickname <>", value, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameGreaterThan(String value) { + addCriterion("nickname >", value, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameGreaterThanOrEqualTo(String value) { + addCriterion("nickname >=", value, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameLessThan(String value) { + addCriterion("nickname <", value, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameLessThanOrEqualTo(String value) { + addCriterion("nickname <=", value, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameLike(String value) { + addCriterion("nickname like", value, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameNotLike(String value) { + addCriterion("nickname not like", value, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameIn(List values) { + addCriterion("nickname in", values, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameNotIn(List values) { + addCriterion("nickname not in", values, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameBetween(String value1, String value2) { + addCriterion("nickname between", value1, value2, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameNotBetween(String value1, String value2) { + addCriterion("nickname not between", value1, value2, "nickname"); + return (Criteria) this; + } + + public Criteria andGenderIsNull() { + addCriterion("gender is null"); + return (Criteria) this; + } + + public Criteria andGenderIsNotNull() { + addCriterion("gender is not null"); + return (Criteria) this; + } + + public Criteria andGenderEqualTo(Byte value) { + addCriterion("gender =", value, "gender"); + return (Criteria) this; + } + + public Criteria andGenderNotEqualTo(Byte value) { + addCriterion("gender <>", value, "gender"); + return (Criteria) this; + } + + public Criteria andGenderGreaterThan(Byte value) { + addCriterion("gender >", value, "gender"); + return (Criteria) this; + } + + public Criteria andGenderGreaterThanOrEqualTo(Byte value) { + addCriterion("gender >=", value, "gender"); + return (Criteria) this; + } + + public Criteria andGenderLessThan(Byte value) { + addCriterion("gender <", value, "gender"); + return (Criteria) this; + } + + public Criteria andGenderLessThanOrEqualTo(Byte value) { + addCriterion("gender <=", value, "gender"); + return (Criteria) this; + } + + public Criteria andGenderIn(List values) { + addCriterion("gender in", values, "gender"); + return (Criteria) this; + } + + public Criteria andGenderNotIn(List values) { + addCriterion("gender not in", values, "gender"); + return (Criteria) this; + } + + public Criteria andGenderBetween(Byte value1, Byte value2) { + addCriterion("gender between", value1, value2, "gender"); + return (Criteria) this; + } + + public Criteria andGenderNotBetween(Byte value1, Byte value2) { + addCriterion("gender not between", value1, value2, "gender"); + return (Criteria) this; + } + + public Criteria andCountryIsNull() { + addCriterion("country is null"); + return (Criteria) this; + } + + public Criteria andCountryIsNotNull() { + addCriterion("country is not null"); + return (Criteria) this; + } + + public Criteria andCountryEqualTo(String value) { + addCriterion("country =", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryNotEqualTo(String value) { + addCriterion("country <>", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryGreaterThan(String value) { + addCriterion("country >", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryGreaterThanOrEqualTo(String value) { + addCriterion("country >=", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryLessThan(String value) { + addCriterion("country <", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryLessThanOrEqualTo(String value) { + addCriterion("country <=", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryLike(String value) { + addCriterion("country like", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryNotLike(String value) { + addCriterion("country not like", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryIn(List values) { + addCriterion("country in", values, "country"); + return (Criteria) this; + } + + public Criteria andCountryNotIn(List values) { + addCriterion("country not in", values, "country"); + return (Criteria) this; + } + + public Criteria andCountryBetween(String value1, String value2) { + addCriterion("country between", value1, value2, "country"); + return (Criteria) this; + } + + public Criteria andCountryNotBetween(String value1, String value2) { + addCriterion("country not between", value1, value2, "country"); + return (Criteria) this; + } + + public Criteria andProvinceIsNull() { + addCriterion("province is null"); + return (Criteria) this; + } + + public Criteria andProvinceIsNotNull() { + addCriterion("province is not null"); + return (Criteria) this; + } + + public Criteria andProvinceEqualTo(String value) { + addCriterion("province =", value, "province"); + return (Criteria) this; + } + + public Criteria andProvinceNotEqualTo(String value) { + addCriterion("province <>", value, "province"); + return (Criteria) this; + } + + public Criteria andProvinceGreaterThan(String value) { + addCriterion("province >", value, "province"); + return (Criteria) this; + } + + public Criteria andProvinceGreaterThanOrEqualTo(String value) { + addCriterion("province >=", value, "province"); + return (Criteria) this; + } + + public Criteria andProvinceLessThan(String value) { + addCriterion("province <", value, "province"); + return (Criteria) this; + } + + public Criteria andProvinceLessThanOrEqualTo(String value) { + addCriterion("province <=", value, "province"); + return (Criteria) this; + } + + public Criteria andProvinceLike(String value) { + addCriterion("province like", value, "province"); + return (Criteria) this; + } + + public Criteria andProvinceNotLike(String value) { + addCriterion("province not like", value, "province"); + return (Criteria) this; + } + + public Criteria andProvinceIn(List values) { + addCriterion("province in", values, "province"); + return (Criteria) this; + } + + public Criteria andProvinceNotIn(List values) { + addCriterion("province not in", values, "province"); + return (Criteria) this; + } + + public Criteria andProvinceBetween(String value1, String value2) { + addCriterion("province between", value1, value2, "province"); + return (Criteria) this; + } + + public Criteria andProvinceNotBetween(String value1, String value2) { + addCriterion("province not between", value1, value2, "province"); + return (Criteria) this; + } + + public Criteria andCityIsNull() { + addCriterion("city is null"); + return (Criteria) this; + } + + public Criteria andCityIsNotNull() { + addCriterion("city is not null"); + return (Criteria) this; + } + + public Criteria andCityEqualTo(String value) { + addCriterion("city =", value, "city"); + return (Criteria) this; + } + + public Criteria andCityNotEqualTo(String value) { + addCriterion("city <>", value, "city"); + return (Criteria) this; + } + + public Criteria andCityGreaterThan(String value) { + addCriterion("city >", value, "city"); + return (Criteria) this; + } + + public Criteria andCityGreaterThanOrEqualTo(String value) { + addCriterion("city >=", value, "city"); + return (Criteria) this; + } + + public Criteria andCityLessThan(String value) { + addCriterion("city <", value, "city"); + return (Criteria) this; + } + + public Criteria andCityLessThanOrEqualTo(String value) { + addCriterion("city <=", value, "city"); + return (Criteria) this; + } + + public Criteria andCityLike(String value) { + addCriterion("city like", value, "city"); + return (Criteria) this; + } + + public Criteria andCityNotLike(String value) { + addCriterion("city not like", value, "city"); + return (Criteria) this; + } + + public Criteria andCityIn(List values) { + addCriterion("city in", values, "city"); + return (Criteria) this; + } + + public Criteria andCityNotIn(List values) { + addCriterion("city not in", values, "city"); + return (Criteria) this; + } + + public Criteria andCityBetween(String value1, String value2) { + addCriterion("city between", value1, value2, "city"); + return (Criteria) this; + } + + public Criteria andCityNotBetween(String value1, String value2) { + addCriterion("city not between", value1, value2, "city"); + return (Criteria) this; + } + + public Criteria andLanguageIsNull() { + addCriterion("language is null"); + return (Criteria) this; + } + + public Criteria andLanguageIsNotNull() { + addCriterion("language is not null"); + return (Criteria) this; + } + + public Criteria andLanguageEqualTo(String value) { + addCriterion("language =", value, "language"); + return (Criteria) this; + } + + public Criteria andLanguageNotEqualTo(String value) { + addCriterion("language <>", value, "language"); + return (Criteria) this; + } + + public Criteria andLanguageGreaterThan(String value) { + addCriterion("language >", value, "language"); + return (Criteria) this; + } + + public Criteria andLanguageGreaterThanOrEqualTo(String value) { + addCriterion("language >=", value, "language"); + return (Criteria) this; + } + + public Criteria andLanguageLessThan(String value) { + addCriterion("language <", value, "language"); + return (Criteria) this; + } + + public Criteria andLanguageLessThanOrEqualTo(String value) { + addCriterion("language <=", value, "language"); + return (Criteria) this; + } + + public Criteria andLanguageLike(String value) { + addCriterion("language like", value, "language"); + return (Criteria) this; + } + + public Criteria andLanguageNotLike(String value) { + addCriterion("language not like", value, "language"); + return (Criteria) this; + } + + public Criteria andLanguageIn(List values) { + addCriterion("language in", values, "language"); + return (Criteria) this; + } + + public Criteria andLanguageNotIn(List values) { + addCriterion("language not in", values, "language"); + return (Criteria) this; + } + + public Criteria andLanguageBetween(String value1, String value2) { + addCriterion("language between", value1, value2, "language"); + return (Criteria) this; + } + + public Criteria andLanguageNotBetween(String value1, String value2) { + addCriterion("language not between", value1, value2, "language"); + return (Criteria) this; + } + + public Criteria andPhoneIsNull() { + addCriterion("phone is null"); + return (Criteria) this; + } + + public Criteria andPhoneIsNotNull() { + addCriterion("phone is not null"); + return (Criteria) this; + } + + public Criteria andPhoneEqualTo(String value) { + addCriterion("phone =", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneNotEqualTo(String value) { + addCriterion("phone <>", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneGreaterThan(String value) { + addCriterion("phone >", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneGreaterThanOrEqualTo(String value) { + addCriterion("phone >=", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneLessThan(String value) { + addCriterion("phone <", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneLessThanOrEqualTo(String value) { + addCriterion("phone <=", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneLike(String value) { + addCriterion("phone like", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneNotLike(String value) { + addCriterion("phone not like", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneIn(List values) { + addCriterion("phone in", values, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneNotIn(List values) { + addCriterion("phone not in", values, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneBetween(String value1, String value2) { + addCriterion("phone between", value1, value2, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneNotBetween(String value1, String value2) { + addCriterion("phone not between", value1, value2, "phone"); + return (Criteria) this; + } + + public Criteria andWechatIsNull() { + addCriterion("wechat is null"); + return (Criteria) this; + } + + public Criteria andWechatIsNotNull() { + addCriterion("wechat is not null"); + return (Criteria) this; + } + + public Criteria andWechatEqualTo(String value) { + addCriterion("wechat =", value, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatNotEqualTo(String value) { + addCriterion("wechat <>", value, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatGreaterThan(String value) { + addCriterion("wechat >", value, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatGreaterThanOrEqualTo(String value) { + addCriterion("wechat >=", value, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatLessThan(String value) { + addCriterion("wechat <", value, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatLessThanOrEqualTo(String value) { + addCriterion("wechat <=", value, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatLike(String value) { + addCriterion("wechat like", value, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatNotLike(String value) { + addCriterion("wechat not like", value, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatIn(List values) { + addCriterion("wechat in", values, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatNotIn(List values) { + addCriterion("wechat not in", values, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatBetween(String value1, String value2) { + addCriterion("wechat between", value1, value2, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatNotBetween(String value1, String value2) { + addCriterion("wechat not between", value1, value2, "wechat"); + return (Criteria) this; + } + + public Criteria andEmailIsNull() { + addCriterion("email is null"); + return (Criteria) this; + } + + public Criteria andEmailIsNotNull() { + addCriterion("email is not null"); + return (Criteria) this; + } + + public Criteria andEmailEqualTo(String value) { + addCriterion("email =", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotEqualTo(String value) { + addCriterion("email <>", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailGreaterThan(String value) { + addCriterion("email >", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailGreaterThanOrEqualTo(String value) { + addCriterion("email >=", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLessThan(String value) { + addCriterion("email <", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLessThanOrEqualTo(String value) { + addCriterion("email <=", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLike(String value) { + addCriterion("email like", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotLike(String value) { + addCriterion("email not like", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailIn(List values) { + addCriterion("email in", values, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotIn(List values) { + addCriterion("email not in", values, "email"); + return (Criteria) this; + } + + public Criteria andEmailBetween(String value1, String value2) { + addCriterion("email between", value1, value2, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotBetween(String value1, String value2) { + addCriterion("email not between", value1, value2, "email"); + return (Criteria) this; + } + + public Criteria andBalanceIsNull() { + addCriterion("balance is null"); + return (Criteria) this; + } + + public Criteria andBalanceIsNotNull() { + addCriterion("balance is not null"); + return (Criteria) this; + } + + public Criteria andBalanceEqualTo(Long value) { + addCriterion("balance =", value, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceNotEqualTo(Long value) { + addCriterion("balance <>", value, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceGreaterThan(Long value) { + addCriterion("balance >", value, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceGreaterThanOrEqualTo(Long value) { + addCriterion("balance >=", value, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceLessThan(Long value) { + addCriterion("balance <", value, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceLessThanOrEqualTo(Long value) { + addCriterion("balance <=", value, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceIn(List values) { + addCriterion("balance in", values, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceNotIn(List values) { + addCriterion("balance not in", values, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceBetween(Long value1, Long value2) { + addCriterion("balance between", value1, value2, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceNotBetween(Long value1, Long value2) { + addCriterion("balance not between", value1, value2, "balance"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Date value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Date value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Date value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Date value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Date value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Date value1, Date value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Date value1, Date value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNull() { + addCriterion("updated_at is null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNotNull() { + addCriterion("updated_at is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtEqualTo(Date value) { + addCriterion("updated_at =", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotEqualTo(Date value) { + addCriterion("updated_at <>", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThan(Date value) { + addCriterion("updated_at >", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("updated_at >=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThan(Date value) { + addCriterion("updated_at <", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { + addCriterion("updated_at <=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIn(List values) { + addCriterion("updated_at in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotIn(List values) { + addCriterion("updated_at not in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtBetween(Date value1, Date value2) { + addCriterion("updated_at between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { + addCriterion("updated_at not between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNull() { + addCriterion("rec_status is null"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNotNull() { + addCriterion("rec_status is not null"); + return (Criteria) this; + } + + public Criteria andRecStatusEqualTo(Byte value) { + addCriterion("rec_status =", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotEqualTo(Byte value) { + addCriterion("rec_status <>", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThan(Byte value) { + addCriterion("rec_status >", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("rec_status >=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThan(Byte value) { + addCriterion("rec_status <", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThanOrEqualTo(Byte value) { + addCriterion("rec_status <=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusIn(List values) { + addCriterion("rec_status in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotIn(List values) { + addCriterion("rec_status not in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusBetween(Byte value1, Byte value2) { + addCriterion("rec_status between", value1, value2, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { + addCriterion("rec_status not between", value1, value2, "recStatus"); + return (Criteria) this; + } + + public Criteria andSourceIsNull() { + addCriterion("source is null"); + return (Criteria) this; + } + + public Criteria andSourceIsNotNull() { + addCriterion("source is not null"); + return (Criteria) this; + } + + public Criteria andSourceEqualTo(Byte value) { + addCriterion("source =", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotEqualTo(Byte value) { + addCriterion("source <>", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceGreaterThan(Byte value) { + addCriterion("source >", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceGreaterThanOrEqualTo(Byte value) { + addCriterion("source >=", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLessThan(Byte value) { + addCriterion("source <", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLessThanOrEqualTo(Byte value) { + addCriterion("source <=", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceIn(List values) { + addCriterion("source in", values, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotIn(List values) { + addCriterion("source not in", values, "source"); + return (Criteria) this; + } + + public Criteria andSourceBetween(Byte value1, Byte value2) { + addCriterion("source between", value1, value2, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotBetween(Byte value1, Byte value2) { + addCriterion("source not between", value1, value2, "source"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/ccsens/opensource/wxconfigurer/config/DruidProps.java b/src/main/java/com/ccsens/opensource/wxconfigurer/config/DruidProps.java index c1728b8..6500d90 100644 --- a/src/main/java/com/ccsens/opensource/wxconfigurer/config/DruidProps.java +++ b/src/main/java/com/ccsens/opensource/wxconfigurer/config/DruidProps.java @@ -32,6 +32,7 @@ public class DruidProps { private String url; private String username; private String password; + private String env; private String driverClassName; private int initialSize; private int minIdle; @@ -70,8 +71,8 @@ public class DruidProps { } public String getPassword(){ - if(StrUtil.isNotEmpty(password)) { - String key = System.getenv("CCSENS_TALL_TEST"); + if(StrUtil.isNotEmpty(password) && StrUtil.isNotEmpty(env)) { + String key = System.getenv(env); SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES, Base64.decode(key)); password = aes.decryptStr(password, CharsetUtil.CHARSET_UTF_8); } diff --git a/src/main/java/com/ccsens/opensource/wxconfigurer/persist/mapper/SysAuthMapper.java b/src/main/java/com/ccsens/opensource/wxconfigurer/persist/mapper/SysAuthMapper.java new file mode 100644 index 0000000..6bf14e0 --- /dev/null +++ b/src/main/java/com/ccsens/opensource/wxconfigurer/persist/mapper/SysAuthMapper.java @@ -0,0 +1,30 @@ +package com.ccsens.opensource.wxconfigurer.persist.mapper; + +import com.ccsens.opensource.wxconfigurer.bean.po.SysAuth; +import com.ccsens.opensource.wxconfigurer.bean.po.SysAuthExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface SysAuthMapper { + long countByExample(SysAuthExample example); + + int deleteByExample(SysAuthExample example); + + int deleteByPrimaryKey(Long id); + + int insert(SysAuth record); + + int insertSelective(SysAuth record); + + List selectByExample(SysAuthExample example); + + SysAuth selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") SysAuth record, @Param("example") SysAuthExample example); + + int updateByExample(@Param("record") SysAuth record, @Param("example") SysAuthExample example); + + int updateByPrimaryKeySelective(SysAuth record); + + int updateByPrimaryKey(SysAuth record); +} \ No newline at end of file diff --git a/src/main/java/com/ccsens/opensource/wxconfigurer/persist/mapper/SysUserMapper.java b/src/main/java/com/ccsens/opensource/wxconfigurer/persist/mapper/SysUserMapper.java new file mode 100644 index 0000000..f52f0d3 --- /dev/null +++ b/src/main/java/com/ccsens/opensource/wxconfigurer/persist/mapper/SysUserMapper.java @@ -0,0 +1,30 @@ +package com.ccsens.opensource.wxconfigurer.persist.mapper; + +import com.ccsens.opensource.wxconfigurer.bean.po.SysUser; +import com.ccsens.opensource.wxconfigurer.bean.po.SysUserExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface SysUserMapper { + long countByExample(SysUserExample example); + + int deleteByExample(SysUserExample example); + + int deleteByPrimaryKey(Long id); + + int insert(SysUser record); + + int insertSelective(SysUser record); + + List selectByExample(SysUserExample example); + + SysUser selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") SysUser record, @Param("example") SysUserExample example); + + int updateByExample(@Param("record") SysUser record, @Param("example") SysUserExample example); + + int updateByPrimaryKeySelective(SysUser record); + + int updateByPrimaryKey(SysUser record); +} \ No newline at end of file diff --git a/src/main/java/com/ccsens/opensource/wxconfigurer/service/IUserService.java b/src/main/java/com/ccsens/opensource/wxconfigurer/service/IUserService.java new file mode 100644 index 0000000..db911bf --- /dev/null +++ b/src/main/java/com/ccsens/opensource/wxconfigurer/service/IUserService.java @@ -0,0 +1,23 @@ +package com.ccsens.opensource.wxconfigurer.service; + + +import java.io.IOException; + +public interface IUserService { + /** + * 更新用户信息 + * @param openId + * @return + */ + String updateUser(String openId); + + /** + * 保存用户信息 + * @param index + * @param openId + * @return + */ + boolean subscribe(int index, String openId); + + void unsubscribe(String openId) throws IOException; +} diff --git a/src/main/java/com/ccsens/opensource/wxconfigurer/service/UserService.java b/src/main/java/com/ccsens/opensource/wxconfigurer/service/UserService.java new file mode 100644 index 0000000..fd088bf --- /dev/null +++ b/src/main/java/com/ccsens/opensource/wxconfigurer/service/UserService.java @@ -0,0 +1,169 @@ +package com.ccsens.opensource.wxconfigurer.service; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.lang.Snowflake; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.ccsens.opensource.wxconfigurer.bean.po.SysAuth; +import com.ccsens.opensource.wxconfigurer.bean.po.SysAuthExample; +import com.ccsens.opensource.wxconfigurer.bean.po.SysUser; +import com.ccsens.opensource.wxconfigurer.bean.po.WxOauth2UserInfo; +import com.ccsens.opensource.wxconfigurer.persist.mapper.SysAuthMapper; +import com.ccsens.opensource.wxconfigurer.persist.mapper.SysUserMapper; +import com.ccsens.opensource.wxconfigurer.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.List; + +/** + * @description: + * @author: whj + * @time: 2020/6/1 16:43 + */ +@Slf4j +@Service +@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) +public class UserService implements IUserService { + + @Resource + private SysAuthMapper sysAuthMapper; + @Resource + private SysUserMapper sysUserMapper; + @Resource + private Snowflake snowflake; + + @Override + public String updateUser(String openId) { + + String accessToken = WxGzhUtil.getAccessToken(); + String url = String.format(WxGzhUtil.USER_GET,accessToken, + StrUtil.isEmpty(openId) ? "" : openId); + log.info("查询用户列表:{}", url); + String response = HttpRequest.get(url).execute().body(); + log.info("查询用户返回结果:{}", response); + // 校验返回结果 错误抛异常 + WxGzhUtil.pageResponse(response); + JSONObject result = JSONObject.parseObject(response); + if (result.getIntValue(WxGzhUtil.Field.COUNT) <= 0) { + return null; + } + log.info("遍历openid"); + JSONArray array = result.getJSONObject(WxGzhUtil.Field.DATA).getJSONArray(WxGzhUtil.Field.OPENID); + + for (Object obj: array) { + // 查询unionid + String newOpenId = (String) obj; + new Thread(new Runnable() { + @Override + public void run() { + // 调用tall的登录接口 + int index = 0; +// while (!siginin(index++, newOpenId)) { +// log.info("循环调用"); +// } + subscribe(index++, newOpenId); + } + + + }).start(); + + } + + + return result.getString(WxGzhUtil.Field.NEXT_OPENID); + } + + /** + * + * @param index + * @param openId + * @return + */ + @Override + public boolean subscribe(int index, String openId) { + try { + if (index >= 5) { + log.info("已经调用5次,不再调用"); + // TODO 报警(邮件) + return true; + } + + WxOauth2UserInfo userInfo = WxGzhUtil.getUserInfo(openId); + if (ObjectUtil.isNull(userInfo)) { + return false; + } + + // 判断用户信息是否被保存 + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.OFFICIAL_ACCOUNT_WX.value) + .andIdentifierEqualTo(userInfo.getOpenId()).andCredentialEqualTo(userInfo.getUnionId()) + .andRecStatusEqualTo((byte)0); + List authList = sysAuthMapper.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + return true; + } + // 保存用户信息 + saveUser(userInfo); + + + } catch (Exception e) { + return false; + } + return false; + } + + private void saveUser(WxOauth2UserInfo userInfo) { + SysAuthExample sysAuthExample = new SysAuthExample(); + sysAuthExample.createCriteria().andCredentialEqualTo(userInfo.getUnionId()).andRecStatusEqualTo((byte)0); + List sysAuthList = sysAuthMapper.selectByExample(sysAuthExample); + if (CollectionUtil.isNotEmpty(sysAuthList)) { + //添加认证方式 + SysAuth theAuth = new SysAuth(); + theAuth.setId(snowflake.nextId()); + theAuth.setUserId(sysAuthList.get(0).getUserId()); + theAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.OFFICIAL_ACCOUNT_WX.value); + theAuth.setIdentifier(userInfo.getOpenId()); + theAuth.setCredential(userInfo.getUnionId()); + sysAuthMapper.insertSelective(theAuth); + } else { + //新建用户并保存微信信息 + SysUser user = new SysUser(); + user.setId(snowflake.nextId()); + user.setAvatarUrl(userInfo.getHeadImgUrl()); + user.setNickname(userInfo.getNickname()); + user.setGender((byte) userInfo.getSex()); + user.setCountry(userInfo.getCountry()); + user.setProvince(userInfo.getProvince()); + user.setCity(userInfo.getCity()); + user.setLanguage(userInfo.getLanguage()); + sysUserMapper.insertSelective(user); + //添加认证方式 + SysAuth theAuth = new SysAuth(); + theAuth.setId(snowflake.nextId()); + theAuth.setUserId(user.getId()); + theAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.OFFICIAL_ACCOUNT_WX.value); + theAuth.setIdentifier(userInfo.getOpenId()); + theAuth.setCredential(userInfo.getUnionId()); + sysAuthMapper.insertSelective(theAuth); + } + } + + @Override + public void unsubscribe(String openId) throws IOException { + log.info("取消关注的用户:{}", openId); + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andIdentifierEqualTo(openId) + .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.OFFICIAL_ACCOUNT_WX.value); + SysAuth auth = new SysAuth(); + auth.setRecStatus((byte)WebConstant.REC_STATUS.Deleted.value); + sysAuthMapper.updateByExampleSelective(auth, authExample); + } +} diff --git a/src/main/java/com/ccsens/opensource/wxconfigurer/util/CodeEnum.java b/src/main/java/com/ccsens/opensource/wxconfigurer/util/CodeEnum.java new file mode 100644 index 0000000..0c9406d --- /dev/null +++ b/src/main/java/com/ccsens/opensource/wxconfigurer/util/CodeEnum.java @@ -0,0 +1,144 @@ +package com.ccsens.opensource.wxconfigurer.util; + +import lombok.Getter; + +@Getter +public enum CodeEnum { + /** + * 异常 + */ + SUCCESS(200, "ok", true), + SYS_ERROR(500, "网络繁忙,请您稍后重试", false), + FILE_FORMAT_ERROR(1, "文件格式错误", true), + AUDITED(2, "已经审核通过,不重复提交。", true), + POSITION_NO_FOUND(3, "未找到对应职务,请重新选择职务。", true), + TITLE_NO_FOUND(4, "未找到对应职称,请重新选择职称。", true), + ADMIN_DEAL(5,"由于您的资格太高,请联系管理员进行审核。", true), + PARAM_NULL(6, "请检查您的参数是否填写完整。", true), + ROLE_NOT_FOUND(7, "未找到相关角色,请确认项目和角色信息。", true), + AUDIT_NOT_PASS (8, "对不起,您尚未审核通过,暂时没有操作权限。", true), + PARAM_ERROR(9,"请求参数错误,请确认操作是否正确。", true), + ID_CARD_ERROR(10,"身份证格式错误,请检查身份证填写是否正确。", true), + QUESTION_NOT_FOUND(11,"试题未找到。", true), + + WSB_NOT_PROJECT_HEADER(12,"没有项目信息的表头",true), + WSB_NOT_MEMBER_HEADER(13,"没有项目成员的表头",true), + WSB_NOT_TASK_HEADER(14,"没有项目任务分解的表头",true), + WBS_PROJECT_TIME_ERROR(15,"时间格式异常",true), + WBS_NOT_PROJECT_TIME(16,"项目时间不能为空",true), + WBS_NOT_PROJECT_NAME(17,"找不到项目信息",true), + WBS_NOT_MEMBER_SHEET(18,"未找到项目成员表",true), + WBS_NOT_PHONE(19,"手机号为空",true), + WBS_STAKEHOLDER_PHONE(20,"奖惩干系人和手机号不匹配",true), + WBS_REPEAT_MEMBER_PHONE(21,"成员或手机号重复",true), + WBS_NOT_FIRST_ROLE(22,"系统角色名称错误",true), + WBS_REPEAT_ROLE_NAME(23,"角色名称重复",true), + WSB_NOT_MEMBER(24,"未找到对应成员,请检查成员姓名是否正确", true), + WBS_NOT_FIND_ROLE(25,"未找到对应的角色,请检查对谁不可见一列的名字与格式",true), + WBS_NOT_TASK_NAME(26,"任务名不能为空",true), + WBS_NOT_FIND_EXECUTOR_ROLE(27,"找不到负责人,请检查负责人的名称",true), + WBS_NOT_FIND_CHECKER_ROLE(28,"找不到检查人,请检查检查人的名称",true), + WBS_DELAY_ERROR(29,"任务切换模式填写错误",true), + WBS_SUB_TASK_ANALYSIS(30,"无法解析此子日程表",true), + WBS_NOT_SUB_TASK(31,"找不到对应的子表,请检查子表的名字是否正确",true), + WBS_NOT_PLUGIN_SHEET(32,"未找到插件表",true), + WBS_NOT_PLUGIN(33,"未找到对应的插件,请确认是否填写正确",true), + PROJECT_DATE_FORMAT_ERROR(34,"输入的日期格式错误,有效日期格式 例:2019-01-01或2019-01",true), + TASK_NOT_UPLOAD_DELIVER(35,"交付物未上传,无法完成任务",true), + NOT_PROJECT(36,"对不起,找不到该项目",true), + NOT_ROLE(37,"对不起,找不到该角色",true), + NOT_DELIVER(38,"对不起,找不到对应的交付物",true), + NOT_TASK(39,"对不起,找不到对应的任务",true), + NOT_DELIVER_FILE(40,"上传文件信息错误,请重试",true), + IS_NOT_EXECUTOR(41,"对不起,您不是该任务负责人",true), + NOT_CHECKER(42,"请选择检查人",true), + SUB_TASK_IS_NOT_FINISH(43,"分组内任务未全部完成,无法完成任务",true), + IS_NOT_CHECKER(44,"您不是该交付物的检查人",true), + NOT_POWER(45,"对不起,您的权限不足,无法进行此操作",true), + SMS_CODE_CORRECT(46,"验证信息错误",true), + + QUESTION_RULE_NOT_FOUND(47,"该评测规则未知,请联系开发人员。", true), + REPORT_DOCTOR_ERROR(48, "对不起,您没有修改报告单结果的权限。", true), + NOT_LOGIN(49, "对不起,您尚未登录或登录已失效,请重新登录。", true), + POSITION_NOT_3(50, "对不起,您尚未选择职务,请重新选择。", true), + + REPEAT_PROJECT_NAME(51,"项目名不能重复,请修改后重试",true), + TIME_ERROR_BEGIN(52,"时间异常,开始时间不能大于结束时间",true), + TIME_ERROR_PROJECT(53,"时间异常,任务的时间不能超出项目的时间",true), + HAS_GROUP_TIME_CHANGE(54,"分组任务不能直接修改时间,请修改其子任务时间",true), + DOCTOR_NOT_SUBMIT(55,"尚未进行资格认证",true), + REPORT_NOT_FOUND(56,"对不起,没有找到您查询的报告单,请确认报告单是否存在。",true), + PATIENT_NOT_CHOICE(57,"没有选择病人,不进行保存答案。", true), + + NOT_GAME_TYPE(58,"对不起,未找到对应的游戏",true), + SIGNIN_REPEAT(59,"请勿重复签到",true), + SCORE_REPEAT(60,"您已经评分,请勿重复提交",true), + NOT_MEMBER(61,"对不起,找不到对应的成员信息",true), + NOT_GAME_RECORD(62,"对不起,找不到对应的游戏场次",true), + NOT_JOIN_GAME(63,"您还未加入游戏,请参加游戏后再试",true), + + GAME_NO_END(64,"您的上一场游戏尚未结束,请勿重复开启",true), + GAME_NOT_TIMES(65,"游戏可玩次数不足,请充值后重试",true), + + GAME_PENDING(66, "游戏尚未开始,请等待主持人开始", true), + GAME_PREPARATION(67, "游戏已经开始倒计时了", true), + GAME_PROCESSING (68, "游戏已经在火热进行啦", true), + GAME_COMPLETED(69, "抱歉,您来晚了,游戏已结束", true), + NOT_REGISTER(70,"该手机号尚未注册账号",true), + PHONE_ERR(71,"请输入正确的手机号",true), + NOT_SELECT_WX(72,"未查到对应的微信信息",true), + ALREADY_EXIST_PHONE(73,"手机号已存在",true), + ALREADY_BINDING_PHONE(74,"您已绑定过手机号,请勿重复绑定",true), + MERGE_WX_PHONE(75,"该手机号已经注册过账号,是否将账号合并",true), + ALREADY_EXIST_ACCOUNT(76,"该账号已存在",true), + NOT_SIGN_FIELD(77,"签到的字段不可用",true), + ALREADY_SIGN(78,"您已经签到过了,请勿重复签到",true), + ALREADY_ATTENTION(79,"您已经关注了这个项目",true), + NOT_EMPLOYEE(80,"未找到成员信息",true), + NOT_SITE(81,"未找到该场所",true), + ALREADY_REAL_AUTH(82,"您已经完成认证",true), + LACK_CONFIG(83,"缺少配置",true), + ANIMAL_HEAT_ERROR(84,"体温异常,请选择正确的健康状态",true), + NOT_BUSINESS(85,"未找到商户信息",true), + SITE_EXCEED(86,"您所添加的场所数量已超出上限,请联系客服提高场所上限",true), + SITE_NAME_REPETITION(86,"场所名重复",true), + LOCATION_LONG(87,"对不起,您的距离太远了,请靠近目的地或打开定位后重试。",true), + NO_IMPORT_DATA(88,"没有有效的数据,请检查您的导入文件。",true), + FILL_ERROR(89,"您的信息填写有误,请检查您的信息。",true), + ACCOUNT_BIND(90,"您的帐号已经绑定了,请重新进入小程序。",true), + RECORDER_NOT(91, "对不起,您不是该信息的录入者,不能修改信息。", true), + REPORT_HAD_COMPLETED(92, "报告单已经完成,不能再修改答题记录。", true), + NOT_REAL_AUTH(93,"您尚未填写基本信息,请补全信息后再试。",true), + HEALTH_TYPE_ERROR(94,"您的健康状态异常,打卡失败。",true), + NOT_HEALTH_RECORD(95,"您今天还未上报健康信息,请上报后再试。",true), + SELECT_TIME_ERROR(96,"请输入正确的查询时间",true), + TASK_PREPARATION(97,"任务已经开始了,请勿重复操作",true), + NOT_COMMENT(98,"该评论不存在",true), + NOT_MESSAGE_TYPE(99,"找不到消息类型,请检查名称是否正确",true), + NOT_LABEL(100,"标签不存在,请检查后操作",true), + REPEAT_LABEL(100,"标签已存在,请勿重复添加",true), + ; + + public CodeEnum addMsg(String msg){ + this.msg = msg+"行:"+this.msg; + return this; + } + public static CodeEnum getByCode(int code) { + for (CodeEnum codeEnum: CodeEnum.values()) { + if (codeEnum.getCode().intValue() == code) { + return codeEnum; + } + } + return null; + } + + private CodeEnum(Integer code, String msg, boolean success) { + this.code = code; + this.msg = msg; + this.success = success; + } + private Integer code; + private String msg; + private boolean success; +} + diff --git a/src/main/java/com/ccsens/opensource/wxconfigurer/util/PropUtil.java b/src/main/java/com/ccsens/opensource/wxconfigurer/util/PropUtil.java new file mode 100644 index 0000000..74c0474 --- /dev/null +++ b/src/main/java/com/ccsens/opensource/wxconfigurer/util/PropUtil.java @@ -0,0 +1,20 @@ +package com.ccsens.opensource.wxconfigurer.util; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +/** + * @description: + * @author: whj + * @time: 2020/6/10 9:51 + */ +@Component +public class PropUtil { + /**tall服务访问地址*/ + public static String TALL_DOMAIN; + @Value("${tall.domain:}") + public void setTallDomain(String tallDomain) { + PropUtil.TALL_DOMAIN = tallDomain; + } + +} diff --git a/src/main/java/com/ccsens/opensource/wxconfigurer/util/RestTemplateUtil.java b/src/main/java/com/ccsens/opensource/wxconfigurer/util/RestTemplateUtil.java new file mode 100644 index 0000000..cf3d0df --- /dev/null +++ b/src/main/java/com/ccsens/opensource/wxconfigurer/util/RestTemplateUtil.java @@ -0,0 +1,123 @@ +package com.ccsens.opensource.wxconfigurer.util; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Component; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.client.RestTemplate; + +import javax.annotation.PostConstruct; +import java.util.Map; + +@Slf4j +@Component +public class RestTemplateUtil { + + @Autowired + private RestTemplate restTemplate; + + private static RestTemplateUtil util; + + @PostConstruct + public void init(){ + util = this; + util.restTemplate = this.restTemplate; + } + + public static Object getForEntity(String url, Map params, Class returnClass) { + + if (params != null && !params.isEmpty()) { + if (!url.contains("?")) { + url += "?"; + } + for (String key : params.keySet()) { + if (url.endsWith("?")) { + url += key + "="+params.get(key)+""; + } else { + url += "&" + key + "="+params.get(key)+""; + } + } + } + log.info("url:{}, params:{}", url, params); + ResponseEntity entity = util.restTemplate.getForEntity(url, String.class); + log.info("entity:{}",entity); + return JSONObject.parseObject(entity.getBody(), returnClass); + } + public static String postBody(String url, Object params) { + log.info("路径:{}, 参数:{}", url, params); + HttpHeaders httpHeaders = new HttpHeaders(); + MediaType type= MediaType.parseMediaType("application/json;charset=UTF-8"); + httpHeaders.setContentType(type); + +// MultiValueMap map=new LinkedMultiValueMap<>(); + + JSONObject json = JSON.parseObject(JSON.toJSONString(params)); + HttpEntity> objectHttpEntity = new HttpEntity<>(json,httpHeaders); + ResponseEntity response = util.restTemplate.postForEntity(url, objectHttpEntity, String.class); + log.info("返回:{}", response); + return response.getBody(); + } + public static String postUrlEncode(String url, Object params) { + log.info("请求路径:{},请求参数:{}", url, params); + JSONObject json = JSON.parseObject(JSON.toJSONString(params)); + MultiValueMap paramMap = transMultiValueMap(json); + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); + HttpEntity formEntity = new HttpEntity<>(paramMap, headers); + ResponseEntity result = util.restTemplate.postForEntity(url, formEntity, String.class); + log.info("接口返回结果:{}", result); + return result.getBody(); + } + + /** + * 发送multipart/form-data + * @author whj + * @date 2019/8/20 + * @param url + * @param params + * @return com.alibaba.fastjson.JSONObject + */ + public static JSONObject postImg(String url, JSONObject params) { + log.info("请求路径:{},请求参数:{}", url, params); + HttpHeaders headers = new HttpHeaders(); + headers.add("Accept", MediaType.APPLICATION_JSON.toString()); + headers.setContentType(MediaType.MULTIPART_FORM_DATA); + MultiValueMap paramMap = transMultiValueMap(params); + HttpEntity formEntity = new HttpEntity<>(paramMap, headers); + JSONObject result = util.restTemplate.postForObject(url, formEntity, JSONObject.class); + log.info("接口返回结果:{}", result); + return result; + } + + /** + * 将参数封装成MultiValueMap对象 + * @author whj + * @date 2019/8/20 + * @param params + * @return org.springframework.util.MultiValueMap + */ + private static MultiValueMap transMultiValueMap(JSONObject params) { + MultiValueMap paramMap = new LinkedMultiValueMap<>(); + for (String key: params.keySet()) { + paramMap.add(key, params.get(key)); + } + return paramMap; + } + + public static boolean pageResult(String result) { + if (StrUtil.isBlank(result) || result.contains(" + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, user_id, identify_type, identifier, credential, salt, created_at, updated_at, + rec_status, register_type + + + + + delete from t_sys_auth + where id = #{id,jdbcType=BIGINT} + + + delete from t_sys_auth + + + + + + insert into t_sys_auth (id, user_id, identify_type, + identifier, credential, salt, + created_at, updated_at, rec_status, + register_type) + values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{identifyType,jdbcType=TINYINT}, + #{identifier,jdbcType=VARCHAR}, #{credential,jdbcType=VARCHAR}, #{salt,jdbcType=VARCHAR}, + #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}, + #{registerType,jdbcType=TINYINT}) + + + insert into t_sys_auth + + + id, + + + user_id, + + + identify_type, + + + identifier, + + + credential, + + + salt, + + + created_at, + + + updated_at, + + + rec_status, + + + register_type, + + + + + #{id,jdbcType=BIGINT}, + + + #{userId,jdbcType=BIGINT}, + + + #{identifyType,jdbcType=TINYINT}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{credential,jdbcType=VARCHAR}, + + + #{salt,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + #{registerType,jdbcType=TINYINT}, + + + + + + update t_sys_auth + + + id = #{record.id,jdbcType=BIGINT}, + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + identify_type = #{record.identifyType,jdbcType=TINYINT}, + + + identifier = #{record.identifier,jdbcType=VARCHAR}, + + + credential = #{record.credential,jdbcType=VARCHAR}, + + + salt = #{record.salt,jdbcType=VARCHAR}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + register_type = #{record.registerType,jdbcType=TINYINT}, + + + + + + + + update t_sys_auth + set id = #{record.id,jdbcType=BIGINT}, + user_id = #{record.userId,jdbcType=BIGINT}, + identify_type = #{record.identifyType,jdbcType=TINYINT}, + identifier = #{record.identifier,jdbcType=VARCHAR}, + credential = #{record.credential,jdbcType=VARCHAR}, + salt = #{record.salt,jdbcType=VARCHAR}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT}, + register_type = #{record.registerType,jdbcType=TINYINT} + + + + + + update t_sys_auth + + + user_id = #{userId,jdbcType=BIGINT}, + + + identify_type = #{identifyType,jdbcType=TINYINT}, + + + identifier = #{identifier,jdbcType=VARCHAR}, + + + credential = #{credential,jdbcType=VARCHAR}, + + + salt = #{salt,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + register_type = #{registerType,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_sys_auth + set user_id = #{userId,jdbcType=BIGINT}, + identify_type = #{identifyType,jdbcType=TINYINT}, + identifier = #{identifier,jdbcType=VARCHAR}, + credential = #{credential,jdbcType=VARCHAR}, + salt = #{salt,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT}, + register_type = #{registerType,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper_raw/SysUserMapper.xml b/src/main/resources/mapper_raw/SysUserMapper.xml new file mode 100644 index 0000000..49e8b2e --- /dev/null +++ b/src/main/resources/mapper_raw/SysUserMapper.xml @@ -0,0 +1,400 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, grade_id, avatar_url, nickname, gender, country, province, city, language, phone, + wechat, email, balance, created_at, updated_at, rec_status, source + + + + + delete from t_sys_user + where id = #{id,jdbcType=BIGINT} + + + delete from t_sys_user + + + + + + insert into t_sys_user (id, grade_id, avatar_url, + nickname, gender, country, + province, city, language, + phone, wechat, email, + balance, created_at, updated_at, + rec_status, source) + values (#{id,jdbcType=BIGINT}, #{gradeId,jdbcType=BIGINT}, #{avatarUrl,jdbcType=VARCHAR}, + #{nickname,jdbcType=VARCHAR}, #{gender,jdbcType=TINYINT}, #{country,jdbcType=VARCHAR}, + #{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{language,jdbcType=VARCHAR}, + #{phone,jdbcType=VARCHAR}, #{wechat,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, + #{balance,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, + #{recStatus,jdbcType=TINYINT}, #{source,jdbcType=TINYINT}) + + + insert into t_sys_user + + + id, + + + grade_id, + + + avatar_url, + + + nickname, + + + gender, + + + country, + + + province, + + + city, + + + language, + + + phone, + + + wechat, + + + email, + + + balance, + + + created_at, + + + updated_at, + + + rec_status, + + + source, + + + + + #{id,jdbcType=BIGINT}, + + + #{gradeId,jdbcType=BIGINT}, + + + #{avatarUrl,jdbcType=VARCHAR}, + + + #{nickname,jdbcType=VARCHAR}, + + + #{gender,jdbcType=TINYINT}, + + + #{country,jdbcType=VARCHAR}, + + + #{province,jdbcType=VARCHAR}, + + + #{city,jdbcType=VARCHAR}, + + + #{language,jdbcType=VARCHAR}, + + + #{phone,jdbcType=VARCHAR}, + + + #{wechat,jdbcType=VARCHAR}, + + + #{email,jdbcType=VARCHAR}, + + + #{balance,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + #{source,jdbcType=TINYINT}, + + + + + + update t_sys_user + + + id = #{record.id,jdbcType=BIGINT}, + + + grade_id = #{record.gradeId,jdbcType=BIGINT}, + + + avatar_url = #{record.avatarUrl,jdbcType=VARCHAR}, + + + nickname = #{record.nickname,jdbcType=VARCHAR}, + + + gender = #{record.gender,jdbcType=TINYINT}, + + + country = #{record.country,jdbcType=VARCHAR}, + + + province = #{record.province,jdbcType=VARCHAR}, + + + city = #{record.city,jdbcType=VARCHAR}, + + + language = #{record.language,jdbcType=VARCHAR}, + + + phone = #{record.phone,jdbcType=VARCHAR}, + + + wechat = #{record.wechat,jdbcType=VARCHAR}, + + + email = #{record.email,jdbcType=VARCHAR}, + + + balance = #{record.balance,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + source = #{record.source,jdbcType=TINYINT}, + + + + + + + + update t_sys_user + set id = #{record.id,jdbcType=BIGINT}, + grade_id = #{record.gradeId,jdbcType=BIGINT}, + avatar_url = #{record.avatarUrl,jdbcType=VARCHAR}, + nickname = #{record.nickname,jdbcType=VARCHAR}, + gender = #{record.gender,jdbcType=TINYINT}, + country = #{record.country,jdbcType=VARCHAR}, + province = #{record.province,jdbcType=VARCHAR}, + city = #{record.city,jdbcType=VARCHAR}, + language = #{record.language,jdbcType=VARCHAR}, + phone = #{record.phone,jdbcType=VARCHAR}, + wechat = #{record.wechat,jdbcType=VARCHAR}, + email = #{record.email,jdbcType=VARCHAR}, + balance = #{record.balance,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT}, + source = #{record.source,jdbcType=TINYINT} + + + + + + update t_sys_user + + + grade_id = #{gradeId,jdbcType=BIGINT}, + + + avatar_url = #{avatarUrl,jdbcType=VARCHAR}, + + + nickname = #{nickname,jdbcType=VARCHAR}, + + + gender = #{gender,jdbcType=TINYINT}, + + + country = #{country,jdbcType=VARCHAR}, + + + province = #{province,jdbcType=VARCHAR}, + + + city = #{city,jdbcType=VARCHAR}, + + + language = #{language,jdbcType=VARCHAR}, + + + phone = #{phone,jdbcType=VARCHAR}, + + + wechat = #{wechat,jdbcType=VARCHAR}, + + + email = #{email,jdbcType=VARCHAR}, + + + balance = #{balance,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + source = #{source,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_sys_user + set grade_id = #{gradeId,jdbcType=BIGINT}, + avatar_url = #{avatarUrl,jdbcType=VARCHAR}, + nickname = #{nickname,jdbcType=VARCHAR}, + gender = #{gender,jdbcType=TINYINT}, + country = #{country,jdbcType=VARCHAR}, + province = #{province,jdbcType=VARCHAR}, + city = #{city,jdbcType=VARCHAR}, + language = #{language,jdbcType=VARCHAR}, + phone = #{phone,jdbcType=VARCHAR}, + wechat = #{wechat,jdbcType=VARCHAR}, + email = #{email,jdbcType=VARCHAR}, + balance = #{balance,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT}, + source = #{source,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mbg.xml b/src/main/resources/mbg.xml index 6c2981a..b77097d 100644 --- a/src/main/resources/mbg.xml +++ b/src/main/resources/mbg.xml @@ -21,7 +21,7 @@ @@ -33,7 +33,7 @@ - @@ -50,58 +50,57 @@ + -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - +
+