Commit b52c1d5d authored by shiyu's avatar shiyu

订阅消息

parent 1c61d217
...@@ -16,6 +16,9 @@ public class DisposableSubscribeRecordEnum { ...@@ -16,6 +16,9 @@ public class DisposableSubscribeRecordEnum {
GROUPPURASE_CLOSER_TO_SUCCESS(5, "ekZ3s3OL6ZlWnORvvMOONfWNZsbm6DTlMNyv_2j2ijk", "拼团待成团提醒"), GROUPPURASE_CLOSER_TO_SUCCESS(5, "ekZ3s3OL6ZlWnORvvMOONfWNZsbm6DTlMNyv_2j2ijk", "拼团待成团提醒"),
GROUPPURASE_RATE(6, "nmpPtwVrFo261tcRbMvCK8NeAztDnrUubwh-04J4_Ow", "拼团进度提醒"), GROUPPURASE_RATE(6, "nmpPtwVrFo261tcRbMvCK8NeAztDnrUubwh-04J4_Ow", "拼团进度提醒"),
SIGN_IN_REMIND(7, "bFVaiBLSMYQBfIrDpYZpwuWzh8IriIVhSdZrY0ewlWk", "签到提醒"), SIGN_IN_REMIND(7, "bFVaiBLSMYQBfIrDpYZpwuWzh8IriIVhSdZrY0ewlWk", "签到提醒"),
//乾岛模板
QIANDAO_SIGN_IN(30, "pRwhVGkfCkwzLYnCMw_Py3Hm74SLYPQUOFSxKXJSDYU", "签到订阅"),
; ;
private int type; private int type;
......
package com.wwdz.ch.core.entity;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Map;
@Data
public class QdSignInNoticeMsg implements Entity, AbstractSubscribeMsg {
/**
* 用户id
*/
private Long userId;
/**
* 用户openid
*/
private String openId;
/**
* 打卡任务名称
*/
private String taskName;
/**
* 截止时间
*/
private String endTime;
/**
* 签到天数
*/
private Long signInDays;
@Override
public Map<String, Object> getTempletParam() {
return null;
}
@Override
public String getTempletId() {
return null;
}
}
package com.wwdz.ch.core.service;
import com.wwdz.ch.core.entity.*;
import com.wwdz.ch.core.type.Result;
public interface QdSendMsgService {
/**
* 签到提醒订阅
* @param groupPurchaseNoticeMsg
* @return
*/
Result sendGroupPurchasecloserToSuccessMsg(GroupPurchaseNoticeMsg groupPurchaseNoticeMsg);
}
package com.wwdz.ch.db.dao.qiandao;
import com.wwdz.ch.db.domain.distribution.DisposableSubscribeRecord;
import com.wwdz.ch.db.domain.qiandao.QdDisposableSubscribeRecord;
import com.wwdz.ch.db.dto.request.distribution.DisposableSubscribeRecordRequestDto;
import java.util.List;
public interface QdDisposableSubscribeRecordDao {
boolean insert(QdDisposableSubscribeRecord disposableSubscribeRecord);
boolean update(QdDisposableSubscribeRecord disposableSubscribeRecord);
boolean updateInvalid(String openid, long targetId, String templateId);
/**
* 是否存在
* @param openid
* @param templateId
* @return
*/
boolean isExisted(String openid, long targetId, String templateId);
/**
* 是否订阅
* @param openid
* @param templateId
* @return
*/
boolean isSubscribed(String openid, long targetId, String templateId);
boolean isSubscribed(long userId, long targetId, int type);
List<QdDisposableSubscribeRecord> findList(DisposableSubscribeRecordRequestDto dto);
List<QdDisposableSubscribeRecord> findValid(long userId);
}
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/22
*/
@Data
public class QdDisposableSubscribeRecord implements Entity {
private Integer id;
/**
* 用户id
*/
private Long userId;
/**
* openid
*/
private String openid;
/**
* 模板id
*/
private String templateId;
/**
* 订阅对象id
*/
private Long targetId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 类型
*/
private Integer type;
/**
* 是否有效
*/
private Boolean isValid;
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(", userId=").append(userId);
sb.append(", openid=").append(openid);
sb.append(", templateId=").append(templateId);
sb.append(", targetId=").append(targetId);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", type=").append(type);
sb.append(", isValid=").append(isValid);
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;
}
QdDisposableSubscribeRecord other = (QdDisposableSubscribeRecord) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getOpenid() == null ? other.getOpenid() == null : this.getOpenid().equals(other.getOpenid()))
&& (this.getTemplateId() == null ? other.getTemplateId() == null : this.getTemplateId().equals(other.getTemplateId()))
&& (this.getTargetId() == null ? other.getTargetId() == null : this.getTargetId().equals(other.getTargetId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getIsValid() == null ? other.getIsValid() == null : this.getIsValid().equals(other.getIsValid()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getOpenid() == null) ? 0 : getOpenid().hashCode());
result = prime * result + ((getTemplateId() == null) ? 0 : getTemplateId().hashCode());
result = prime * result + ((getTargetId() == null) ? 0 : getTargetId().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getIsValid() == null) ? 0 : getIsValid().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER", false),
userId("user_id", "userId", "BIGINT", false),
openid("openid", "openid", "VARCHAR", false),
templateId("template_id", "templateId", "VARCHAR", false),
targetId("target_id", "targetId", "BIGINT", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false),
type("type", "type", "INTEGER", true),
isValid("is_valid", "isValid", "BIT", false);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table qd_disposable_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_disposable_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_disposable_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_disposable_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_disposable_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_disposable_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_disposable_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_disposable_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_disposable_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_disposable_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_disposable_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_disposable_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_disposable_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_disposable_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_disposable_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 QdDisposableSubscribeRecordExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public QdDisposableSubscribeRecordExample() {
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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public QdDisposableSubscribeRecordExample orderBy(String orderByClause) {
this.setOrderByClause(orderByClause);
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public QdDisposableSubscribeRecordExample 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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Criteria newAndCreateCriteria() {
QdDisposableSubscribeRecordExample example = new QdDisposableSubscribeRecordExample();
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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdEqualToColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdNotEqualToColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanOrEqualToColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanOrEqualToColumn(QdDisposableSubscribeRecord.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 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;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("user_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdNotEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("user_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdGreaterThanColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("user_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdGreaterThanOrEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("user_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdLessThanColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("user_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdLessThanOrEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("user_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> 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 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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenidEqualToColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenidNotEqualToColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenidGreaterThanColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenidGreaterThanOrEqualToColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenidLessThanColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOpenidLessThanOrEqualToColumn(QdDisposableSubscribeRecord.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 andTemplateIdIsNull() {
addCriterion("template_id is null");
return (Criteria) this;
}
public Criteria andTemplateIdIsNotNull() {
addCriterion("template_id is not null");
return (Criteria) this;
}
public Criteria andTemplateIdEqualTo(String value) {
addCriterion("template_id =", value, "templateId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTemplateIdEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("template_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTemplateIdNotEqualTo(String value) {
addCriterion("template_id <>", value, "templateId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTemplateIdNotEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("template_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTemplateIdGreaterThan(String value) {
addCriterion("template_id >", value, "templateId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTemplateIdGreaterThanColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("template_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTemplateIdGreaterThanOrEqualTo(String value) {
addCriterion("template_id >=", value, "templateId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTemplateIdGreaterThanOrEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("template_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTemplateIdLessThan(String value) {
addCriterion("template_id <", value, "templateId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTemplateIdLessThanColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("template_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTemplateIdLessThanOrEqualTo(String value) {
addCriterion("template_id <=", value, "templateId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTemplateIdLessThanOrEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("template_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTemplateIdLike(String value) {
addCriterion("template_id like", value, "templateId");
return (Criteria) this;
}
public Criteria andTemplateIdNotLike(String value) {
addCriterion("template_id not like", value, "templateId");
return (Criteria) this;
}
public Criteria andTemplateIdIn(List<String> values) {
addCriterion("template_id in", values, "templateId");
return (Criteria) this;
}
public Criteria andTemplateIdNotIn(List<String> values) {
addCriterion("template_id not in", values, "templateId");
return (Criteria) this;
}
public Criteria andTemplateIdBetween(String value1, String value2) {
addCriterion("template_id between", value1, value2, "templateId");
return (Criteria) this;
}
public Criteria andTemplateIdNotBetween(String value1, String value2) {
addCriterion("template_id not between", value1, value2, "templateId");
return (Criteria) this;
}
public Criteria andTargetIdIsNull() {
addCriterion("target_id is null");
return (Criteria) this;
}
public Criteria andTargetIdIsNotNull() {
addCriterion("target_id is not null");
return (Criteria) this;
}
public Criteria andTargetIdEqualTo(Long value) {
addCriterion("target_id =", value, "targetId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTargetIdEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("target_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTargetIdNotEqualTo(Long value) {
addCriterion("target_id <>", value, "targetId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTargetIdNotEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("target_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTargetIdGreaterThan(Long value) {
addCriterion("target_id >", value, "targetId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTargetIdGreaterThanColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("target_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTargetIdGreaterThanOrEqualTo(Long value) {
addCriterion("target_id >=", value, "targetId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTargetIdGreaterThanOrEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("target_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTargetIdLessThan(Long value) {
addCriterion("target_id <", value, "targetId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTargetIdLessThanColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("target_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTargetIdLessThanOrEqualTo(Long value) {
addCriterion("target_id <=", value, "targetId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTargetIdLessThanOrEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("target_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTargetIdIn(List<Long> values) {
addCriterion("target_id in", values, "targetId");
return (Criteria) this;
}
public Criteria andTargetIdNotIn(List<Long> values) {
addCriterion("target_id not in", values, "targetId");
return (Criteria) this;
}
public Criteria andTargetIdBetween(Long value1, Long value2) {
addCriterion("target_id between", value1, value2, "targetId");
return (Criteria) this;
}
public Criteria andTargetIdNotBetween(Long value1, Long value2) {
addCriterion("target_id not between", value1, value2, "targetId");
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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeEqualToColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeNotEqualToColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanOrEqualToColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanOrEqualToColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeEqualToColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeNotEqualToColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanOrEqualToColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanColumn(QdDisposableSubscribeRecord.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_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanOrEqualToColumn(QdDisposableSubscribeRecord.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 andTypeIsNull() {
addCriterion("`type` is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("`type` is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Integer value) {
addCriterion("`type` =", value, "type");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("`type` = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("`type` <>", value, "type");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeNotEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("`type` <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("`type` >", value, "type");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeGreaterThanColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("`type` > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("`type` >=", value, "type");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeGreaterThanOrEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("`type` >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("`type` <", value, "type");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeLessThanColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("`type` < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("`type` <=", value, "type");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeLessThanOrEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("`type` <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("`type` in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("`type` not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("`type` between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("`type` not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andIsValidIsNull() {
addCriterion("is_valid is null");
return (Criteria) this;
}
public Criteria andIsValidIsNotNull() {
addCriterion("is_valid is not null");
return (Criteria) this;
}
public Criteria andIsValidEqualTo(Boolean value) {
addCriterion("is_valid =", value, "isValid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsValidEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("is_valid = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsValidNotEqualTo(Boolean value) {
addCriterion("is_valid <>", value, "isValid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsValidNotEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("is_valid <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsValidGreaterThan(Boolean value) {
addCriterion("is_valid >", value, "isValid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsValidGreaterThanColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("is_valid > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsValidGreaterThanOrEqualTo(Boolean value) {
addCriterion("is_valid >=", value, "isValid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsValidGreaterThanOrEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("is_valid >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsValidLessThan(Boolean value) {
addCriterion("is_valid <", value, "isValid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsValidLessThanColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("is_valid < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsValidLessThanOrEqualTo(Boolean value) {
addCriterion("is_valid <=", value, "isValid");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsValidLessThanOrEqualToColumn(QdDisposableSubscribeRecord.Column column) {
addCriterion(new StringBuilder("is_valid <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsValidIn(List<Boolean> values) {
addCriterion("is_valid in", values, "isValid");
return (Criteria) this;
}
public Criteria andIsValidNotIn(List<Boolean> values) {
addCriterion("is_valid not in", values, "isValid");
return (Criteria) this;
}
public Criteria andIsValidBetween(Boolean value1, Boolean value2) {
addCriterion("is_valid between", value1, value2, "isValid");
return (Criteria) this;
}
public Criteria andIsValidNotBetween(Boolean value1, Boolean value2) {
addCriterion("is_valid not between", value1, value2, "isValid");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private QdDisposableSubscribeRecordExample example;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
protected Criteria(QdDisposableSubscribeRecordExample example) {
super();
this.example = example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public QdDisposableSubscribeRecordExample example() {
return this.example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_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_disposable_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_disposable_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.github.pagehelper.PageHelper;
import com.wwdz.ch.db.dao.DisposableSubscribeRecordDao;
import com.wwdz.ch.db.dao.qiandao.QdDisposableSubscribeRecordDao;
import com.wwdz.ch.db.domain.distribution.DisposableSubscribeRecord;
import com.wwdz.ch.db.domain.qiandao.QdDisposableSubscribeRecord;
import com.wwdz.ch.db.domain.qiandao.QdDisposableSubscribeRecordExample;
import com.wwdz.ch.db.dto.request.distribution.DisposableSubscribeRecordRequestDto;
import com.wwdz.ch.db.mapper.distribution.DisposableSubscribeRecordMapper;
import com.wwdz.ch.db.mapper.qiandao.QdDisposableSubscribeRecordMapper;
import com.xxdxxs.db.component.JdbcHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
@Repository
public class QdDisposableSubscribeRecordDaoImpl implements QdDisposableSubscribeRecordDao {
@Autowired
QdDisposableSubscribeRecordMapper qdDisposableSubscribeRecordMapper;
@Override
public boolean insert(QdDisposableSubscribeRecord disposableSubscribeRecord) {
return qdDisposableSubscribeRecordMapper.insert(disposableSubscribeRecord) > 0;
}
@Override
public boolean update(QdDisposableSubscribeRecord qdDisposableSubscribeRecord) {
QdDisposableSubscribeRecordExample example = new QdDisposableSubscribeRecordExample();
QdDisposableSubscribeRecordExample.Criteria criteria = example.createCriteria();
criteria.andOpenidEqualTo(qdDisposableSubscribeRecord.getOpenid());
criteria.andTargetIdEqualTo(qdDisposableSubscribeRecord.getTargetId());
criteria.andTemplateIdEqualTo(qdDisposableSubscribeRecord.getTemplateId());
qdDisposableSubscribeRecord.setUpdateTime(new Date());
return qdDisposableSubscribeRecordMapper.updateByExampleSelective(qdDisposableSubscribeRecord, example) > 0;
}
@Override
public boolean updateInvalid(String openid, long targetId, String templateId) {
QdDisposableSubscribeRecordExample example = new QdDisposableSubscribeRecordExample();
QdDisposableSubscribeRecordExample.Criteria criteria = example.createCriteria();
criteria.andOpenidEqualTo(openid);
criteria.andTargetIdEqualTo(targetId);
criteria.andTemplateIdEqualTo(templateId);
QdDisposableSubscribeRecord disposableSubscribeRecord = new QdDisposableSubscribeRecord();
disposableSubscribeRecord.setIsValid(false);
disposableSubscribeRecord.setUpdateTime(new Date());
return qdDisposableSubscribeRecordMapper.updateByExampleSelective(disposableSubscribeRecord, example) > 0;
}
@Override
public boolean isExisted(String openid, long targetId, String templateId) {
QdDisposableSubscribeRecordExample example = new QdDisposableSubscribeRecordExample();
QdDisposableSubscribeRecordExample.Criteria criteria = example.createCriteria();
criteria.andOpenidEqualTo(openid);
criteria.andTargetIdEqualTo(targetId);
criteria.andTemplateIdEqualTo(templateId);
return qdDisposableSubscribeRecordMapper.countByExample(example) > 0;
}
@Override
public boolean isSubscribed(String openid, long targetId, String templateId) {
QdDisposableSubscribeRecordExample example = new QdDisposableSubscribeRecordExample();
QdDisposableSubscribeRecordExample.Criteria criteria = example.createCriteria();
criteria.andOpenidEqualTo(openid);
criteria.andTargetIdEqualTo(targetId);
criteria.andTemplateIdEqualTo(templateId);
criteria.andIsValidEqualTo(true);
return qdDisposableSubscribeRecordMapper.countByExample(example) > 0;
}
@Override
public boolean isSubscribed(long userId, long targetId, int type) {
QdDisposableSubscribeRecordExample example = new QdDisposableSubscribeRecordExample();
QdDisposableSubscribeRecordExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
criteria.andTargetIdEqualTo(targetId);
criteria.andTypeEqualTo(type);
criteria.andIsValidEqualTo(true);
return qdDisposableSubscribeRecordMapper.countByExample(example) > 0;
}
@Override
public List<QdDisposableSubscribeRecord> findList(DisposableSubscribeRecordRequestDto dto) {
QdDisposableSubscribeRecordExample example = new QdDisposableSubscribeRecordExample();
QdDisposableSubscribeRecordExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(dto.getUserId(), criteria::andUserIdEqualTo);
JdbcHelper.ifPresent(dto.getOpenid(), criteria::andOpenidEqualTo);
JdbcHelper.ifPresent(dto.getTargetId(), criteria::andTargetIdEqualTo);
JdbcHelper.ifPresent(dto.getTemplateId(), criteria::andTemplateIdEqualTo);
JdbcHelper.ifPresent(dto.getType(), criteria::andTypeEqualTo);
criteria.andIsValidEqualTo(true);
example.setOrderByClause("create_time desc");
PageHelper.startPage(dto.getPage(), dto.getLimit());
return qdDisposableSubscribeRecordMapper.selectByExample(example);
}
@Override
public List<QdDisposableSubscribeRecord> findValid(long userId) {
QdDisposableSubscribeRecordExample example = new QdDisposableSubscribeRecordExample();
QdDisposableSubscribeRecordExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
criteria.andIsValidEqualTo(true);
return qdDisposableSubscribeRecordMapper.selectByExample(example);
}
}
package com.wwdz.ch.db.mapper.qiandao;
import com.wwdz.ch.db.domain.qiandao.QdDisposableSubscribeRecord;
import com.wwdz.ch.db.domain.qiandao.QdDisposableSubscribeRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface QdDisposableSubscribeRecordMapper {
long countByExample(QdDisposableSubscribeRecordExample example);
int deleteByExample(QdDisposableSubscribeRecordExample example);
int deleteByPrimaryKey(Integer id);
int insert(QdDisposableSubscribeRecord record);
int insertSelective(QdDisposableSubscribeRecord record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
QdDisposableSubscribeRecord selectOneByExample(QdDisposableSubscribeRecordExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
QdDisposableSubscribeRecord selectOneByExampleSelective(@Param("example") QdDisposableSubscribeRecordExample example, @Param("selective") QdDisposableSubscribeRecord.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<QdDisposableSubscribeRecord> selectByExampleSelective(@Param("example") QdDisposableSubscribeRecordExample example, @Param("selective") QdDisposableSubscribeRecord.Column ... selective);
List<QdDisposableSubscribeRecord> selectByExample(QdDisposableSubscribeRecordExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_disposable_subscribe_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
QdDisposableSubscribeRecord selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") QdDisposableSubscribeRecord.Column ... selective);
QdDisposableSubscribeRecord selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") QdDisposableSubscribeRecord record, @Param("example") QdDisposableSubscribeRecordExample example);
int updateByExample(@Param("record") QdDisposableSubscribeRecord record, @Param("example") QdDisposableSubscribeRecordExample example);
int updateByPrimaryKeySelective(QdDisposableSubscribeRecord record);
int updateByPrimaryKey(QdDisposableSubscribeRecord 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.QdDisposableSubscribeRecordMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.qiandao.QdDisposableSubscribeRecord">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="openid" jdbcType="VARCHAR" property="openid" />
<result column="template_id" jdbcType="VARCHAR" property="templateId" />
<result column="target_id" jdbcType="BIGINT" property="targetId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="is_valid" jdbcType="BIT" property="isValid" />
</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, user_id, openid, template_id, target_id, create_time, update_time, `type`, is_valid
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.qiandao.QdDisposableSubscribeRecordExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from qd_disposable_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, user_id, openid, template_id, target_id, create_time, update_time, `type`, is_valid
</otherwise>
</choose>
from qd_disposable_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_disposable_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, user_id, openid, template_id, target_id, create_time, update_time, `type`, is_valid
</otherwise>
</choose>
from qd_disposable_subscribe_record
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from qd_disposable_subscribe_record
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wwdz.ch.db.domain.qiandao.QdDisposableSubscribeRecordExample">
delete from qd_disposable_subscribe_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.qiandao.QdDisposableSubscribeRecord">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into qd_disposable_subscribe_record (user_id, openid, template_id,
target_id, create_time, update_time,
`type`, is_valid)
values (#{userId,jdbcType=BIGINT}, #{openid,jdbcType=VARCHAR}, #{templateId,jdbcType=VARCHAR},
#{targetId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{type,jdbcType=INTEGER}, #{isValid,jdbcType=BIT})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.qiandao.QdDisposableSubscribeRecord">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into qd_disposable_subscribe_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="openid != null">
openid,
</if>
<if test="templateId != null">
template_id,
</if>
<if test="targetId != null">
target_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="type != null">
`type`,
</if>
<if test="isValid != null">
is_valid,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="openid != null">
#{openid,jdbcType=VARCHAR},
</if>
<if test="templateId != null">
#{templateId,jdbcType=VARCHAR},
</if>
<if test="targetId != null">
#{targetId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="isValid != null">
#{isValid,jdbcType=BIT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.qiandao.QdDisposableSubscribeRecordExample" resultType="java.lang.Long">
select count(*) from qd_disposable_subscribe_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update qd_disposable_subscribe_record
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.openid != null">
openid = #{record.openid,jdbcType=VARCHAR},
</if>
<if test="record.templateId != null">
template_id = #{record.templateId,jdbcType=VARCHAR},
</if>
<if test="record.targetId != null">
target_id = #{record.targetId,jdbcType=BIGINT},
</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.type != null">
`type` = #{record.type,jdbcType=INTEGER},
</if>
<if test="record.isValid != null">
is_valid = #{record.isValid,jdbcType=BIT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update qd_disposable_subscribe_record
set id = #{record.id,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=BIGINT},
openid = #{record.openid,jdbcType=VARCHAR},
template_id = #{record.templateId,jdbcType=VARCHAR},
target_id = #{record.targetId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
`type` = #{record.type,jdbcType=INTEGER},
is_valid = #{record.isValid,jdbcType=BIT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.qiandao.QdDisposableSubscribeRecord">
update qd_disposable_subscribe_record
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="openid != null">
openid = #{openid,jdbcType=VARCHAR},
</if>
<if test="templateId != null">
template_id = #{templateId,jdbcType=VARCHAR},
</if>
<if test="targetId != null">
target_id = #{targetId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="type != null">
`type` = #{type,jdbcType=INTEGER},
</if>
<if test="isValid != null">
is_valid = #{isValid,jdbcType=BIT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.qiandao.QdDisposableSubscribeRecord">
update qd_disposable_subscribe_record
set user_id = #{userId,jdbcType=BIGINT},
openid = #{openid,jdbcType=VARCHAR},
template_id = #{templateId,jdbcType=VARCHAR},
target_id = #{targetId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
`type` = #{type,jdbcType=INTEGER},
is_valid = #{isValid,jdbcType=BIT}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.qiandao.QdDisposableSubscribeRecordExample" 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_disposable_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, user_id, openid, template_id, target_id, create_time, update_time, `type`, is_valid
</otherwise>
</choose>
from qd_disposable_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 @@ ...@@ -72,7 +72,7 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.qiandao" <javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.qiandao"
targetProject="ch-dao/src/main/java"/> targetProject="ch-dao/src/main/java"/>
<table tableName="wx_check_record" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"> <table tableName="qd_disposable_subscribe_record" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<generatedKey column="id" sqlStatement="Mysql" identity="true" /> <generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table> </table>
......
package com.wwdz.ch.wx.impl.qiandao;
import com.wwdz.ch.core.consts.DisposableSubscribeRecordEnum;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dao.qiandao.QdDisposableSubscribeRecordDao;
import com.wwdz.ch.db.dao.qiandao.QdUserDao;
import com.wwdz.ch.db.domain.User;
import com.wwdz.ch.db.domain.distribution.DisposableSubscribeRecord;
import com.wwdz.ch.db.domain.qiandao.QdDisposableSubscribeRecord;
import com.wwdz.ch.db.domain.qiandao.QdUser;
import com.wwdz.ch.db.dto.request.distribution.DisposableSubscribeRecordRequestDto;
import com.wwdz.ch.wx.service.qiandao.QdDisposableSubscribeRecordService;
import com.xxdxxs.utils.EntityMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class QdDisposableSubscribeRecordServiceImpl implements QdDisposableSubscribeRecordService {
private static final Logger logger = LoggerFactory.getLogger(QdDisposableSubscribeRecordServiceImpl.class);
@Autowired
QdDisposableSubscribeRecordDao qdDisposableSubscribeRecordDao;
@Autowired
QdUserDao qdUserDao;
@Override
public Result subscribe(DisposableSubscribeRecordRequestDto dto) {
try {
long userId = dto.getUserId();
QdUser user = qdUserDao.queryById(userId);
String openid = user.getWxOpenid();
String templateId = dto.getTemplateId();
long targetId = dto.getTargetId();
QdDisposableSubscribeRecord disposableSubscribeRecord = new QdDisposableSubscribeRecord();
EntityMapper.copyAttribute(dto, disposableSubscribeRecord);
disposableSubscribeRecord.setType(DisposableSubscribeRecordEnum.TypeEnum.getTypeByTemplateId(templateId));
//签到消息订阅,targetId前端固定传0
disposableSubscribeRecord.setOpenid(openid);
disposableSubscribeRecord.setIsValid(true);
disposableSubscribeRecord.setCreateTime(new Date());
disposableSubscribeRecord.setUpdateTime(new Date());
//没订阅过就新增数据
if (!qdDisposableSubscribeRecordDao.isSubscribed(openid, targetId, templateId)) {
qdDisposableSubscribeRecordDao.insert(disposableSubscribeRecord);
}
return Result.success();
} catch (Exception e) {
logger.error("保存一次性订阅消息记录 error: {}", e);
}
return Result.failed();
}
@Override
public Result update(QdDisposableSubscribeRecord disposableSubscribeRecord) {
try {
qdDisposableSubscribeRecordDao.update(disposableSubscribeRecord);
return Result.success();
} catch (Exception e) {
logger.error("更新订阅记录 error: {}", e);
}
return Result.failed();
}
@Override
public Result isSubscribed(DisposableSubscribeRecordRequestDto dto) {
return null;
}
@Override
public List<QdDisposableSubscribeRecord> findList(long userId) {
return null;
}
}
package com.wwdz.ch.wx.service.qiandao;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.domain.distribution.DisposableSubscribeRecord;
import com.wwdz.ch.db.domain.qiandao.QdDisposableSubscribeRecord;
import com.wwdz.ch.db.dto.request.distribution.DisposableSubscribeRecordRequestDto;
import java.util.List;
/**
* 小程序一次性订阅消息
*/
public interface QdDisposableSubscribeRecordService {
/**
* 用户订阅
* @param dto
* @return
*/
Result subscribe(DisposableSubscribeRecordRequestDto dto);
Result update(QdDisposableSubscribeRecord disposableSubscribeRecord);
Result isSubscribed(DisposableSubscribeRecordRequestDto dto);
List<QdDisposableSubscribeRecord> findList(long userId);
}
package com.wwdz.ch.wx.web.qiandao;
import com.alibaba.fastjson.JSON;
import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.distribution.DisposableSubscribeRecordRequestDto;
import com.wwdz.ch.wx.service.qiandao.QdDisposableSubscribeRecordService;
import com.wwdz.ch.wx.web.distribution.DistributionOrderController;
import com.xxdxxs.service.FormHandler;
import com.xxdxxs.validation.Validator;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/wx/qdDisposableSubscribeRecord")
public class QdDisposableSubscribeRecordController {
private static final Logger logger = LoggerFactory.getLogger(DistributionOrderController.class);
@Autowired
QdDisposableSubscribeRecordService qdDisposableSubscribeRecordService;
@ApiOperation(value = "小程序用户订阅消息")
@PostMapping("/subscribe")
public Result subscribe(@RequestBody DisposableSubscribeRecordRequestDto dto) {
logger.info("小程序用户订阅消息,请求参数:{}", JSON.toJSONString(dto));
if (dto.getUserId() == null) {
dto.setUserId(CommConsts.SYSTEM_ACCOUNT_FOR_UNLOGIN);
}
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("userId", "用户id").must().number()
.set("templateId", "模板id").must().string()
.set("targetId", "订阅对象id").must().number()
.end();
if (!validator.isValid()) {
return Result.failed(validator.getErrorInfo());
}
return qdDisposableSubscribeRecordService.subscribe(dto);
}
}
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