Commit 80514973 authored by shiyu's avatar shiyu

公众号通知回调

parent e065d866
package com.wwdz.ch.db.dao.qiandao;
import com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecord;
public interface QdOfficialAccountSubscribeRecordDao {
boolean insert(QdOfficialAccountSubscribeRecord officialAccountSubscribeRecord);
boolean update(QdOfficialAccountSubscribeRecord officialAccountSubscribeRecord);
boolean isExisted(String openid);
boolean isSubscribed(String unionid);
QdOfficialAccountSubscribeRecord findOne(String unionid);
}
package com.wwdz.ch.db.domain.qiandao;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
* @author shiyu
* @date 2025/01/08
*/
@Data
public class QdOfficialAccountSubscribeRecord implements Entity {
private Integer id;
/**
* openid
*/
private String openid;
/**
* unionid
*/
private String unionid;
/**
* 平台类型(1微信,2支付宝,3其他)
*/
private Integer platformType;
/**
* 手机号
*/
private String phone;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 是否有效0无效,1有效
*/
private Integer enabled;
private static final long serialVersionUID = 1L;
@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(", openid=").append(openid);
sb.append(", unionid=").append(unionid);
sb.append(", platformType=").append(platformType);
sb.append(", phone=").append(phone);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", enabled=").append(enabled);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
QdOfficialAccountSubscribeRecord other = (QdOfficialAccountSubscribeRecord) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getOpenid() == null ? other.getOpenid() == null : this.getOpenid().equals(other.getOpenid()))
&& (this.getUnionid() == null ? other.getUnionid() == null : this.getUnionid().equals(other.getUnionid()))
&& (this.getPlatformType() == null ? other.getPlatformType() == null : this.getPlatformType().equals(other.getPlatformType()))
&& (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getEnabled() == null ? other.getEnabled() == null : this.getEnabled().equals(other.getEnabled()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getOpenid() == null) ? 0 : getOpenid().hashCode());
result = prime * result + ((getUnionid() == null) ? 0 : getUnionid().hashCode());
result = prime * result + ((getPlatformType() == null) ? 0 : getPlatformType().hashCode());
result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getEnabled() == null) ? 0 : getEnabled().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER", false),
openid("openid", "openid", "VARCHAR", false),
unionid("unionid", "unionid", "VARCHAR", false),
platformType("platform_type", "platformType", "INTEGER", false),
phone("phone", "phone", "VARCHAR", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false),
enabled("enabled", "enabled", "INTEGER", false);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String BEGINNING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String ENDING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String column;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final boolean isColumnNameDelimited;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String javaProperty;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String jdbcType;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String value() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getValue() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJavaProperty() {
return this.javaProperty;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJdbcType() {
return this.jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
}
}
\ No newline at end of file
package com.wwdz.ch.db.domain.qiandao;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class QdOfficialAccountSubscribeRecordExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public QdOfficialAccountSubscribeRecordExample() {
oredCriteria = new ArrayList<Criteria>();
}
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<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public QdOfficialAccountSubscribeRecordExample orderBy(String orderByClause) {
this.setOrderByClause(orderByClause);
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public QdOfficialAccountSubscribeRecordExample orderBy(String ... orderByClauses) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < orderByClauses.length; i++) {
sb.append(orderByClauses[i]);
if (i < orderByClauses.length - 1) {
sb.append(" , ");
}
}
this.setOrderByClause(sb.toString());
return this;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria(this);
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Criteria newAndCreateCriteria() {
QdOfficialAccountSubscribeRecordExample example = new QdOfficialAccountSubscribeRecordExample();
return example.createCriteria();
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> 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(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdNotEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanOrEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanOrEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andOpenidIsNull() {
addCriterion("openid is null");
return (Criteria) this;
}
public Criteria andOpenidIsNotNull() {
addCriterion("openid is not null");
return (Criteria) this;
}
public Criteria andOpenidEqualTo(String value) {
addCriterion("openid =", value, "openid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenidEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("openid = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOpenidNotEqualTo(String value) {
addCriterion("openid <>", value, "openid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenidNotEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("openid <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOpenidGreaterThan(String value) {
addCriterion("openid >", value, "openid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenidGreaterThanColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("openid > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOpenidGreaterThanOrEqualTo(String value) {
addCriterion("openid >=", value, "openid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenidGreaterThanOrEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("openid >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOpenidLessThan(String value) {
addCriterion("openid <", value, "openid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenidLessThanColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("openid < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOpenidLessThanOrEqualTo(String value) {
addCriterion("openid <=", value, "openid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenidLessThanOrEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("openid <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOpenidLike(String value) {
addCriterion("openid like", value, "openid");
return (Criteria) this;
}
public Criteria andOpenidNotLike(String value) {
addCriterion("openid not like", value, "openid");
return (Criteria) this;
}
public Criteria andOpenidIn(List<String> values) {
addCriterion("openid in", values, "openid");
return (Criteria) this;
}
public Criteria andOpenidNotIn(List<String> values) {
addCriterion("openid not in", values, "openid");
return (Criteria) this;
}
public Criteria andOpenidBetween(String value1, String value2) {
addCriterion("openid between", value1, value2, "openid");
return (Criteria) this;
}
public Criteria andOpenidNotBetween(String value1, String value2) {
addCriterion("openid not between", value1, value2, "openid");
return (Criteria) this;
}
public Criteria andUnionidIsNull() {
addCriterion("unionid is null");
return (Criteria) this;
}
public Criteria andUnionidIsNotNull() {
addCriterion("unionid is not null");
return (Criteria) this;
}
public Criteria andUnionidEqualTo(String value) {
addCriterion("unionid =", value, "unionid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUnionidEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("unionid = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUnionidNotEqualTo(String value) {
addCriterion("unionid <>", value, "unionid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUnionidNotEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("unionid <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUnionidGreaterThan(String value) {
addCriterion("unionid >", value, "unionid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUnionidGreaterThanColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("unionid > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUnionidGreaterThanOrEqualTo(String value) {
addCriterion("unionid >=", value, "unionid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUnionidGreaterThanOrEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("unionid >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUnionidLessThan(String value) {
addCriterion("unionid <", value, "unionid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUnionidLessThanColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("unionid < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUnionidLessThanOrEqualTo(String value) {
addCriterion("unionid <=", value, "unionid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUnionidLessThanOrEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("unionid <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUnionidLike(String value) {
addCriterion("unionid like", value, "unionid");
return (Criteria) this;
}
public Criteria andUnionidNotLike(String value) {
addCriterion("unionid not like", value, "unionid");
return (Criteria) this;
}
public Criteria andUnionidIn(List<String> values) {
addCriterion("unionid in", values, "unionid");
return (Criteria) this;
}
public Criteria andUnionidNotIn(List<String> values) {
addCriterion("unionid not in", values, "unionid");
return (Criteria) this;
}
public Criteria andUnionidBetween(String value1, String value2) {
addCriterion("unionid between", value1, value2, "unionid");
return (Criteria) this;
}
public Criteria andUnionidNotBetween(String value1, String value2) {
addCriterion("unionid not between", value1, value2, "unionid");
return (Criteria) this;
}
public Criteria andPlatformTypeIsNull() {
addCriterion("platform_type is null");
return (Criteria) this;
}
public Criteria andPlatformTypeIsNotNull() {
addCriterion("platform_type is not null");
return (Criteria) this;
}
public Criteria andPlatformTypeEqualTo(Integer value) {
addCriterion("platform_type =", value, "platformType");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPlatformTypeEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("platform_type = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPlatformTypeNotEqualTo(Integer value) {
addCriterion("platform_type <>", value, "platformType");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPlatformTypeNotEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("platform_type <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPlatformTypeGreaterThan(Integer value) {
addCriterion("platform_type >", value, "platformType");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPlatformTypeGreaterThanColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("platform_type > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPlatformTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("platform_type >=", value, "platformType");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPlatformTypeGreaterThanOrEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("platform_type >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPlatformTypeLessThan(Integer value) {
addCriterion("platform_type <", value, "platformType");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPlatformTypeLessThanColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("platform_type < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPlatformTypeLessThanOrEqualTo(Integer value) {
addCriterion("platform_type <=", value, "platformType");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPlatformTypeLessThanOrEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("platform_type <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPlatformTypeIn(List<Integer> values) {
addCriterion("platform_type in", values, "platformType");
return (Criteria) this;
}
public Criteria andPlatformTypeNotIn(List<Integer> values) {
addCriterion("platform_type not in", values, "platformType");
return (Criteria) this;
}
public Criteria andPlatformTypeBetween(Integer value1, Integer value2) {
addCriterion("platform_type between", value1, value2, "platformType");
return (Criteria) this;
}
public Criteria andPlatformTypeNotBetween(Integer value1, Integer value2) {
addCriterion("platform_type not between", value1, value2, "platformType");
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;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPhoneEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("phone = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPhoneNotEqualTo(String value) {
addCriterion("phone <>", value, "phone");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPhoneNotEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("phone <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPhoneGreaterThan(String value) {
addCriterion("phone >", value, "phone");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPhoneGreaterThanColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("phone > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPhoneGreaterThanOrEqualTo(String value) {
addCriterion("phone >=", value, "phone");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPhoneGreaterThanOrEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("phone >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPhoneLessThan(String value) {
addCriterion("phone <", value, "phone");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPhoneLessThanColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("phone < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPhoneLessThanOrEqualTo(String value) {
addCriterion("phone <=", value, "phone");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPhoneLessThanOrEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("phone <= ").append(column.getEscapedColumnName()).toString());
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<String> values) {
addCriterion("phone in", values, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotIn(List<String> 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 andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("create_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeNotEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("create_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("create_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanOrEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("create_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("create_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanOrEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("create_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("update_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeNotEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("update_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("update_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanOrEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("update_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("update_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanOrEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("update_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andEnabledIsNull() {
addCriterion("enabled is null");
return (Criteria) this;
}
public Criteria andEnabledIsNotNull() {
addCriterion("enabled is not null");
return (Criteria) this;
}
public Criteria andEnabledEqualTo(Integer value) {
addCriterion("enabled =", value, "enabled");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEnabledEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("enabled = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEnabledNotEqualTo(Integer value) {
addCriterion("enabled <>", value, "enabled");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEnabledNotEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("enabled <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEnabledGreaterThan(Integer value) {
addCriterion("enabled >", value, "enabled");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEnabledGreaterThanColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("enabled > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEnabledGreaterThanOrEqualTo(Integer value) {
addCriterion("enabled >=", value, "enabled");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEnabledGreaterThanOrEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("enabled >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEnabledLessThan(Integer value) {
addCriterion("enabled <", value, "enabled");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEnabledLessThanColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("enabled < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEnabledLessThanOrEqualTo(Integer value) {
addCriterion("enabled <=", value, "enabled");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEnabledLessThanOrEqualToColumn(QdOfficialAccountSubscribeRecord.Column column) {
addCriterion(new StringBuilder("enabled <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEnabledIn(List<Integer> values) {
addCriterion("enabled in", values, "enabled");
return (Criteria) this;
}
public Criteria andEnabledNotIn(List<Integer> values) {
addCriterion("enabled not in", values, "enabled");
return (Criteria) this;
}
public Criteria andEnabledBetween(Integer value1, Integer value2) {
addCriterion("enabled between", value1, value2, "enabled");
return (Criteria) this;
}
public Criteria andEnabledNotBetween(Integer value1, Integer value2) {
addCriterion("enabled not between", value1, value2, "enabled");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private QdOfficialAccountSubscribeRecordExample example;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
protected Criteria(QdOfficialAccountSubscribeRecordExample example) {
super();
this.example = example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public QdOfficialAccountSubscribeRecordExample example() {
return this.example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIf(boolean ifAdd, ICriteriaAdd add) {
if (ifAdd) {
add.add(this);
}
return this;
}
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public interface ICriteriaAdd {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Criteria add(Criteria add);
}
}
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
package com.wwdz.ch.db.impl.qiandao;
import com.wwdz.ch.db.dao.qiandao.QdOfficialAccountSubscribeRecordDao;
import com.wwdz.ch.db.domain.OfficialAccountSubscribeRecord;
import com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecord;
import com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecordExample;
import com.wwdz.ch.db.mapper.qiandao.QdOfficialAccountSubscribeRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class QdOfficialAccountSubscribeRecordDaoImpl implements QdOfficialAccountSubscribeRecordDao {
@Autowired
QdOfficialAccountSubscribeRecordMapper qdOfficialAccountSubscribeRecordMapper;
@Override
public boolean insert(QdOfficialAccountSubscribeRecord officialAccountSubscribeRecord) {
return qdOfficialAccountSubscribeRecordMapper.insert(officialAccountSubscribeRecord) > 0;
}
@Override
public boolean update(QdOfficialAccountSubscribeRecord officialAccountSubscribeRecord) {
QdOfficialAccountSubscribeRecordExample example = new QdOfficialAccountSubscribeRecordExample();
QdOfficialAccountSubscribeRecordExample.Criteria criteria = example.createCriteria();
criteria.andOpenidEqualTo(officialAccountSubscribeRecord.getOpenid());
return qdOfficialAccountSubscribeRecordMapper.updateByExampleSelective(officialAccountSubscribeRecord, example) > 0;
}
@Override
public boolean isExisted(String openid) {
QdOfficialAccountSubscribeRecordExample example = new QdOfficialAccountSubscribeRecordExample();
QdOfficialAccountSubscribeRecordExample.Criteria criteria = example.createCriteria();
criteria.andOpenidEqualTo(openid);
return qdOfficialAccountSubscribeRecordMapper.countByExample(example) > 0;
}
@Override
public boolean isSubscribed(String unionid) {
QdOfficialAccountSubscribeRecordExample example = new QdOfficialAccountSubscribeRecordExample();
QdOfficialAccountSubscribeRecordExample.Criteria criteria = example.createCriteria();
criteria.andUnionidEqualTo(unionid);
criteria.andEnabledEqualTo(1);
return qdOfficialAccountSubscribeRecordMapper.countByExample(example) > 0;
}
@Override
public QdOfficialAccountSubscribeRecord findOne(String unionid) {
QdOfficialAccountSubscribeRecordExample example = new QdOfficialAccountSubscribeRecordExample();
QdOfficialAccountSubscribeRecordExample.Criteria criteria = example.createCriteria();
criteria.andUnionidEqualTo(unionid);
return qdOfficialAccountSubscribeRecordMapper.selectOneByExample(example);
}
}
package com.wwdz.ch.db.mapper.qiandao;
import com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecord;
import com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface QdOfficialAccountSubscribeRecordMapper {
long countByExample(QdOfficialAccountSubscribeRecordExample example);
int deleteByExample(QdOfficialAccountSubscribeRecordExample example);
int deleteByPrimaryKey(Integer id);
int insert(QdOfficialAccountSubscribeRecord record);
int insertSelective(QdOfficialAccountSubscribeRecord record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
QdOfficialAccountSubscribeRecord selectOneByExample(QdOfficialAccountSubscribeRecordExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
QdOfficialAccountSubscribeRecord selectOneByExampleSelective(@Param("example") QdOfficialAccountSubscribeRecordExample example, @Param("selective") QdOfficialAccountSubscribeRecord.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<QdOfficialAccountSubscribeRecord> selectByExampleSelective(@Param("example") QdOfficialAccountSubscribeRecordExample example, @Param("selective") QdOfficialAccountSubscribeRecord.Column ... selective);
List<QdOfficialAccountSubscribeRecord> selectByExample(QdOfficialAccountSubscribeRecordExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_official_account_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
QdOfficialAccountSubscribeRecord selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") QdOfficialAccountSubscribeRecord.Column ... selective);
QdOfficialAccountSubscribeRecord selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") QdOfficialAccountSubscribeRecord record, @Param("example") QdOfficialAccountSubscribeRecordExample example);
int updateByExample(@Param("record") QdOfficialAccountSubscribeRecord record, @Param("example") QdOfficialAccountSubscribeRecordExample example);
int updateByPrimaryKeySelective(QdOfficialAccountSubscribeRecord record);
int updateByPrimaryKey(QdOfficialAccountSubscribeRecord record);
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.wwdz.ch.db.mapper.qiandao.QdOfficialAccountSubscribeRecordMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecord">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="openid" jdbcType="VARCHAR" property="openid" />
<result column="unionid" jdbcType="VARCHAR" property="unionid" />
<result column="platform_type" jdbcType="INTEGER" property="platformType" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="enabled" jdbcType="INTEGER" property="enabled" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, openid, unionid, platform_type, phone, create_time, update_time, enabled
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecordExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from qd_official_account_subscribe_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<if test="example.distinct">
distinct
</if>
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, openid, unionid, platform_type, phone, create_time, update_time, enabled
</otherwise>
</choose>
from qd_official_account_subscribe_record
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from qd_official_account_subscribe_record
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, openid, unionid, platform_type, phone, create_time, update_time, enabled
</otherwise>
</choose>
from qd_official_account_subscribe_record
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from qd_official_account_subscribe_record
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecordExample">
delete from qd_official_account_subscribe_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecord">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into qd_official_account_subscribe_record (openid, unionid, platform_type,
phone, create_time, update_time,
enabled)
values (#{openid,jdbcType=VARCHAR}, #{unionid,jdbcType=VARCHAR}, #{platformType,jdbcType=INTEGER},
#{phone,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{enabled,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecord">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into qd_official_account_subscribe_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="openid != null">
openid,
</if>
<if test="unionid != null">
unionid,
</if>
<if test="platformType != null">
platform_type,
</if>
<if test="phone != null">
phone,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="enabled != null">
enabled,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="openid != null">
#{openid,jdbcType=VARCHAR},
</if>
<if test="unionid != null">
#{unionid,jdbcType=VARCHAR},
</if>
<if test="platformType != null">
#{platformType,jdbcType=INTEGER},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="enabled != null">
#{enabled,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecordExample" resultType="java.lang.Long">
select count(*) from qd_official_account_subscribe_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update qd_official_account_subscribe_record
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.openid != null">
openid = #{record.openid,jdbcType=VARCHAR},
</if>
<if test="record.unionid != null">
unionid = #{record.unionid,jdbcType=VARCHAR},
</if>
<if test="record.platformType != null">
platform_type = #{record.platformType,jdbcType=INTEGER},
</if>
<if test="record.phone != null">
phone = #{record.phone,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.enabled != null">
enabled = #{record.enabled,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update qd_official_account_subscribe_record
set id = #{record.id,jdbcType=INTEGER},
openid = #{record.openid,jdbcType=VARCHAR},
unionid = #{record.unionid,jdbcType=VARCHAR},
platform_type = #{record.platformType,jdbcType=INTEGER},
phone = #{record.phone,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
enabled = #{record.enabled,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecord">
update qd_official_account_subscribe_record
<set>
<if test="openid != null">
openid = #{openid,jdbcType=VARCHAR},
</if>
<if test="unionid != null">
unionid = #{unionid,jdbcType=VARCHAR},
</if>
<if test="platformType != null">
platform_type = #{platformType,jdbcType=INTEGER},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="enabled != null">
enabled = #{enabled,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecord">
update qd_official_account_subscribe_record
set openid = #{openid,jdbcType=VARCHAR},
unionid = #{unionid,jdbcType=VARCHAR},
platform_type = #{platformType,jdbcType=INTEGER},
phone = #{phone,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
enabled = #{enabled,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecordExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<include refid="Base_Column_List" />
from qd_official_account_subscribe_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
limit 1
</select>
<select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, openid, unionid, platform_type, phone, create_time, update_time, enabled
</otherwise>
</choose>
from qd_official_account_subscribe_record
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
limit 1
</select>
</mapper>
\ No newline at end of file
......@@ -72,7 +72,7 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.qiandao"
targetProject="ch-dao/src/main/java"/>
<table tableName="qd_user_sign_in_task" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<table tableName="qd_official_account_subscribe_record" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table>
......
......@@ -3,27 +3,23 @@ package com.wwdz.ch.wx.api;
import com.wwdz.ch.core.api.QdOfficialAccountApi;
import com.wwdz.ch.core.consts.OfficalAccountEnum;
import com.wwdz.ch.core.entity.ConsignSaleSubscribeMsg;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dao.qiandao.QdUserDao;
import com.wwdz.ch.db.domain.OfficialAccountSubscribeRecord;
import com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecord;
import com.wwdz.ch.db.domain.qiandao.QdUser;
import com.wwdz.ch.wx.api.aes.AesException;
import com.wwdz.ch.wx.api.aes.WXBizMsgCrypt;
import com.wwdz.ch.wx.service.OfficialAccountSubscribeRecordService;
import com.wwdz.ch.wx.service.qiandao.QdOfficialAccountSubscribeRecordService;
import com.xxdxxs.utils.StringUtils;
import com.xxdxxs.utils.XmlUtils;
import io.swagger.annotations.ApiOperation;
import org.dom4j.DocumentException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
......@@ -62,7 +58,7 @@ public class QdOfficialAccountCallbackController {
QdOfficialAccountApi qdOfficialAccountApi;
@Autowired
OfficialAccountSubscribeRecordService officialAccountSubscribeRecordService;
QdOfficialAccountSubscribeRecordService qdOfficialAccountSubscribeRecordService;
@Autowired
QdUserDao qdUserDao;
......@@ -102,8 +98,8 @@ public class QdOfficialAccountCallbackController {
Date date = new Date(Long.valueOf(createTime) * 1000L);
logger.info("解析xml得到 openId:{}, event :{}, time:{}", userOpenId, event, date);
//新增或更新订阅记录
OfficialAccountSubscribeRecord officialAccountSubscribeRecord = new OfficialAccountSubscribeRecord();
officialAccountSubscribeRecord.setOpenid(userOpenId);
QdOfficialAccountSubscribeRecord qdOfficialAccountSubscribeRecord = new QdOfficialAccountSubscribeRecord();
qdOfficialAccountSubscribeRecord.setOpenid(userOpenId);
if (SUBSCRIBE_EVENT.equals(event)) {
//只有关注了公众号,才可以通过根据openid获取unionid
String unionid = qdOfficialAccountApi.getUnionidByOpenid(userOpenId);
......@@ -111,24 +107,24 @@ public class QdOfficialAccountCallbackController {
QdUser user = qdUserDao.getUserByUnionId(unionid);
if (user != null) {
logger.info("根据unionid查询手机号, unionid :{}, phone : {}", unionid, user.getMobile());
officialAccountSubscribeRecord.setPhone(user.getMobile());
qdOfficialAccountSubscribeRecord.setPhone(user.getMobile());
}
officialAccountSubscribeRecord.setUnionid(unionid);
officialAccountSubscribeRecord.setEnabled(1);
qdOfficialAccountSubscribeRecord.setUnionid(unionid);
qdOfficialAccountSubscribeRecord.setEnabled(1);
} else {
officialAccountSubscribeRecord.setEnabled(0);
qdOfficialAccountSubscribeRecord.setEnabled(0);
}
//查询有无历史订阅记录
boolean isExisted = officialAccountSubscribeRecordService.isExisted(userOpenId);
boolean isExisted = qdOfficialAccountSubscribeRecordService.isExisted(userOpenId);
if (isExisted) {
officialAccountSubscribeRecord.setUpdateTime(date);
officialAccountSubscribeRecordService.update(officialAccountSubscribeRecord);
qdOfficialAccountSubscribeRecord.setUpdateTime(date);
qdOfficialAccountSubscribeRecordService.update(qdOfficialAccountSubscribeRecord);
} else {
//没有历史订阅记录
officialAccountSubscribeRecord.setCreateTime(date);
officialAccountSubscribeRecord.setUpdateTime(date);
officialAccountSubscribeRecord.setPlatformType(OfficalAccountEnum.PlatformTypeEnum.WECHAT.getCode());
officialAccountSubscribeRecordService.insert(officialAccountSubscribeRecord);
qdOfficialAccountSubscribeRecord.setCreateTime(date);
qdOfficialAccountSubscribeRecord.setUpdateTime(date);
qdOfficialAccountSubscribeRecord.setPlatformType(OfficalAccountEnum.PlatformTypeEnum.WECHAT.getCode());
qdOfficialAccountSubscribeRecordService.insert(qdOfficialAccountSubscribeRecord);
}
logger.info("=============== 更新订阅公众号记录成功 ==============");
} else if (SUBSCRIBE_MSG_POPUP_EVENT.equals(event)) {
......
......@@ -40,6 +40,9 @@ public class QdHomePageServiceImpl implements QdHomePageService {
@Autowired
QdUserSignInDao qdUserSignInDao;
@Autowired
QdOfficialAccountSubscribeRecordDao qdOfficialAccountSubscribeRecordDao;
@Override
public Result findUserInfo(QdHomePageRequestDto dto) {
try {
......@@ -62,6 +65,14 @@ public class QdHomePageServiceImpl implements QdHomePageService {
List<SignInTask> signInTaskList = signInTaskDao.findDataByPage(signInTaskRequestDto);
map.put("taskList", signInTaskList);
}
//用户是否订阅公众号
String unionid = qdUser.getWxUnionid();
if (StringUtils.hasLength(unionid)) {
boolean flag = qdOfficialAccountSubscribeRecordDao.isSubscribed(unionid);
map.put("isSubscribed", flag);
} else {
map.put("isSubscribed", false);
}
return Result.success(map);
} catch (Exception e) {
logger.error("查询乾岛首页用户信息失败 error:{}", e);
......
package com.wwdz.ch.wx.impl.qiandao;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dao.qiandao.QdOfficialAccountSubscribeRecordDao;
import com.wwdz.ch.db.domain.OfficialAccountSubscribeRecord;
import com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecord;
import com.wwdz.ch.wx.service.qiandao.QdOfficialAccountSubscribeRecordService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
@Service
public class QdOfficialAccountSubscribeRecordServiceImpl implements QdOfficialAccountSubscribeRecordService {
private static final Logger logger = LoggerFactory.getLogger(QdOfficialAccountSubscribeRecordServiceImpl.class);
private static final String OFFICAL_ACCOUNT_URL = "https://mp.weixin.qq.com/s?__biz=Mzk0MDY4NjkxOQ==&mid=2247485269&idx=1&sn=244235b56cf8632e6ca7184efdb8c82f&chksm=c2dcac7df5ab256ba2c966616168501680a0d8b4625f3c637244f01355fbe34c2c37f7b047ce#rd";
@Autowired
QdOfficialAccountSubscribeRecordDao qdOfficialAccountSubscribeRecordDao;
@Override
public Result insert(QdOfficialAccountSubscribeRecord qdOfficialAccountSubscribeRecord) {
try {
qdOfficialAccountSubscribeRecordDao.insert(qdOfficialAccountSubscribeRecord);
return Result.success();
} catch (Exception e) {
logger.error("新增公众号订阅记录出错:{}", e);
}
return Result.failed();
}
@Override
public Result update(QdOfficialAccountSubscribeRecord qdOfficialAccountSubscribeRecord) {
try {
qdOfficialAccountSubscribeRecordDao.update(qdOfficialAccountSubscribeRecord);
return Result.success();
} catch (Exception e) {
logger.error("新增公众号订阅记录出错:{}", e);
}
return Result.failed();
}
@Override
public boolean isExisted(String openid) {
return qdOfficialAccountSubscribeRecordDao.isExisted(openid);
}
@Override
public Result isSubscribed(String unionid) {
try {
boolean flag = qdOfficialAccountSubscribeRecordDao.isSubscribed(unionid);
Map<String, Object> map = new HashMap<>();
// map.put("isSubscribed", flag);
//暂时先默认为关注
map.put("isSubscribed", true);
map.put("url", OFFICAL_ACCOUNT_URL);
return Result.success(map);
} catch (Exception e) {
logger.error("isSubscribed error :{}", e);
}
return Result.failed();
}
@Override
public Result findOne(String unionid) {
try {
QdOfficialAccountSubscribeRecord officialAccountSubscribeRecord = qdOfficialAccountSubscribeRecordDao.findOne(unionid);
return Result.success(officialAccountSubscribeRecord);
} catch (Exception e) {
logger.error("findOne error :{}", e);
}
return Result.failed();
}
}
package com.wwdz.ch.wx.service.qiandao;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.domain.OfficialAccountSubscribeRecord;
import com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecord;
public interface QdOfficialAccountSubscribeRecordService {
Result insert(QdOfficialAccountSubscribeRecord officialAccountSubscribeRecord);
Result update(QdOfficialAccountSubscribeRecord officialAccountSubscribeRecord);
/**
* 是否有历史订阅记录
* @param openid
* @return
*/
boolean isExisted(String openid);
/**
* 是否关注过公众号
* @param openid
* @return
*/
Result isSubscribed(String openid);
Result findOne(String openid);
}
package com.wwdz.ch.wx.web.qiandao;
import com.alibaba.fastjson.JSON;
import com.wwdz.ch.core.api.OfficialAccountApi;
import com.wwdz.ch.core.consts.ResultCode;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.domain.User;
import com.wwdz.ch.db.domain.qiandao.QdUser;
import com.wwdz.ch.db.dto.request.UserRequestDto;
import com.wwdz.ch.db.dto.request.qiandao.QdUserRequestDto;
import com.wwdz.ch.wx.service.qiandao.QdOfficialAccountSubscribeRecordService;
import com.wwdz.ch.wx.service.qiandao.QdUserService;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/wx/qdOfficialAccount")
public class QdOfficialAccountController {
private static final Logger logger = LoggerFactory.getLogger(QdOfficialAccountController.class);
@Autowired
QdOfficialAccountSubscribeRecordService qdOfficialAccountSubscribeRecordService;
@Autowired
QdUserService qdUserService;
@ApiOperation(value = "判断用户是否关注过公众号")
@PostMapping("/isSubscribed")
public Result isSubscribed(@RequestBody QdUserRequestDto dto) {
logger.info("【请求开始】判断用户是否关注过公众号,请求参数:{}", JSON.toJSONString(dto));
if (StringUtils.isEmpty(dto.getUserId())) {
return Result.failed(ResultCode.PARAM_ERROR);
}
Result<QdUser> result = qdUserService.queryUserInfo(dto);
String unionid = null;
if (result.getSuccess() && result.getData() != null) {
unionid = result.getData().getWxUnionid();
}
if (unionid == null) {
return Result.failed("该用户没有记录下unionid");
}
return qdOfficialAccountSubscribeRecordService.isSubscribed(unionid);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment