Commit 0ceb0afa authored by shiyu's avatar shiyu

关注和粉丝

parent fb807b73
...@@ -31,4 +31,7 @@ public interface CommConsts { ...@@ -31,4 +31,7 @@ public interface CommConsts {
* 上传微信小程序码目录 * 上传微信小程序码目录
*/ */
public static final String UPLOAD_PRE_WXACODE_DIRECTORY = "quanku/wxacode/"; public static final String UPLOAD_PRE_WXACODE_DIRECTORY = "quanku/wxacode/";
} }
package com.wwdz.ch.core.consts;
public class MessageEnum {
public enum StateEnum {
UNREAD(0, "未读"),
READED(1, "已读"),
DELETED(2, "删除"),
;
private int code;
private String des;
StateEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (StateEnum stateEnum : StateEnum.values()) {
if (code == stateEnum.getCode()) {
return stateEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
public enum TypeEnum {
SYSTEM(0, "系统信息"),
SHARE(1, "分享信息"),
COLLECT(2, "收藏信息"),
FOLLOW(3, "关注信息"),
;
private int code;
private String des;
TypeEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (TypeEnum typeEnum : TypeEnum.values()) {
if (code == typeEnum.getCode()) {
return typeEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
}
package com.wwdz.ch.db.dao;
import com.wwdz.ch.db.domain.FollowFansRecord;
import com.wwdz.ch.db.dto.request.FollowFansRecordRequestDto;
import java.util.List;
public interface FollowFansRecordDao {
int add(FollowFansRecord record);
/**
* 取消关注
* @param record
* @return
*/
boolean delete(FollowFansRecord record);
List<FollowFansRecord> findList(FollowFansRecordRequestDto dto);
FollowFansRecord findOne(FollowFansRecordRequestDto dto);
/**
* 统计关注的人数
* @param id
* @return
*/
long countFollowers(long id);
/**
* 统计粉丝的人数
* @param id
* @return
*/
long countFans(long id);
}
package com.wwdz.ch.db.dao;
import com.wwdz.ch.db.domain.MessageContent;
import com.wwdz.ch.db.dto.MessageContentRequestDto;
import java.util.List;
public interface MessageContentDao {
int add(MessageContent messageContent);
/**
* 查询消息列表
* @param dto
* @return
*/
List<MessageContent> findList(MessageContentRequestDto dto);
List<MessageContent> findListByIds(List<Integer> idList);
}
package com.wwdz.ch.db.dao;
import com.wwdz.ch.db.domain.MessageRecord;
import com.wwdz.ch.db.dto.MessageRecordRequestDto;
import java.util.List;
public interface MessageRecordDao {
int add(MessageRecord messageRecord);
/**
* 统计消息数量
* @param dto
* @return
*/
long count(MessageRecordRequestDto dto);
/**
* 查询消息列表
* @param dto
* @return
*/
List<MessageRecord> findList(MessageRecordRequestDto dto);
boolean update(MessageRecord record);
}
package com.wwdz.ch.db.domain;
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 2023/09/15
*/
@Data
public class FollowFansRecord implements Entity {
private Integer id;
/**
* 粉丝id
*/
private Long fansId;
/**
* 被关注者id
*/
private Long followerId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 状态
*/
private Integer state;
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(", fansId=").append(fansId);
sb.append(", followerId=").append(followerId);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", state=").append(state);
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;
}
FollowFansRecord other = (FollowFansRecord) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getFansId() == null ? other.getFansId() == null : this.getFansId().equals(other.getFansId()))
&& (this.getFollowerId() == null ? other.getFollowerId() == null : this.getFollowerId().equals(other.getFollowerId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getFansId() == null) ? 0 : getFansId().hashCode());
result = prime * result + ((getFollowerId() == null) ? 0 : getFollowerId().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER", false),
fansId("fans_id", "fansId", "BIGINT", false),
followerId("follower_id", "followerId", "BIGINT", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false),
state("state", "state", "INTEGER", true);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table follow_fans_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 follow_fans_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 follow_fans_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 follow_fans_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 follow_fans_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 follow_fans_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 follow_fans_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 follow_fans_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 follow_fans_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 follow_fans_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 follow_fans_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 follow_fans_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 follow_fans_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 follow_fans_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 follow_fans_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;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class FollowFansRecordExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public FollowFansRecordExample() {
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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public FollowFansRecordExample orderBy(String orderByClause) {
this.setOrderByClause(orderByClause);
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public FollowFansRecordExample 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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Criteria newAndCreateCriteria() {
FollowFansRecordExample example = new FollowFansRecordExample();
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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdEqualToColumn(FollowFansRecord.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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdNotEqualToColumn(FollowFansRecord.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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanColumn(FollowFansRecord.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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanOrEqualToColumn(FollowFansRecord.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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanColumn(FollowFansRecord.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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanOrEqualToColumn(FollowFansRecord.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 andFansIdIsNull() {
addCriterion("fans_id is null");
return (Criteria) this;
}
public Criteria andFansIdIsNotNull() {
addCriterion("fans_id is not null");
return (Criteria) this;
}
public Criteria andFansIdEqualTo(Long value) {
addCriterion("fans_id =", value, "fansId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andFansIdEqualToColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("fans_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andFansIdNotEqualTo(Long value) {
addCriterion("fans_id <>", value, "fansId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andFansIdNotEqualToColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("fans_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andFansIdGreaterThan(Long value) {
addCriterion("fans_id >", value, "fansId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andFansIdGreaterThanColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("fans_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andFansIdGreaterThanOrEqualTo(Long value) {
addCriterion("fans_id >=", value, "fansId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andFansIdGreaterThanOrEqualToColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("fans_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andFansIdLessThan(Long value) {
addCriterion("fans_id <", value, "fansId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andFansIdLessThanColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("fans_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andFansIdLessThanOrEqualTo(Long value) {
addCriterion("fans_id <=", value, "fansId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andFansIdLessThanOrEqualToColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("fans_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andFansIdIn(List<Long> values) {
addCriterion("fans_id in", values, "fansId");
return (Criteria) this;
}
public Criteria andFansIdNotIn(List<Long> values) {
addCriterion("fans_id not in", values, "fansId");
return (Criteria) this;
}
public Criteria andFansIdBetween(Long value1, Long value2) {
addCriterion("fans_id between", value1, value2, "fansId");
return (Criteria) this;
}
public Criteria andFansIdNotBetween(Long value1, Long value2) {
addCriterion("fans_id not between", value1, value2, "fansId");
return (Criteria) this;
}
public Criteria andFollowerIdIsNull() {
addCriterion("follower_id is null");
return (Criteria) this;
}
public Criteria andFollowerIdIsNotNull() {
addCriterion("follower_id is not null");
return (Criteria) this;
}
public Criteria andFollowerIdEqualTo(Long value) {
addCriterion("follower_id =", value, "followerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andFollowerIdEqualToColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("follower_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andFollowerIdNotEqualTo(Long value) {
addCriterion("follower_id <>", value, "followerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andFollowerIdNotEqualToColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("follower_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andFollowerIdGreaterThan(Long value) {
addCriterion("follower_id >", value, "followerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andFollowerIdGreaterThanColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("follower_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andFollowerIdGreaterThanOrEqualTo(Long value) {
addCriterion("follower_id >=", value, "followerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andFollowerIdGreaterThanOrEqualToColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("follower_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andFollowerIdLessThan(Long value) {
addCriterion("follower_id <", value, "followerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andFollowerIdLessThanColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("follower_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andFollowerIdLessThanOrEqualTo(Long value) {
addCriterion("follower_id <=", value, "followerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andFollowerIdLessThanOrEqualToColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("follower_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andFollowerIdIn(List<Long> values) {
addCriterion("follower_id in", values, "followerId");
return (Criteria) this;
}
public Criteria andFollowerIdNotIn(List<Long> values) {
addCriterion("follower_id not in", values, "followerId");
return (Criteria) this;
}
public Criteria andFollowerIdBetween(Long value1, Long value2) {
addCriterion("follower_id between", value1, value2, "followerId");
return (Criteria) this;
}
public Criteria andFollowerIdNotBetween(Long value1, Long value2) {
addCriterion("follower_id not between", value1, value2, "followerId");
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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeEqualToColumn(FollowFansRecord.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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeNotEqualToColumn(FollowFansRecord.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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanColumn(FollowFansRecord.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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanOrEqualToColumn(FollowFansRecord.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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanColumn(FollowFansRecord.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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanOrEqualToColumn(FollowFansRecord.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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeEqualToColumn(FollowFansRecord.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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeNotEqualToColumn(FollowFansRecord.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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanColumn(FollowFansRecord.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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanOrEqualToColumn(FollowFansRecord.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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanColumn(FollowFansRecord.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 follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanOrEqualToColumn(FollowFansRecord.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 andStateIsNull() {
addCriterion("`state` is null");
return (Criteria) this;
}
public Criteria andStateIsNotNull() {
addCriterion("`state` is not null");
return (Criteria) this;
}
public Criteria andStateEqualTo(Integer value) {
addCriterion("`state` =", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateEqualToColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("`state` = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateNotEqualTo(Integer value) {
addCriterion("`state` <>", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateNotEqualToColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("`state` <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateGreaterThan(Integer value) {
addCriterion("`state` >", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateGreaterThanColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("`state` > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateGreaterThanOrEqualTo(Integer value) {
addCriterion("`state` >=", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateGreaterThanOrEqualToColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("`state` >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateLessThan(Integer value) {
addCriterion("`state` <", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateLessThanColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("`state` < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateLessThanOrEqualTo(Integer value) {
addCriterion("`state` <=", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateLessThanOrEqualToColumn(FollowFansRecord.Column column) {
addCriterion(new StringBuilder("`state` <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateIn(List<Integer> values) {
addCriterion("`state` in", values, "state");
return (Criteria) this;
}
public Criteria andStateNotIn(List<Integer> values) {
addCriterion("`state` not in", values, "state");
return (Criteria) this;
}
public Criteria andStateBetween(Integer value1, Integer value2) {
addCriterion("`state` between", value1, value2, "state");
return (Criteria) this;
}
public Criteria andStateNotBetween(Integer value1, Integer value2) {
addCriterion("`state` not between", value1, value2, "state");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private FollowFansRecordExample example;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
protected Criteria(FollowFansRecordExample example) {
super();
this.example = example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public FollowFansRecordExample example() {
return this.example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_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 follow_fans_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 follow_fans_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.domain;
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 2023/09/15
*/
@Data
public class MessageContent implements Entity {
private Integer id;
/**
* 发送者id
*/
private Long senderId;
/**
* 消息类型
*/
private Integer type;
/**
* 创建时间
*/
private Date createTime;
/**
* 消息内容
*/
private String content;
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(", senderId=").append(senderId);
sb.append(", type=").append(type);
sb.append(", createTime=").append(createTime);
sb.append(", content=").append(content);
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;
}
MessageContent other = (MessageContent) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getSenderId() == null ? other.getSenderId() == null : this.getSenderId().equals(other.getSenderId()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getSenderId() == null) ? 0 : getSenderId().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER", false),
senderId("sender_id", "senderId", "BIGINT", false),
type("type", "type", "INTEGER", true),
createTime("create_time", "createTime", "TIMESTAMP", false),
content("content", "content", "LONGVARCHAR", false);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table message_content
*
* @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 message_content
*
* @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 message_content
*
* @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 message_content
*
* @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 message_content
*
* @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 message_content
*
* @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 message_content
*
* @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 message_content
*
* @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 message_content
*
* @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 message_content
*
* @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 message_content
*
* @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 message_content
*
* @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 message_content
*
* @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 message_content
*
* @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 message_content
*
* @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;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class MessageContentExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public MessageContentExample() {
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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public MessageContentExample orderBy(String orderByClause) {
this.setOrderByClause(orderByClause);
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public MessageContentExample 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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Criteria newAndCreateCriteria() {
MessageContentExample example = new MessageContentExample();
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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdEqualToColumn(MessageContent.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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdNotEqualToColumn(MessageContent.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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanColumn(MessageContent.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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanOrEqualToColumn(MessageContent.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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanColumn(MessageContent.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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanOrEqualToColumn(MessageContent.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 andSenderIdIsNull() {
addCriterion("sender_id is null");
return (Criteria) this;
}
public Criteria andSenderIdIsNotNull() {
addCriterion("sender_id is not null");
return (Criteria) this;
}
public Criteria andSenderIdEqualTo(Long value) {
addCriterion("sender_id =", value, "senderId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSenderIdEqualToColumn(MessageContent.Column column) {
addCriterion(new StringBuilder("sender_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSenderIdNotEqualTo(Long value) {
addCriterion("sender_id <>", value, "senderId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSenderIdNotEqualToColumn(MessageContent.Column column) {
addCriterion(new StringBuilder("sender_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSenderIdGreaterThan(Long value) {
addCriterion("sender_id >", value, "senderId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSenderIdGreaterThanColumn(MessageContent.Column column) {
addCriterion(new StringBuilder("sender_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSenderIdGreaterThanOrEqualTo(Long value) {
addCriterion("sender_id >=", value, "senderId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSenderIdGreaterThanOrEqualToColumn(MessageContent.Column column) {
addCriterion(new StringBuilder("sender_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSenderIdLessThan(Long value) {
addCriterion("sender_id <", value, "senderId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSenderIdLessThanColumn(MessageContent.Column column) {
addCriterion(new StringBuilder("sender_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSenderIdLessThanOrEqualTo(Long value) {
addCriterion("sender_id <=", value, "senderId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSenderIdLessThanOrEqualToColumn(MessageContent.Column column) {
addCriterion(new StringBuilder("sender_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSenderIdIn(List<Long> values) {
addCriterion("sender_id in", values, "senderId");
return (Criteria) this;
}
public Criteria andSenderIdNotIn(List<Long> values) {
addCriterion("sender_id not in", values, "senderId");
return (Criteria) this;
}
public Criteria andSenderIdBetween(Long value1, Long value2) {
addCriterion("sender_id between", value1, value2, "senderId");
return (Criteria) this;
}
public Criteria andSenderIdNotBetween(Long value1, Long value2) {
addCriterion("sender_id not between", value1, value2, "senderId");
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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeEqualToColumn(MessageContent.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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeNotEqualToColumn(MessageContent.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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeGreaterThanColumn(MessageContent.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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeGreaterThanOrEqualToColumn(MessageContent.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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeLessThanColumn(MessageContent.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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeLessThanOrEqualToColumn(MessageContent.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 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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeEqualToColumn(MessageContent.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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeNotEqualToColumn(MessageContent.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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanColumn(MessageContent.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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanOrEqualToColumn(MessageContent.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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanColumn(MessageContent.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 message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanOrEqualToColumn(MessageContent.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 static class Criteria extends GeneratedCriteria {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private MessageContentExample example;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
protected Criteria(MessageContentExample example) {
super();
this.example = example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public MessageContentExample example() {
return this.example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @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 message_content
*
* @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 message_content
*
* @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.domain;
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 2023/09/15
*/
@Data
public class MessageRecord implements Entity {
private Integer id;
/**
* 接收者id
*/
private Long receiverId;
/**
* 对应消息id
*/
private Integer messageId;
/**
* 消息状态
*/
private Integer state;
/**
* 重试次数
*/
private Integer tryNum;
/**
* 消息类型
*/
private Integer type;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
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(", receiverId=").append(receiverId);
sb.append(", messageId=").append(messageId);
sb.append(", state=").append(state);
sb.append(", tryNum=").append(tryNum);
sb.append(", type=").append(type);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
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;
}
MessageRecord other = (MessageRecord) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getReceiverId() == null ? other.getReceiverId() == null : this.getReceiverId().equals(other.getReceiverId()))
&& (this.getMessageId() == null ? other.getMessageId() == null : this.getMessageId().equals(other.getMessageId()))
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
&& (this.getTryNum() == null ? other.getTryNum() == null : this.getTryNum().equals(other.getTryNum()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getReceiverId() == null) ? 0 : getReceiverId().hashCode());
result = prime * result + ((getMessageId() == null) ? 0 : getMessageId().hashCode());
result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
result = prime * result + ((getTryNum() == null) ? 0 : getTryNum().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER", false),
receiverId("receiver_id", "receiverId", "BIGINT", false),
messageId("message_id", "messageId", "INTEGER", false),
state("state", "state", "INTEGER", true),
tryNum("try_num", "tryNum", "INTEGER", false),
type("type", "type", "INTEGER", true),
createTime("create_time", "createTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table message_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 message_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 message_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 message_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 message_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 message_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 message_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 message_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 message_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 message_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 message_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 message_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 message_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 message_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 message_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;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class MessageRecordExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public MessageRecordExample() {
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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public MessageRecordExample orderBy(String orderByClause) {
this.setOrderByClause(orderByClause);
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public MessageRecordExample 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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Criteria newAndCreateCriteria() {
MessageRecordExample example = new MessageRecordExample();
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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdEqualToColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdNotEqualToColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanOrEqualToColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanOrEqualToColumn(MessageRecord.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 andReceiverIdIsNull() {
addCriterion("receiver_id is null");
return (Criteria) this;
}
public Criteria andReceiverIdIsNotNull() {
addCriterion("receiver_id is not null");
return (Criteria) this;
}
public Criteria andReceiverIdEqualTo(Long value) {
addCriterion("receiver_id =", value, "receiverId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andReceiverIdEqualToColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("receiver_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andReceiverIdNotEqualTo(Long value) {
addCriterion("receiver_id <>", value, "receiverId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andReceiverIdNotEqualToColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("receiver_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andReceiverIdGreaterThan(Long value) {
addCriterion("receiver_id >", value, "receiverId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andReceiverIdGreaterThanColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("receiver_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andReceiverIdGreaterThanOrEqualTo(Long value) {
addCriterion("receiver_id >=", value, "receiverId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andReceiverIdGreaterThanOrEqualToColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("receiver_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andReceiverIdLessThan(Long value) {
addCriterion("receiver_id <", value, "receiverId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andReceiverIdLessThanColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("receiver_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andReceiverIdLessThanOrEqualTo(Long value) {
addCriterion("receiver_id <=", value, "receiverId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andReceiverIdLessThanOrEqualToColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("receiver_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andReceiverIdIn(List<Long> values) {
addCriterion("receiver_id in", values, "receiverId");
return (Criteria) this;
}
public Criteria andReceiverIdNotIn(List<Long> values) {
addCriterion("receiver_id not in", values, "receiverId");
return (Criteria) this;
}
public Criteria andReceiverIdBetween(Long value1, Long value2) {
addCriterion("receiver_id between", value1, value2, "receiverId");
return (Criteria) this;
}
public Criteria andReceiverIdNotBetween(Long value1, Long value2) {
addCriterion("receiver_id not between", value1, value2, "receiverId");
return (Criteria) this;
}
public Criteria andMessageIdIsNull() {
addCriterion("message_id is null");
return (Criteria) this;
}
public Criteria andMessageIdIsNotNull() {
addCriterion("message_id is not null");
return (Criteria) this;
}
public Criteria andMessageIdEqualTo(Integer value) {
addCriterion("message_id =", value, "messageId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andMessageIdEqualToColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("message_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andMessageIdNotEqualTo(Integer value) {
addCriterion("message_id <>", value, "messageId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andMessageIdNotEqualToColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("message_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andMessageIdGreaterThan(Integer value) {
addCriterion("message_id >", value, "messageId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andMessageIdGreaterThanColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("message_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andMessageIdGreaterThanOrEqualTo(Integer value) {
addCriterion("message_id >=", value, "messageId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andMessageIdGreaterThanOrEqualToColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("message_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andMessageIdLessThan(Integer value) {
addCriterion("message_id <", value, "messageId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andMessageIdLessThanColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("message_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andMessageIdLessThanOrEqualTo(Integer value) {
addCriterion("message_id <=", value, "messageId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andMessageIdLessThanOrEqualToColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("message_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andMessageIdIn(List<Integer> values) {
addCriterion("message_id in", values, "messageId");
return (Criteria) this;
}
public Criteria andMessageIdNotIn(List<Integer> values) {
addCriterion("message_id not in", values, "messageId");
return (Criteria) this;
}
public Criteria andMessageIdBetween(Integer value1, Integer value2) {
addCriterion("message_id between", value1, value2, "messageId");
return (Criteria) this;
}
public Criteria andMessageIdNotBetween(Integer value1, Integer value2) {
addCriterion("message_id not between", value1, value2, "messageId");
return (Criteria) this;
}
public Criteria andStateIsNull() {
addCriterion("`state` is null");
return (Criteria) this;
}
public Criteria andStateIsNotNull() {
addCriterion("`state` is not null");
return (Criteria) this;
}
public Criteria andStateEqualTo(Integer value) {
addCriterion("`state` =", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateEqualToColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("`state` = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateNotEqualTo(Integer value) {
addCriterion("`state` <>", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateNotEqualToColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("`state` <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateGreaterThan(Integer value) {
addCriterion("`state` >", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateGreaterThanColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("`state` > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateGreaterThanOrEqualTo(Integer value) {
addCriterion("`state` >=", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateGreaterThanOrEqualToColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("`state` >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateLessThan(Integer value) {
addCriterion("`state` <", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateLessThanColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("`state` < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateLessThanOrEqualTo(Integer value) {
addCriterion("`state` <=", value, "state");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStateLessThanOrEqualToColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("`state` <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStateIn(List<Integer> values) {
addCriterion("`state` in", values, "state");
return (Criteria) this;
}
public Criteria andStateNotIn(List<Integer> values) {
addCriterion("`state` not in", values, "state");
return (Criteria) this;
}
public Criteria andStateBetween(Integer value1, Integer value2) {
addCriterion("`state` between", value1, value2, "state");
return (Criteria) this;
}
public Criteria andStateNotBetween(Integer value1, Integer value2) {
addCriterion("`state` not between", value1, value2, "state");
return (Criteria) this;
}
public Criteria andTryNumIsNull() {
addCriterion("try_num is null");
return (Criteria) this;
}
public Criteria andTryNumIsNotNull() {
addCriterion("try_num is not null");
return (Criteria) this;
}
public Criteria andTryNumEqualTo(Integer value) {
addCriterion("try_num =", value, "tryNum");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTryNumEqualToColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("try_num = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTryNumNotEqualTo(Integer value) {
addCriterion("try_num <>", value, "tryNum");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTryNumNotEqualToColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("try_num <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTryNumGreaterThan(Integer value) {
addCriterion("try_num >", value, "tryNum");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTryNumGreaterThanColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("try_num > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTryNumGreaterThanOrEqualTo(Integer value) {
addCriterion("try_num >=", value, "tryNum");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTryNumGreaterThanOrEqualToColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("try_num >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTryNumLessThan(Integer value) {
addCriterion("try_num <", value, "tryNum");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTryNumLessThanColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("try_num < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTryNumLessThanOrEqualTo(Integer value) {
addCriterion("try_num <=", value, "tryNum");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTryNumLessThanOrEqualToColumn(MessageRecord.Column column) {
addCriterion(new StringBuilder("try_num <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTryNumIn(List<Integer> values) {
addCriterion("try_num in", values, "tryNum");
return (Criteria) this;
}
public Criteria andTryNumNotIn(List<Integer> values) {
addCriterion("try_num not in", values, "tryNum");
return (Criteria) this;
}
public Criteria andTryNumBetween(Integer value1, Integer value2) {
addCriterion("try_num between", value1, value2, "tryNum");
return (Criteria) this;
}
public Criteria andTryNumNotBetween(Integer value1, Integer value2) {
addCriterion("try_num not between", value1, value2, "tryNum");
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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeEqualToColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeNotEqualToColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeGreaterThanColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeGreaterThanOrEqualToColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeLessThanColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeLessThanOrEqualToColumn(MessageRecord.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 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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeEqualToColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeNotEqualToColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanOrEqualToColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanOrEqualToColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeEqualToColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeNotEqualToColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanOrEqualToColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanColumn(MessageRecord.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 message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanOrEqualToColumn(MessageRecord.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 static class Criteria extends GeneratedCriteria {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private MessageRecordExample example;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
protected Criteria(MessageRecordExample example) {
super();
this.example = example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public MessageRecordExample example() {
return this.example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_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 message_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 message_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.dto;
import com.wwdz.ch.db.dto.request.BaseRequestDto;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class MessageContentRequestDto extends BaseRequestDto implements Entity {
private Integer id;
/**
* 发送者id
*/
private Long senderId;
/**
* 消息类型
*/
private Integer type;
/**
* 创建时间
*/
private Date createTime;
/**
* 消息内容
*/
private String content;
}
package com.wwdz.ch.db.dto;
import com.wwdz.ch.db.dto.request.BaseRequestDto;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class MessageRecordRequestDto extends BaseRequestDto implements Entity {
private Integer id;
/**
* 接收者id
*/
private Long receiverId;
/**
* 对应消息id
*/
private Integer messageId;
/**
* 消息状态
*/
private Integer state;
/**
* 消息类型
*/
private Integer type;
/**
* 被排除的消息状态
*/
private Integer excluedState;
/**
* 重试次数
*/
private Integer tryNum;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
}
package com.wwdz.ch.db.dto.request;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class FollowFansRecordRequestDto extends BaseRequestDto implements Entity {
private Integer id;
/**
* 被查询对象的id
*/
private Long searchTargetId;
/**
* 粉丝id
*/
private Long fansId;
/**
* 被关注者id
*/
private Long followerId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 状态
*/
private Integer state;
}
package com.wwdz.ch.db.impl;
import com.github.pagehelper.PageHelper;
import com.wwdz.ch.db.dao.FollowFansRecordDao;
import com.wwdz.ch.db.domain.FollowFansRecord;
import com.wwdz.ch.db.domain.FollowFansRecordExample;
import com.wwdz.ch.db.dto.request.FollowFansRecordRequestDto;
import com.wwdz.ch.db.mapper.FollowFansRecordMapper;
import com.xxdxxs.db.component.JdbcHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class FollowFansRecordDaoImpl implements FollowFansRecordDao {
@Autowired
FollowFansRecordMapper followFansRecordMapper;
@Override
public int add(FollowFansRecord record) {
followFansRecordMapper.insertSelective(record);
return record.getId();
}
@Override
public boolean delete(FollowFansRecord record) {
return followFansRecordMapper.updateByPrimaryKeySelective(record) > 0;
}
@Override
public List<FollowFansRecord> findList(FollowFansRecordRequestDto dto) {
FollowFansRecordExample example = new FollowFansRecordExample();
FollowFansRecordExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(dto.getFollowerId(), criteria::andFollowerIdEqualTo);
JdbcHelper.ifPresent(dto.getFansId(), criteria::andFansIdEqualTo);
criteria.andStateEqualTo(1);
PageHelper.startPage(dto.getPage(), dto.getLimit());
return followFansRecordMapper.selectByExample(example);
}
@Override
public FollowFansRecord findOne(FollowFansRecordRequestDto dto) {
FollowFansRecordExample example = new FollowFansRecordExample();
FollowFansRecordExample.Criteria criteria = example.createCriteria();
criteria.andFollowerIdEqualTo(dto.getFollowerId());
criteria.andFansIdEqualTo(dto.getFansId());
criteria.andStateEqualTo(1);
return followFansRecordMapper.selectOneByExample(example);
}
@Override
public long countFollowers(long id) {
FollowFansRecordExample example = new FollowFansRecordExample();
FollowFansRecordExample.Criteria criteria = example.createCriteria();
criteria.andFansIdEqualTo(id);
criteria.andStateEqualTo(1);
return followFansRecordMapper.countByExample(example);
}
@Override
public long countFans(long id) {
FollowFansRecordExample example = new FollowFansRecordExample();
FollowFansRecordExample.Criteria criteria = example.createCriteria();
criteria.andFollowerIdEqualTo(id);
criteria.andStateEqualTo(1);
return followFansRecordMapper.countByExample(example);
}
}
package com.wwdz.ch.db.impl;
import com.github.pagehelper.PageHelper;
import com.wwdz.ch.db.dao.MessageContentDao;
import com.wwdz.ch.db.domain.MessageContent;
import com.wwdz.ch.db.domain.MessageContentExample;
import com.wwdz.ch.db.dto.MessageContentRequestDto;
import com.wwdz.ch.db.mapper.MessageContentMapper;
import com.xxdxxs.db.component.JdbcHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class MessageContentDaoImpl implements MessageContentDao {
@Autowired
MessageContentMapper messageContentMapper;
@Override
public int add(MessageContent messageContent) {
messageContentMapper.insertSelective(messageContent);
return messageContent.getId();
}
@Override
public List<MessageContent> findList(MessageContentRequestDto dto) {
MessageContentExample example = new MessageContentExample();
MessageContentExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(dto.getSenderId(), criteria::andSenderIdEqualTo);
JdbcHelper.ifPresent(dto.getId(), criteria::andIdEqualTo);
JdbcHelper.ifPresent(dto.getType(), criteria::andTypeEqualTo);
PageHelper.startPage(dto.getPage(), dto.getLimit());
return messageContentMapper.selectByExample(example);
}
@Override
public List<MessageContent> findListByIds(List<Integer> idList) {
MessageContentExample example = new MessageContentExample();
MessageContentExample.Criteria criteria = example.createCriteria();
criteria.andIdIn(idList);
return messageContentMapper.selectByExample(example);
}
}
package com.wwdz.ch.db.impl;
import com.github.pagehelper.PageHelper;
import com.wwdz.ch.db.dao.MessageRecordDao;
import com.wwdz.ch.db.domain.MessageRecord;
import com.wwdz.ch.db.domain.MessageRecordExample;
import com.wwdz.ch.db.dto.MessageRecordRequestDto;
import com.wwdz.ch.db.mapper.MessageRecordMapper;
import com.xxdxxs.db.component.JdbcHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class MessageRecordDaoImpl implements MessageRecordDao {
@Autowired
MessageRecordMapper messageRecordMapper;
@Override
public int add(MessageRecord messageRecord) {
messageRecordMapper.insertSelective(messageRecord);
return messageRecord.getId();
}
@Override
public long count(MessageRecordRequestDto dto) {
MessageRecordExample example = new MessageRecordExample();
MessageRecordExample.Criteria criteria = example.createCriteria();
criteria.andReceiverIdEqualTo(dto.getReceiverId());
criteria.andStateEqualTo(dto.getState());
return messageRecordMapper.countByExample(example);
}
@Override
public List<MessageRecord> findList(MessageRecordRequestDto dto) {
MessageRecordExample example = new MessageRecordExample();
MessageRecordExample.Criteria criteria = example.createCriteria();
criteria.andReceiverIdEqualTo(dto.getReceiverId());
JdbcHelper.ifPresent(dto.getType(), criteria::andTypeEqualTo);
JdbcHelper.ifPresent(dto.getState(), criteria::andStateEqualTo);
//排除删除的消息
JdbcHelper.ifPresent(dto.getExcluedState(), criteria::andStateNotEqualTo);
example.setOrderByClause(" update_time desc");
PageHelper.startPage(dto.getPage(), dto.getLimit());
return messageRecordMapper.selectByExample(example);
}
@Override
public boolean update(MessageRecord record) {
return messageRecordMapper.updateByPrimaryKeySelective(record) > 0;
}
}
package com.wwdz.ch.db.mapper;
import com.wwdz.ch.db.domain.FollowFansRecord;
import com.wwdz.ch.db.domain.FollowFansRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface FollowFansRecordMapper {
long countByExample(FollowFansRecordExample example);
int deleteByExample(FollowFansRecordExample example);
int deleteByPrimaryKey(Integer id);
int insert(FollowFansRecord record);
int insertSelective(FollowFansRecord record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
FollowFansRecord selectOneByExample(FollowFansRecordExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
FollowFansRecord selectOneByExampleSelective(@Param("example") FollowFansRecordExample example, @Param("selective") FollowFansRecord.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<FollowFansRecord> selectByExampleSelective(@Param("example") FollowFansRecordExample example, @Param("selective") FollowFansRecord.Column ... selective);
List<FollowFansRecord> selectByExample(FollowFansRecordExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
FollowFansRecord selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") FollowFansRecord.Column ... selective);
FollowFansRecord selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") FollowFansRecord record, @Param("example") FollowFansRecordExample example);
int updateByExample(@Param("record") FollowFansRecord record, @Param("example") FollowFansRecordExample example);
int updateByPrimaryKeySelective(FollowFansRecord record);
int updateByPrimaryKey(FollowFansRecord record);
}
\ No newline at end of file
package com.wwdz.ch.db.mapper;
import com.wwdz.ch.db.domain.MessageContent;
import com.wwdz.ch.db.domain.MessageContentExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface MessageContentMapper {
long countByExample(MessageContentExample example);
int deleteByExample(MessageContentExample example);
int deleteByPrimaryKey(Integer id);
int insert(MessageContent record);
int insertSelective(MessageContent record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
MessageContent selectOneByExample(MessageContentExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
MessageContent selectOneByExampleSelective(@Param("example") MessageContentExample example, @Param("selective") MessageContent.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
MessageContent selectOneByExampleWithBLOBs(MessageContentExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<MessageContent> selectByExampleSelective(@Param("example") MessageContentExample example, @Param("selective") MessageContent.Column ... selective);
List<MessageContent> selectByExampleWithBLOBs(MessageContentExample example);
List<MessageContent> selectByExample(MessageContentExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
MessageContent selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") MessageContent.Column ... selective);
MessageContent selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") MessageContent record, @Param("example") MessageContentExample example);
int updateByExampleWithBLOBs(@Param("record") MessageContent record, @Param("example") MessageContentExample example);
int updateByExample(@Param("record") MessageContent record, @Param("example") MessageContentExample example);
int updateByPrimaryKeySelective(MessageContent record);
int updateByPrimaryKeyWithBLOBs(MessageContent record);
int updateByPrimaryKey(MessageContent record);
}
\ No newline at end of file
package com.wwdz.ch.db.mapper;
import com.wwdz.ch.db.domain.MessageRecord;
import com.wwdz.ch.db.domain.MessageRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface MessageRecordMapper {
long countByExample(MessageRecordExample example);
int deleteByExample(MessageRecordExample example);
int deleteByPrimaryKey(Integer id);
int insert(MessageRecord record);
int insertSelective(MessageRecord record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
MessageRecord selectOneByExample(MessageRecordExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
MessageRecord selectOneByExampleSelective(@Param("example") MessageRecordExample example, @Param("selective") MessageRecord.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<MessageRecord> selectByExampleSelective(@Param("example") MessageRecordExample example, @Param("selective") MessageRecord.Column ... selective);
List<MessageRecord> selectByExample(MessageRecordExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
MessageRecord selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") MessageRecord.Column ... selective);
MessageRecord selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") MessageRecord record, @Param("example") MessageRecordExample example);
int updateByExample(@Param("record") MessageRecord record, @Param("example") MessageRecordExample example);
int updateByPrimaryKeySelective(MessageRecord record);
int updateByPrimaryKey(MessageRecord 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.FollowFansRecordMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.FollowFansRecord">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="fans_id" jdbcType="BIGINT" property="fansId" />
<result column="follower_id" jdbcType="BIGINT" property="followerId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="state" jdbcType="INTEGER" property="state" />
</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, fans_id, follower_id, create_time, update_time, `state`
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.FollowFansRecordExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from follow_fans_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, fans_id, follower_id, create_time, update_time, `state`
</otherwise>
</choose>
from follow_fans_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 follow_fans_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, fans_id, follower_id, create_time, update_time, `state`
</otherwise>
</choose>
from follow_fans_record
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from follow_fans_record
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wwdz.ch.db.domain.FollowFansRecordExample">
delete from follow_fans_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.FollowFansRecord">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into follow_fans_record (fans_id, follower_id, create_time,
update_time, `state`)
values (#{fansId,jdbcType=BIGINT}, #{followerId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{state,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.FollowFansRecord">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into follow_fans_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fansId != null">
fans_id,
</if>
<if test="followerId != null">
follower_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="state != null">
`state`,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fansId != null">
#{fansId,jdbcType=BIGINT},
</if>
<if test="followerId != null">
#{followerId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="state != null">
#{state,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.FollowFansRecordExample" resultType="java.lang.Long">
select count(*) from follow_fans_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update follow_fans_record
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.fansId != null">
fans_id = #{record.fansId,jdbcType=BIGINT},
</if>
<if test="record.followerId != null">
follower_id = #{record.followerId,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.state != null">
`state` = #{record.state,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update follow_fans_record
set id = #{record.id,jdbcType=INTEGER},
fans_id = #{record.fansId,jdbcType=BIGINT},
follower_id = #{record.followerId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
`state` = #{record.state,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.FollowFansRecord">
update follow_fans_record
<set>
<if test="fansId != null">
fans_id = #{fansId,jdbcType=BIGINT},
</if>
<if test="followerId != null">
follower_id = #{followerId,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="state != null">
`state` = #{state,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.FollowFansRecord">
update follow_fans_record
set fans_id = #{fansId,jdbcType=BIGINT},
follower_id = #{followerId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
`state` = #{state,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.FollowFansRecordExample" 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 follow_fans_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, fans_id, follower_id, create_time, update_time, `state`
</otherwise>
</choose>
from follow_fans_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
<?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.MessageContentMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.MessageContent">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="sender_id" jdbcType="BIGINT" property="senderId" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.wwdz.ch.db.domain.MessageContent">
<result column="content" jdbcType="LONGVARCHAR" property="content" />
</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, sender_id, `type`, create_time
</sql>
<sql id="Blob_Column_List">
content
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.wwdz.ch.db.domain.MessageContentExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from message_content
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.MessageContentExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from message_content
<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="ResultMapWithBLOBs">
<!--
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, sender_id, `type`, create_time, content
</otherwise>
</choose>
from message_content
<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="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from message_content
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByPrimaryKeySelective" parameterType="map" resultMap="ResultMapWithBLOBs">
<!--
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, sender_id, `type`, create_time, content
</otherwise>
</choose>
from message_content
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from message_content
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wwdz.ch.db.domain.MessageContentExample">
delete from message_content
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.MessageContent">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into message_content (sender_id, `type`, create_time,
content)
values (#{senderId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{content,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.MessageContent">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into message_content
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="senderId != null">
sender_id,
</if>
<if test="type != null">
`type`,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="content != null">
content,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="senderId != null">
#{senderId,jdbcType=BIGINT},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.MessageContentExample" resultType="java.lang.Long">
select count(*) from message_content
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update message_content
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.senderId != null">
sender_id = #{record.senderId,jdbcType=BIGINT},
</if>
<if test="record.type != null">
`type` = #{record.type,jdbcType=INTEGER},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update message_content
set id = #{record.id,jdbcType=INTEGER},
sender_id = #{record.senderId,jdbcType=BIGINT},
`type` = #{record.type,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
content = #{record.content,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update message_content
set id = #{record.id,jdbcType=INTEGER},
sender_id = #{record.senderId,jdbcType=BIGINT},
`type` = #{record.type,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.MessageContent">
update message_content
<set>
<if test="senderId != null">
sender_id = #{senderId,jdbcType=BIGINT},
</if>
<if test="type != null">
`type` = #{type,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.wwdz.ch.db.domain.MessageContent">
update message_content
set sender_id = #{senderId,jdbcType=BIGINT},
`type` = #{type,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
content = #{content,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.MessageContent">
update message_content
set sender_id = #{senderId,jdbcType=BIGINT},
`type` = #{type,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.MessageContentExample" 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 message_content
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
limit 1
</select>
<select id="selectOneByExampleWithBLOBs" parameterType="com.wwdz.ch.db.domain.MessageContentExample" resultMap="ResultMapWithBLOBs">
<!--
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" />
,
<include refid="Blob_Column_List" />
from message_content
<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="ResultMapWithBLOBs">
<!--
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, sender_id, `type`, create_time, content
</otherwise>
</choose>
from message_content
<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
<?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.MessageRecordMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.MessageRecord">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="receiver_id" jdbcType="BIGINT" property="receiverId" />
<result column="message_id" jdbcType="INTEGER" property="messageId" />
<result column="state" jdbcType="INTEGER" property="state" />
<result column="try_num" jdbcType="INTEGER" property="tryNum" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</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, receiver_id, message_id, `state`, try_num, `type`, create_time, update_time
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.MessageRecordExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from message_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 &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, receiver_id, message_id, `state`, try_num, `type`, create_time, update_time
</otherwise>
</choose>
from message_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 message_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 &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, receiver_id, message_id, `state`, try_num, `type`, create_time, update_time
</otherwise>
</choose>
from message_record
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from message_record
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wwdz.ch.db.domain.MessageRecordExample">
delete from message_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.MessageRecord">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into message_record (receiver_id, message_id, `state`,
try_num, `type`, create_time,
update_time)
values (#{receiverId,jdbcType=BIGINT}, #{messageId,jdbcType=INTEGER}, #{state,jdbcType=INTEGER},
#{tryNum,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.MessageRecord">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into message_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="receiverId != null">
receiver_id,
</if>
<if test="messageId != null">
message_id,
</if>
<if test="state != null">
`state`,
</if>
<if test="tryNum != null">
try_num,
</if>
<if test="type != null">
`type`,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="receiverId != null">
#{receiverId,jdbcType=BIGINT},
</if>
<if test="messageId != null">
#{messageId,jdbcType=INTEGER},
</if>
<if test="state != null">
#{state,jdbcType=INTEGER},
</if>
<if test="tryNum != null">
#{tryNum,jdbcType=INTEGER},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.MessageRecordExample" resultType="java.lang.Long">
select count(*) from message_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update message_record
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.receiverId != null">
receiver_id = #{record.receiverId,jdbcType=BIGINT},
</if>
<if test="record.messageId != null">
message_id = #{record.messageId,jdbcType=INTEGER},
</if>
<if test="record.state != null">
`state` = #{record.state,jdbcType=INTEGER},
</if>
<if test="record.tryNum != null">
try_num = #{record.tryNum,jdbcType=INTEGER},
</if>
<if test="record.type != null">
`type` = #{record.type,jdbcType=INTEGER},
</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>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update message_record
set id = #{record.id,jdbcType=INTEGER},
receiver_id = #{record.receiverId,jdbcType=BIGINT},
message_id = #{record.messageId,jdbcType=INTEGER},
`state` = #{record.state,jdbcType=INTEGER},
try_num = #{record.tryNum,jdbcType=INTEGER},
`type` = #{record.type,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.MessageRecord">
update message_record
<set>
<if test="receiverId != null">
receiver_id = #{receiverId,jdbcType=BIGINT},
</if>
<if test="messageId != null">
message_id = #{messageId,jdbcType=INTEGER},
</if>
<if test="state != null">
`state` = #{state,jdbcType=INTEGER},
</if>
<if test="tryNum != null">
try_num = #{tryNum,jdbcType=INTEGER},
</if>
<if test="type != null">
`type` = #{type,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.MessageRecord">
update message_record
set receiver_id = #{receiverId,jdbcType=BIGINT},
message_id = #{messageId,jdbcType=INTEGER},
`state` = #{state,jdbcType=INTEGER},
try_num = #{tryNum,jdbcType=INTEGER},
`type` = #{type,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.MessageRecordExample" 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 message_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 &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, receiver_id, message_id, `state`, try_num, `type`, create_time, update_time
</otherwise>
</choose>
from message_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
package com.wwdz.ch.wx.entity.request;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class MessageRequestDto implements Entity {
/**
* 发送者id
*/
private Long senderId;
/**
* 消息类型
*/
private Integer type;
/**
* 消息内容
*/
private String content;
/**
* 接收者id
*/
private Long receiverId;
/**
* 对应消息id
*/
private Integer messageId;
private List<Integer> messageIdList;
/**
* 消息状态
*/
private Integer state;
/**
* 重试次数
*/
private Integer tryNum;
/**
* 创建时间
*/
private Date createTime;
}
package com.wwdz.ch.wx.entity.vo;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class FollowFansRecordVo implements Entity {
private Integer id;
/**
* 粉丝id
*/
private Long fansId;
private String fansName;
/**
* 被关注者id
*/
private Long followerId;
private String followerName;
/**
* 关系(已关注,互相关注, 回关)
*/
private String relation;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 状态
*/
private Integer state;
private String stateName;
}
package com.wwdz.ch.wx.entity.vo;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
import java.util.Map;
@Data
public class MessageVo implements Entity {
/**
* 发送者id
*/
private Long senderId;
private String senderName;
/**
* 消息类型
*/
private Integer type;
private String typeName;
/**
* 消息内容
*/
private Map<String, Object> content;
/**
* 接收者id
*/
private Long receiverId;
private String receiverName;
/**
* 对应消息id
*/
private Integer messageId;
/**
* 消息状态
*/
private Integer state;
/**
* 重试次数
*/
private Integer tryNum;
/**
* 创建时间
*/
private Date createTime;
}
package com.wwdz.ch.wx.impl;
import com.wwdz.ch.core.consts.ResultCode;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.CacheUtil;
import com.wwdz.ch.db.dao.FollowFansRecordDao;
import com.wwdz.ch.db.domain.FollowFansRecord;
import com.wwdz.ch.db.dto.request.FollowFansRecordRequestDto;
import com.wwdz.ch.wx.entity.vo.FollowFansRecordVo;
import com.wwdz.ch.wx.service.FollowFansRecordService;
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.*;
import java.util.stream.Collectors;
@Service
public class FollowFansRecordServiceImpl implements FollowFansRecordService {
private static final Logger logger = LoggerFactory.getLogger(FollowFansRecordServiceImpl.class);
@Autowired
FollowFansRecordDao followFansRecordDao;
@Autowired
CacheUtil cacheUtil;
@Override
public Result follow(FollowFansRecordRequestDto dto) {
try {
if (dto.getFollowerId() == null || dto.getFansId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
Date now = new Date();
FollowFansRecord followFansRecord = new FollowFansRecord();
EntityMapper.copyAttribute(dto, followFansRecord);
followFansRecord.setCreateTime(now);
followFansRecord.setUpdateTime(now);
followFansRecord.setState(1);
int id = followFansRecordDao.add(followFansRecord);
Map<String, Object> map = new HashMap<>();
map.put("recordId", id);
return Result.success(map);
} catch (Exception e) {
logger.error("{} 关注 {} error {}", dto.getFansId(), dto.getFollowerId(), e);
}
return Result.failed();
}
@Override
public Result cancelFollow(FollowFansRecordRequestDto dto) {
try {
if (dto.getId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
FollowFansRecord followFansRecord = new FollowFansRecord();
followFansRecord.setId(dto.getId());
followFansRecord.setState(0);
followFansRecordDao.delete(followFansRecord);
return Result.success();
} catch (Exception e) {
logger.error("{} 取消关注error {}", dto.getId(), e);
}
return Result.failed();
}
@Override
public Result countFollowFans(FollowFansRecordRequestDto dto) {
try {
if (dto.getSearchTargetId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
long followerNum = followFansRecordDao.countFollowers(dto.getSearchTargetId());
long fansNum = followFansRecordDao.countFans(dto.getSearchTargetId());
Map<String, Object> map = new HashMap<>();
map.put("followerNum", followerNum);
map.put("fansNum", fansNum);
return Result.success(map);
} catch (Exception e) {
logger.error("{} 查询关注和粉丝数量 {}", dto.getId(), e);
}
return Result.failed();
}
@Override
public Result findFollowList(FollowFansRecordRequestDto dto) {
try {
if (dto.getSearchTargetId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
List<FollowFansRecordVo> followFansRecordVos = new ArrayList<>();
//查询关注的人
dto.setFansId(dto.getSearchTargetId());
List<FollowFansRecord> followFansRecordList = followFansRecordDao.findList(dto);
//查询粉丝
FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto();
followFansRecordRequestDto.setFollowerId(dto.getSearchTargetId());
Result fansResult = findFansList(followFansRecordRequestDto);
if (!fansResult.getSuccess()) {
return Result.failed();
}
List<FollowFansRecord> fansRecordList = (List<FollowFansRecord>) fansResult.getData();
List<Long> fansIdList = fansRecordList.stream().map(FollowFansRecord::getFansId).collect(Collectors.toList());
followFansRecordList.forEach(f -> {
FollowFansRecordVo followFansRecordVo = new FollowFansRecordVo();
EntityMapper.copyAttribute(f, followFansRecordVo);
followFansRecordVo.setFollowerName(cacheUtil.getAppletUserNameById(f.getFansId()));
if (fansIdList.contains(f.getFollowerId().longValue())) {
followFansRecordVo.setRelation("互相关注");
} else {
followFansRecordVo.setRelation("已关注");
}
followFansRecordVos.add(followFansRecordVo);
});
return Result.success(followFansRecordVos);
} catch (Exception e) {
logger.error("{} 查询关注列表 {}", dto.getId(), e);
}
return Result.failed();
}
@Override
public Result findFansList(FollowFansRecordRequestDto dto) {
try {
if (dto.getSearchTargetId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
List<FollowFansRecordVo> followFansRecordVos = new ArrayList<>();
dto.setFollowerId(dto.getSearchTargetId());
List<FollowFansRecord> followFansRecordList = followFansRecordDao.findList(dto);
followFansRecordList.forEach(f -> {
FollowFansRecordVo followFansRecordVo = new FollowFansRecordVo();
EntityMapper.copyAttribute(f, followFansRecordVo);
followFansRecordVo.setFansName(cacheUtil.getAppletUserNameById(f.getFansId()));
followFansRecordVos.add(followFansRecordVo);
});
return Result.success(followFansRecordVos);
} catch (Exception e) {
logger.error("{} 查询粉丝列表 {}", dto.getId(), e);
}
return Result.failed();
}
}
package com.wwdz.ch.wx.impl;
import com.wwdz.ch.core.consts.MessageEnum;
import com.wwdz.ch.core.consts.ResultCode;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.CacheUtil;
import com.wwdz.ch.db.dao.MessageContentDao;
import com.wwdz.ch.db.dao.MessageRecordDao;
import com.wwdz.ch.db.domain.MessageContent;
import com.wwdz.ch.db.domain.MessageRecord;
import com.wwdz.ch.db.dto.MessageRecordRequestDto;
import com.wwdz.ch.wx.entity.request.MessageRequestDto;
import com.wwdz.ch.wx.service.MessageService;
import com.xxdxxs.entity.Entity;
import com.xxdxxs.service.FormHandler;
import com.xxdxxs.utils.EntityMapper;
import com.xxdxxs.validation.Validator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@Service
public class MessageServiceImpl implements MessageService {
private static final Logger logger = LoggerFactory.getLogger(FollowFansRecordServiceImpl.class);
@Autowired
MessageRecordDao messageRecordDao;
@Autowired
MessageContentDao messageContentDao;
@Autowired
CacheUtil cacheUtil;
@Transactional(rollbackFor = Exception.class)
@Override
public Result add(MessageRequestDto messageRequestDto) {
try {
Validator validator = new Validator(FormHandler.ofEntity(messageRequestDto));
validator.set("senderId", "发送者id").must().number()
.set("type", "消息类型").must().number()
.set("content", "消息内容").must().string()
.set("receiverId", "接收者id").must().number()
.end();
if (!validator.isValid()) {
return Result.failed(ResultCode.PARAM_ERROR.getCode(), validator.getErrorInfo());
}
Date now = new Date();
MessageContent messageContent = new MessageContent();
EntityMapper.copyAttribute(messageRequestDto, messageContent);
messageContent.setCreateTime(now);
int messageId = messageContentDao.add(messageContent);
MessageRecord messageRecord = new MessageRecord();
messageRecord.setType(messageRequestDto.getType());
messageRecord.setMessageId(messageId);
messageRecord.setReceiverId(messageRequestDto.getReceiverId());
messageRecord.setState(MessageEnum.StateEnum.UNREAD.getCode());
messageRecord.setCreateTime(now);
messageRecord.setUpdateTime(now);
messageRecord.setTryNum(0);
messageRecordDao.add(messageRecord);
return Result.success();
} catch (Exception e) {
logger.error("创建新消息 error : {}", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
return Result.failed();
}
@Override
public Result findList(MessageRequestDto messageRequestDto) {
return null;
}
@Override
public Result findUnreadNum(MessageRequestDto messageRequestDto) {
try {
if (messageRequestDto.getReceiverId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
MessageRecordRequestDto messageRecordRequestDto = new MessageRecordRequestDto();
messageRecordRequestDto.setReceiverId(messageRequestDto.getReceiverId());
messageRecordRequestDto.setState(MessageEnum.StateEnum.UNREAD.getCode());
long num = messageRecordDao.count(messageRecordRequestDto);
Map<String, Object> map = new HashMap<>();
map.put("unreadNum", num);
return Result.success(map);
} catch (Exception e) {
logger.error("统计未读消息 error : {}", e);
}
return Result.failed();
}
@Override
public Result delete(MessageRequestDto messageRequestDto) {
try {
if (messageRequestDto.getMessageId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
MessageRecord record = new MessageRecord();
record.setId(messageRequestDto.getMessageId());
record.setState(MessageEnum.StateEnum.DELETED.getCode());
record.setUpdateTime(new Date());
messageRecordDao.update(record);
return Result.success();
} catch (Exception e) {
logger.error("删除信息失败 error : {}", e);
}
return Result.failed();
}
@Override
public Result read(MessageRequestDto messageRequestDto) {
try {
if (messageRequestDto.getMessageId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
MessageRecord record = new MessageRecord();
record.setId(messageRequestDto.getMessageId());
record.setState(MessageEnum.StateEnum.READED.getCode());
record.setUpdateTime(new Date());
messageRecordDao.update(record);
return Result.success();
} catch (Exception e) {
logger.error("信息设置为已读失败 error : {}", e);
}
return Result.failed();
}
}
package com.wwdz.ch.wx.service;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.FollowFansRecordRequestDto;
public interface FollowFansRecordService {
/**
* 关注某人
* @param dto
* @return
*/
Result follow(FollowFansRecordRequestDto dto);
/**
* 取消关注某人
* @param dto
* @return
*/
Result cancelFollow(FollowFansRecordRequestDto dto);
/**
* 查询关注和粉丝人数
* @param dto
* @return
*/
Result countFollowFans(FollowFansRecordRequestDto dto);
/**
* 查询关注列表
* @param dto
* @return
*/
Result findFollowList(FollowFansRecordRequestDto dto);
/**
* 查询粉丝列表
* @param dto
* @return
*/
Result findFansList(FollowFansRecordRequestDto dto);
}
package com.wwdz.ch.wx.service;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.wx.entity.request.MessageRequestDto;
public interface MessageService {
/**
* 新增消息
* @param messageRequestDto
* @return
*/
Result add(MessageRequestDto messageRequestDto);
/**
* 查询消息列表
* @param messageRequestDto
* @return
*/
Result findList(MessageRequestDto messageRequestDto);
/**
* 统计未读消息数量
* @param messageRequestDto
* @return
*/
Result findUnreadNum(MessageRequestDto messageRequestDto);
/**
* 删除消息
* @param messageRequestDto
* @return
*/
Result delete(MessageRequestDto messageRequestDto);
/**
* 消息设置为已读
*/
Result read(MessageRequestDto messageRequestDto);
}
package com.wwdz.ch.wx.web;
import com.alibaba.fastjson.JSON;
import com.wwdz.ch.core.consts.ResultCode;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.FollowFansRecordRequestDto;
import com.wwdz.ch.wx.entity.request.QueryPriceRequestDto;
import com.wwdz.ch.wx.service.FollowFansRecordService;
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.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/follow")
public class FollowFansRecordController {
private static final Logger logger = LoggerFactory.getLogger(FollowFansRecordController.class);
@Autowired
FollowFansRecordService followFansRecordService;
@ApiOperation(value = "新增关注")
@PostMapping("/addFollow")
public Result addFollow(@RequestBody FollowFansRecordRequestDto dto) {
logger.info("新增关注,请求参数:{}", JSON.toJSONString(dto));
if (dto.getFollowerId() == null || dto.getFansId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
return followFansRecordService.follow(dto);
}
@ApiOperation(value = "取消关注")
@PostMapping("/cancelFollow")
public Result cancelFollow(@RequestBody FollowFansRecordRequestDto dto) {
logger.info("取消关注,请求参数:{}", JSON.toJSONString(dto));
if (dto.getId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
return followFansRecordService.cancelFollow(dto);
}
@ApiOperation(value = "统计关注和粉丝数量")
@PostMapping("/countFollowFans")
public Result countFollowFans(@RequestBody FollowFansRecordRequestDto dto) {
logger.info("统计关注和粉丝数量,请求参数:{}", JSON.toJSONString(dto));
if (dto.getSearchTargetId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
return followFansRecordService.countFollowFans(dto);
}
@ApiOperation(value = "查询关注列表")
@PostMapping("/findFollowList")
public Result findFollowList(@RequestBody FollowFansRecordRequestDto dto) {
logger.info("查询关注列表,请求参数:{}", JSON.toJSONString(dto));
if (dto.getSearchTargetId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
return followFansRecordService.findFollowList(dto);
}
@ApiOperation(value = "查询粉丝列表")
@PostMapping("/findFansList")
public Result findFansList(@RequestBody FollowFansRecordRequestDto dto) {
logger.info("查询粉丝列表,请求参数:{}", JSON.toJSONString(dto));
if (dto.getSearchTargetId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
return followFansRecordService.findFansList(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