Commit 2b3a4045 authored by shiyu's avatar shiyu

上传藏品

parent 37d1cf30
...@@ -2,6 +2,7 @@ package com.wwdz.ch.admin.impl; ...@@ -2,6 +2,7 @@ package com.wwdz.ch.admin.impl;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.wwdz.ch.admin.service.SysSupplierItemService; import com.wwdz.ch.admin.service.SysSupplierItemService;
import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.consts.DistributionEnum; import com.wwdz.ch.core.consts.DistributionEnum;
import com.wwdz.ch.core.entity.SupplierItemVo; import com.wwdz.ch.core.entity.SupplierItemVo;
import com.wwdz.ch.core.type.PageSearchResult; import com.wwdz.ch.core.type.PageSearchResult;
...@@ -25,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -25,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -76,6 +78,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService { ...@@ -76,6 +78,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
} else { } else {
supplierItem.setSupplyPrice(0L); supplierItem.setSupplyPrice(0L);
} }
supplierItem.setRebate(new BigDecimal(dto.getRebate()));
supplierItem.setImages(dto.getImages()); supplierItem.setImages(dto.getImages());
supplierItem.setVideos(dto.getVideos()); supplierItem.setVideos(dto.getVideos());
supplierItem.setSort(1); supplierItem.setSort(1);
...@@ -83,6 +86,8 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService { ...@@ -83,6 +86,8 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
supplierItem.setUpdateTime(now); supplierItem.setUpdateTime(now);
supplierItem.setIsOnSale(true); supplierItem.setIsOnSale(true);
supplierItem.setIsDeleted(false); supplierItem.setIsDeleted(false);
//平台上传商品使用系统默认账号
supplierItem.setUserId(CommConsts.SYSTEM_ACCOUNT);
long itemId = supplierItemDao.insert(supplierItem); long itemId = supplierItemDao.insert(supplierItem);
//竞拍商品,维护竞拍配置 //竞拍商品,维护竞拍配置
if (dto.getType() == DistributionEnum.DistributionTypeEnum.AUCTION.getCode()) { if (dto.getType() == DistributionEnum.DistributionTypeEnum.AUCTION.getCode()) {
...@@ -152,6 +157,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService { ...@@ -152,6 +157,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
if (supplierItem.getBuyLimitNum() == -1) { if (supplierItem.getBuyLimitNum() == -1) {
supplierItemVo.setIsLimitBuy(false); supplierItemVo.setIsLimitBuy(false);
} }
supplierItemVo.setRebate(supplierItem.getRebate().toPlainString());
supplierItemVo.setSupplyPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getSupplyPrice())); supplierItemVo.setSupplyPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getSupplyPrice()));
supplierItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getDistributionPrice())); supplierItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getDistributionPrice()));
supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos())); supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos()));
...@@ -206,6 +212,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService { ...@@ -206,6 +212,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
} }
SupplierItem supplierItem = new SupplierItem(); SupplierItem supplierItem = new SupplierItem();
EntityMapper.copyAttribute(dto, supplierItem); EntityMapper.copyAttribute(dto, supplierItem);
supplierItem.setRebate(new BigDecimal(dto.getRebate()));
supplierItem.setDistributionPrice(PriceUtil.convertPriceFromStr(dto.getDistributionPrice())); supplierItem.setDistributionPrice(PriceUtil.convertPriceFromStr(dto.getDistributionPrice()));
if (StringUtils.hasLength(dto.getSupplyPrice())) { if (StringUtils.hasLength(dto.getSupplyPrice())) {
supplierItem.setSupplyPrice(PriceUtil.convertPriceFromStr(dto.getSupplyPrice())); supplierItem.setSupplyPrice(PriceUtil.convertPriceFromStr(dto.getSupplyPrice()));
......
...@@ -38,5 +38,8 @@ public interface CommConsts { ...@@ -38,5 +38,8 @@ public interface CommConsts {
public static final String AUCTION_LOCK_KEY_PRE = "AUCTION:OFFER:"; public static final String AUCTION_LOCK_KEY_PRE = "AUCTION:OFFER:";
public static final Long SYSTEM_ACCOUNT = 8888888888L;
} }
...@@ -89,6 +89,7 @@ public class DistributionEnum { ...@@ -89,6 +89,7 @@ public class DistributionEnum {
public enum DistributionTypeEnum { public enum DistributionTypeEnum {
FIXED_PRICE(1, "一口价"), FIXED_PRICE(1, "一口价"),
AUCTION(2, "竞拍"), AUCTION(2, "竞拍"),
COLLECT(3, "藏品"),
; ;
private int code; private int code;
......
...@@ -106,6 +106,11 @@ public class SupplierItemVo implements Entity { ...@@ -106,6 +106,11 @@ public class SupplierItemVo implements Entity {
*/ */
private Long selledNum; private Long selledNum;
/**
* 返佣比例
*/
private String rebate;
/** /**
* 是否限购 * 是否限购
*/ */
...@@ -137,6 +142,11 @@ public class SupplierItemVo implements Entity { ...@@ -137,6 +142,11 @@ public class SupplierItemVo implements Entity {
*/ */
private Date auctionEndTime; private Date auctionEndTime;
/**
* 实际竞拍结束时间
*/
private Date realEndTime;
/** /**
* 起拍价 * 起拍价
* 单位元 需要转为分 * 单位元 需要转为分
...@@ -150,9 +160,22 @@ public class SupplierItemVo implements Entity { ...@@ -150,9 +160,22 @@ public class SupplierItemVo implements Entity {
private String addExtent; private String addExtent;
/** /**
* 实际竞拍结束时间 * 竞拍商品的状态
*/ */
private Date realEndTime; private Integer state;
/**
* 状态
*/
private String stateName;
/**
* 用户的状态
* 出价、已领先、立即支付、竞拍结束
*/
private Integer userState;
private String userStateName;
/** /**
* 是否可编辑 * 是否可编辑
...@@ -165,4 +188,10 @@ public class SupplierItemVo implements Entity { ...@@ -165,4 +188,10 @@ public class SupplierItemVo implements Entity {
*/ */
private String currentPrice; private String currentPrice;
/**
* 预计佣金
*/
private String rebateAmount;
} }
...@@ -35,10 +35,8 @@ public class PriceUtil { ...@@ -35,10 +35,8 @@ public class PriceUtil {
} }
public static String convertDoubleToString(Double price){ public static String convertDoubleToString(Double price){
BigDecimal bigDecimal = new BigDecimal(String.valueOf( price / 100)); BigDecimal bigDecimal = new BigDecimal(String.valueOf( price / 100)).setScale(2,BigDecimal.ROUND_DOWN);
DecimalFormat df = new DecimalFormat("#0.00"); return bigDecimal.stripTrailingZeros().toPlainString();
String str = df.format(bigDecimal);
return new BigDecimal(str).stripTrailingZeros().toPlainString();
} }
......
package com.wwdz.ch.db.dao.distribution;
import com.wwdz.ch.db.domain.distribution.CollectionBook;
import com.wwdz.ch.db.dto.request.distribution.CollectionBookRequestDto;
import java.util.List;
public interface CollectionBookDao {
/**
* 插入新记录
*
* @param collectionBook
* @return
*/
int insert(CollectionBook collectionBook);
/**
* 查询记录
* @param dto
* @return
*/
List<CollectionBook> find(CollectionBookRequestDto dto);
List<CollectionBook> findByUserId(long userId);
int delete(long id);
}
package com.wwdz.ch.db.dao.distribution;
import com.wwdz.ch.db.domain.distribution.CollectionItemsRelation;
import com.wwdz.ch.db.dto.request.distribution.CollectionItemsRelationRequestDto;
import java.util.List;
public interface CollectionItemsRelationDao {
/**
* 插入新记录
*
* @param collectionItemsRelation
* @return
*/
int insert(CollectionItemsRelation collectionItemsRelation);
/**
* 查询记录
* @param dto
* @return
*/
List<CollectionItemsRelation> find(CollectionItemsRelationRequestDto dto);
/**
*
* @param itemId
* @return
*/
List<CollectionItemsRelation> findByItemId(long itemId);
boolean isExisted(long bookId, long itemId);
int delete(CollectionItemsRelationRequestDto dto);
}
...@@ -25,6 +25,14 @@ public interface DistributorShareRecordDao { ...@@ -25,6 +25,14 @@ public interface DistributorShareRecordDao {
DistributorShareRecord findById(String shareId); DistributorShareRecord findById(String shareId);
/**
* 查询列表
* @param dto
* @return
*/
List<DistributorShareRecord> find(DistributorShareRecordRequestDto dto);
/** /**
* 查询最高价格的分享记录 * 查询最高价格的分享记录
* @param dto * @param dto
...@@ -39,4 +47,25 @@ public interface DistributorShareRecordDao { ...@@ -39,4 +47,25 @@ public interface DistributorShareRecordDao {
*/ */
int updateDisEnabled(long itemId); int updateDisEnabled(long itemId);
/**
* 删除分销商关于该商品的分销链接
* @param distributorId, itemId
* @return
*/
int updateDisEnabledForDistributor(long distributorId, long itemId);
/**
* 根据分销商id查询分享记录
*/
List<DistributorShareRecord> findByDistributorId(DistributorShareRecordRequestDto dto);
/**
* 查询分销商是否已经分销过该商品
* @param distributorId
* @param itemId
* @return
*
*/
DistributorShareRecord findItemShareRecordByDistributorId(long distributorId, long itemId);
} }
...@@ -18,6 +18,15 @@ public interface UserRecentBrowseDao { ...@@ -18,6 +18,15 @@ public interface UserRecentBrowseDao {
*/ */
UserRecentBrowse findByUserId(long userId); UserRecentBrowse findByUserId(long userId);
/**
* 根据用户id查询最近浏览的记录
* @param userId, distributorId
* @return
*/
boolean isExisted(long userId, long distributorId);
/** /**
* 插入新记录 * 插入新记录
* @param userRecentBrowse * @param userRecentBrowse
......
package com.wwdz.ch.db.domain.distribution;
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 2024/03/20
*/
@Data
public class CollectionBook implements Entity {
private Long id;
/**
* 用户id
*/
private Long userId;
/**
* 标题
*/
private String title;
/**
* 排序
*/
private Integer sort;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 逻辑删除
*/
private Boolean isDeleted;
private static final long serialVersionUID = 1L;
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", title=").append(title);
sb.append(", sort=").append(sort);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDeleted=").append(isDeleted);
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;
}
CollectionBook other = (CollectionBook) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
&& (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "BIGINT", false),
userId("user_id", "userId", "BIGINT", false),
title("title", "title", "VARCHAR", false),
sort("sort", "sort", "INTEGER", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false),
isDeleted("is_deleted", "isDeleted", "BIT", false);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table collection_book
*
* @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 collection_book
*
* @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 collection_book
*
* @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 collection_book
*
* @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 collection_book
*
* @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 collection_book
*
* @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 collection_book
*
* @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 collection_book
*
* @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 collection_book
*
* @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 collection_book
*
* @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 collection_book
*
* @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 collection_book
*
* @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 collection_book
*
* @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 collection_book
*
* @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 collection_book
*
* @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.distribution;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class CollectionBookExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public CollectionBookExample() {
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 collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public CollectionBookExample orderBy(String orderByClause) {
this.setOrderByClause(orderByClause);
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public CollectionBookExample 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 collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Criteria newAndCreateCriteria() {
CollectionBookExample example = new CollectionBookExample();
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(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdNotEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanOrEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanOrEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("user_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdNotEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("user_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdGreaterThanColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("user_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdGreaterThanOrEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("user_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdLessThanColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("user_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdLessThanOrEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("user_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andTitleIsNull() {
addCriterion("title is null");
return (Criteria) this;
}
public Criteria andTitleIsNotNull() {
addCriterion("title is not null");
return (Criteria) this;
}
public Criteria andTitleEqualTo(String value) {
addCriterion("title =", value, "title");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTitleEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("title = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTitleNotEqualTo(String value) {
addCriterion("title <>", value, "title");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTitleNotEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("title <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTitleGreaterThan(String value) {
addCriterion("title >", value, "title");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTitleGreaterThanColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("title > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTitleGreaterThanOrEqualTo(String value) {
addCriterion("title >=", value, "title");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTitleGreaterThanOrEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("title >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTitleLessThan(String value) {
addCriterion("title <", value, "title");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTitleLessThanColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("title < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTitleLessThanOrEqualTo(String value) {
addCriterion("title <=", value, "title");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTitleLessThanOrEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("title <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTitleLike(String value) {
addCriterion("title like", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotLike(String value) {
addCriterion("title not like", value, "title");
return (Criteria) this;
}
public Criteria andTitleIn(List<String> values) {
addCriterion("title in", values, "title");
return (Criteria) this;
}
public Criteria andTitleNotIn(List<String> values) {
addCriterion("title not in", values, "title");
return (Criteria) this;
}
public Criteria andTitleBetween(String value1, String value2) {
addCriterion("title between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andTitleNotBetween(String value1, String value2) {
addCriterion("title not between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andSortIsNull() {
addCriterion("sort is null");
return (Criteria) this;
}
public Criteria andSortIsNotNull() {
addCriterion("sort is not null");
return (Criteria) this;
}
public Criteria andSortEqualTo(Integer value) {
addCriterion("sort =", value, "sort");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSortEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("sort = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSortNotEqualTo(Integer value) {
addCriterion("sort <>", value, "sort");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSortNotEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("sort <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSortGreaterThan(Integer value) {
addCriterion("sort >", value, "sort");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSortGreaterThanColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("sort > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSortGreaterThanOrEqualTo(Integer value) {
addCriterion("sort >=", value, "sort");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSortGreaterThanOrEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("sort >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSortLessThan(Integer value) {
addCriterion("sort <", value, "sort");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSortLessThanColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("sort < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSortLessThanOrEqualTo(Integer value) {
addCriterion("sort <=", value, "sort");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSortLessThanOrEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("sort <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSortIn(List<Integer> values) {
addCriterion("sort in", values, "sort");
return (Criteria) this;
}
public Criteria andSortNotIn(List<Integer> values) {
addCriterion("sort not in", values, "sort");
return (Criteria) this;
}
public Criteria andSortBetween(Integer value1, Integer value2) {
addCriterion("sort between", value1, value2, "sort");
return (Criteria) this;
}
public Criteria andSortNotBetween(Integer value1, Integer value2) {
addCriterion("sort not between", value1, value2, "sort");
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 collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeEqualToColumn(CollectionBook.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 collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeNotEqualToColumn(CollectionBook.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 collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanColumn(CollectionBook.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 collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanOrEqualToColumn(CollectionBook.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 collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanColumn(CollectionBook.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 collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanOrEqualToColumn(CollectionBook.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 collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeEqualToColumn(CollectionBook.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 collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeNotEqualToColumn(CollectionBook.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 collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanColumn(CollectionBook.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 collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanOrEqualToColumn(CollectionBook.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 collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanColumn(CollectionBook.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 collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanOrEqualToColumn(CollectionBook.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 andIsDeletedIsNull() {
addCriterion("is_deleted is null");
return (Criteria) this;
}
public Criteria andIsDeletedIsNotNull() {
addCriterion("is_deleted is not null");
return (Criteria) this;
}
public Criteria andIsDeletedEqualTo(Boolean value) {
addCriterion("is_deleted =", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("is_deleted = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedNotEqualTo(Boolean value) {
addCriterion("is_deleted <>", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedNotEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("is_deleted <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedGreaterThan(Boolean value) {
addCriterion("is_deleted >", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedGreaterThanColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("is_deleted > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedGreaterThanOrEqualTo(Boolean value) {
addCriterion("is_deleted >=", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedGreaterThanOrEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("is_deleted >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedLessThan(Boolean value) {
addCriterion("is_deleted <", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedLessThanColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("is_deleted < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedLessThanOrEqualTo(Boolean value) {
addCriterion("is_deleted <=", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedLessThanOrEqualToColumn(CollectionBook.Column column) {
addCriterion(new StringBuilder("is_deleted <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedIn(List<Boolean> values) {
addCriterion("is_deleted in", values, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedNotIn(List<Boolean> values) {
addCriterion("is_deleted not in", values, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedBetween(Boolean value1, Boolean value2) {
addCriterion("is_deleted between", value1, value2, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedNotBetween(Boolean value1, Boolean value2) {
addCriterion("is_deleted not between", value1, value2, "isDeleted");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private CollectionBookExample example;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
protected Criteria(CollectionBookExample example) {
super();
this.example = example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public CollectionBookExample example() {
return this.example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @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 collection_book
*
* @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 collection_book
*
* @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.distribution;
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 2024/03/20
*/
@Data
public class CollectionItemsRelation implements Entity {
/**
* id
*/
private Long id;
/**
* 收藏册id
*/
private Long collectionBookId;
/**
* 用户id
*/
private Long userId;
/**
* 商品id
*/
private Long itemId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 是否删除
*/
private Boolean isDeleted;
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(", collectionBookId=").append(collectionBookId);
sb.append(", userId=").append(userId);
sb.append(", itemId=").append(itemId);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDeleted=").append(isDeleted);
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;
}
CollectionItemsRelation other = (CollectionItemsRelation) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getCollectionBookId() == null ? other.getCollectionBookId() == null : this.getCollectionBookId().equals(other.getCollectionBookId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getItemId() == null ? other.getItemId() == null : this.getItemId().equals(other.getItemId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getCollectionBookId() == null) ? 0 : getCollectionBookId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getItemId() == null) ? 0 : getItemId().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "BIGINT", false),
collectionBookId("collection_book_id", "collectionBookId", "BIGINT", false),
userId("user_id", "userId", "BIGINT", false),
itemId("item_id", "itemId", "BIGINT", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false),
isDeleted("is_deleted", "isDeleted", "BIT", false);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table collection_items_relation
*
* @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 collection_items_relation
*
* @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 collection_items_relation
*
* @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 collection_items_relation
*
* @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 collection_items_relation
*
* @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 collection_items_relation
*
* @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 collection_items_relation
*
* @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 collection_items_relation
*
* @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 collection_items_relation
*
* @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 collection_items_relation
*
* @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 collection_items_relation
*
* @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 collection_items_relation
*
* @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 collection_items_relation
*
* @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 collection_items_relation
*
* @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 collection_items_relation
*
* @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.distribution;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class CollectionItemsRelationExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public CollectionItemsRelationExample() {
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 collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public CollectionItemsRelationExample orderBy(String orderByClause) {
this.setOrderByClause(orderByClause);
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public CollectionItemsRelationExample 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 collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Criteria newAndCreateCriteria() {
CollectionItemsRelationExample example = new CollectionItemsRelationExample();
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(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdNotEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanOrEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanOrEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andCollectionBookIdIsNull() {
addCriterion("collection_book_id is null");
return (Criteria) this;
}
public Criteria andCollectionBookIdIsNotNull() {
addCriterion("collection_book_id is not null");
return (Criteria) this;
}
public Criteria andCollectionBookIdEqualTo(Long value) {
addCriterion("collection_book_id =", value, "collectionBookId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCollectionBookIdEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("collection_book_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCollectionBookIdNotEqualTo(Long value) {
addCriterion("collection_book_id <>", value, "collectionBookId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCollectionBookIdNotEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("collection_book_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCollectionBookIdGreaterThan(Long value) {
addCriterion("collection_book_id >", value, "collectionBookId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCollectionBookIdGreaterThanColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("collection_book_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCollectionBookIdGreaterThanOrEqualTo(Long value) {
addCriterion("collection_book_id >=", value, "collectionBookId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCollectionBookIdGreaterThanOrEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("collection_book_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCollectionBookIdLessThan(Long value) {
addCriterion("collection_book_id <", value, "collectionBookId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCollectionBookIdLessThanColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("collection_book_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCollectionBookIdLessThanOrEqualTo(Long value) {
addCriterion("collection_book_id <=", value, "collectionBookId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCollectionBookIdLessThanOrEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("collection_book_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCollectionBookIdIn(List<Long> values) {
addCriterion("collection_book_id in", values, "collectionBookId");
return (Criteria) this;
}
public Criteria andCollectionBookIdNotIn(List<Long> values) {
addCriterion("collection_book_id not in", values, "collectionBookId");
return (Criteria) this;
}
public Criteria andCollectionBookIdBetween(Long value1, Long value2) {
addCriterion("collection_book_id between", value1, value2, "collectionBookId");
return (Criteria) this;
}
public Criteria andCollectionBookIdNotBetween(Long value1, Long value2) {
addCriterion("collection_book_id not between", value1, value2, "collectionBookId");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("user_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdNotEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("user_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdGreaterThanColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("user_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdGreaterThanOrEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("user_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdLessThanColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("user_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdLessThanOrEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("user_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andItemIdIsNull() {
addCriterion("item_id is null");
return (Criteria) this;
}
public Criteria andItemIdIsNotNull() {
addCriterion("item_id is not null");
return (Criteria) this;
}
public Criteria andItemIdEqualTo(Long value) {
addCriterion("item_id =", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("item_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdNotEqualTo(Long value) {
addCriterion("item_id <>", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdNotEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("item_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdGreaterThan(Long value) {
addCriterion("item_id >", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdGreaterThanColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("item_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdGreaterThanOrEqualTo(Long value) {
addCriterion("item_id >=", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdGreaterThanOrEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("item_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdLessThan(Long value) {
addCriterion("item_id <", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdLessThanColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("item_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdLessThanOrEqualTo(Long value) {
addCriterion("item_id <=", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdLessThanOrEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("item_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdIn(List<Long> values) {
addCriterion("item_id in", values, "itemId");
return (Criteria) this;
}
public Criteria andItemIdNotIn(List<Long> values) {
addCriterion("item_id not in", values, "itemId");
return (Criteria) this;
}
public Criteria andItemIdBetween(Long value1, Long value2) {
addCriterion("item_id between", value1, value2, "itemId");
return (Criteria) this;
}
public Criteria andItemIdNotBetween(Long value1, Long value2) {
addCriterion("item_id not between", value1, value2, "itemId");
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 collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeEqualToColumn(CollectionItemsRelation.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 collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeNotEqualToColumn(CollectionItemsRelation.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 collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanColumn(CollectionItemsRelation.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 collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanOrEqualToColumn(CollectionItemsRelation.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 collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanColumn(CollectionItemsRelation.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 collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanOrEqualToColumn(CollectionItemsRelation.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 collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeEqualToColumn(CollectionItemsRelation.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 collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeNotEqualToColumn(CollectionItemsRelation.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 collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanColumn(CollectionItemsRelation.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 collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanOrEqualToColumn(CollectionItemsRelation.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 collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanColumn(CollectionItemsRelation.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 collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanOrEqualToColumn(CollectionItemsRelation.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 andIsDeletedIsNull() {
addCriterion("is_deleted is null");
return (Criteria) this;
}
public Criteria andIsDeletedIsNotNull() {
addCriterion("is_deleted is not null");
return (Criteria) this;
}
public Criteria andIsDeletedEqualTo(Boolean value) {
addCriterion("is_deleted =", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("is_deleted = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedNotEqualTo(Boolean value) {
addCriterion("is_deleted <>", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedNotEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("is_deleted <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedGreaterThan(Boolean value) {
addCriterion("is_deleted >", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedGreaterThanColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("is_deleted > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedGreaterThanOrEqualTo(Boolean value) {
addCriterion("is_deleted >=", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedGreaterThanOrEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("is_deleted >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedLessThan(Boolean value) {
addCriterion("is_deleted <", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedLessThanColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("is_deleted < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedLessThanOrEqualTo(Boolean value) {
addCriterion("is_deleted <=", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedLessThanOrEqualToColumn(CollectionItemsRelation.Column column) {
addCriterion(new StringBuilder("is_deleted <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedIn(List<Boolean> values) {
addCriterion("is_deleted in", values, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedNotIn(List<Boolean> values) {
addCriterion("is_deleted not in", values, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedBetween(Boolean value1, Boolean value2) {
addCriterion("is_deleted between", value1, value2, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedNotBetween(Boolean value1, Boolean value2) {
addCriterion("is_deleted not between", value1, value2, "isDeleted");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private CollectionItemsRelationExample example;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
protected Criteria(CollectionItemsRelationExample example) {
super();
this.example = example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public CollectionItemsRelationExample example() {
return this.example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @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 collection_items_relation
*
* @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 collection_items_relation
*
* @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.distribution; package com.wwdz.ch.db.domain.distribution;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
...@@ -10,7 +11,7 @@ import lombok.Data; ...@@ -10,7 +11,7 @@ import lombok.Data;
/** /**
* @author shiyu * @author shiyu
* @date 2024/02/29 * @date 2024/03/20
*/ */
@Data @Data
public class SupplierItem implements Entity { public class SupplierItem implements Entity {
...@@ -77,10 +78,20 @@ public class SupplierItem implements Entity { ...@@ -77,10 +78,20 @@ public class SupplierItem implements Entity {
private Integer buyLimitNum; private Integer buyLimitNum;
/** /**
* 商品类型1一口价2竞拍 * 商品类型1一口价2竞拍3用户藏品
*/ */
private Integer type; private Integer type;
/**
* 返佣比例
*/
private BigDecimal rebate;
/**
* 用户id,非用户id的为系统账号
*/
private Long userId;
/** /**
* 商品图片,分号分隔 * 商品图片,分号分隔
*/ */
...@@ -118,6 +129,8 @@ public class SupplierItem implements Entity { ...@@ -118,6 +129,8 @@ public class SupplierItem implements Entity {
sb.append(", isDeleted=").append(isDeleted); sb.append(", isDeleted=").append(isDeleted);
sb.append(", buyLimitNum=").append(buyLimitNum); sb.append(", buyLimitNum=").append(buyLimitNum);
sb.append(", type=").append(type); sb.append(", type=").append(type);
sb.append(", rebate=").append(rebate);
sb.append(", userId=").append(userId);
sb.append(", images=").append(images); sb.append(", images=").append(images);
sb.append(", videos=").append(videos); sb.append(", videos=").append(videos);
sb.append(", description=").append(description); sb.append(", description=").append(description);
...@@ -152,6 +165,8 @@ public class SupplierItem implements Entity { ...@@ -152,6 +165,8 @@ public class SupplierItem implements Entity {
&& (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted())) && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
&& (this.getBuyLimitNum() == null ? other.getBuyLimitNum() == null : this.getBuyLimitNum().equals(other.getBuyLimitNum())) && (this.getBuyLimitNum() == null ? other.getBuyLimitNum() == null : this.getBuyLimitNum().equals(other.getBuyLimitNum()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getRebate() == null ? other.getRebate() == null : this.getRebate().equals(other.getRebate()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getImages() == null ? other.getImages() == null : this.getImages().equals(other.getImages())) && (this.getImages() == null ? other.getImages() == null : this.getImages().equals(other.getImages()))
&& (this.getVideos() == null ? other.getVideos() == null : this.getVideos().equals(other.getVideos())) && (this.getVideos() == null ? other.getVideos() == null : this.getVideos().equals(other.getVideos()))
&& (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription())); && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()));
...@@ -175,6 +190,8 @@ public class SupplierItem implements Entity { ...@@ -175,6 +190,8 @@ public class SupplierItem implements Entity {
result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode()); result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
result = prime * result + ((getBuyLimitNum() == null) ? 0 : getBuyLimitNum().hashCode()); result = prime * result + ((getBuyLimitNum() == null) ? 0 : getBuyLimitNum().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getRebate() == null) ? 0 : getRebate().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getImages() == null) ? 0 : getImages().hashCode()); result = prime * result + ((getImages() == null) ? 0 : getImages().hashCode());
result = prime * result + ((getVideos() == null) ? 0 : getVideos().hashCode()); result = prime * result + ((getVideos() == null) ? 0 : getVideos().hashCode());
result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode()); result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
...@@ -203,6 +220,8 @@ public class SupplierItem implements Entity { ...@@ -203,6 +220,8 @@ public class SupplierItem implements Entity {
isDeleted("is_deleted", "isDeleted", "BIT", false), isDeleted("is_deleted", "isDeleted", "BIT", false),
buyLimitNum("buy_limit_num", "buyLimitNum", "INTEGER", false), buyLimitNum("buy_limit_num", "buyLimitNum", "INTEGER", false),
type("type", "type", "INTEGER", true), type("type", "type", "INTEGER", true),
rebate("rebate", "rebate", "DECIMAL", false),
userId("user_id", "userId", "BIGINT", false),
images("images", "images", "LONGVARCHAR", false), images("images", "images", "LONGVARCHAR", false),
videos("videos", "videos", "LONGVARCHAR", false), videos("videos", "videos", "LONGVARCHAR", false),
description("description", "description", "LONGVARCHAR", false); description("description", "description", "LONGVARCHAR", false);
......
package com.wwdz.ch.db.domain.distribution; package com.wwdz.ch.db.domain.distribution;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -2015,6 +2016,270 @@ public class SupplierItemExample { ...@@ -2015,6 +2016,270 @@ public class SupplierItemExample {
addCriterion("`type` not between", value1, value2, "type"); addCriterion("`type` not between", value1, value2, "type");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRebateIsNull() {
addCriterion("rebate is null");
return (Criteria) this;
}
public Criteria andRebateIsNotNull() {
addCriterion("rebate is not null");
return (Criteria) this;
}
public Criteria andRebateEqualTo(BigDecimal value) {
addCriterion("rebate =", value, "rebate");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRebateEqualToColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("rebate = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRebateNotEqualTo(BigDecimal value) {
addCriterion("rebate <>", value, "rebate");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRebateNotEqualToColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("rebate <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRebateGreaterThan(BigDecimal value) {
addCriterion("rebate >", value, "rebate");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRebateGreaterThanColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("rebate > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRebateGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("rebate >=", value, "rebate");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRebateGreaterThanOrEqualToColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("rebate >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRebateLessThan(BigDecimal value) {
addCriterion("rebate <", value, "rebate");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRebateLessThanColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("rebate < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRebateLessThanOrEqualTo(BigDecimal value) {
addCriterion("rebate <=", value, "rebate");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRebateLessThanOrEqualToColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("rebate <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRebateIn(List<BigDecimal> values) {
addCriterion("rebate in", values, "rebate");
return (Criteria) this;
}
public Criteria andRebateNotIn(List<BigDecimal> values) {
addCriterion("rebate not in", values, "rebate");
return (Criteria) this;
}
public Criteria andRebateBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("rebate between", value1, value2, "rebate");
return (Criteria) this;
}
public Criteria andRebateNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("rebate not between", value1, value2, "rebate");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdEqualToColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("user_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdNotEqualToColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("user_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdGreaterThanColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("user_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdGreaterThanOrEqualToColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("user_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdLessThanColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("user_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdLessThanOrEqualToColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("user_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {
......
package com.wwdz.ch.db.domain.distribution; package com.wwdz.ch.db.domain.distribution;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
...@@ -24,7 +23,7 @@ public class UserRecentBrowse implements Entity { ...@@ -24,7 +23,7 @@ public class UserRecentBrowse implements Entity {
/** /**
* 分销商id * 分销商id
*/ */
private Long distributorId; private Long sharerId;
/** /**
* 创建时间 * 创建时间
...@@ -51,7 +50,7 @@ public class UserRecentBrowse implements Entity { ...@@ -51,7 +50,7 @@ public class UserRecentBrowse implements Entity {
sb.append("Hash = ").append(hashCode()); sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id); sb.append(", id=").append(id);
sb.append(", userId=").append(userId); sb.append(", userId=").append(userId);
sb.append(", distributorId=").append(distributorId); sb.append(", distributorId=").append(sharerId);
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", shareRecordId=").append(shareRecordId); sb.append(", shareRecordId=").append(shareRecordId);
...@@ -74,7 +73,7 @@ public class UserRecentBrowse implements Entity { ...@@ -74,7 +73,7 @@ public class UserRecentBrowse implements Entity {
UserRecentBrowse other = (UserRecentBrowse) that; UserRecentBrowse other = (UserRecentBrowse) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getDistributorId() == null ? other.getDistributorId() == null : this.getDistributorId().equals(other.getDistributorId())) && (this.getSharerId() == null ? other.getSharerId() == null : this.getSharerId().equals(other.getSharerId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getShareRecordId() == null ? other.getShareRecordId() == null : this.getShareRecordId().equals(other.getShareRecordId())); && (this.getShareRecordId() == null ? other.getShareRecordId() == null : this.getShareRecordId().equals(other.getShareRecordId()));
...@@ -86,7 +85,7 @@ public class UserRecentBrowse implements Entity { ...@@ -86,7 +85,7 @@ public class UserRecentBrowse implements Entity {
int result = 1; int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getDistributorId() == null) ? 0 : getDistributorId().hashCode()); result = prime * result + ((getSharerId() == null) ? 0 : getSharerId().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getShareRecordId() == null) ? 0 : getShareRecordId().hashCode()); result = prime * result + ((getShareRecordId() == null) ? 0 : getShareRecordId().hashCode());
......
package com.wwdz.ch.db.dto.request.distribution;
import com.wwdz.ch.db.dto.request.BaseRequestDto;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class CollectionBookRequestDto extends BaseRequestDto implements Entity {
private Long id;
/**
* 用户id
*/
private Long userId;
/**
* 标题
*/
private String title;
/**
* 描述
*/
private String description;
/**
* 排序
*/
private Integer sort;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 逻辑删除
*/
private Boolean isDeleted;
/**
* 收藏册图片,用;分隔
*/
private String images;
}
package com.wwdz.ch.db.dto.request.distribution;
import com.wwdz.ch.db.dto.request.BaseRequestDto;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class CollectionItemsRelationRequestDto extends BaseRequestDto implements Entity {
/**
* id
*/
private Long id;
/**
* 收藏册id
*/
private Long collectionBookId;
/**
* 多个收藏册id
* 分号分割
*/
private String collectionBookIds;
/**
* 用户id
*/
private Long userId;
/**
* 商品id
*/
private Long itemId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 是否删除
*/
private Boolean isDeleted;
}
...@@ -5,6 +5,7 @@ import com.xxdxxs.entity.Entity; ...@@ -5,6 +5,7 @@ import com.xxdxxs.entity.Entity;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 分销分享链接记录参数类 * 分销分享链接记录参数类
...@@ -27,11 +28,21 @@ public class DistributorShareRecordRequestDto extends BaseRequestDto implements ...@@ -27,11 +28,21 @@ public class DistributorShareRecordRequestDto extends BaseRequestDto implements
*/ */
private Long itemId; private Long itemId;
/**
* 商品id集合
*/
private List<Long> itemIdList;
/** /**
* 分销商id * 分销商id
*/ */
private Long distributorId; private Long distributorId;
/**
* 分销商id
*/
private List<Long> distributorIdList;
/** /**
* 分销商店铺id * 分销商店铺id
*/ */
...@@ -42,5 +53,10 @@ public class DistributorShareRecordRequestDto extends BaseRequestDto implements ...@@ -42,5 +53,10 @@ public class DistributorShareRecordRequestDto extends BaseRequestDto implements
*/ */
private Date createTime; private Date createTime;
/**
* 类型
*/
private Integer type;
} }
...@@ -4,6 +4,7 @@ import com.wwdz.ch.db.dto.request.BaseRequestDto; ...@@ -4,6 +4,7 @@ import com.wwdz.ch.db.dto.request.BaseRequestDto;
import com.xxdxxs.entity.Entity; import com.xxdxxs.entity.Entity;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -108,6 +109,11 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity { ...@@ -108,6 +109,11 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity {
*/ */
private Boolean isShop; private Boolean isShop;
/**
* 返佣比例
*/
private String rebate;
/** /**
* 商品类型1一口价2竞拍 * 商品类型1一口价2竞拍
*/ */
...@@ -139,4 +145,12 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity { ...@@ -139,4 +145,12 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity {
* 实际竞拍结束时间 * 实际竞拍结束时间
*/ */
private Date realEndTime; private Date realEndTime;
/**
* 收藏标签id
* 分号分割,可以是多个
*/
private String collectionBookId;
} }
package com.wwdz.ch.db.impl.distribution;
import com.github.pagehelper.PageHelper;
import com.wwdz.ch.db.dao.distribution.CollectionBookDao;
import com.wwdz.ch.db.domain.distribution.CollectionBook;
import com.wwdz.ch.db.domain.distribution.CollectionBookExample;
import com.wwdz.ch.db.dto.request.distribution.CollectionBookRequestDto;
import com.wwdz.ch.db.mapper.distribution.CollectionBookMapper;
import com.xxdxxs.db.component.JdbcHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
@Repository
public class CollectionBookDaoImpl implements CollectionBookDao {
@Autowired
CollectionBookMapper collectionBookMapper;
@Override
public int insert(CollectionBook collectionBook) {
return collectionBookMapper.insert(collectionBook);
}
@Override
public List<CollectionBook> find(CollectionBookRequestDto dto) {
CollectionBookExample example = new CollectionBookExample();
CollectionBookExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(dto.getUserId(), criteria::andUserIdEqualTo);
criteria.andIsDeletedEqualTo(false);
example.setOrderByClause("update_time desc");
PageHelper.startPage(dto.getPage(), dto.getLimit());
return collectionBookMapper.selectByExample(example);
}
@Override
public List<CollectionBook> findByUserId(long userId) {
CollectionBookExample example = new CollectionBookExample();
CollectionBookExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
criteria.andIsDeletedEqualTo(false);
example.setOrderByClause("update_time desc");
return collectionBookMapper.selectByExample(example);
}
@Override
public int delete(long id) {
CollectionBook collectionBook = new CollectionBook();
collectionBook.setUpdateTime(new Date());
collectionBook.setIsDeleted(true);
collectionBook.setId(id);
return collectionBookMapper.updateByPrimaryKeySelective(collectionBook);
}
}
package com.wwdz.ch.db.impl.distribution;
import com.wwdz.ch.db.dao.distribution.CollectionItemsRelationDao;
import com.wwdz.ch.db.domain.distribution.CollectionItemsRelation;
import com.wwdz.ch.db.domain.distribution.CollectionItemsRelationExample;
import com.wwdz.ch.db.dto.request.distribution.CollectionItemsRelationRequestDto;
import com.wwdz.ch.db.mapper.distribution.CollectionItemsRelationMapper;
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 CollectionItemsRelationDaoImpl implements CollectionItemsRelationDao {
@Autowired
CollectionItemsRelationMapper collectionItemsRelationMapper;
@Override
public int insert(CollectionItemsRelation collectionItemsRelation) {
return collectionItemsRelationMapper.insert(collectionItemsRelation);
}
@Override
public List<CollectionItemsRelation> find(CollectionItemsRelationRequestDto dto) {
CollectionItemsRelationExample example = new CollectionItemsRelationExample();
CollectionItemsRelationExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(dto.getUserId(), criteria::andUserIdEqualTo);
JdbcHelper.ifPresent(dto.getCollectionBookId(), criteria::andCollectionBookIdEqualTo);
JdbcHelper.ifPresent(dto.getItemId(), criteria::andItemIdEqualTo);
return collectionItemsRelationMapper.selectByExample(example);
}
@Override
public List<CollectionItemsRelation> findByItemId(long itemId) {
CollectionItemsRelationExample example = new CollectionItemsRelationExample();
CollectionItemsRelationExample.Criteria criteria = example.createCriteria();
criteria.andItemIdEqualTo(itemId);
return collectionItemsRelationMapper.selectByExample(example);
}
@Override
public boolean isExisted(long bookId, long itemId) {
CollectionItemsRelationExample example = new CollectionItemsRelationExample();
CollectionItemsRelationExample.Criteria criteria = example.createCriteria();
criteria.andCollectionBookIdEqualTo(bookId);
criteria.andItemIdEqualTo(itemId);
return collectionItemsRelationMapper.countByExample(example) > 0;
}
@Override
public int delete(CollectionItemsRelationRequestDto dto) {
CollectionItemsRelationExample example = new CollectionItemsRelationExample();
CollectionItemsRelationExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(dto.getUserId(), criteria::andUserIdEqualTo);
JdbcHelper.ifPresent(dto.getCollectionBookId(), criteria::andCollectionBookIdEqualTo);
JdbcHelper.ifPresent(dto.getItemId(), criteria::andItemIdEqualTo);
CollectionItemsRelation collectionItemsRelation = new CollectionItemsRelation();
collectionItemsRelation.setIsDeleted(true);
return collectionItemsRelationMapper.updateByExampleSelective(collectionItemsRelation, example);
}
}
package com.wwdz.ch.db.impl.distribution; package com.wwdz.ch.db.impl.distribution;
import com.github.pagehelper.PageHelper;
import com.wwdz.ch.db.dao.distribution.DistributorShareRecordDao; import com.wwdz.ch.db.dao.distribution.DistributorShareRecordDao;
import com.wwdz.ch.db.domain.distribution.DistributorShareRecord; import com.wwdz.ch.db.domain.distribution.DistributorShareRecord;
import com.wwdz.ch.db.domain.distribution.DistributorShareRecordExample; import com.wwdz.ch.db.domain.distribution.DistributorShareRecordExample;
import com.wwdz.ch.db.dto.request.distribution.DistributorShareRecordRequestDto; import com.wwdz.ch.db.dto.request.distribution.DistributorShareRecordRequestDto;
import com.wwdz.ch.db.mapper.distribution.DistributorShareRecordMapper; import com.wwdz.ch.db.mapper.distribution.DistributorShareRecordMapper;
import com.xxdxxs.db.component.JdbcHelper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.Date; import java.util.Date;
...@@ -29,6 +31,16 @@ public class DistributorShareRecordDaoImpl implements DistributorShareRecordDao ...@@ -29,6 +31,16 @@ public class DistributorShareRecordDaoImpl implements DistributorShareRecordDao
return distributorShareRecordMapper.selectOneByExample(distributorShareRecordExample); return distributorShareRecordMapper.selectOneByExample(distributorShareRecordExample);
} }
@Override
public List<DistributorShareRecord> find(DistributorShareRecordRequestDto dto) {
DistributorShareRecordExample example = new DistributorShareRecordExample();
DistributorShareRecordExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(dto.getDistributorIdList(), criteria::andDistributorIdIn);
JdbcHelper.ifPresent(dto.getItemIdList(), criteria::andItemIdIn);
criteria.andEnabledEqualTo(true);
return distributorShareRecordMapper.selectByExample(example);
}
@Override @Override
public List<DistributorShareRecord> findMaxPriceRecord(DistributorShareRecordRequestDto dto) { public List<DistributorShareRecord> findMaxPriceRecord(DistributorShareRecordRequestDto dto) {
List<DistributorShareRecord> distributorShareRecords = distributorShareRecordMapper.findMaxPriceRecord(dto.getDistributorId()); List<DistributorShareRecord> distributorShareRecords = distributorShareRecordMapper.findMaxPriceRecord(dto.getDistributorId());
...@@ -44,4 +56,39 @@ public class DistributorShareRecordDaoImpl implements DistributorShareRecordDao ...@@ -44,4 +56,39 @@ public class DistributorShareRecordDaoImpl implements DistributorShareRecordDao
distributorShareRecord.setEnabled(false); distributorShareRecord.setEnabled(false);
return distributorShareRecordMapper.updateByExampleSelective(distributorShareRecord, distributorShareRecordExample); return distributorShareRecordMapper.updateByExampleSelective(distributorShareRecord, distributorShareRecordExample);
} }
@Override
public int updateDisEnabledForDistributor(long distributorId, long itemId) {
DistributorShareRecordExample distributorShareRecordExample = new DistributorShareRecordExample();
DistributorShareRecordExample.Criteria criteria = distributorShareRecordExample.createCriteria();
criteria.andDistributorIdEqualTo(distributorId);
criteria.andItemIdEqualTo(itemId);
DistributorShareRecord distributorShareRecord = new DistributorShareRecord();
distributorShareRecord.setEnabled(false);
return distributorShareRecordMapper.updateByExampleSelective(distributorShareRecord, distributorShareRecordExample);
}
@Override
public List<DistributorShareRecord> findByDistributorId(DistributorShareRecordRequestDto dto) {
DistributorShareRecordExample distributorShareRecordExample = new DistributorShareRecordExample();
DistributorShareRecordExample.Criteria criteria = distributorShareRecordExample.createCriteria();
criteria.andDistributorIdEqualTo(dto.getDistributorId());
criteria.andEnabledEqualTo(true);
criteria.andTypeEqualTo(dto.getType());
distributorShareRecordExample.setOrderByClause(" create_time desc");
PageHelper.startPage(dto.getPage(), dto.getLimit());
return distributorShareRecordMapper.selectByExample(distributorShareRecordExample);
}
@Override
public DistributorShareRecord findItemShareRecordByDistributorId(long distributorId, long itemId) {
DistributorShareRecordExample example = new DistributorShareRecordExample();
DistributorShareRecordExample.Criteria criteria = example.createCriteria();
criteria.andDistributorIdEqualTo(distributorId);
criteria.andItemIdEqualTo(itemId);
criteria.andEnabledEqualTo(true);
return distributorShareRecordMapper.selectOneByExample(example);
}
} }
...@@ -30,6 +30,15 @@ public class UserRecentBrowseDaoImpl implements UserRecentBrowseDao { ...@@ -30,6 +30,15 @@ public class UserRecentBrowseDaoImpl implements UserRecentBrowseDao {
return userRecentBrowseMapper.selectOneByExample(example); return userRecentBrowseMapper.selectOneByExample(example);
} }
@Override
public boolean isExisted(long userId, long distributorId) {
UserRecentBrowseExample example = new UserRecentBrowseExample();
UserRecentBrowseExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
criteria.andDistributorIdEqualTo(distributorId);
return userRecentBrowseMapper.countByExample(example) > 0;
}
@Override @Override
public int insert(UserRecentBrowse userRecentBrowse) { public int insert(UserRecentBrowse userRecentBrowse) {
return userRecentBrowseMapper.insert(userRecentBrowse); return userRecentBrowseMapper.insert(userRecentBrowse);
......
package com.wwdz.ch.db.mapper.distribution;
import com.wwdz.ch.db.domain.distribution.CollectionBook;
import com.wwdz.ch.db.domain.distribution.CollectionBookExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface CollectionBookMapper {
long countByExample(CollectionBookExample example);
int deleteByExample(CollectionBookExample example);
int deleteByPrimaryKey(Long id);
int insert(CollectionBook record);
int insertSelective(CollectionBook record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
CollectionBook selectOneByExample(CollectionBookExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
CollectionBook selectOneByExampleSelective(@Param("example") CollectionBookExample example, @Param("selective") CollectionBook.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<CollectionBook> selectByExampleSelective(@Param("example") CollectionBookExample example, @Param("selective") CollectionBook.Column ... selective);
List<CollectionBook> selectByExample(CollectionBookExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
CollectionBook selectByPrimaryKeySelective(@Param("id") Long id, @Param("selective") CollectionBook.Column ... selective);
CollectionBook selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") CollectionBook record, @Param("example") CollectionBookExample example);
int updateByExample(@Param("record") CollectionBook record, @Param("example") CollectionBookExample example);
int updateByPrimaryKeySelective(CollectionBook record);
int updateByPrimaryKey(CollectionBook record);
}
\ No newline at end of file
package com.wwdz.ch.db.mapper.distribution;
import com.wwdz.ch.db.domain.distribution.CollectionItemsRelation;
import com.wwdz.ch.db.domain.distribution.CollectionItemsRelationExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface CollectionItemsRelationMapper {
long countByExample(CollectionItemsRelationExample example);
int deleteByExample(CollectionItemsRelationExample example);
int deleteByPrimaryKey(Long id);
int insert(CollectionItemsRelation record);
int insertSelective(CollectionItemsRelation record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
CollectionItemsRelation selectOneByExample(CollectionItemsRelationExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
CollectionItemsRelation selectOneByExampleSelective(@Param("example") CollectionItemsRelationExample example, @Param("selective") CollectionItemsRelation.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<CollectionItemsRelation> selectByExampleSelective(@Param("example") CollectionItemsRelationExample example, @Param("selective") CollectionItemsRelation.Column ... selective);
List<CollectionItemsRelation> selectByExample(CollectionItemsRelationExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
CollectionItemsRelation selectByPrimaryKeySelective(@Param("id") Long id, @Param("selective") CollectionItemsRelation.Column ... selective);
CollectionItemsRelation selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") CollectionItemsRelation record, @Param("example") CollectionItemsRelationExample example);
int updateByExample(@Param("record") CollectionItemsRelation record, @Param("example") CollectionItemsRelationExample example);
int updateByPrimaryKeySelective(CollectionItemsRelation record);
int updateByPrimaryKey(CollectionItemsRelation 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.distribution.CollectionBookMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.distribution.CollectionBook">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_deleted" jdbcType="BIT" property="isDeleted" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, user_id, title, sort, create_time, update_time, is_deleted
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.CollectionBookExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from collection_book
<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, user_id, title, sort, create_time, update_time, is_deleted
</otherwise>
</choose>
from collection_book
<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.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from collection_book
where id = #{id,jdbcType=BIGINT}
</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, user_id, title, sort, create_time, update_time, is_deleted
</otherwise>
</choose>
from collection_book
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from collection_book
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.wwdz.ch.db.domain.distribution.CollectionBookExample">
delete from collection_book
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.distribution.CollectionBook">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into collection_book (user_id, title, sort,
create_time, update_time, is_deleted
)
values (#{userId,jdbcType=BIGINT}, #{title,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}
)
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.CollectionBook">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into collection_book
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="title != null">
title,
</if>
<if test="sort != null">
sort,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="isDeleted != null">
is_deleted,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDeleted != null">
#{isDeleted,jdbcType=BIT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.distribution.CollectionBookExample" resultType="java.lang.Long">
select count(*) from collection_book
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update collection_book
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.sort != null">
sort = #{record.sort,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>
<if test="record.isDeleted != null">
is_deleted = #{record.isDeleted,jdbcType=BIT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update collection_book
set id = #{record.id,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
title = #{record.title,jdbcType=VARCHAR},
sort = #{record.sort,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_deleted = #{record.isDeleted,jdbcType=BIT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.distribution.CollectionBook">
update collection_book
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDeleted != null">
is_deleted = #{isDeleted,jdbcType=BIT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.distribution.CollectionBook">
update collection_book
set user_id = #{userId,jdbcType=BIGINT},
title = #{title,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_deleted = #{isDeleted,jdbcType=BIT}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.distribution.CollectionBookExample" 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 collection_book
<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, user_id, title, sort, create_time, update_time, is_deleted
</otherwise>
</choose>
from collection_book
<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.distribution.CollectionItemsRelationMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.distribution.CollectionItemsRelation">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="collection_book_id" jdbcType="BIGINT" property="collectionBookId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="item_id" jdbcType="BIGINT" property="itemId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_deleted" jdbcType="BIT" property="isDeleted" />
</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, collection_book_id, user_id, item_id, create_time, update_time, is_deleted
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.CollectionItemsRelationExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from collection_items_relation
<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, collection_book_id, user_id, item_id, create_time, update_time, is_deleted
</otherwise>
</choose>
from collection_items_relation
<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.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from collection_items_relation
where id = #{id,jdbcType=BIGINT}
</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, collection_book_id, user_id, item_id, create_time, update_time, is_deleted
</otherwise>
</choose>
from collection_items_relation
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from collection_items_relation
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.wwdz.ch.db.domain.distribution.CollectionItemsRelationExample">
delete from collection_items_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.distribution.CollectionItemsRelation">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into collection_items_relation (collection_book_id, user_id, item_id,
create_time, update_time, is_deleted
)
values (#{collectionBookId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{itemId,jdbcType=BIGINT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}
)
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.CollectionItemsRelation">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into collection_items_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="collectionBookId != null">
collection_book_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="itemId != null">
item_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="isDeleted != null">
is_deleted,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="collectionBookId != null">
#{collectionBookId,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="itemId != null">
#{itemId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDeleted != null">
#{isDeleted,jdbcType=BIT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.distribution.CollectionItemsRelationExample" resultType="java.lang.Long">
select count(*) from collection_items_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update collection_items_relation
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.collectionBookId != null">
collection_book_id = #{record.collectionBookId,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.itemId != null">
item_id = #{record.itemId,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.isDeleted != null">
is_deleted = #{record.isDeleted,jdbcType=BIT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update collection_items_relation
set id = #{record.id,jdbcType=BIGINT},
collection_book_id = #{record.collectionBookId,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
item_id = #{record.itemId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_deleted = #{record.isDeleted,jdbcType=BIT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.distribution.CollectionItemsRelation">
update collection_items_relation
<set>
<if test="collectionBookId != null">
collection_book_id = #{collectionBookId,jdbcType=BIGINT},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="itemId != null">
item_id = #{itemId,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="isDeleted != null">
is_deleted = #{isDeleted,jdbcType=BIT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.distribution.CollectionItemsRelation">
update collection_items_relation
set collection_book_id = #{collectionBookId,jdbcType=BIGINT},
user_id = #{userId,jdbcType=BIGINT},
item_id = #{itemId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_deleted = #{isDeleted,jdbcType=BIT}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.distribution.CollectionItemsRelationExample" 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 collection_items_relation
<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, collection_book_id, user_id, item_id, create_time, update_time, is_deleted
</otherwise>
</choose>
from collection_items_relation
<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
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
<result column="is_deleted" jdbcType="BIT" property="isDeleted" /> <result column="is_deleted" jdbcType="BIT" property="isDeleted" />
<result column="buy_limit_num" jdbcType="INTEGER" property="buyLimitNum" /> <result column="buy_limit_num" jdbcType="INTEGER" property="buyLimitNum" />
<result column="type" jdbcType="INTEGER" property="type" /> <result column="type" jdbcType="INTEGER" property="type" />
<result column="rebate" jdbcType="DECIMAL" property="rebate" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.wwdz.ch.db.domain.distribution.SupplierItem"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.wwdz.ch.db.domain.distribution.SupplierItem">
<result column="images" jdbcType="LONGVARCHAR" property="images" /> <result column="images" jdbcType="LONGVARCHAR" property="images" />
...@@ -82,7 +84,7 @@ ...@@ -82,7 +84,7 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price, id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type` stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, user_id
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
images, videos, description images, videos, description
...@@ -138,8 +140,8 @@ ...@@ -138,8 +140,8 @@
</when> </when>
<otherwise> <otherwise>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price, id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, images, videos, stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, user_id,
description images, videos, description
</otherwise> </otherwise>
</choose> </choose>
from supplier_item from supplier_item
...@@ -173,8 +175,8 @@ ...@@ -173,8 +175,8 @@
</when> </when>
<otherwise> <otherwise>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price, id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, images, videos, stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, user_id,
description images, videos, description
</otherwise> </otherwise>
</choose> </choose>
from supplier_item from supplier_item
...@@ -198,14 +200,16 @@ ...@@ -198,14 +200,16 @@
sort, top_image, distribution_price, sort, top_image, distribution_price,
supply_price, stock, create_time, supply_price, stock, create_time,
update_time, is_deleted, buy_limit_num, update_time, is_deleted, buy_limit_num,
`type`, images, videos, `type`, rebate, user_id,
description) images, videos, description
)
values (#{name,jdbcType=VARCHAR}, #{supplierId,jdbcType=BIGINT}, #{isOnSale,jdbcType=BIT}, values (#{name,jdbcType=VARCHAR}, #{supplierId,jdbcType=BIGINT}, #{isOnSale,jdbcType=BIT},
#{sort,jdbcType=INTEGER}, #{topImage,jdbcType=VARCHAR}, #{distributionPrice,jdbcType=BIGINT}, #{sort,jdbcType=INTEGER}, #{topImage,jdbcType=VARCHAR}, #{distributionPrice,jdbcType=BIGINT},
#{supplyPrice,jdbcType=BIGINT}, #{stock,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{supplyPrice,jdbcType=BIGINT}, #{stock,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}, #{buyLimitNum,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}, #{buyLimitNum,jdbcType=INTEGER},
#{type,jdbcType=INTEGER}, #{images,jdbcType=LONGVARCHAR}, #{videos,jdbcType=LONGVARCHAR}, #{type,jdbcType=INTEGER}, #{rebate,jdbcType=DECIMAL}, #{userId,jdbcType=BIGINT},
#{description,jdbcType=LONGVARCHAR}) #{images,jdbcType=LONGVARCHAR}, #{videos,jdbcType=LONGVARCHAR}, #{description,jdbcType=LONGVARCHAR}
)
</insert> </insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.SupplierItem"> <insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.SupplierItem">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
...@@ -252,6 +256,12 @@ ...@@ -252,6 +256,12 @@
<if test="type != null"> <if test="type != null">
`type`, `type`,
</if> </if>
<if test="rebate != null">
rebate,
</if>
<if test="userId != null">
user_id,
</if>
<if test="images != null"> <if test="images != null">
images, images,
</if> </if>
...@@ -302,6 +312,12 @@ ...@@ -302,6 +312,12 @@
<if test="type != null"> <if test="type != null">
#{type,jdbcType=INTEGER}, #{type,jdbcType=INTEGER},
</if> </if>
<if test="rebate != null">
#{rebate,jdbcType=DECIMAL},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="images != null"> <if test="images != null">
#{images,jdbcType=LONGVARCHAR}, #{images,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -364,6 +380,12 @@ ...@@ -364,6 +380,12 @@
<if test="record.type != null"> <if test="record.type != null">
`type` = #{record.type,jdbcType=INTEGER}, `type` = #{record.type,jdbcType=INTEGER},
</if> </if>
<if test="record.rebate != null">
rebate = #{record.rebate,jdbcType=DECIMAL},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.images != null"> <if test="record.images != null">
images = #{record.images,jdbcType=LONGVARCHAR}, images = #{record.images,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -394,6 +416,8 @@ ...@@ -394,6 +416,8 @@
is_deleted = #{record.isDeleted,jdbcType=BIT}, is_deleted = #{record.isDeleted,jdbcType=BIT},
buy_limit_num = #{record.buyLimitNum,jdbcType=INTEGER}, buy_limit_num = #{record.buyLimitNum,jdbcType=INTEGER},
`type` = #{record.type,jdbcType=INTEGER}, `type` = #{record.type,jdbcType=INTEGER},
rebate = #{record.rebate,jdbcType=DECIMAL},
user_id = #{record.userId,jdbcType=BIGINT},
images = #{record.images,jdbcType=LONGVARCHAR}, images = #{record.images,jdbcType=LONGVARCHAR},
videos = #{record.videos,jdbcType=LONGVARCHAR}, videos = #{record.videos,jdbcType=LONGVARCHAR},
description = #{record.description,jdbcType=LONGVARCHAR} description = #{record.description,jdbcType=LONGVARCHAR}
...@@ -416,7 +440,9 @@ ...@@ -416,7 +440,9 @@
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_deleted = #{record.isDeleted,jdbcType=BIT}, is_deleted = #{record.isDeleted,jdbcType=BIT},
buy_limit_num = #{record.buyLimitNum,jdbcType=INTEGER}, buy_limit_num = #{record.buyLimitNum,jdbcType=INTEGER},
`type` = #{record.type,jdbcType=INTEGER} `type` = #{record.type,jdbcType=INTEGER},
rebate = #{record.rebate,jdbcType=DECIMAL},
user_id = #{record.userId,jdbcType=BIGINT}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -463,6 +489,12 @@ ...@@ -463,6 +489,12 @@
<if test="type != null"> <if test="type != null">
`type` = #{type,jdbcType=INTEGER}, `type` = #{type,jdbcType=INTEGER},
</if> </if>
<if test="rebate != null">
rebate = #{rebate,jdbcType=DECIMAL},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="images != null"> <if test="images != null">
images = #{images,jdbcType=LONGVARCHAR}, images = #{images,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -490,6 +522,8 @@ ...@@ -490,6 +522,8 @@
is_deleted = #{isDeleted,jdbcType=BIT}, is_deleted = #{isDeleted,jdbcType=BIT},
buy_limit_num = #{buyLimitNum,jdbcType=INTEGER}, buy_limit_num = #{buyLimitNum,jdbcType=INTEGER},
`type` = #{type,jdbcType=INTEGER}, `type` = #{type,jdbcType=INTEGER},
rebate = #{rebate,jdbcType=DECIMAL},
user_id = #{userId,jdbcType=BIGINT},
images = #{images,jdbcType=LONGVARCHAR}, images = #{images,jdbcType=LONGVARCHAR},
videos = #{videos,jdbcType=LONGVARCHAR}, videos = #{videos,jdbcType=LONGVARCHAR},
description = #{description,jdbcType=LONGVARCHAR} description = #{description,jdbcType=LONGVARCHAR}
...@@ -509,7 +543,9 @@ ...@@ -509,7 +543,9 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
is_deleted = #{isDeleted,jdbcType=BIT}, is_deleted = #{isDeleted,jdbcType=BIT},
buy_limit_num = #{buyLimitNum,jdbcType=INTEGER}, buy_limit_num = #{buyLimitNum,jdbcType=INTEGER},
`type` = #{type,jdbcType=INTEGER} `type` = #{type,jdbcType=INTEGER},
rebate = #{rebate,jdbcType=DECIMAL},
user_id = #{userId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.distribution.SupplierItemExample" resultMap="BaseResultMap"> <select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.distribution.SupplierItemExample" resultMap="BaseResultMap">
...@@ -566,8 +602,8 @@ ...@@ -566,8 +602,8 @@
</when> </when>
<otherwise> <otherwise>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price, id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, images, videos, stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, user_id,
description images, videos, description
</otherwise> </otherwise>
</choose> </choose>
from supplier_item from supplier_item
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.distribution" <javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.distribution"
targetProject="ch-dao/src/main/java"/> targetProject="ch-dao/src/main/java"/>
<table tableName="auction_config" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"> <table tableName="collection_items_relation" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<generatedKey column="id" sqlStatement="Mysql" identity="true" /> <generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table> </table>
......
...@@ -37,7 +37,11 @@ ...@@ -37,7 +37,11 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.wwdz.mall</groupId>
<artifactId>notify-api</artifactId>
<version>1.9.5-RELEASE</version>
</dependency>
<dependency> <dependency>
<groupId>com.github.binarywang</groupId> <groupId>com.github.binarywang</groupId>
......
...@@ -45,7 +45,7 @@ public class WebMvcConfiguration implements WebMvcConfigurer { ...@@ -45,7 +45,7 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
"/wx/returnOrder/**", "/wx/distributionOrder/confirmSigned", "/wx/distributionOrder/delivery", "/wx/distributionOrder/cancel", "/wx/returnOrder/**", "/wx/distributionOrder/confirmSigned", "/wx/distributionOrder/delivery", "/wx/distributionOrder/cancel",
"/wx/distributionOrder/refund", "/wx/distributionOrder/refund",
"/wx/supplierItem/findItemsOfCurrentDistributor" "/wx/supplierItem/findItemsOfCurrentDistributor"
// , "/wx/supplierItem/**", "/wx/shareRecord/**", "/wx/distributionOrder/**", "/wx/selfPage/**", "/wx/auctionRecord/**" , "/wx/supplierItem/**", "/wx/shareRecord/**", "/wx/distributionOrder/**", "/wx/selfPage/**", "/wx/auctionRecord/**", "/wx/shareRecord"
/* "/wx/officialAccount/**", /* "/wx/officialAccount/**",
"/wx/item/**", "/wx/item/**",
"/wx/aiAssistant/**", "/wx/aiAssistant/**",
......
package com.wwdz.ch.wx.entity.vo.distribution;
import com.xxdxxs.entity.Entity;
import lombok.Data;
@Data
public class CollectionBookVo implements Entity {
}
package com.wwdz.ch.wx.entity.vo.distribution;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
import java.util.Map;
@Data
public class DistributorShareRecordVo implements Entity {
/**
* 分享记录id
*/
private String shareId;
/**
* 商品id
*/
private Long itemId;
/**
* 商品名称
*/
private String itemName;
/**
* 商品定价,要除以100
*/
private String distributionPrice;
/**
* 用于列表展示的图片对象
*/
private Map<String, Object> homePageImage;
/**
* 分销商id
*/
private Long distributorId;
/**
* 分销商店铺id
*/
private Long shopId;
/**
* 创建时间
*/
private Date createTime;
/**
* 是否有效
*/
private Boolean enabled;
/**
* 分享类型1一口价2竞拍
*/
private Integer type;
/**
* 预计佣金
*/
private String rebateAmount;
}
...@@ -913,7 +913,6 @@ public class ItemServiceImpl implements ItemService { ...@@ -913,7 +913,6 @@ public class ItemServiceImpl implements ItemService {
userCollectBrowseNumDao.update(userCollectBrowseNum); userCollectBrowseNumDao.update(userCollectBrowseNum);
} }
} }
// 发送收藏消息 // 发送收藏消息
sendMessage(item.getId(), dto.getUserId(), MessageEnum.TypeEnum.COLLECT.getCode(), MessageEnum.ContentIdTypeEnum.ITEM.getCode()); sendMessage(item.getId(), dto.getUserId(), MessageEnum.TypeEnum.COLLECT.getCode(), MessageEnum.ContentIdTypeEnum.ITEM.getCode());
......
package com.wwdz.ch.wx.impl.distribution;
import com.github.pagehelper.PageInfo;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dao.distribution.CollectionBookDao;
import com.wwdz.ch.db.domain.distribution.CollectionBook;
import com.wwdz.ch.db.dto.request.distribution.CollectionBookRequestDto;
import com.wwdz.ch.wx.service.distribution.CollectionBookService;
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.*;
@Service
public class CollectionBookServiceImpl implements CollectionBookService {
private static final Logger logger = LoggerFactory.getLogger(CollectionBookServiceImpl.class);
@Autowired
CollectionBookDao collectionBookDao;
@Override
public Result create(CollectionBookRequestDto dto) {
try {
CollectionBook collectionBook = new CollectionBook();
EntityMapper.copyAttribute(dto, collectionBook);
collectionBook.setCreateTime(new Date());
collectionBook.setUpdateTime(new Date());
collectionBook.setIsDeleted(false);
collectionBookDao.insert(collectionBook);
return Result.success();
} catch (Exception e) {
logger.error("新建收藏册 error: {}", e);
}
return Result.failed();
}
@Override
public Result findList(CollectionBookRequestDto dto) {
try {
List<CollectionBook> collectionBookList = collectionBookDao.findByUserId(dto.getUserId());
Map<String, Object> map = new LinkedHashMap<>();
collectionBookList.forEach(collectionBook -> {
map.put("id", collectionBook.getId());
map.put("title", collectionBook.getTitle());
});
return Result.success(map);
} catch (Exception e) {
logger.error("查询收藏册 error: {}", e);
}
return Result.failed();
}
@Override
public Result delete(CollectionBookRequestDto dto) {
try {
collectionBookDao.delete(dto.getId());
return Result.success();
} catch (Exception e) {
logger.error("删除收藏册 error: {}", e);
}
return Result.failed();
}
}
package com.wwdz.ch.wx.impl.distribution;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dao.distribution.CollectionItemsRelationDao;
import com.wwdz.ch.db.domain.distribution.CollectionItemsRelation;
import com.wwdz.ch.db.dto.request.distribution.CollectionItemsRelationRequestDto;
import com.wwdz.ch.wx.service.distribution.CollectionItemsRelationService;
import com.xxdxxs.utils.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class CollectionItemsRelationServiceImpl implements CollectionItemsRelationService {
private static final Logger logger = LoggerFactory.getLogger(CollectionItemsRelationServiceImpl.class);
@Autowired
CollectionItemsRelationDao collectionItemsRelationDao;
@Override
public Result create(CollectionItemsRelationRequestDto dto) {
try {
Date now = new Date();
List<String> collectionBookIds = StringUtils.stringToList(dto.getCollectionBookIds(), ";");
collectionBookIds.forEach(collectionBookId -> {
if (!collectionItemsRelationDao.isExisted(Long.valueOf(collectionBookId), dto.getItemId())) {
CollectionItemsRelation collectionItemsRelation = new CollectionItemsRelation();
collectionItemsRelation.setCollectionBookId(Long.valueOf(collectionBookId));
collectionItemsRelation.setUserId(dto.getUserId());
collectionItemsRelation.setItemId(dto.getItemId());
collectionItemsRelation.setCreateTime(now);
collectionItemsRelation.setUpdateTime(now);
collectionItemsRelation.setIsDeleted(false);
collectionItemsRelationDao.insert(collectionItemsRelation);
}
});
}catch (Exception e) {
logger.error("查询收藏册 error: {}", e);
}
return Result.failed();
}
}
...@@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; ...@@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo;
import com.wechat.pay.java.service.refund.model.Refund; import com.wechat.pay.java.service.refund.model.Refund;
import com.wechat.pay.java.service.refund.model.Status; import com.wechat.pay.java.service.refund.model.Status;
import com.wwdz.ch.core.api.wxpay.WxPayServiceApi; import com.wwdz.ch.core.api.wxpay.WxPayServiceApi;
import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.consts.DistributionEnum; import com.wwdz.ch.core.consts.DistributionEnum;
import com.wwdz.ch.core.consts.LogisticsEnum; import com.wwdz.ch.core.consts.LogisticsEnum;
import com.wwdz.ch.core.consts.ResultCode; import com.wwdz.ch.core.consts.ResultCode;
...@@ -55,8 +56,6 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { ...@@ -55,8 +56,6 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
private static final String CREATE_ORDER_KEY_PRE = "AUCTION:CREATE:"; private static final String CREATE_ORDER_KEY_PRE = "AUCTION:CREATE:";
private final static Long SYSTEM_ACCOUNT = 8888888888L;
@Autowired @Autowired
DistributionOrderDao distributionOrderDao; DistributionOrderDao distributionOrderDao;
...@@ -421,13 +420,13 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { ...@@ -421,13 +420,13 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
DistributionOrder distributionOrder = new DistributionOrder(); DistributionOrder distributionOrder = new DistributionOrder();
distributionOrder.setItemId(itemId); distributionOrder.setItemId(itemId);
distributionOrder.setItemNum(1); distributionOrder.setItemNum(1);
distributionOrder.setShareRecordId("DA" + SYSTEM_ACCOUNT); distributionOrder.setShareRecordId("DA" + CommConsts.SYSTEM_ACCOUNT);
distributionOrder.setDistributionOrderId(distributionOrderId); distributionOrder.setDistributionOrderId(distributionOrderId);
distributionOrder.setPrepayId(prepayId); distributionOrder.setPrepayId(prepayId);
distributionOrder.setBuyerId(dto.getBuyerId()); distributionOrder.setBuyerId(dto.getBuyerId());
distributionOrder.setBuyerOpenid(dto.getBuyerOpenid()); distributionOrder.setBuyerOpenid(dto.getBuyerOpenid());
distributionOrder.setShopId(SYSTEM_ACCOUNT); distributionOrder.setShopId(CommConsts.SYSTEM_ACCOUNT);
distributionOrder.setSellerId(SYSTEM_ACCOUNT); distributionOrder.setSellerId(CommConsts.SYSTEM_ACCOUNT);
distributionOrder.setAmount(supplierItem.getDistributionPrice()); distributionOrder.setAmount(supplierItem.getDistributionPrice());
distributionOrder.setAddressId(dto.getAddressId()); distributionOrder.setAddressId(dto.getAddressId());
distributionOrder.setReceiverAddress(dto.getReceiverAddress()); distributionOrder.setReceiverAddress(dto.getReceiverAddress());
......
package com.wwdz.ch.wx.impl.distribution; package com.wwdz.ch.wx.impl.distribution;
import com.github.pagehelper.PageInfo;
import com.wwdz.ch.core.consts.DistributionEnum; import com.wwdz.ch.core.consts.DistributionEnum;
import com.wwdz.ch.core.type.PageSearchResult;
import com.wwdz.ch.core.type.Result; import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.IdUtils; import com.wwdz.ch.core.util.IdUtils;
import com.wwdz.ch.core.util.MediaUtil;
import com.wwdz.ch.core.util.PriceUtil; import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.core.util.UUID; import com.wwdz.ch.core.util.UUID;
import com.wwdz.ch.db.dao.distribution.AuctionConfigDao; import com.wwdz.ch.db.dao.distribution.AuctionConfigDao;
...@@ -12,15 +15,21 @@ import com.wwdz.ch.db.domain.distribution.AuctionConfig; ...@@ -12,15 +15,21 @@ import com.wwdz.ch.db.domain.distribution.AuctionConfig;
import com.wwdz.ch.db.domain.distribution.DistributorShareRecord; import com.wwdz.ch.db.domain.distribution.DistributorShareRecord;
import com.wwdz.ch.db.domain.distribution.SupplierItem; import com.wwdz.ch.db.domain.distribution.SupplierItem;
import com.wwdz.ch.db.dto.request.distribution.DistributorShareRecordRequestDto; import com.wwdz.ch.db.dto.request.distribution.DistributorShareRecordRequestDto;
import com.wwdz.ch.wx.entity.vo.distribution.DistributorShareRecordVo;
import com.wwdz.ch.wx.service.distribution.DistributorShareRecordService; import com.wwdz.ch.wx.service.distribution.DistributorShareRecordService;
import com.xxdxxs.utils.EntityMapper;
import com.xxdxxs.utils.StringUtils;
import org.apache.commons.collections4.Put; import org.apache.commons.collections4.Put;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
@Service @Service
public class DistributorShareRecordServiceImpl implements DistributorShareRecordService { public class DistributorShareRecordServiceImpl implements DistributorShareRecordService {
...@@ -40,6 +49,10 @@ public class DistributorShareRecordServiceImpl implements DistributorShareRecord ...@@ -40,6 +49,10 @@ public class DistributorShareRecordServiceImpl implements DistributorShareRecord
@Override @Override
public Result createShareRecord(DistributorShareRecordRequestDto dto) { public Result createShareRecord(DistributorShareRecordRequestDto dto) {
try { try {
DistributorShareRecord record = distributorShareRecordDao.findItemShareRecordByDistributorId(dto.getDistributorId(), dto.getItemId());
if (record != null && StringUtils.hasLength(record.getShareId())) {
return Result.success(new HashMap<String, String>(){{put("shareId", record.getShareId());}});
}
SupplierItem supplierItem = supplierItemDao.findById(dto.getItemId()); SupplierItem supplierItem = supplierItemDao.findById(dto.getItemId());
long supplierPrice = supplierItem.getDistributionPrice(); long supplierPrice = supplierItem.getDistributionPrice();
if (supplierPrice > PriceUtil.convertPriceFromStr(dto.getPrice())) { if (supplierPrice > PriceUtil.convertPriceFromStr(dto.getPrice())) {
...@@ -74,6 +87,11 @@ public class DistributorShareRecordServiceImpl implements DistributorShareRecord ...@@ -74,6 +87,11 @@ public class DistributorShareRecordServiceImpl implements DistributorShareRecord
if (now.after(auctionConfig.getRealEndTime())) { if (now.after(auctionConfig.getRealEndTime())) {
return Result.failed("该商品已截拍"); return Result.failed("该商品已截拍");
} }
DistributorShareRecord record = distributorShareRecordDao.findItemShareRecordByDistributorId(dto.getDistributorId(), itemId);
if (record != null && StringUtils.hasLength(record.getShareId())) {
return Result.success(new HashMap<String, String>(){{put("shareId", record.getShareId());}});
}
DistributorShareRecord distributorShareRecord = new DistributorShareRecord(); DistributorShareRecord distributorShareRecord = new DistributorShareRecord();
String shareRecordId = UUID.fastUUID().toString(true); String shareRecordId = UUID.fastUUID().toString(true);
distributorShareRecord.setShareId(shareRecordId); distributorShareRecord.setShareId(shareRecordId);
...@@ -92,4 +110,51 @@ public class DistributorShareRecordServiceImpl implements DistributorShareRecord ...@@ -92,4 +110,51 @@ public class DistributorShareRecordServiceImpl implements DistributorShareRecord
} }
return Result.failed(); return Result.failed();
} }
@Override
public Result findList(DistributorShareRecordRequestDto dto) {
try {
List<DistributorShareRecord> distributorShareRecords = distributorShareRecordDao.findByDistributorId(dto);
PageInfo<DistributorShareRecord> pageInfo = new PageInfo<>(distributorShareRecords);
List<DistributorShareRecordVo> distributorShareRecordVoList = new ArrayList<>();
distributorShareRecords.forEach(distributorShareRecord -> {
DistributorShareRecordVo distributorShareRecordVo = new DistributorShareRecordVo();
EntityMapper.copyAttribute(distributorShareRecord, distributorShareRecordVo);
SupplierItem supplierItem = supplierItemDao.findById(distributorShareRecord.getItemId());
distributorShareRecordVo.setItemName(supplierItem.getName());
distributorShareRecordVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos()));
distributorShareRecordVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(distributorShareRecord.getPrice()));
String distributionPrice = supplierItem.getDistributionPrice().toString();
if (dto.getType() == DistributionEnum.DistributionTypeEnum.FIXED_PRICE.getCode()) {
BigDecimal decimal = supplierItem.getRebate().divide(new BigDecimal("100")).multiply(new BigDecimal(distributionPrice));
distributorShareRecordVo.setRebateAmount(PriceUtil.convertDoubleToString(decimal.doubleValue()));
}
distributorShareRecordVoList.add(distributorShareRecordVo);
});
return Result.success(PageSearchResult.of(pageInfo, distributorShareRecordVoList));
} catch (Exception e) {
logger.error("查询分享记录失败 error: {}", e);
}
return Result.failed();
}
@Override
public Result setInvalid(DistributorShareRecordRequestDto dto) {
try {
distributorShareRecordDao.updateDisEnabledForDistributor(dto.getDistributorId(), dto.getItemId());
return Result.success();
} catch (Exception e) {
logger.error("删除分享链接失败 error: {}", e);
}
return Result.failed();
}
public static void main(String[] args) {
String distributionPrice = "990";
BigDecimal decimal = new BigDecimal("3.00").divide(new BigDecimal("100")).multiply(new BigDecimal(distributionPrice));
System.out.println(decimal.toPlainString());
System.out.println(PriceUtil.convertDoubleToString(decimal.doubleValue()));
}
} }
...@@ -73,12 +73,12 @@ public class SelfPageServiceImpl implements SelfPageService { ...@@ -73,12 +73,12 @@ public class SelfPageServiceImpl implements SelfPageService {
}); });
//分销商卖出去的商品订单 //分销商卖出去的商品订单
selfPageInfoVo.setOrderNumForDistributor(distributionOrderNumList); selfPageInfoVo.setOrderNumForDistributor(distributionOrderNumList);
//分销商自己购买的订单 /* //分销商自己购买的订单
List<DistributionOrderNum> selfBuyNumList = distributionOrderDao.countGroupByStateForUser(dto.getUserId()); List<DistributionOrderNum> selfBuyNumList = distributionOrderDao.countGroupByStateForUser(dto.getUserId());
selfBuyNumList.forEach(s -> { selfBuyNumList.forEach(s -> {
s.setStateName(DistributionEnum.DistributionOrderStateEnum.getNameByCode(s.getState())); s.setStateName(DistributionEnum.DistributionOrderStateEnum.getNameByCode(s.getState()));
}); });
selfPageInfoVo.setOrderNum(selfBuyNumList); selfPageInfoVo.setOrderNum(selfBuyNumList);*/
return Result.success(selfPageInfoVo); return Result.success(selfPageInfoVo);
} catch (Exception e) { } catch (Exception e) {
logger.error("查询分销商个人主页失败 error : {}", e); logger.error("查询分销商个人主页失败 error : {}", e);
...@@ -121,5 +121,20 @@ public class SelfPageServiceImpl implements SelfPageService { ...@@ -121,5 +121,20 @@ public class SelfPageServiceImpl implements SelfPageService {
} }
@Override
public Result getMyOrders(SelfPageRequestDto dto) {
try {
SelfPageInfoVo selfPageInfoVo = new SelfPageInfoVo();
//分销商自己购买的订单
List<DistributionOrderNum> selfBuyNumList = distributionOrderDao.countGroupByStateForUser(dto.getUserId());
selfBuyNumList.forEach(s -> {
s.setStateName(DistributionEnum.DistributionOrderStateEnum.getNameByCode(s.getState()));
});
selfPageInfoVo.setOrderNum(selfBuyNumList);
return Result.success(selfPageInfoVo);
} catch (Exception e) {
logger.error("查询分销商我的订单数量失败 error : {}", e);
}
return Result.failed();
}
} }
...@@ -12,13 +12,16 @@ import com.wwdz.ch.db.dao.distribution.*; ...@@ -12,13 +12,16 @@ import com.wwdz.ch.db.dao.distribution.*;
import com.wwdz.ch.db.domain.Switch; import com.wwdz.ch.db.domain.Switch;
import com.wwdz.ch.db.domain.distribution.*; import com.wwdz.ch.db.domain.distribution.*;
import com.wwdz.ch.db.dto.request.distribution.AuctionRecordRequestDto; import com.wwdz.ch.db.dto.request.distribution.AuctionRecordRequestDto;
import com.wwdz.ch.db.dto.request.distribution.CollectionItemsRelationRequestDto;
import com.wwdz.ch.db.dto.request.distribution.DistributorShareRecordRequestDto; import com.wwdz.ch.db.dto.request.distribution.DistributorShareRecordRequestDto;
import com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto; import com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto;
import com.wwdz.ch.core.entity.SupplierItemVo; import com.wwdz.ch.core.entity.SupplierItemVo;
import com.wwdz.ch.wx.entity.vo.distribution.AuctionDetailVo; import com.wwdz.ch.wx.entity.vo.distribution.AuctionDetailVo;
import com.wwdz.ch.wx.entity.vo.distribution.AuctionRecordRowVo; import com.wwdz.ch.wx.entity.vo.distribution.AuctionRecordRowVo;
import com.wwdz.ch.wx.service.distribution.CollectionItemsRelationService;
import com.wwdz.ch.wx.service.distribution.DistributionOrderService; import com.wwdz.ch.wx.service.distribution.DistributionOrderService;
import com.wwdz.ch.wx.service.distribution.SupplierItemService; import com.wwdz.ch.wx.service.distribution.SupplierItemService;
import com.xxdxxs.utils.DateUtils;
import com.xxdxxs.utils.EntityMapper; import com.xxdxxs.utils.EntityMapper;
import com.xxdxxs.utils.StringUtils; import com.xxdxxs.utils.StringUtils;
import org.redisson.api.RLock; import org.redisson.api.RLock;
...@@ -30,6 +33,7 @@ import org.springframework.stereotype.Service; ...@@ -30,6 +33,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.time.Duration; import java.time.Duration;
import java.time.Instant; import java.time.Instant;
import java.util.*; import java.util.*;
...@@ -74,6 +78,12 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -74,6 +78,12 @@ public class SupplierItemServiceImpl implements SupplierItemService {
@Autowired @Autowired
DistributionOrderService distributionOrderService; DistributionOrderService distributionOrderService;
@Autowired
CollectionItemsRelationDao collectionItemsRelationDao;
@Autowired
CollectionItemsRelationService collectionItemsRelationService;
@Override @Override
public Result findList(SupplierItemRequestDto dto) { public Result findList(SupplierItemRequestDto dto) {
try { try {
...@@ -98,12 +108,9 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -98,12 +108,9 @@ public class SupplierItemServiceImpl implements SupplierItemService {
} else { } else {
//没有出价记录最新价格为0 //没有出价记录最新价格为0
supplierItemVo.setCurrentPrice("0"); supplierItemVo.setCurrentPrice("0");
/* //查询商品起拍价
AuctionConfig auctionConfig = auctionConfigDao.findByItemId(supplierItem.getId());
if (auctionConfig != null) {
supplierItemVo.setCurrentPrice(PriceUtil.convertPriceFenToYuan(auctionConfig.getStartPrice()));
}*/
} }
AuctionConfig auctionConfig = auctionConfigDao.findByItemId(supplierItem.getId());
supplierItemVo.setRealEndTime(auctionConfig.getRealEndTime());
} }
supplierItemVos.add(supplierItemVo); supplierItemVos.add(supplierItemVo);
}); });
...@@ -146,25 +153,17 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -146,25 +153,17 @@ public class SupplierItemServiceImpl implements SupplierItemService {
if (!dto.getIsShop()) { if (!dto.getIsShop()) {
supplierItemVo.setSalePrice(PriceUtil.convertPriceFenToYuan(distributorShareRecord.getPrice())); supplierItemVo.setSalePrice(PriceUtil.convertPriceFenToYuan(distributorShareRecord.getPrice()));
itemId = distributorShareRecord.getItemId(); itemId = distributorShareRecord.getItemId();
//如果用户绑定过分销商,则不做浏览记录 //做浏览记录
boolean isBinded = distributorBindDao.isExisted(dto.getUserId()); boolean flag = userRecentBrowseDao.isExisted(dto.getUserId(),distributorShareRecord.getDistributorId());
if (!isBinded) { if (!flag) {
//不存在就新增,存在浏览记录就更新
UserRecentBrowse userRecentBrowse = userRecentBrowseDao.findByUserId(dto.getUserId());
if (userRecentBrowse != null && userRecentBrowse.getUserId() != null) {
userRecentBrowse.setShareRecordId(dto.getShareRecordId());
userRecentBrowse.setDistributorId(distributorShareRecord.getDistributorId());
userRecentBrowseDao.update(userRecentBrowse);
} else {
UserRecentBrowse newRecord = new UserRecentBrowse(); UserRecentBrowse newRecord = new UserRecentBrowse();
newRecord.setShareRecordId(dto.getShareRecordId()); newRecord.setShareRecordId(dto.getShareRecordId());
newRecord.setDistributorId(distributorShareRecord.getDistributorId()); newRecord.setSharerId(distributorShareRecord.getDistributorId());
newRecord.setUserId(dto.getUserId()); newRecord.setUserId(dto.getUserId());
newRecord.setCreateTime(new Date()); newRecord.setCreateTime(new Date());
newRecord.setUpdateTime(new Date()); newRecord.setUpdateTime(new Date());
userRecentBrowseDao.insert(newRecord); userRecentBrowseDao.insert(newRecord);
} }
}
} else { } else {
//店家进入详情,需要判断是否购买过样品 //店家进入详情,需要判断是否购买过样品
if (distributionOrderDao.isBuyItem(dto.getUserId(), itemId)) { if (distributionOrderDao.isBuyItem(dto.getUserId(), itemId)) {
...@@ -179,6 +178,9 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -179,6 +178,9 @@ public class SupplierItemServiceImpl implements SupplierItemService {
supplierItemVo.setSupplyPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getSupplyPrice())); supplierItemVo.setSupplyPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getSupplyPrice()));
supplierItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getDistributionPrice())); supplierItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getDistributionPrice()));
supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos())); supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos()));
BigDecimal decimal = supplierItem.getRebate().divide(new BigDecimal("100")).multiply(new BigDecimal(supplierItem.getDistributionPrice().toString()));
supplierItemVo.setRebateAmount(PriceUtil.convertDoubleToString(decimal.doubleValue()));
supplierItemVo.setRebate(supplierItem.getRebate().toPlainString() + "%");
return Result.success(supplierItemVo); return Result.success(supplierItemVo);
} catch (Exception e) { } catch (Exception e) {
logger.error("供应商商品详情查询失败 error : {}", e); logger.error("供应商商品详情查询失败 error : {}", e);
...@@ -256,8 +258,8 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -256,8 +258,8 @@ public class SupplierItemServiceImpl implements SupplierItemService {
} else { } else {
//查询是否有最近一次浏览的分销商记录 //查询是否有最近一次浏览的分销商记录
UserRecentBrowse userRecentBrowse = userRecentBrowseDao.findByUserId(userId); UserRecentBrowse userRecentBrowse = userRecentBrowseDao.findByUserId(userId);
if (userRecentBrowse != null && userRecentBrowse.getDistributorId() != null) { if (userRecentBrowse != null && userRecentBrowse.getSharerId() != null) {
sellerId = userRecentBrowse.getDistributorId(); sellerId = userRecentBrowse.getSharerId();
} }
} }
DistributorShareRecordRequestDto distributorShareRecordRequestDto = new DistributorShareRecordRequestDto(); DistributorShareRecordRequestDto distributorShareRecordRequestDto = new DistributorShareRecordRequestDto();
...@@ -290,6 +292,8 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -290,6 +292,8 @@ public class SupplierItemServiceImpl implements SupplierItemService {
} else { } else {
supplierItemVo.setCurrentPrice("0"); supplierItemVo.setCurrentPrice("0");
} }
AuctionConfig auctionConfig = auctionConfigDao.findByItemId(supplierItem.getId());
supplierItemVo.setRealEndTime(auctionConfig.getRealEndTime());
} }
supplierItemVos.add(supplierItemVo); supplierItemVos.add(supplierItemVo);
}); });
...@@ -455,4 +459,82 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -455,4 +459,82 @@ public class SupplierItemServiceImpl implements SupplierItemService {
} }
return Result.failed(); return Result.failed();
} }
@Override
public Result create(SupplierItemRequestDto dto) {
try {
SupplierItem supplierItem = new SupplierItem();
EntityMapper.copyAttribute(dto, supplierItem);
supplierItem.setDistributionPrice(PriceUtil.convertPriceFromStr(StringUtils.isEmpty(dto.getDistributionPrice())?"0":dto.getDistributionPrice()));
supplierItem.setSupplyPrice(0L);
supplierItem.setRebate(new BigDecimal(dto.getRebate()));
supplierItem.setImages(dto.getImages());
supplierItem.setVideos(dto.getVideos());
supplierItem.setSort(1);
Date now = new Date();
supplierItem.setCreateTime(now);
supplierItem.setUpdateTime(now);
supplierItem.setIsOnSale(true);
supplierItem.setIsDeleted(false);
supplierItem.setUserId(dto.getUserId());
supplierItem.setType(DistributionEnum.DistributionTypeEnum.COLLECT.getCode());
long itemId = supplierItemDao.insert(supplierItem);
//商品对应收藏册关联
if (StringUtils.hasLength(dto.getCollectionBookId())) {
CollectionItemsRelationRequestDto collectionItemsRelationRequestDto = new CollectionItemsRelationRequestDto();
collectionItemsRelationRequestDto.setItemId(itemId);
collectionItemsRelationRequestDto.setCollectionBookIds(dto.getCollectionBookId());
collectionItemsRelationRequestDto.setUserId(dto.getUserId());
collectionItemsRelationService.create(collectionItemsRelationRequestDto);
}
return Result.success();
} catch (Exception e) {
logger.error("上传藏品失败 error : {}", e);
}
return Result.failed();
}
@Override
public Result update(SupplierItemRequestDto dto) {
try {
SupplierItem supplierItem = new SupplierItem();
EntityMapper.copyAttribute(dto, supplierItem);
supplierItem.setDistributionPrice(PriceUtil.convertPriceFromStr(StringUtils.isEmpty(dto.getDistributionPrice())?"0":dto.getDistributionPrice()));
supplierItem.setImages(dto.getImages());
supplierItem.setVideos(dto.getVideos());
supplierItemDao.update(supplierItem);
//更新相关的收藏册
if (StringUtils.hasLength(dto.getCollectionBookId())) {
CollectionItemsRelationRequestDto collectionItemsRelationRequestDto = new CollectionItemsRelationRequestDto();
collectionItemsRelationRequestDto.setItemId(dto.getId());
collectionItemsRelationRequestDto.setCollectionBookIds(dto.getCollectionBookId());
collectionItemsRelationRequestDto.setUserId(dto.getUserId());
collectionItemsRelationService.create(collectionItemsRelationRequestDto);
}
//删除去掉的标签对应的关系
List<CollectionItemsRelation> collectionItemsRelations = collectionItemsRelationDao.findByItemId(dto.getId());
if (!CollectionUtils.isEmpty(collectionItemsRelations) && StringUtils.hasLength(dto.getCollectionBookId())) {
List<Long> collectionBookIds = collectionItemsRelations.stream().map(CollectionItemsRelation::getCollectionBookId).collect(Collectors.toList());
List<String> newLinkIds = StringUtils.stringToList(dto.getCollectionBookId(), ";");
collectionBookIds.forEach(id -> {
//新选的标签中不包含原来的数据,说明该标签和商品的关联关系取消
if (!newLinkIds.contains(id.toString())) {
CollectionItemsRelationRequestDto deleteDto = new CollectionItemsRelationRequestDto();
deleteDto.setCollectionBookId(id);
deleteDto.setItemId(dto.getId());
collectionItemsRelationDao.delete(deleteDto);
}
});
}
return Result.success();
} catch (Exception e) {
logger.error("更新上传藏品失败 error : {}", e);
}
return Result.failed();
}
} }
package com.wwdz.ch.wx.service.distribution;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.distribution.CollectionBookRequestDto;
public interface CollectionBookService {
/**
* 新增收藏册
* @param dto
* @return
*/
Result create(CollectionBookRequestDto dto);
/**
* 查询收藏册
* @param dto
* @return
*/
Result findList(CollectionBookRequestDto dto);
/**
* 删除收藏册
* @param dto
* @return
*/
Result delete(CollectionBookRequestDto dto);
}
package com.wwdz.ch.wx.service.distribution;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.distribution.CollectionBookRequestDto;
import com.wwdz.ch.db.dto.request.distribution.CollectionItemsRelationRequestDto;
public interface CollectionItemsRelationService {
/**
* 新增藏品与收藏册关系
* @param dto
* @return
*/
Result create(CollectionItemsRelationRequestDto dto);
}
...@@ -19,4 +19,22 @@ public interface DistributorShareRecordService { ...@@ -19,4 +19,22 @@ public interface DistributorShareRecordService {
* @return * @return
*/ */
Result createAuctionShareRecord(DistributorShareRecordRequestDto dto); Result createAuctionShareRecord(DistributorShareRecordRequestDto dto);
/**
* 查询分享记录
* @param dto
* @return
*/
Result findList(DistributorShareRecordRequestDto dto);
/**
* 手动设置分销记录无效
* @param dto
* @return
*/
Result setInvalid(DistributorShareRecordRequestDto dto);
} }
...@@ -8,6 +8,7 @@ public interface SelfPageService { ...@@ -8,6 +8,7 @@ public interface SelfPageService {
/** /**
* 查询分销商个人主页信息 * 查询分销商个人主页信息
* 分销中心模块展示的信息
* @param dto * @param dto
* @return * @return
*/ */
...@@ -22,4 +23,12 @@ public interface SelfPageService { ...@@ -22,4 +23,12 @@ public interface SelfPageService {
Result getUserPageInfo(SelfPageRequestDto dto); Result getUserPageInfo(SelfPageRequestDto dto);
/**
* 展示我的订单数量
* @param dto
* @return
*/
Result getMyOrders(SelfPageRequestDto dto);
} }
...@@ -6,6 +6,21 @@ import com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto; ...@@ -6,6 +6,21 @@ import com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto;
public interface SupplierItemService { public interface SupplierItemService {
/**
* 上传藏品
* @param dto
* @return
*/
Result create(SupplierItemRequestDto dto);
/**
* 修改藏品
* @param dto
* @return
*/
Result update(SupplierItemRequestDto dto);
/** /**
* 查询供应商商品列表 * 查询供应商商品列表
* @param dto * @param dto
......
...@@ -61,4 +61,33 @@ public class DistributorShareRecordController { ...@@ -61,4 +61,33 @@ public class DistributorShareRecordController {
return distributorShareRecordService.createAuctionShareRecord(dto); return distributorShareRecordService.createAuctionShareRecord(dto);
} }
@ApiOperation(value = "查询分享记录")
@PostMapping("/findList")
public Result findList(@RequestBody DistributorShareRecordRequestDto dto) {
logger.info("查询分享记录,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("distributorId", "分销商id").must().number()
.end();
if (!validator.isValid()) {
return Result.failed(validator.getErrorInfo());
}
return distributorShareRecordService.findList(dto);
}
@ApiOperation(value = "手动设置分销记录无效")
@PostMapping("/setInvalid")
public Result setInvalid(@RequestBody DistributorShareRecordRequestDto dto) {
logger.info("手动设置分销记录无效,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("distributorId", "分销商id").must().number()
.set("itemId", "商品id").must().number()
.end();
if (!validator.isValid()) {
return Result.failed(validator.getErrorInfo());
}
return distributorShareRecordService.setInvalid(dto);
}
} }
...@@ -56,4 +56,18 @@ public class SelfPageController { ...@@ -56,4 +56,18 @@ public class SelfPageController {
return selfPageService.getUserPageInfo(dto); return selfPageService.getUserPageInfo(dto);
} }
@ApiOperation(value = "分销商查询自己购买的订单信息")
@PostMapping("/getMyOrders")
public Result getMyOrders(@RequestBody SelfPageRequestDto dto) {
logger.info("分销商查询自己购买的订单信息,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("userId", "用户id").must().number()
.end();
if (!validator.isValid()) {
return Result.failed(validator.getErrorInfo());
}
return selfPageService.getMyOrders(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