完成商品交易大厅相关接口

main
whb 5 months ago
parent ac9d24e475
commit c8c10c0951

@ -10,13 +10,10 @@ import com.sztzjy.trade.util.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@ -99,11 +96,6 @@ public class StuGoodsTradingCenterController {
}
@ApiOperation("购物车信息展示")
@PostMapping("/getShoppingCartInfo")
@AnonymousAccess
@ -115,6 +107,19 @@ public class StuGoodsTradingCenterController {
}
@ApiOperation("商品排序")
@PostMapping("/goodsOrder")
@AnonymousAccess
public ResultEntity goodsOrder(@ApiParam("排序关键字(商品类型) 默认:综合")String keyword,
@ApiParam("用户ID") String userId,
@ApiParam("当前页") @RequestParam(required = true, defaultValue = "1")Integer index,
@ApiParam("每页条数") @RequestParam(required = true, defaultValue = "60") Integer size,
@ApiParam("正序1倒叙0")Integer type){
return tradingCenterService.goodsOrder(keyword,userId,index,size,type);
}

@ -0,0 +1,122 @@
package com.sztzjy.trade.entity;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
/**
*
*
* @author whb
* stu_goods_comment_info
*/
public class StuGoodsCommentInfo {
@ApiModelProperty(notes = "id")
private Integer id;
@ApiModelProperty(notes = "订单号")
private String orderNumber;
@ApiModelProperty(notes = "1-5")
private Integer goodsRating;
@ApiModelProperty(notes = "商品评语")
private String goodsComment;
@ApiModelProperty(notes = "匿名评价0关闭 1开启默认关闭")
private Integer anonymousEvaluation;
@ApiModelProperty(notes = "创建时间")
private Date createTime;
@ApiModelProperty(notes = "评论层级(默认为0)")
private Integer commentHierarchy;
@ApiModelProperty(notes = "用户ID")
private String userId;
@ApiModelProperty(notes = "商品ID")
private Integer goodsId;
@ApiModelProperty(notes = "电脑传图 json类型type,url")
private String imageUpload;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getOrderNumber() {
return orderNumber;
}
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber == null ? null : orderNumber.trim();
}
public Integer getGoodsRating() {
return goodsRating;
}
public void setGoodsRating(Integer goodsRating) {
this.goodsRating = goodsRating;
}
public String getGoodsComment() {
return goodsComment;
}
public void setGoodsComment(String goodsComment) {
this.goodsComment = goodsComment == null ? null : goodsComment.trim();
}
public Integer getAnonymousEvaluation() {
return anonymousEvaluation;
}
public void setAnonymousEvaluation(Integer anonymousEvaluation) {
this.anonymousEvaluation = anonymousEvaluation;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getCommentHierarchy() {
return commentHierarchy;
}
public void setCommentHierarchy(Integer commentHierarchy) {
this.commentHierarchy = commentHierarchy;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId == null ? null : userId.trim();
}
public Integer getGoodsId() {
return goodsId;
}
public void setGoodsId(Integer goodsId) {
this.goodsId = goodsId;
}
public String getImageUpload() {
return imageUpload;
}
public void setImageUpload(String imageUpload) {
this.imageUpload = imageUpload == null ? null : imageUpload.trim();
}
}

@ -0,0 +1,770 @@
package com.sztzjy.trade.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class StuGoodsCommentInfoExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public StuGoodsCommentInfoExample() {
oredCriteria = new ArrayList<>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andOrderNumberIsNull() {
addCriterion("order_number is null");
return (Criteria) this;
}
public Criteria andOrderNumberIsNotNull() {
addCriterion("order_number is not null");
return (Criteria) this;
}
public Criteria andOrderNumberEqualTo(String value) {
addCriterion("order_number =", value, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberNotEqualTo(String value) {
addCriterion("order_number <>", value, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberGreaterThan(String value) {
addCriterion("order_number >", value, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberGreaterThanOrEqualTo(String value) {
addCriterion("order_number >=", value, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberLessThan(String value) {
addCriterion("order_number <", value, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberLessThanOrEqualTo(String value) {
addCriterion("order_number <=", value, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberLike(String value) {
addCriterion("order_number like", value, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberNotLike(String value) {
addCriterion("order_number not like", value, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberIn(List<String> values) {
addCriterion("order_number in", values, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberNotIn(List<String> values) {
addCriterion("order_number not in", values, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberBetween(String value1, String value2) {
addCriterion("order_number between", value1, value2, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberNotBetween(String value1, String value2) {
addCriterion("order_number not between", value1, value2, "orderNumber");
return (Criteria) this;
}
public Criteria andGoodsRatingIsNull() {
addCriterion("goods_rating is null");
return (Criteria) this;
}
public Criteria andGoodsRatingIsNotNull() {
addCriterion("goods_rating is not null");
return (Criteria) this;
}
public Criteria andGoodsRatingEqualTo(Integer value) {
addCriterion("goods_rating =", value, "goodsRating");
return (Criteria) this;
}
public Criteria andGoodsRatingNotEqualTo(Integer value) {
addCriterion("goods_rating <>", value, "goodsRating");
return (Criteria) this;
}
public Criteria andGoodsRatingGreaterThan(Integer value) {
addCriterion("goods_rating >", value, "goodsRating");
return (Criteria) this;
}
public Criteria andGoodsRatingGreaterThanOrEqualTo(Integer value) {
addCriterion("goods_rating >=", value, "goodsRating");
return (Criteria) this;
}
public Criteria andGoodsRatingLessThan(Integer value) {
addCriterion("goods_rating <", value, "goodsRating");
return (Criteria) this;
}
public Criteria andGoodsRatingLessThanOrEqualTo(Integer value) {
addCriterion("goods_rating <=", value, "goodsRating");
return (Criteria) this;
}
public Criteria andGoodsRatingIn(List<Integer> values) {
addCriterion("goods_rating in", values, "goodsRating");
return (Criteria) this;
}
public Criteria andGoodsRatingNotIn(List<Integer> values) {
addCriterion("goods_rating not in", values, "goodsRating");
return (Criteria) this;
}
public Criteria andGoodsRatingBetween(Integer value1, Integer value2) {
addCriterion("goods_rating between", value1, value2, "goodsRating");
return (Criteria) this;
}
public Criteria andGoodsRatingNotBetween(Integer value1, Integer value2) {
addCriterion("goods_rating not between", value1, value2, "goodsRating");
return (Criteria) this;
}
public Criteria andGoodsCommentIsNull() {
addCriterion("goods_comment is null");
return (Criteria) this;
}
public Criteria andGoodsCommentIsNotNull() {
addCriterion("goods_comment is not null");
return (Criteria) this;
}
public Criteria andGoodsCommentEqualTo(String value) {
addCriterion("goods_comment =", value, "goodsComment");
return (Criteria) this;
}
public Criteria andGoodsCommentNotEqualTo(String value) {
addCriterion("goods_comment <>", value, "goodsComment");
return (Criteria) this;
}
public Criteria andGoodsCommentGreaterThan(String value) {
addCriterion("goods_comment >", value, "goodsComment");
return (Criteria) this;
}
public Criteria andGoodsCommentGreaterThanOrEqualTo(String value) {
addCriterion("goods_comment >=", value, "goodsComment");
return (Criteria) this;
}
public Criteria andGoodsCommentLessThan(String value) {
addCriterion("goods_comment <", value, "goodsComment");
return (Criteria) this;
}
public Criteria andGoodsCommentLessThanOrEqualTo(String value) {
addCriterion("goods_comment <=", value, "goodsComment");
return (Criteria) this;
}
public Criteria andGoodsCommentLike(String value) {
addCriterion("goods_comment like", value, "goodsComment");
return (Criteria) this;
}
public Criteria andGoodsCommentNotLike(String value) {
addCriterion("goods_comment not like", value, "goodsComment");
return (Criteria) this;
}
public Criteria andGoodsCommentIn(List<String> values) {
addCriterion("goods_comment in", values, "goodsComment");
return (Criteria) this;
}
public Criteria andGoodsCommentNotIn(List<String> values) {
addCriterion("goods_comment not in", values, "goodsComment");
return (Criteria) this;
}
public Criteria andGoodsCommentBetween(String value1, String value2) {
addCriterion("goods_comment between", value1, value2, "goodsComment");
return (Criteria) this;
}
public Criteria andGoodsCommentNotBetween(String value1, String value2) {
addCriterion("goods_comment not between", value1, value2, "goodsComment");
return (Criteria) this;
}
public Criteria andAnonymousEvaluationIsNull() {
addCriterion("anonymous_evaluation is null");
return (Criteria) this;
}
public Criteria andAnonymousEvaluationIsNotNull() {
addCriterion("anonymous_evaluation is not null");
return (Criteria) this;
}
public Criteria andAnonymousEvaluationEqualTo(Integer value) {
addCriterion("anonymous_evaluation =", value, "anonymousEvaluation");
return (Criteria) this;
}
public Criteria andAnonymousEvaluationNotEqualTo(Integer value) {
addCriterion("anonymous_evaluation <>", value, "anonymousEvaluation");
return (Criteria) this;
}
public Criteria andAnonymousEvaluationGreaterThan(Integer value) {
addCriterion("anonymous_evaluation >", value, "anonymousEvaluation");
return (Criteria) this;
}
public Criteria andAnonymousEvaluationGreaterThanOrEqualTo(Integer value) {
addCriterion("anonymous_evaluation >=", value, "anonymousEvaluation");
return (Criteria) this;
}
public Criteria andAnonymousEvaluationLessThan(Integer value) {
addCriterion("anonymous_evaluation <", value, "anonymousEvaluation");
return (Criteria) this;
}
public Criteria andAnonymousEvaluationLessThanOrEqualTo(Integer value) {
addCriterion("anonymous_evaluation <=", value, "anonymousEvaluation");
return (Criteria) this;
}
public Criteria andAnonymousEvaluationIn(List<Integer> values) {
addCriterion("anonymous_evaluation in", values, "anonymousEvaluation");
return (Criteria) this;
}
public Criteria andAnonymousEvaluationNotIn(List<Integer> values) {
addCriterion("anonymous_evaluation not in", values, "anonymousEvaluation");
return (Criteria) this;
}
public Criteria andAnonymousEvaluationBetween(Integer value1, Integer value2) {
addCriterion("anonymous_evaluation between", value1, value2, "anonymousEvaluation");
return (Criteria) this;
}
public Criteria andAnonymousEvaluationNotBetween(Integer value1, Integer value2) {
addCriterion("anonymous_evaluation not between", value1, value2, "anonymousEvaluation");
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;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
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 andCommentHierarchyIsNull() {
addCriterion("comment_hierarchy is null");
return (Criteria) this;
}
public Criteria andCommentHierarchyIsNotNull() {
addCriterion("comment_hierarchy is not null");
return (Criteria) this;
}
public Criteria andCommentHierarchyEqualTo(Integer value) {
addCriterion("comment_hierarchy =", value, "commentHierarchy");
return (Criteria) this;
}
public Criteria andCommentHierarchyNotEqualTo(Integer value) {
addCriterion("comment_hierarchy <>", value, "commentHierarchy");
return (Criteria) this;
}
public Criteria andCommentHierarchyGreaterThan(Integer value) {
addCriterion("comment_hierarchy >", value, "commentHierarchy");
return (Criteria) this;
}
public Criteria andCommentHierarchyGreaterThanOrEqualTo(Integer value) {
addCriterion("comment_hierarchy >=", value, "commentHierarchy");
return (Criteria) this;
}
public Criteria andCommentHierarchyLessThan(Integer value) {
addCriterion("comment_hierarchy <", value, "commentHierarchy");
return (Criteria) this;
}
public Criteria andCommentHierarchyLessThanOrEqualTo(Integer value) {
addCriterion("comment_hierarchy <=", value, "commentHierarchy");
return (Criteria) this;
}
public Criteria andCommentHierarchyIn(List<Integer> values) {
addCriterion("comment_hierarchy in", values, "commentHierarchy");
return (Criteria) this;
}
public Criteria andCommentHierarchyNotIn(List<Integer> values) {
addCriterion("comment_hierarchy not in", values, "commentHierarchy");
return (Criteria) this;
}
public Criteria andCommentHierarchyBetween(Integer value1, Integer value2) {
addCriterion("comment_hierarchy between", value1, value2, "commentHierarchy");
return (Criteria) this;
}
public Criteria andCommentHierarchyNotBetween(Integer value1, Integer value2) {
addCriterion("comment_hierarchy not between", value1, value2, "commentHierarchy");
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(String value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(String value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(String value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(String value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(String value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(String value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLike(String value) {
addCriterion("user_id like", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotLike(String value) {
addCriterion("user_id not like", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<String> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<String> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(String value1, String value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(String value1, String value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andGoodsIdIsNull() {
addCriterion("goods_id is null");
return (Criteria) this;
}
public Criteria andGoodsIdIsNotNull() {
addCriterion("goods_id is not null");
return (Criteria) this;
}
public Criteria andGoodsIdEqualTo(Integer value) {
addCriterion("goods_id =", value, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdNotEqualTo(Integer value) {
addCriterion("goods_id <>", value, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdGreaterThan(Integer value) {
addCriterion("goods_id >", value, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdGreaterThanOrEqualTo(Integer value) {
addCriterion("goods_id >=", value, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdLessThan(Integer value) {
addCriterion("goods_id <", value, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdLessThanOrEqualTo(Integer value) {
addCriterion("goods_id <=", value, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdIn(List<Integer> values) {
addCriterion("goods_id in", values, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdNotIn(List<Integer> values) {
addCriterion("goods_id not in", values, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdBetween(Integer value1, Integer value2) {
addCriterion("goods_id between", value1, value2, "goodsId");
return (Criteria) this;
}
public Criteria andGoodsIdNotBetween(Integer value1, Integer value2) {
addCriterion("goods_id not between", value1, value2, "goodsId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -0,0 +1,155 @@
package com.sztzjy.trade.entity;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
/**
*
*
* @author whb
* stu_goods_order_info
*/
public class StuGoodsOrderInfo {
@ApiModelProperty(notes = "ID")
private Integer id;
@ApiModelProperty(notes = "订单类型")
private String orderType;
@ApiModelProperty(notes = "订单编号")
private String orderNumber;
@ApiModelProperty(notes = "商品ID")
private Integer goodsId;
@ApiModelProperty(notes = "商品名称")
private String goodsName;
@ApiModelProperty(notes = "店铺名称")
private String shopName;
@ApiModelProperty(notes = "收货人")
private String consignee;
@ApiModelProperty(notes = "下单时间")
private Date orderTime;
@ApiModelProperty(notes = "商品链接")
private String goodsUrl;
@ApiModelProperty(notes = "数量")
private Integer number;
@ApiModelProperty(notes = "收货状态0未收货 1已收货")
private Integer receiptStatus;
@ApiModelProperty(notes = "评论状态0未评论 1已评论")
private Integer commentStatus;
@ApiModelProperty(notes = "用户ID")
private String userId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getOrderType() {
return orderType;
}
public void setOrderType(String orderType) {
this.orderType = orderType == null ? null : orderType.trim();
}
public String getOrderNumber() {
return orderNumber;
}
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber == null ? null : orderNumber.trim();
}
public Integer getGoodsId() {
return goodsId;
}
public void setGoodsId(Integer goodsId) {
this.goodsId = goodsId;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName == null ? null : goodsName.trim();
}
public String getShopName() {
return shopName;
}
public void setShopName(String shopName) {
this.shopName = shopName == null ? null : shopName.trim();
}
public String getConsignee() {
return consignee;
}
public void setConsignee(String consignee) {
this.consignee = consignee == null ? null : consignee.trim();
}
public Date getOrderTime() {
return orderTime;
}
public void setOrderTime(Date orderTime) {
this.orderTime = orderTime;
}
public String getGoodsUrl() {
return goodsUrl;
}
public void setGoodsUrl(String goodsUrl) {
this.goodsUrl = goodsUrl == null ? null : goodsUrl.trim();
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public Integer getReceiptStatus() {
return receiptStatus;
}
public void setReceiptStatus(Integer receiptStatus) {
this.receiptStatus = receiptStatus;
}
public Integer getCommentStatus() {
return commentStatus;
}
public void setCommentStatus(Integer commentStatus) {
this.commentStatus = commentStatus;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId == null ? null : userId.trim();
}
}

@ -0,0 +1,69 @@
package com.sztzjy.trade.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
*
*
* @author whb
* stu_goods_sales_manage
*/
public class StuGoodsSalesManageDTO {
@ApiModelProperty(notes = "ID")
private Integer id;
@ApiModelProperty(notes = "商品ID")
private Integer goodsId;
@ApiModelProperty(notes = "商品名称")
private String goodsName;
@ApiModelProperty(notes = "商品类型")
private String goodsType;
@ApiModelProperty(notes = "商品小类")
private String goodsSubclass;
@ApiModelProperty(notes = "上架数量")
private String onlineTotal;
@ApiModelProperty(notes = "可用库存数量")
private Integer availableInventoryQuantity;
@ApiModelProperty(notes = "已售数量")
private String soldQuantity;
@ApiModelProperty(notes = "销售额")
private String salesVolume;
@ApiModelProperty(notes = "毛利率")
private String grossMargin;
@ApiModelProperty(notes = "评论数")
private Integer numberOfComments;
@ApiModelProperty(notes = "点赞数")
private Integer numberOfLikes;
@ApiModelProperty(notes = "收藏数")
private Integer numberOfCollections;
@ApiModelProperty(notes = "分享数")
private Integer numberOfShares;
@ApiModelProperty(notes = "上架时间")
private Date onlineTime;
@ApiModelProperty(notes = "是否展示1上架展示 0下架不展示")
private Integer state;
@ApiModelProperty(notes = "用户ID")
private String userId;
@ApiModelProperty(notes = "评论数量")
private Integer commentNumber;
}

@ -0,0 +1,36 @@
package com.sztzjy.trade.mapper;
import com.sztzjy.trade.entity.StuGoodsCommentInfo;
import com.sztzjy.trade.entity.StuGoodsCommentInfoExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface StuGoodsCommentInfoMapper {
long countByExample(StuGoodsCommentInfoExample example);
int deleteByExample(StuGoodsCommentInfoExample example);
int deleteByPrimaryKey(Integer id);
int insert(StuGoodsCommentInfo record);
int insertSelective(StuGoodsCommentInfo record);
List<StuGoodsCommentInfo> selectByExampleWithBLOBs(StuGoodsCommentInfoExample example);
List<StuGoodsCommentInfo> selectByExample(StuGoodsCommentInfoExample example);
StuGoodsCommentInfo selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") StuGoodsCommentInfo record, @Param("example") StuGoodsCommentInfoExample example);
int updateByExampleWithBLOBs(@Param("record") StuGoodsCommentInfo record, @Param("example") StuGoodsCommentInfoExample example);
int updateByExample(@Param("record") StuGoodsCommentInfo record, @Param("example") StuGoodsCommentInfoExample example);
int updateByPrimaryKeySelective(StuGoodsCommentInfo record);
int updateByPrimaryKeyWithBLOBs(StuGoodsCommentInfo record);
int updateByPrimaryKey(StuGoodsCommentInfo record);
}

@ -0,0 +1,30 @@
package com.sztzjy.trade.mapper;
import com.sztzjy.trade.entity.StuGoodsOrderInfo;
import com.sztzjy.trade.entity.StuGoodsOrderInfoExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface StuGoodsOrderInfoMapper {
long countByExample(StuGoodsOrderInfoExample example);
int deleteByExample(StuGoodsOrderInfoExample example);
int deleteByPrimaryKey(Integer id);
int insert(StuGoodsOrderInfo record);
int insertSelective(StuGoodsOrderInfo record);
List<StuGoodsOrderInfo> selectByExample(StuGoodsOrderInfoExample example);
StuGoodsOrderInfo selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") StuGoodsOrderInfo record, @Param("example") StuGoodsOrderInfoExample example);
int updateByExample(@Param("record") StuGoodsOrderInfo record, @Param("example") StuGoodsOrderInfoExample example);
int updateByPrimaryKeySelective(StuGoodsOrderInfo record);
int updateByPrimaryKey(StuGoodsOrderInfo record);
}

@ -30,4 +30,7 @@ public interface StuGoodsTradingCenterService {
//购物车数量
ResultEntity getNumberOfShopping(String userId);
//商品排序
ResultEntity goodsOrder(String keyword, String userId, Integer index, Integer size,Integer type);
}

@ -1,34 +1,27 @@
package com.sztzjy.trade.service.impl;
import com.sztzjy.trade.entity.StuGoodSalesManage;
import com.sztzjy.trade.entity.StuGoodSalesManageExample;
import com.sztzjy.trade.entity.StuGoodsInfo;
import com.sztzjy.trade.entity.StuGoodsInfoExample;
import com.sztzjy.trade.mapper.StuGoodSalesManageMapper;
import com.sztzjy.trade.mapper.StuGoodsInfoMapper;
import com.github.pagehelper.PageHelper;
import com.sztzjy.trade.entity.*;
import com.sztzjy.trade.entity.dto.StuGoodsSalesManageDTO;
import com.sztzjy.trade.mapper.*;
import com.github.pagehelper.PageInfo;
import com.sztzjy.trade.entity.StuShoppingCartInfo;
import com.sztzjy.trade.entity.StuShoppingCartInfoExample;
import com.sztzjy.trade.mapper.StuShoppingCartInfoMapper;
import com.sztzjy.trade.service.StuGoodsTradingCenterService;
import com.sztzjy.trade.util.ResultEntity;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import com.sztzjy.trade.util.PageUtil;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.Comparator;
import java.util.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
/**
* @author 17803
* @date 2024-10-28 09:15
* @author tz
* @date 2024-10-28 09:15
* @date 2024/10/28 15:03
*/
@Service
@ -42,6 +35,14 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
@Resource
StuShoppingCartInfoMapper shoppingCartInfoMapper;
@Autowired
private StuGoodsSalesManageMapper stuGoodsSalesManageMapper;
@Autowired
private StuGoodsOrderInfoMapper stuGoodsOrderInfoMapper;
@Autowired
private StuGoodsCommentInfoMapper stuGoodsCommentInfoMapper;
//小广告位招租
@Override
@ -59,7 +60,7 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
sorted(Comparator.comparing(StuGoodSalesManage::getSoldQuantity).reversed())
.limit(10)
.collect(Collectors.toList());
return new ResultEntity<>(HttpStatus.OK,manageSaleTenList);
return new ResultEntity<>(HttpStatus.OK, manageSaleTenList);
}
//内置16个商品以及相关信息,一般不为空
return new ResultEntity<>(HttpStatus.NO_CONTENT);
@ -76,8 +77,8 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
List<StuGoodsInfo> stuGoodsInfoList = stuGoodsInfoMapper.selectByExample(example);
if (stuGoodsInfoList != null && stuGoodsInfoList.size() > 0) {
return new ResultEntity<>(HttpStatus.OK,stuGoodsInfoList);
}else {
return new ResultEntity<>(HttpStatus.OK, stuGoodsInfoList);
} else {
return new ResultEntity<>(HttpStatus.NO_CONTENT);
}
@ -90,13 +91,13 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
StuGoodsInfoExample example = new StuGoodsInfoExample();
example.createCriteria().andUserIdEqualTo(userId).andOnlineStateEqualTo(1);
if(keyWord!=null && keyWord.length()>0){
example.createCriteria().andGoodsNameLike("%"+keyWord+"%");
if (keyWord != null && keyWord.length() > 0) {
example.createCriteria().andGoodsNameLike("%" + keyWord + "%");
}
List<StuGoodsInfo> stuGoodsInfoList = stuGoodsInfoMapper.selectByExample(example);
if (stuGoodsInfoList != null && stuGoodsInfoList.size() > 0) {
return new ResultEntity<>(HttpStatus.OK,stuGoodsInfoList);
}else {
return new ResultEntity<>(HttpStatus.OK, stuGoodsInfoList);
} else {
return new ResultEntity<>(HttpStatus.NO_CONTENT);
}
@ -104,12 +105,12 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
@Override
public PageInfo<StuShoppingCartInfo> getShoppingCartInfo(String userId, Integer index, Integer size) {
StuShoppingCartInfoExample cartInfoExample=new StuShoppingCartInfoExample();
StuShoppingCartInfoExample cartInfoExample = new StuShoppingCartInfoExample();
cartInfoExample.createCriteria().andUserIdEqualTo(userId);
List<StuShoppingCartInfo> stuShoppingCartInfos = shoppingCartInfoMapper.selectByExample(cartInfoExample);
return PageUtil.pageHelper(stuShoppingCartInfos,index,size);
return PageUtil.pageHelper(stuShoppingCartInfos, index, size);
}
@ -126,8 +127,8 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
if (goodSalesManageList.size() >= 2) {
Collections.shuffle(goodSalesManageList, new Random(System.currentTimeMillis()));
List<StuGoodSalesManage> goodSalesManageList1 = goodSalesManageList.subList(0, 2);
return new ResultEntity<>(HttpStatus.OK,goodSalesManageList1);
}else {
return new ResultEntity<>(HttpStatus.OK, goodSalesManageList1);
} else {
return new ResultEntity<>(goodSalesManageList);
}
}
@ -144,13 +145,13 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
StuGoodsInfoExample example = new StuGoodsInfoExample();
example.createCriteria().andUserIdEqualTo(userId).andOnlineStateEqualTo(1);
if(type!=null && type.length()>0){
example.createCriteria().andGoodsNameLike("%"+type+"%");
if (type != null && type.length() > 0) {
example.createCriteria().andGoodsNameLike("%" + type + "%");
}
List<StuGoodsInfo> stuGoodsInfoList = stuGoodsInfoMapper.selectByExample(example);
if (stuGoodsInfoList != null && stuGoodsInfoList.size() > 0) {
return new ResultEntity<>(HttpStatus.OK,stuGoodsInfoList);
}else {
return new ResultEntity<>(HttpStatus.OK, stuGoodsInfoList);
} else {
return new ResultEntity<>(HttpStatus.NO_CONTENT);
}
@ -160,19 +161,123 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
@Override
public ResultEntity getNumberOfShopping(String userId) {
StuShoppingCartInfoExample cartInfoExample=new StuShoppingCartInfoExample();
StuShoppingCartInfoExample cartInfoExample = new StuShoppingCartInfoExample();
cartInfoExample.createCriteria().andUserIdEqualTo(userId);
List<StuShoppingCartInfo> stuShoppingCartInfos = shoppingCartInfoMapper.selectByExample(cartInfoExample);
if (stuShoppingCartInfos != null && stuShoppingCartInfos.size() > 0) {
return new ResultEntity(HttpStatus.OK,stuShoppingCartInfos.size());
}else {
return new ResultEntity<>(HttpStatus.OK,0);
return new ResultEntity(HttpStatus.OK, stuShoppingCartInfos.size());
} else {
return new ResultEntity<>(HttpStatus.OK, 0);
}
}
//商品排序
@Override
public ResultEntity goodsOrder(String keyword, String userId, Integer index, Integer size, Integer type) {
//开启分页
PageHelper.startPage(index, size);
StuGoodSalesManageExample goodSalesManageExample = new StuGoodSalesManageExample();
StuGoodSalesManageExample.Criteria criteria = goodSalesManageExample.createCriteria();
criteria.andUserIdEqualTo(userId).andStateEqualTo(1);
//倒叙
//分页查询 默认每页展示60条商品记录
//默认综合查询根据,销售数量,评论数,创建时间排序(默认按照综合,从高到低排序)
if (keyword.equals("综合")) { //正序
String order = "";
if (type == 1) {
order = "DESC";
} else {
order = "ASC";
}
//查询所有已经上间的商品 按照规格计算并且展示
// 查询所有已经上架的商品,按照多个条件排序
// 拼接排序条件
String orderByClause = "sold_quantity " + order + ", " +
"number_of_likes " + order + ", " +
"number_of_collections " + order + ", " +
"number_of_shares " + order;
goodSalesManageExample.setOrderByClause(orderByClause);
//提取出来前25%
} else if (keyword.equals("销量")) {
//销量排序
if (type == 1) {
goodSalesManageExample.setOrderByClause("sold_quantity desc");
} else {
goodSalesManageExample.setOrderByClause("sold_quantity asc");
}
} else if (keyword.equals("新品")) {
//新品(创建时间)
if (type == 1) {
goodSalesManageExample.setOrderByClause("online_time desc");
} else {
goodSalesManageExample.setOrderByClause("online_time asc");
}
}
List<StuGoodSalesManage> goodSalesManageList = stuGoodSalesManageMapper.selectByExample(goodSalesManageExample);
if (goodSalesManageList != null && goodSalesManageList.size() > 0) {
//////////////////////////////////////////
if (keyword.equals("评论数")) {
List<Integer> collect = goodSalesManageList.stream().map(item -> item.getGoodsId()).collect(Collectors.toList());
StuGoodsCommentInfoExample commentInfoExample = new StuGoodsCommentInfoExample();
commentInfoExample.createCriteria().andUserIdEqualTo(userId);
List<StuGoodsCommentInfo> stuGoodsCommentInfoList = stuGoodsCommentInfoMapper.selectByExample(commentInfoExample);
if (!stuGoodsCommentInfoList.isEmpty())
{
// stuGoodsCommentInfoList.stream().map(item -> item.getGoodsId()).co
}
//评论数 查询多个表
if (type == 1) {
} else {
}
} else if (keyword.equals("价格")) {
//多表查询
//价格
if (type == 1) {
} else {
}
}
} else {
return new ResultEntity<>(HttpStatus.NO_CONTENT);
}
//根据商品订单查询评论层级为0的评价数量
return null;
}
}

@ -0,0 +1,341 @@
<?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.sztzjy.trade.mapper.StuGoodsCommentInfoMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.trade.entity.StuGoodsCommentInfo">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="order_number" jdbcType="VARCHAR" property="orderNumber" />
<result column="goods_rating" jdbcType="INTEGER" property="goodsRating" />
<result column="goods_comment" jdbcType="VARCHAR" property="goodsComment" />
<result column="anonymous_evaluation" jdbcType="INTEGER" property="anonymousEvaluation" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="comment_hierarchy" jdbcType="INTEGER" property="commentHierarchy" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="goods_id" jdbcType="INTEGER" property="goodsId" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.trade.entity.StuGoodsCommentInfo">
<result column="image_upload" jdbcType="LONGVARCHAR" property="imageUpload" />
</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, order_number, goods_rating, goods_comment, anonymous_evaluation, create_time,
comment_hierarchy, user_id, goods_id
</sql>
<sql id="Blob_Column_List">
image_upload
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.trade.entity.StuGoodsCommentInfoExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_goods_comment_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.sztzjy.trade.entity.StuGoodsCommentInfoExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from stu_goods_comment_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_goods_comment_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from stu_goods_comment_info
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.trade.entity.StuGoodsCommentInfoExample">
delete from stu_goods_comment_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.trade.entity.StuGoodsCommentInfo">
insert into stu_goods_comment_info (id, order_number, goods_rating,
goods_comment, anonymous_evaluation, create_time,
comment_hierarchy, user_id, goods_id,
image_upload)
values (#{id,jdbcType=INTEGER}, #{orderNumber,jdbcType=VARCHAR}, #{goodsRating,jdbcType=INTEGER},
#{goodsComment,jdbcType=VARCHAR}, #{anonymousEvaluation,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{commentHierarchy,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{goodsId,jdbcType=INTEGER},
#{imageUpload,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.trade.entity.StuGoodsCommentInfo">
insert into stu_goods_comment_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="orderNumber != null">
order_number,
</if>
<if test="goodsRating != null">
goods_rating,
</if>
<if test="goodsComment != null">
goods_comment,
</if>
<if test="anonymousEvaluation != null">
anonymous_evaluation,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="commentHierarchy != null">
comment_hierarchy,
</if>
<if test="userId != null">
user_id,
</if>
<if test="goodsId != null">
goods_id,
</if>
<if test="imageUpload != null">
image_upload,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="orderNumber != null">
#{orderNumber,jdbcType=VARCHAR},
</if>
<if test="goodsRating != null">
#{goodsRating,jdbcType=INTEGER},
</if>
<if test="goodsComment != null">
#{goodsComment,jdbcType=VARCHAR},
</if>
<if test="anonymousEvaluation != null">
#{anonymousEvaluation,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="commentHierarchy != null">
#{commentHierarchy,jdbcType=INTEGER},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="goodsId != null">
#{goodsId,jdbcType=INTEGER},
</if>
<if test="imageUpload != null">
#{imageUpload,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.trade.entity.StuGoodsCommentInfoExample" resultType="java.lang.Long">
select count(*) from stu_goods_comment_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update stu_goods_comment_info
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.orderNumber != null">
order_number = #{record.orderNumber,jdbcType=VARCHAR},
</if>
<if test="record.goodsRating != null">
goods_rating = #{record.goodsRating,jdbcType=INTEGER},
</if>
<if test="record.goodsComment != null">
goods_comment = #{record.goodsComment,jdbcType=VARCHAR},
</if>
<if test="record.anonymousEvaluation != null">
anonymous_evaluation = #{record.anonymousEvaluation,jdbcType=INTEGER},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.commentHierarchy != null">
comment_hierarchy = #{record.commentHierarchy,jdbcType=INTEGER},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.goodsId != null">
goods_id = #{record.goodsId,jdbcType=INTEGER},
</if>
<if test="record.imageUpload != null">
image_upload = #{record.imageUpload,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update stu_goods_comment_info
set id = #{record.id,jdbcType=INTEGER},
order_number = #{record.orderNumber,jdbcType=VARCHAR},
goods_rating = #{record.goodsRating,jdbcType=INTEGER},
goods_comment = #{record.goodsComment,jdbcType=VARCHAR},
anonymous_evaluation = #{record.anonymousEvaluation,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
comment_hierarchy = #{record.commentHierarchy,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=VARCHAR},
goods_id = #{record.goodsId,jdbcType=INTEGER},
image_upload = #{record.imageUpload,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_goods_comment_info
set id = #{record.id,jdbcType=INTEGER},
order_number = #{record.orderNumber,jdbcType=VARCHAR},
goods_rating = #{record.goodsRating,jdbcType=INTEGER},
goods_comment = #{record.goodsComment,jdbcType=VARCHAR},
anonymous_evaluation = #{record.anonymousEvaluation,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
comment_hierarchy = #{record.commentHierarchy,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=VARCHAR},
goods_id = #{record.goodsId,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.trade.entity.StuGoodsCommentInfo">
update stu_goods_comment_info
<set>
<if test="orderNumber != null">
order_number = #{orderNumber,jdbcType=VARCHAR},
</if>
<if test="goodsRating != null">
goods_rating = #{goodsRating,jdbcType=INTEGER},
</if>
<if test="goodsComment != null">
goods_comment = #{goodsComment,jdbcType=VARCHAR},
</if>
<if test="anonymousEvaluation != null">
anonymous_evaluation = #{anonymousEvaluation,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="commentHierarchy != null">
comment_hierarchy = #{commentHierarchy,jdbcType=INTEGER},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="goodsId != null">
goods_id = #{goodsId,jdbcType=INTEGER},
</if>
<if test="imageUpload != null">
image_upload = #{imageUpload,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.trade.entity.StuGoodsCommentInfo">
update stu_goods_comment_info
set order_number = #{orderNumber,jdbcType=VARCHAR},
goods_rating = #{goodsRating,jdbcType=INTEGER},
goods_comment = #{goodsComment,jdbcType=VARCHAR},
anonymous_evaluation = #{anonymousEvaluation,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
comment_hierarchy = #{commentHierarchy,jdbcType=INTEGER},
user_id = #{userId,jdbcType=VARCHAR},
goods_id = #{goodsId,jdbcType=INTEGER},
image_upload = #{imageUpload,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.trade.entity.StuGoodsCommentInfo">
update stu_goods_comment_info
set order_number = #{orderNumber,jdbcType=VARCHAR},
goods_rating = #{goodsRating,jdbcType=INTEGER},
goods_comment = #{goodsComment,jdbcType=VARCHAR},
anonymous_evaluation = #{anonymousEvaluation,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
comment_hierarchy = #{commentHierarchy,jdbcType=INTEGER},
user_id = #{userId,jdbcType=VARCHAR},
goods_id = #{goodsId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

@ -0,0 +1,338 @@
<?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.sztzjy.trade.mapper.StuGoodsOrderInfoMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.trade.entity.StuGoodsOrderInfo">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="order_type" jdbcType="VARCHAR" property="orderType" />
<result column="order_number" jdbcType="VARCHAR" property="orderNumber" />
<result column="goods_id" jdbcType="INTEGER" property="goodsId" />
<result column="goods_name" jdbcType="VARCHAR" property="goodsName" />
<result column="shop_name" jdbcType="VARCHAR" property="shopName" />
<result column="consignee" jdbcType="VARCHAR" property="consignee" />
<result column="order_time" jdbcType="TIMESTAMP" property="orderTime" />
<result column="goods_url" jdbcType="VARCHAR" property="goodsUrl" />
<result column="number" jdbcType="INTEGER" property="number" />
<result column="receipt_status" jdbcType="INTEGER" property="receiptStatus" />
<result column="comment_status" jdbcType="INTEGER" property="commentStatus" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
</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, order_type, order_number, goods_id, goods_name, shop_name, consignee, order_time,
goods_url, number, receipt_status, comment_status, user_id
</sql>
<select id="selectByExample" parameterType="com.sztzjy.trade.entity.StuGoodsOrderInfoExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from stu_goods_order_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from stu_goods_order_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from stu_goods_order_info
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.trade.entity.StuGoodsOrderInfoExample">
delete from stu_goods_order_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.trade.entity.StuGoodsOrderInfo">
insert into stu_goods_order_info (id, order_type, order_number,
goods_id, goods_name, shop_name,
consignee, order_time, goods_url,
number, receipt_status, comment_status,
user_id)
values (#{id,jdbcType=INTEGER}, #{orderType,jdbcType=VARCHAR}, #{orderNumber,jdbcType=VARCHAR},
#{goodsId,jdbcType=INTEGER}, #{goodsName,jdbcType=VARCHAR}, #{shopName,jdbcType=VARCHAR},
#{consignee,jdbcType=VARCHAR}, #{orderTime,jdbcType=TIMESTAMP}, #{goodsUrl,jdbcType=VARCHAR},
#{number,jdbcType=INTEGER}, #{receiptStatus,jdbcType=INTEGER}, #{commentStatus,jdbcType=INTEGER},
#{userId,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.trade.entity.StuGoodsOrderInfo">
insert into stu_goods_order_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="orderType != null">
order_type,
</if>
<if test="orderNumber != null">
order_number,
</if>
<if test="goodsId != null">
goods_id,
</if>
<if test="goodsName != null">
goods_name,
</if>
<if test="shopName != null">
shop_name,
</if>
<if test="consignee != null">
consignee,
</if>
<if test="orderTime != null">
order_time,
</if>
<if test="goodsUrl != null">
goods_url,
</if>
<if test="number != null">
number,
</if>
<if test="receiptStatus != null">
receipt_status,
</if>
<if test="commentStatus != null">
comment_status,
</if>
<if test="userId != null">
user_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="orderType != null">
#{orderType,jdbcType=VARCHAR},
</if>
<if test="orderNumber != null">
#{orderNumber,jdbcType=VARCHAR},
</if>
<if test="goodsId != null">
#{goodsId,jdbcType=INTEGER},
</if>
<if test="goodsName != null">
#{goodsName,jdbcType=VARCHAR},
</if>
<if test="shopName != null">
#{shopName,jdbcType=VARCHAR},
</if>
<if test="consignee != null">
#{consignee,jdbcType=VARCHAR},
</if>
<if test="orderTime != null">
#{orderTime,jdbcType=TIMESTAMP},
</if>
<if test="goodsUrl != null">
#{goodsUrl,jdbcType=VARCHAR},
</if>
<if test="number != null">
#{number,jdbcType=INTEGER},
</if>
<if test="receiptStatus != null">
#{receiptStatus,jdbcType=INTEGER},
</if>
<if test="commentStatus != null">
#{commentStatus,jdbcType=INTEGER},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.trade.entity.StuGoodsOrderInfoExample" resultType="java.lang.Long">
select count(*) from stu_goods_order_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update stu_goods_order_info
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.orderType != null">
order_type = #{record.orderType,jdbcType=VARCHAR},
</if>
<if test="record.orderNumber != null">
order_number = #{record.orderNumber,jdbcType=VARCHAR},
</if>
<if test="record.goodsId != null">
goods_id = #{record.goodsId,jdbcType=INTEGER},
</if>
<if test="record.goodsName != null">
goods_name = #{record.goodsName,jdbcType=VARCHAR},
</if>
<if test="record.shopName != null">
shop_name = #{record.shopName,jdbcType=VARCHAR},
</if>
<if test="record.consignee != null">
consignee = #{record.consignee,jdbcType=VARCHAR},
</if>
<if test="record.orderTime != null">
order_time = #{record.orderTime,jdbcType=TIMESTAMP},
</if>
<if test="record.goodsUrl != null">
goods_url = #{record.goodsUrl,jdbcType=VARCHAR},
</if>
<if test="record.number != null">
number = #{record.number,jdbcType=INTEGER},
</if>
<if test="record.receiptStatus != null">
receipt_status = #{record.receiptStatus,jdbcType=INTEGER},
</if>
<if test="record.commentStatus != null">
comment_status = #{record.commentStatus,jdbcType=INTEGER},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_goods_order_info
set id = #{record.id,jdbcType=INTEGER},
order_type = #{record.orderType,jdbcType=VARCHAR},
order_number = #{record.orderNumber,jdbcType=VARCHAR},
goods_id = #{record.goodsId,jdbcType=INTEGER},
goods_name = #{record.goodsName,jdbcType=VARCHAR},
shop_name = #{record.shopName,jdbcType=VARCHAR},
consignee = #{record.consignee,jdbcType=VARCHAR},
order_time = #{record.orderTime,jdbcType=TIMESTAMP},
goods_url = #{record.goodsUrl,jdbcType=VARCHAR},
number = #{record.number,jdbcType=INTEGER},
receipt_status = #{record.receiptStatus,jdbcType=INTEGER},
comment_status = #{record.commentStatus,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.trade.entity.StuGoodsOrderInfo">
update stu_goods_order_info
<set>
<if test="orderType != null">
order_type = #{orderType,jdbcType=VARCHAR},
</if>
<if test="orderNumber != null">
order_number = #{orderNumber,jdbcType=VARCHAR},
</if>
<if test="goodsId != null">
goods_id = #{goodsId,jdbcType=INTEGER},
</if>
<if test="goodsName != null">
goods_name = #{goodsName,jdbcType=VARCHAR},
</if>
<if test="shopName != null">
shop_name = #{shopName,jdbcType=VARCHAR},
</if>
<if test="consignee != null">
consignee = #{consignee,jdbcType=VARCHAR},
</if>
<if test="orderTime != null">
order_time = #{orderTime,jdbcType=TIMESTAMP},
</if>
<if test="goodsUrl != null">
goods_url = #{goodsUrl,jdbcType=VARCHAR},
</if>
<if test="number != null">
number = #{number,jdbcType=INTEGER},
</if>
<if test="receiptStatus != null">
receipt_status = #{receiptStatus,jdbcType=INTEGER},
</if>
<if test="commentStatus != null">
comment_status = #{commentStatus,jdbcType=INTEGER},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.trade.entity.StuGoodsOrderInfo">
update stu_goods_order_info
set order_type = #{orderType,jdbcType=VARCHAR},
order_number = #{orderNumber,jdbcType=VARCHAR},
goods_id = #{goodsId,jdbcType=INTEGER},
goods_name = #{goodsName,jdbcType=VARCHAR},
shop_name = #{shopName,jdbcType=VARCHAR},
consignee = #{consignee,jdbcType=VARCHAR},
order_time = #{orderTime,jdbcType=TIMESTAMP},
goods_url = #{goodsUrl,jdbcType=VARCHAR},
number = #{number,jdbcType=INTEGER},
receipt_status = #{receiptStatus,jdbcType=INTEGER},
comment_status = #{commentStatus,jdbcType=INTEGER},
user_id = #{userId,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
Loading…
Cancel
Save