完成商品详情页面内容展示,智能推荐,购物车关联算法等接口开发

main
whb 5 months ago
parent 023927f3a1
commit b9d00eca19

@ -2,6 +2,7 @@ package com.sztzjy.trade.controller.stu;
import com.sztzjy.trade.annotation.AnonymousAccess;
import com.sztzjy.trade.service.StuGoodsTradingCenterService;
import com.sztzjy.trade.service.StuGoodsTradingOrderService;
import com.sztzjy.trade.util.ResultEntity;
import com.sztzjy.trade.annotation.AnonymousAccess;
import com.sztzjy.trade.entity.StuShoppingCartInfo;
@ -32,37 +33,40 @@ public class StuGoodsTradingCenterController {
@Resource
StuGoodsTradingCenterService tradingCenterService;
@Autowired
private StuGoodsTradingOrderService stuGoodsTradingOrderService;
@ApiOperation("小广告位招租")
@AnonymousAccess
@GetMapping("/smallAdPlacement")
public ResultEntity getSmallAdPlacement(String userId) {
public ResultEntity getSmallAdPlacement() {
//销量前10位的商品
return tradingCenterService.getSmallAdPlacement(userId);
return tradingCenterService.getSmallAdPlacement();
}
@ApiOperation("所有商品展示")
@AnonymousAccess
@GetMapping("/allProductInquiries")
public ResultEntity getAllProductInquiries(String userId) {
public ResultEntity getAllProductInquiries() {
return tradingCenterService.AllProductInquiries(userId);
return tradingCenterService.AllProductInquiries();
}
@ApiOperation("商品查询")
@AnonymousAccess
@GetMapping("/productInquiry")
public ResultEntity getProductInquiry(String userId,String keyWord) {
return tradingCenterService.getProductInquiry(userId,keyWord);
}
// @ApiOperation("商品查询")
// @AnonymousAccess
// @GetMapping("/productInquiry")
// public ResultEntity getProductInquiry(String userId,String keyWord) {
//
// return tradingCenterService.getProductInquiry(userId,keyWord);
//
// }
@ -82,9 +86,9 @@ public class StuGoodsTradingCenterController {
@ApiOperation("大广告位招租 随机两条数据")
@AnonymousAccess
@GetMapping("/bigAdPlacement")
public ResultEntity getBigAdPlacement(String userId) {
public ResultEntity getBigAdPlacement() {
return tradingCenterService.getBigAdPlacement(userId);
return tradingCenterService.getBigAdPlacement();
}
@ -164,20 +168,54 @@ public class StuGoodsTradingCenterController {
}
@ApiOperation("商品排序")
@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);
@ApiParam("降序1升序0")Integer type ,
@ApiParam("搜索的商品") String search){
return tradingCenterService.goodsOrder(keyword,index,size,type,search);
}
@ApiOperation("商品详情页面:查询基本商品详情")
@AnonymousAccess
@GetMapping("/goodsBaseInfo")
public ResultEntity getGoodsBaseInfo(String userId,Integer goodsId) {
return stuGoodsTradingOrderService.getGoodsBaseInfo(userId,goodsId);
}
@ApiOperation("商品详情页面:看了又看功能")
@AnonymousAccess
@GetMapping("/seeingYouOnAndOn")
public ResultEntity getSeeingYouOnAndOn(String userId,Integer goodsId,
@ApiParam("当前页") @RequestParam(required = true, defaultValue = "1") Integer index,
@ApiParam("每页条数") @RequestParam(required = true, defaultValue = "20") Integer size,
@ApiParam("类别") String goodsType) {
return stuGoodsTradingOrderService.getSeeingYouOnAndOn(userId,goodsId,index,size,goodsType);
}
// @ApiOperation("商品详情页面:单独购买/拼单购买")
// @AnonymousAccess
// @GetMapping("/buyGoods")
// public ResultEntity getbuyGoods(String userId,Integer goodsId,) {
//
// return stuGoodsTradingOrderService.getSeeingYouOnAndOn(userId,goodsId,index,size,goodsType);
//
// }
}

@ -0,0 +1,77 @@
package com.sztzjy.trade.entity;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @author whb
* stu_goods_record_info
*/
public class StuGoodsRecordInfo {
@ApiModelProperty(notes = "用户ID")
private String userId;
@ApiModelProperty(notes = "创建时间")
private Date createTime;
@ApiModelProperty(notes = "更新时间")
private Date updateTime;
@ApiModelProperty(notes = "参与拼单商品id逗号隔开")
private String participateInGroupBuying;
@ApiModelProperty(notes = "收藏商品ID")
private String collectProducts;
@ApiModelProperty(notes = "已发起拼单商品id逗号隔开")
private String initiateGroupOrder;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId == null ? null : userId.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getParticipateInGroupBuying() {
return participateInGroupBuying;
}
public void setParticipateInGroupBuying(String participateInGroupBuying) {
this.participateInGroupBuying = participateInGroupBuying == null ? null : participateInGroupBuying.trim();
}
public String getCollectProducts() {
return collectProducts;
}
public void setCollectProducts(String collectProducts) {
this.collectProducts = collectProducts == null ? null : collectProducts.trim();
}
public String getInitiateGroupOrder() {
return initiateGroupOrder;
}
public void setInitiateGroupOrder(String initiateGroupOrder) {
this.initiateGroupOrder = initiateGroupOrder == null ? null : initiateGroupOrder.trim();
}
}

@ -0,0 +1,460 @@
package com.sztzjy.trade.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class StuGoodsRecordInfoExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public StuGoodsRecordInfoExample() {
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 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 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 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;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
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 andParticipateInGroupBuyingIsNull() {
addCriterion("participate_in_group_buying is null");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingIsNotNull() {
addCriterion("participate_in_group_buying is not null");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingEqualTo(String value) {
addCriterion("participate_in_group_buying =", value, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingNotEqualTo(String value) {
addCriterion("participate_in_group_buying <>", value, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingGreaterThan(String value) {
addCriterion("participate_in_group_buying >", value, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingGreaterThanOrEqualTo(String value) {
addCriterion("participate_in_group_buying >=", value, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingLessThan(String value) {
addCriterion("participate_in_group_buying <", value, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingLessThanOrEqualTo(String value) {
addCriterion("participate_in_group_buying <=", value, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingLike(String value) {
addCriterion("participate_in_group_buying like", value, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingNotLike(String value) {
addCriterion("participate_in_group_buying not like", value, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingIn(List<String> values) {
addCriterion("participate_in_group_buying in", values, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingNotIn(List<String> values) {
addCriterion("participate_in_group_buying not in", values, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingBetween(String value1, String value2) {
addCriterion("participate_in_group_buying between", value1, value2, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingNotBetween(String value1, String value2) {
addCriterion("participate_in_group_buying not between", value1, value2, "participateInGroupBuying");
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,110 @@
package com.sztzjy.trade.entity;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @author whb
* stu_splicing_orders_info
*/
public class StuSplicingOrdersInfo {
@ApiModelProperty(notes = "id")
private Integer id;
@ApiModelProperty(notes = "商品ID")
private Integer goodsId;
@ApiModelProperty(notes = "创建时间")
private Date createTime;
@ApiModelProperty(notes = "发起者用户ID(多个用户ID用逗号隔开)")
private String userId;
@ApiModelProperty(notes = "拼单结束时间")
private Date stopTime;
@ApiModelProperty(notes = "商品类型")
private String goodsType;
@ApiModelProperty(notes = "参与拼单")
private String participateInGroupBuying;
@ApiModelProperty(notes = "是否拼单成功默认未成功为0")
private Integer orderSuccess;
@ApiModelProperty(notes = "拼单差人数")
private Integer missManyPeople;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getGoodsId() {
return goodsId;
}
public void setGoodsId(Integer goodsId) {
this.goodsId = goodsId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId == null ? null : userId.trim();
}
public Date getStopTime() {
return stopTime;
}
public void setStopTime(Date stopTime) {
this.stopTime = stopTime;
}
public String getGoodsType() {
return goodsType;
}
public void setGoodsType(String goodsType) {
this.goodsType = goodsType == null ? null : goodsType.trim();
}
public String getParticipateInGroupBuying() {
return participateInGroupBuying;
}
public void setParticipateInGroupBuying(String participateInGroupBuying) {
this.participateInGroupBuying = participateInGroupBuying == null ? null : participateInGroupBuying.trim();
}
public Integer getOrderSuccess() {
return orderSuccess;
}
public void setOrderSuccess(Integer orderSuccess) {
this.orderSuccess = orderSuccess;
}
public Integer getMissManyPeople() {
return missManyPeople;
}
public void setMissManyPeople(Integer missManyPeople) {
this.missManyPeople = missManyPeople;
}
}

@ -0,0 +1,770 @@
package com.sztzjy.trade.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class StuSplicingOrdersInfoExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public StuSplicingOrdersInfoExample() {
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 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 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 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 andStopTimeIsNull() {
addCriterion("stop_time is null");
return (Criteria) this;
}
public Criteria andStopTimeIsNotNull() {
addCriterion("stop_time is not null");
return (Criteria) this;
}
public Criteria andStopTimeEqualTo(Date value) {
addCriterion("stop_time =", value, "stopTime");
return (Criteria) this;
}
public Criteria andStopTimeNotEqualTo(Date value) {
addCriterion("stop_time <>", value, "stopTime");
return (Criteria) this;
}
public Criteria andStopTimeGreaterThan(Date value) {
addCriterion("stop_time >", value, "stopTime");
return (Criteria) this;
}
public Criteria andStopTimeGreaterThanOrEqualTo(Date value) {
addCriterion("stop_time >=", value, "stopTime");
return (Criteria) this;
}
public Criteria andStopTimeLessThan(Date value) {
addCriterion("stop_time <", value, "stopTime");
return (Criteria) this;
}
public Criteria andStopTimeLessThanOrEqualTo(Date value) {
addCriterion("stop_time <=", value, "stopTime");
return (Criteria) this;
}
public Criteria andStopTimeIn(List<Date> values) {
addCriterion("stop_time in", values, "stopTime");
return (Criteria) this;
}
public Criteria andStopTimeNotIn(List<Date> values) {
addCriterion("stop_time not in", values, "stopTime");
return (Criteria) this;
}
public Criteria andStopTimeBetween(Date value1, Date value2) {
addCriterion("stop_time between", value1, value2, "stopTime");
return (Criteria) this;
}
public Criteria andStopTimeNotBetween(Date value1, Date value2) {
addCriterion("stop_time not between", value1, value2, "stopTime");
return (Criteria) this;
}
public Criteria andGoodsTypeIsNull() {
addCriterion("goods_type is null");
return (Criteria) this;
}
public Criteria andGoodsTypeIsNotNull() {
addCriterion("goods_type is not null");
return (Criteria) this;
}
public Criteria andGoodsTypeEqualTo(String value) {
addCriterion("goods_type =", value, "goodsType");
return (Criteria) this;
}
public Criteria andGoodsTypeNotEqualTo(String value) {
addCriterion("goods_type <>", value, "goodsType");
return (Criteria) this;
}
public Criteria andGoodsTypeGreaterThan(String value) {
addCriterion("goods_type >", value, "goodsType");
return (Criteria) this;
}
public Criteria andGoodsTypeGreaterThanOrEqualTo(String value) {
addCriterion("goods_type >=", value, "goodsType");
return (Criteria) this;
}
public Criteria andGoodsTypeLessThan(String value) {
addCriterion("goods_type <", value, "goodsType");
return (Criteria) this;
}
public Criteria andGoodsTypeLessThanOrEqualTo(String value) {
addCriterion("goods_type <=", value, "goodsType");
return (Criteria) this;
}
public Criteria andGoodsTypeLike(String value) {
addCriterion("goods_type like", value, "goodsType");
return (Criteria) this;
}
public Criteria andGoodsTypeNotLike(String value) {
addCriterion("goods_type not like", value, "goodsType");
return (Criteria) this;
}
public Criteria andGoodsTypeIn(List<String> values) {
addCriterion("goods_type in", values, "goodsType");
return (Criteria) this;
}
public Criteria andGoodsTypeNotIn(List<String> values) {
addCriterion("goods_type not in", values, "goodsType");
return (Criteria) this;
}
public Criteria andGoodsTypeBetween(String value1, String value2) {
addCriterion("goods_type between", value1, value2, "goodsType");
return (Criteria) this;
}
public Criteria andGoodsTypeNotBetween(String value1, String value2) {
addCriterion("goods_type not between", value1, value2, "goodsType");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingIsNull() {
addCriterion("\"participate_in_group buying\" is null");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingIsNotNull() {
addCriterion("\"participate_in_group buying\" is not null");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingEqualTo(String value) {
addCriterion("\"participate_in_group buying\" =", value, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingNotEqualTo(String value) {
addCriterion("\"participate_in_group buying\" <>", value, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingGreaterThan(String value) {
addCriterion("\"participate_in_group buying\" >", value, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingGreaterThanOrEqualTo(String value) {
addCriterion("\"participate_in_group buying\" >=", value, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingLessThan(String value) {
addCriterion("\"participate_in_group buying\" <", value, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingLessThanOrEqualTo(String value) {
addCriterion("\"participate_in_group buying\" <=", value, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingLike(String value) {
addCriterion("\"participate_in_group buying\" like", value, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingNotLike(String value) {
addCriterion("\"participate_in_group buying\" not like", value, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingIn(List<String> values) {
addCriterion("\"participate_in_group buying\" in", values, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingNotIn(List<String> values) {
addCriterion("\"participate_in_group buying\" not in", values, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingBetween(String value1, String value2) {
addCriterion("\"participate_in_group buying\" between", value1, value2, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andParticipateInGroupBuyingNotBetween(String value1, String value2) {
addCriterion("\"participate_in_group buying\" not between", value1, value2, "participateInGroupBuying");
return (Criteria) this;
}
public Criteria andOrderSuccessIsNull() {
addCriterion("order_success is null");
return (Criteria) this;
}
public Criteria andOrderSuccessIsNotNull() {
addCriterion("order_success is not null");
return (Criteria) this;
}
public Criteria andOrderSuccessEqualTo(Integer value) {
addCriterion("order_success =", value, "orderSuccess");
return (Criteria) this;
}
public Criteria andOrderSuccessNotEqualTo(Integer value) {
addCriterion("order_success <>", value, "orderSuccess");
return (Criteria) this;
}
public Criteria andOrderSuccessGreaterThan(Integer value) {
addCriterion("order_success >", value, "orderSuccess");
return (Criteria) this;
}
public Criteria andOrderSuccessGreaterThanOrEqualTo(Integer value) {
addCriterion("order_success >=", value, "orderSuccess");
return (Criteria) this;
}
public Criteria andOrderSuccessLessThan(Integer value) {
addCriterion("order_success <", value, "orderSuccess");
return (Criteria) this;
}
public Criteria andOrderSuccessLessThanOrEqualTo(Integer value) {
addCriterion("order_success <=", value, "orderSuccess");
return (Criteria) this;
}
public Criteria andOrderSuccessIn(List<Integer> values) {
addCriterion("order_success in", values, "orderSuccess");
return (Criteria) this;
}
public Criteria andOrderSuccessNotIn(List<Integer> values) {
addCriterion("order_success not in", values, "orderSuccess");
return (Criteria) this;
}
public Criteria andOrderSuccessBetween(Integer value1, Integer value2) {
addCriterion("order_success between", value1, value2, "orderSuccess");
return (Criteria) this;
}
public Criteria andOrderSuccessNotBetween(Integer value1, Integer value2) {
addCriterion("order_success not between", value1, value2, "orderSuccess");
return (Criteria) this;
}
public Criteria andMissManyPeopleIsNull() {
addCriterion("miss_many_people is null");
return (Criteria) this;
}
public Criteria andMissManyPeopleIsNotNull() {
addCriterion("miss_many_people is not null");
return (Criteria) this;
}
public Criteria andMissManyPeopleEqualTo(Integer value) {
addCriterion("miss_many_people =", value, "missManyPeople");
return (Criteria) this;
}
public Criteria andMissManyPeopleNotEqualTo(Integer value) {
addCriterion("miss_many_people <>", value, "missManyPeople");
return (Criteria) this;
}
public Criteria andMissManyPeopleGreaterThan(Integer value) {
addCriterion("miss_many_people >", value, "missManyPeople");
return (Criteria) this;
}
public Criteria andMissManyPeopleGreaterThanOrEqualTo(Integer value) {
addCriterion("miss_many_people >=", value, "missManyPeople");
return (Criteria) this;
}
public Criteria andMissManyPeopleLessThan(Integer value) {
addCriterion("miss_many_people <", value, "missManyPeople");
return (Criteria) this;
}
public Criteria andMissManyPeopleLessThanOrEqualTo(Integer value) {
addCriterion("miss_many_people <=", value, "missManyPeople");
return (Criteria) this;
}
public Criteria andMissManyPeopleIn(List<Integer> values) {
addCriterion("miss_many_people in", values, "missManyPeople");
return (Criteria) this;
}
public Criteria andMissManyPeopleNotIn(List<Integer> values) {
addCriterion("miss_many_people not in", values, "missManyPeople");
return (Criteria) this;
}
public Criteria andMissManyPeopleBetween(Integer value1, Integer value2) {
addCriterion("miss_many_people between", value1, value2, "missManyPeople");
return (Criteria) this;
}
public Criteria andMissManyPeopleNotBetween(Integer value1, Integer value2) {
addCriterion("miss_many_people not between", value1, value2, "missManyPeople");
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,117 @@
package com.sztzjy.trade.entity.dto;
import com.sztzjy.trade.entity.StuSplicingOrdersInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
*
* @author whb
* stu_goods_info
*/
@Data
public class StuGoodsInfoDTO {
@ApiModelProperty(notes = "ID")
private Integer id;
@ApiModelProperty(notes = "商品名称")
private String goodsName;
@ApiModelProperty(notes = "商品类型")
private String goodsType;
@ApiModelProperty(notes = "商品小类")
private String goodsSubclass;
@ApiModelProperty(notes = "计价单位")
private String pricingUnit;
@ApiModelProperty(notes = "单位成本价")
private BigDecimal unitCostPrice;
@ApiModelProperty(notes = "毛利率")
private String grossMargin;
@ApiModelProperty(notes = "商品主图片")
private String goodsMainImage;
@ApiModelProperty(notes = "轮播图(多个逗号隔开)")
private String carouselImage;
@ApiModelProperty(notes = "定价种类名称")
private String pricingCategoryName;
@ApiModelProperty(notes = "重量")
private Double weight;
@ApiModelProperty(notes = "促销成本价")
private BigDecimal promotionCostPrice;
@ApiModelProperty(notes = "最高价")
private BigDecimal maximumPrice;
@ApiModelProperty(notes = "定价")
private BigDecimal fixAPrice;
@ApiModelProperty(notes = "匹配群体")
private String matchingGroups;
@ApiModelProperty(notes = "商品链接")
private String goodsUrl;
@ApiModelProperty(notes = "分享数")
private Integer numberOfShares;
@ApiModelProperty(notes = "分享折扣")
private String shareDiscounts;
@ApiModelProperty(notes = "分享分销提成")
private String shareCommission;
@ApiModelProperty(notes = "短视频分销提成")
private String shortVideoCommission;
@ApiModelProperty(notes = "内容分销提成")
private String contentCommission;
@ApiModelProperty(notes = "产品关键字(多个逗号隔开)")
private String productKeyword;
@ApiModelProperty(notes = "创建时间")
private Date createTime;
@ApiModelProperty(notes = "更新时间")
private Date updateTime;
@ApiModelProperty(notes = "上架状态0下架 1上架")
private Integer onlineState;
@ApiModelProperty(notes = "用户ID")
private String userId;
@ApiModelProperty(notes = "学校ID")
private String schoolId;
@ApiModelProperty(notes = "商品介绍")
private String goodsIntroduction;
@ApiModelProperty(notes = "规格与包装")
private String specificationPackaging;
@ApiModelProperty(notes = "收藏状态0未收藏 | 1已收藏")
private Integer collectStatus;
@ApiModelProperty(notes = "正在拼单用户")
private List<StuSplicingOrdersInfo> stuSplicingOrdersInfoList;
@ApiModelProperty(notes = "销售榜单排名")
private Integer ranking;
@ApiModelProperty(notes = "商品评价")
private double storeScore;
}

@ -1,6 +1,7 @@
package com.sztzjy.trade.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@ -10,6 +11,7 @@ import java.util.Date;
* @author whb
* stu_goods_sales_manage
*/
@Data
public class StuGoodsSalesManageDTO {
@ApiModelProperty(notes = "ID")
private Integer id;
@ -65,5 +67,9 @@ public class StuGoodsSalesManageDTO {
@ApiModelProperty(notes = "评论数量")
private Integer commentNumber;
@ApiModelProperty(notes = "商品单价")
private Double price;
}

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

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

@ -28,16 +28,16 @@ public interface StuGoodsTradingCenterService {
PageInfo<StuGoodsOrderInfo> getMyOrderInfo(String userId,Integer index,Integer size, String orderType, String name);
ResultEntity getSmallAdPlacement(String userId);
ResultEntity getSmallAdPlacement();
//所有商品查询
ResultEntity AllProductInquiries(String userId);
ResultEntity AllProductInquiries();
//商品查询
ResultEntity getProductInquiry(String userId, String keyWord);
//大广告招租
ResultEntity getBigAdPlacement(String userId);
ResultEntity getBigAdPlacement();
//根据类型展示数据
ResultEntity getTypeQuery(String userId, String type);
@ -46,5 +46,5 @@ public interface StuGoodsTradingCenterService {
ResultEntity getNumberOfShopping(String userId);
//商品排序
ResultEntity goodsOrder(String keyword, String userId, Integer index, Integer size,Integer type);
ResultEntity goodsOrder(String keyword, Integer index, Integer size,Integer type,String search);
}

@ -0,0 +1,15 @@
package com.sztzjy.trade.service;
import com.sztzjy.trade.util.ResultEntity;
/**
* @author 17803
* @date 2024-11-01 13:23
*/
public interface StuGoodsTradingOrderService {
//商品详情页面:查询基本商品详情
ResultEntity getGoodsBaseInfo(String userId, Integer goodsId);
//商品详情页面:看了又看功能
ResultEntity getSeeingYouOnAndOn(String userId, Integer goodsId,Integer index,Integer size,String goodsType);
}

@ -1,5 +1,7 @@
package com.sztzjy.trade.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageHelper;
import com.sztzjy.trade.entity.*;
import com.sztzjy.trade.entity.dto.StuGoodsSalesManageDTO;
@ -11,6 +13,7 @@ import com.sztzjy.trade.entity.dto.StuSettlementDTO;
import com.sztzjy.trade.mapper.*;
import com.sztzjy.trade.service.StuGoodsTradingCenterService;
import com.sztzjy.trade.util.BigDecimalUtils;
import com.sztzjy.trade.util.ConvertUtil;
import com.sztzjy.trade.util.ResultEntity;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -67,11 +70,11 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
//小广告位招租
@Override
public ResultEntity getSmallAdPlacement(String userId) {
public ResultEntity getSmallAdPlacement() {
//查询用户商品销售管理数据
StuGoodSalesManageExample goodSalesManageExample = new StuGoodSalesManageExample();
goodSalesManageExample.createCriteria().andUserIdEqualTo(userId).andStateEqualTo(1);
goodSalesManageExample.createCriteria().andStateEqualTo(1);
List<StuGoodSalesManage> goodSalesManageList = stuGoodSalesManageMapper.selectByExample(goodSalesManageExample);
//如果为空 默认展示前十位数据,不为空按照销量展示数据
@ -91,10 +94,10 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
//所有商品查询
@Override
public ResultEntity AllProductInquiries(String userId) {
public ResultEntity AllProductInquiries() {
StuGoodsInfoExample example = new StuGoodsInfoExample();
example.createCriteria().andUserIdEqualTo(userId).andOnlineStateEqualTo(1);
example.createCriteria().andOnlineStateEqualTo(1);
List<StuGoodsInfo> stuGoodsInfoList = stuGoodsInfoMapper.selectByExample(example);
if (stuGoodsInfoList != null && stuGoodsInfoList.size() > 0) {
@ -125,8 +128,8 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
}
@Override
public PageInfo getShoppingCartInfo(String userId, Integer index, Integer size) {
StuShoppingCartInfoExample cartInfoExample=new StuShoppingCartInfoExample();
public PageInfo getShoppingCartInfo(String userId, Integer index, Integer size) {
StuShoppingCartInfoExample cartInfoExample = new StuShoppingCartInfoExample();
cartInfoExample.createCriteria().andUserIdEqualTo(userId);
@ -140,7 +143,7 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
}
@Override
public Integer attention(Integer id,Integer attention) {
public Integer attention(Integer id, Integer attention) {
StuShoppingCartInfo stuShoppingCartInfo = shoppingCartInfoMapper.selectByPrimaryKey(id);
stuShoppingCartInfo.setAttentionState(attention);
return shoppingCartInfoMapper.updateByPrimaryKey(stuShoppingCartInfo);
@ -148,11 +151,11 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
@Override
public String getBalance(String userId) {
StuTradeAccountInfoExample accountInfoExample=new StuTradeAccountInfoExample();
StuTradeAccountInfoExample accountInfoExample = new StuTradeAccountInfoExample();
accountInfoExample.createCriteria().andUserIdEqualTo(userId);
List<StuTradeAccountInfo> stuTradeAccountInfos = accountInfoMapper.selectByExample(accountInfoExample);
if(stuTradeAccountInfos.isEmpty()){ //设置默认值
StuTradeAccountInfo stuTradeAccountInfo=new StuTradeAccountInfo(userId);
if (stuTradeAccountInfos.isEmpty()) { //设置默认值
StuTradeAccountInfo stuTradeAccountInfo = new StuTradeAccountInfo(userId);
accountInfoMapper.insert(stuTradeAccountInfo);
stuTradeAccountInfos.add(stuTradeAccountInfo);
}
@ -166,11 +169,11 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
@Override
public void settlement(StuSettlementDTO stuSettlementDTO) {
// TODO: 2024/10/28 1、查询账户余额,检验余额是否足够、
StuTradeAccountInfoExample accountInfoExample=new StuTradeAccountInfoExample();
StuTradeAccountInfoExample accountInfoExample = new StuTradeAccountInfoExample();
accountInfoExample.createCriteria().andUserIdEqualTo(stuSettlementDTO.getUserId());
List<StuTradeAccountInfo> stuTradeAccountInfos = accountInfoMapper.selectByExample(accountInfoExample);
if(stuTradeAccountInfos.isEmpty()){ //设置默认值
StuTradeAccountInfo stuTradeAccountInfo=new StuTradeAccountInfo(stuSettlementDTO.getUserId());
if (stuTradeAccountInfos.isEmpty()) { //设置默认值
StuTradeAccountInfo stuTradeAccountInfo = new StuTradeAccountInfo(stuSettlementDTO.getUserId());
accountInfoMapper.insert(stuTradeAccountInfo);
stuTradeAccountInfos.add(stuTradeAccountInfo);
}
@ -178,34 +181,34 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
BigDecimal accountBalance = stuTradeAccountInfos.get(0).getAccountBalance().stripTrailingZeros();
BigDecimal bigDecimal = stuSettlementDTO.getAmount().stripTrailingZeros();
if(accountBalance.compareTo(bigDecimal)<0){
throw new ServiceException(HttpStatus.ACCEPTED,"余额不足");
if (accountBalance.compareTo(bigDecimal) < 0) {
throw new ServiceException(HttpStatus.ACCEPTED, "余额不足");
}
// TODO: 2024/10/28 2、检验商品上架信息和库存信息
List<StuShoppingCartInfo> shoppingCartInfos = stuSettlementDTO.getShoppingCartInfos();
for (StuShoppingCartInfo stuShoppingCartInfo:shoppingCartInfos) {
for (StuShoppingCartInfo stuShoppingCartInfo : shoppingCartInfos) {
//根据商品ID查询商品是否已下架
StuGoodsInfo stuGoodsInfo = stuGoodsInfoMapper.selectByPrimaryKey(stuShoppingCartInfo.getGoodsId());
if(stuGoodsInfo.getOnlineState()==0){
throw new ServiceException(HttpStatus.ACCEPTED,stuGoodsInfo.getGoodsName()+"商品已下架,请重新选择结算商品");
if (stuGoodsInfo.getOnlineState() == 0) {
throw new ServiceException(HttpStatus.ACCEPTED, stuGoodsInfo.getGoodsName() + "商品已下架,请重新选择结算商品");
}
//根据商品ID查询商品库存是否足够
StuGoodsSalesManageExample salesManageExample=new StuGoodsSalesManageExample();
StuGoodsSalesManageExample salesManageExample = new StuGoodsSalesManageExample();
salesManageExample.createCriteria().andGoodsIdEqualTo(stuShoppingCartInfo.getGoodsId());
List<StuGoodsSalesManage> stuGoodsSalesManages = goodsSalesManageMapper.selectByExample(salesManageExample);
if(stuGoodsSalesManages.get(0).getOnlineTotal()<stuShoppingCartInfo.getNumber()){
throw new ServiceException(HttpStatus.ACCEPTED,stuGoodsInfo.getGoodsName()+"商品已售完,请重新选择结算商品");
if (stuGoodsSalesManages.get(0).getOnlineTotal() < stuShoppingCartInfo.getNumber()) {
throw new ServiceException(HttpStatus.ACCEPTED, stuGoodsInfo.getGoodsName() + "商品已售完,请重新选择结算商品");
}
}
// TODO: 2024/10/28 3、生成订单信息并删除所结算商品在购物车中的信息
for (StuShoppingCartInfo stuShoppingCartInfo:shoppingCartInfos) {
for (StuShoppingCartInfo stuShoppingCartInfo : shoppingCartInfos) {
//生成订单信息
StuGoodsOrderInfo stuGoodsOrderInfo=new StuGoodsOrderInfo();
StuGoodsOrderInfo stuGoodsOrderInfo = new StuGoodsOrderInfo();
//赋值
Integer uuid= UUID.randomUUID().toString().replaceAll("-","").hashCode();
Integer uuid = UUID.randomUUID().toString().replaceAll("-", "").hashCode();
uuid = uuid < 0 ? -uuid : uuid;//String.hashCode() 值会为空
stuGoodsOrderInfo.setId(uuid);
stuGoodsOrderInfo.setGoodsId(stuShoppingCartInfo.getGoodsId());
@ -242,18 +245,18 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
@Override
public PageInfo getMyOrderInfo(String userId, Integer index, Integer size, String orderType, String name) {
List<StuGoodsOrderInfo> stuGoodsOrderInfos=orderInfoMapper.selectMyOrderInfoList(userId,orderType,name);
return PageUtil.pageHelper(stuGoodsOrderInfos,index,size);
List<StuGoodsOrderInfo> stuGoodsOrderInfos = orderInfoMapper.selectMyOrderInfoList(userId, orderType, name);
return PageUtil.pageHelper(stuGoodsOrderInfos, index, size);
}
//大广告招租
@Override
public ResultEntity getBigAdPlacement(String userId) {
public ResultEntity getBigAdPlacement() {
//查询用户商品销售管理数据
StuGoodSalesManageExample goodSalesManageExample = new StuGoodSalesManageExample();
goodSalesManageExample.createCriteria().andUserIdEqualTo(userId).andStateEqualTo(1);
goodSalesManageExample.createCriteria().andStateEqualTo(1);
List<StuGoodSalesManage> goodSalesManageList = stuGoodSalesManageMapper.selectByExample(goodSalesManageExample);
if (goodSalesManageList != null && goodSalesManageList.size() > 0) {
@ -310,13 +313,21 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
//商品排序
@Override
public ResultEntity goodsOrder(String keyword, String userId, Integer index, Integer size, Integer type) {
public ResultEntity goodsOrder(String keyword, Integer index, Integer size, Integer type, String search) {
//开启分页
PageHelper.startPage(index, size);
StuGoodSalesManageExample goodSalesManageExample = new StuGoodSalesManageExample();
StuGoodSalesManageExample.Criteria criteria = goodSalesManageExample.createCriteria();
criteria.andUserIdEqualTo(userId).andStateEqualTo(1);
criteria.andStateEqualTo(1);
if (search != null && search.length() > 0) {
criteria.andGoodsNameLike("%" + search + "%");
criteria.andGoodsTypeLike("%" + search + "%");
criteria.andGoodsSubclassLike("%" + search + "%");
}
//倒叙
@ -360,57 +371,121 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
List<StuGoodSalesManage> goodSalesManageList = stuGoodSalesManageMapper.selectByExample(goodSalesManageExample);
if (goodSalesManageList != null && goodSalesManageList.size() > 0) {
//评论数 查询多个表
List<StuGoodsSalesManageDTO> stuGoodsSalesManageDTOArrayList = new ArrayList<>();
StuGoodsCommentInfoExample commentInfoExample = new StuGoodsCommentInfoExample();
commentInfoExample.createCriteria().andCommentHierarchyEqualTo(0);
List<StuGoodsCommentInfo> stuGoodsCommentInfoList = stuGoodsCommentInfoMapper.selectByExample(commentInfoExample);
//价格
StuGoodsInfoExample example = new StuGoodsInfoExample();
example.createCriteria().andOnlineStateEqualTo(1);
List<StuGoodsInfo> stuGoodsInfoList = stuGoodsInfoMapper.selectByExample(example);
//防止出现存在评论为空或者定价为空
StuGoodsCommentInfo stuGoodsCommentInfo1 = new StuGoodsCommentInfo();
stuGoodsCommentInfo1.setGoodsId(999999999);
stuGoodsCommentInfoList.add(stuGoodsCommentInfo1);
StuGoodsInfo stuGoodsInfo = new StuGoodsInfo();
stuGoodsInfo.setId(999999999);
stuGoodsInfoList.add(stuGoodsInfo);
if (!stuGoodsCommentInfoList.isEmpty() && !stuGoodsInfoList.isEmpty()) {
//评论数
for (StuGoodSalesManage stuGoodSalesManage : goodSalesManageList) {
StuGoodsSalesManageDTO salesManageDTO = new StuGoodsSalesManageDTO();
int i = 0;
BigDecimal k = BigDecimal.ZERO;
for (StuGoodsCommentInfo stuGoodsCommentInfo : stuGoodsCommentInfoList) {
if (stuGoodSalesManage.getGoodsId() == stuGoodsCommentInfo.getGoodsId()) {
i++;
}
}
for (StuGoodsInfo stuGoodsCommentInfo : stuGoodsInfoList) {
if (stuGoodSalesManage.getGoodsId() == stuGoodsCommentInfo.getId()) {
k = stuGoodsCommentInfo.getUnitCostPrice();
break;
}
}
BeanUtils.copyProperties(stuGoodSalesManage, salesManageDTO);
//评论数量
salesManageDTO.setCommentNumber(i);
//价格
if (Convert.toInt(k)==0)
{
continue;
}
salesManageDTO.setPrice(Convert.toDouble(k));
stuGoodsSalesManageDTOArrayList.add(salesManageDTO);
}
}
//////////////////////////////////////////
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) {
// String order = "desc";
//降序
stuGoodsSalesManageDTOArrayList = stuGoodsSalesManageDTOArrayList.stream().sorted(Comparator.comparing(StuGoodsSalesManageDTO::getCommentNumber).reversed()).collect(Collectors.toList());
} else {
//升序
stuGoodsSalesManageDTOArrayList = stuGoodsSalesManageDTOArrayList.stream().sorted(Comparator.comparing(StuGoodsSalesManageDTO::getCommentNumber)).collect(Collectors.toList());
}
//评论数 查询多个表
if (type == 1) {
PageInfo<StuGoodsSalesManageDTO> goodsSalesManageDTOPageInfo = new PageInfo<>(stuGoodsSalesManageDTOArrayList);
return new ResultEntity(HttpStatus.OK, goodsSalesManageDTOPageInfo);
} else {
}
}
} else if (keyword.equals("价格")) {
if (keyword.equals("价格")) {
//多表查询
//价格
if (type == 1) {
// String order = "desc";
//降序
stuGoodsSalesManageDTOArrayList = stuGoodsSalesManageDTOArrayList.stream().sorted(Comparator.comparing(StuGoodsSalesManageDTO::getPrice).reversed()).collect(Collectors.toList());
} else {
//升序
stuGoodsSalesManageDTOArrayList = stuGoodsSalesManageDTOArrayList.stream().sorted(Comparator.comparing(StuGoodsSalesManageDTO::getPrice)).collect(Collectors.toList());
}
PageInfo<StuGoodsSalesManageDTO> goodsSalesManageDTOPageInfo = new PageInfo<>(stuGoodsSalesManageDTOArrayList);
return new ResultEntity(HttpStatus.OK, goodsSalesManageDTOPageInfo);
}
PageInfo<StuGoodsSalesManageDTO> manageDTOPageInfo = new PageInfo<>(stuGoodsSalesManageDTOArrayList);
return new ResultEntity(HttpStatus.OK, manageDTOPageInfo);
} else {
return new ResultEntity<>(HttpStatus.NO_CONTENT);
}
//根据商品订单查询评论层级为0的评价数量
return new ResultEntity(HttpStatus.OK, "为查询到上架商品");
//根据商品订单查询评论层级为0的评价数量
}
return null;
}
}

@ -0,0 +1,202 @@
package com.sztzjy.trade.service.impl;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sztzjy.trade.entity.*;
import com.sztzjy.trade.entity.dto.StuGoodsInfoDTO;
import com.sztzjy.trade.entity.dto.StuGoodsSalesManageDTO;
import com.sztzjy.trade.mapper.*;
import com.sztzjy.trade.service.StuGoodsTradingOrderService;
import com.sztzjy.trade.util.ResultEntity;
import org.bouncycastle.pqc.math.linearalgebra.RandUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author 17803
* @date 2024-11-01 13:24
*/
@Service
public class StuGoodsTradingOrderServiceImpl implements StuGoodsTradingOrderService {
@Autowired
private StuGoodsOrderInfoMapper stuGoodsOrderInfoMapper;
@Autowired
private StuGoodsCommentInfoMapper stuGoodsCommentInfoMapper;
@Autowired
private StuGoodsInfoMapper stuGoodsInfoMapper;
@Autowired
private StuGoodsRecordInfoMapper stuGoodsRecordInfoMapper;
@Autowired
private StuSplicingOrdersInfoMapper stuSplicingOrdersInfoMapper;
@Autowired
private StuGoodsSalesManageMapper stuGoodsSalesManageMapper;
@Autowired
private StuShoppingCartInfoMapper stuShoppingCartInfoMapper;
@Override
public ResultEntity getGoodsBaseInfo(String userId, Integer goodsId) {
StuGoodsInfoExample example = new StuGoodsInfoExample();
example.createCriteria().andOnlineStateEqualTo(1).andIdEqualTo(goodsId);
List<StuGoodsInfo> stuGoodsInfoList = stuGoodsInfoMapper.selectByExample(example);
if (!stuGoodsInfoList.isEmpty()) {
StuGoodsInfo stuGoodsInfo = stuGoodsInfoList.get(0);
StuGoodsInfoDTO stuGoodsInfoDTO = new StuGoodsInfoDTO();
BeanUtils.copyProperties(stuGoodsInfo, stuGoodsInfoDTO);
//根据userId查询是否收藏
StuGoodsRecordInfo stuGoodsRecordInfo = stuGoodsRecordInfoMapper.selectByPrimaryKey(userId);
String[] goodsArray = stuGoodsRecordInfo.getCollectProducts().split(",");
String matchedItem = Arrays.stream(goodsArray).filter(item -> item.equals(goodsId.toString())).findFirst().orElse(null);
// 输出结果
if (matchedItem != null) {
//收藏
stuGoodsInfoDTO.setCollectStatus(1);
} else {
//未收藏
stuGoodsInfoDTO.setCollectStatus(0);
}
//正在拼单详情
StuSplicingOrdersInfoExample stuSplicingOrdersInfoExample = new StuSplicingOrdersInfoExample();
stuSplicingOrdersInfoExample.createCriteria().andGoodsIdEqualTo(goodsId).andOrderSuccessEqualTo(0);
List<StuSplicingOrdersInfo> splicingOrdersInfoList = stuSplicingOrdersInfoMapper.selectByExample(stuSplicingOrdersInfoExample);
if (!splicingOrdersInfoList.isEmpty()) {
//查看拼单时间是否过期
List<StuSplicingOrdersInfo> stuSplicingOrdersInfoList =
splicingOrdersInfoList.stream().filter(item -> item.getStopTime().after(new Date()))
.sorted(Comparator.comparing(StuSplicingOrdersInfo::getCreateTime))
.collect(Collectors.toList());
stuGoodsInfoDTO.setStuSplicingOrdersInfoList(stuSplicingOrdersInfoList);
}
//销售榜单排名
StuGoodsSalesManageExample stuGoodsSalesManageExample = new StuGoodsSalesManageExample();
stuGoodsSalesManageExample.createCriteria().andStateEqualTo(1).andGoodsTypeEqualTo(stuGoodsInfoList.get(0).getGoodsType());
List<StuGoodsSalesManage> stuGoodsSalesManageList = stuGoodsSalesManageMapper.selectByExample(stuGoodsSalesManageExample);
if (!stuGoodsSalesManageList.isEmpty()) {
List<StuGoodsSalesManage> goodsSalesManageList = stuGoodsSalesManageList.stream()
.sorted(Comparator.comparing(StuGoodsSalesManage::getSoldQuantity).reversed())
.collect(Collectors.toList());
for (int i = 1; i < goodsSalesManageList.size(); i++) {
if (goodsId == goodsSalesManageList.get(i).getGoodsId()) {
stuGoodsInfoDTO.setRanking(i);
break;
}
}
}
//计算店铺商品评价
StuGoodsCommentInfoExample stuGoodsCommentInfoExample = new StuGoodsCommentInfoExample();
stuGoodsCommentInfoExample.createCriteria().andGoodsIdEqualTo(goodsId);
List<StuGoodsCommentInfo> stuGoodsCommentInfoList = stuGoodsCommentInfoMapper.selectByExampleWithBLOBs(stuGoodsCommentInfoExample);
if (!stuGoodsCommentInfoList.isEmpty()) {
DoubleSummaryStatistics doubleSummaryStatistics = stuGoodsCommentInfoList.stream()
.filter(item -> item.getGoodsRating() != null) // 筛选非空评分
.mapToDouble(StuGoodsCommentInfo::getGoodsRating)
.summaryStatistics();
double average = doubleSummaryStatistics.getAverage();
stuGoodsInfoDTO.setStoreScore(average);
}
return new ResultEntity<>(HttpStatus.OK, stuGoodsInfoDTO);
}
return new ResultEntity<>(HttpStatus.NO_CONTENT);
}
//商品详情页面:看了又看功能
@Override
public ResultEntity getSeeingYouOnAndOn(String userId, Integer goodsId, Integer index, Integer size, String goodsType) {
int sum = 0;
List<StuGoodsInfo> arrayList = new ArrayList<StuGoodsInfo>(22);
//开启分页
PageHelper.startPage(index, size);
//查询的是已经上架的商品 根据商品ID
//根据类型 随机 查询其他商品
//根据购物车查询推荐同类型商品
StuShoppingCartInfoExample stuShoppingCartInfoExample = new StuShoppingCartInfoExample();
stuShoppingCartInfoExample.createCriteria().andUserIdEqualTo(userId);
List<StuShoppingCartInfo> stuShoppingCartInfoList = stuShoppingCartInfoMapper.selectByExample(stuShoppingCartInfoExample);
if (!stuShoppingCartInfoList.isEmpty()) {
String carRandomGoodsType = stuShoppingCartInfoList.get(RandomUtil.randomInt(1, stuShoppingCartInfoList.size())).getGoodsType();
StuGoodsInfoExample stuGoodsInfoExample = new StuGoodsInfoExample();
stuGoodsInfoExample.createCriteria().andGoodsTypeEqualTo(carRandomGoodsType).andOnlineStateEqualTo(1);
List<StuGoodsInfo> stuGoodsInfoList = stuGoodsInfoMapper.selectByExample(stuGoodsInfoExample);
if (!stuGoodsInfoList.isEmpty()) {
sum = RandomUtil.randomInt(3, 7);
Collections.shuffle(stuGoodsInfoList, new Random(System.currentTimeMillis()));
for (int j = 0; j < stuGoodsInfoList.size(); j++) {
if (j == sum) {
break;
}
arrayList.add(stuGoodsInfoList.get(j));
}
}
} else {
//购物车为空的情况
StuGoodsInfoExample stuGoodsInfoExample = new StuGoodsInfoExample();
stuGoodsInfoExample.createCriteria().andGoodsTypeEqualTo(goodsType).andOnlineStateEqualTo(1);
List<StuGoodsInfo> stuGoodsInfoList = stuGoodsInfoMapper.selectByExample(stuGoodsInfoExample);
if (!stuGoodsInfoList.isEmpty()) {
Collections.shuffle(stuGoodsInfoList, new Random(System.currentTimeMillis()));
arrayList = stuGoodsInfoList.stream().limit(20).collect(Collectors.toList());
}
}
PageInfo<StuGoodsInfo> stuGoodsInfoPageInfo = new PageInfo<>(arrayList);
return new ResultEntity<>(HttpStatus.OK, stuGoodsInfoPageInfo);
}
}

@ -0,0 +1,268 @@
<?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.StuGoodsRecordInfoMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.trade.entity.StuGoodsRecordInfo">
<id column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="participate_in_group_buying" jdbcType="VARCHAR" property="participateInGroupBuying" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.trade.entity.StuGoodsRecordInfo">
<result column="collect_products" jdbcType="LONGVARCHAR" property="collectProducts" />
<result column="initiate_group_order" jdbcType="LONGVARCHAR" property="initiateGroupOrder" />
</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">
user_id, create_time, update_time, participate_in_group_buying
</sql>
<sql id="Blob_Column_List">
collect_products, initiate_group_order
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.trade.entity.StuGoodsRecordInfoExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_goods_record_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.StuGoodsRecordInfoExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from stu_goods_record_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.String" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_goods_record_info
where user_id = #{userId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from stu_goods_record_info
where user_id = #{userId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.trade.entity.StuGoodsRecordInfoExample">
delete from stu_goods_record_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.trade.entity.StuGoodsRecordInfo">
insert into stu_goods_record_info (user_id, create_time, update_time,
participate_in_group_buying, collect_products,
initiate_group_order)
values (#{userId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{participateInGroupBuying,jdbcType=VARCHAR}, #{collectProducts,jdbcType=LONGVARCHAR},
#{initiateGroupOrder,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.trade.entity.StuGoodsRecordInfo">
insert into stu_goods_record_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="participateInGroupBuying != null">
participate_in_group_buying,
</if>
<if test="collectProducts != null">
collect_products,
</if>
<if test="initiateGroupOrder != null">
initiate_group_order,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="participateInGroupBuying != null">
#{participateInGroupBuying,jdbcType=VARCHAR},
</if>
<if test="collectProducts != null">
#{collectProducts,jdbcType=LONGVARCHAR},
</if>
<if test="initiateGroupOrder != null">
#{initiateGroupOrder,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.trade.entity.StuGoodsRecordInfoExample" resultType="java.lang.Long">
select count(*) from stu_goods_record_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update stu_goods_record_info
<set>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.participateInGroupBuying != null">
participate_in_group_buying = #{record.participateInGroupBuying,jdbcType=VARCHAR},
</if>
<if test="record.collectProducts != null">
collect_products = #{record.collectProducts,jdbcType=LONGVARCHAR},
</if>
<if test="record.initiateGroupOrder != null">
initiate_group_order = #{record.initiateGroupOrder,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_record_info
set user_id = #{record.userId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
participate_in_group_buying = #{record.participateInGroupBuying,jdbcType=VARCHAR},
collect_products = #{record.collectProducts,jdbcType=LONGVARCHAR},
initiate_group_order = #{record.initiateGroupOrder,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_goods_record_info
set user_id = #{record.userId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
participate_in_group_buying = #{record.participateInGroupBuying,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.trade.entity.StuGoodsRecordInfo">
update stu_goods_record_info
<set>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="participateInGroupBuying != null">
participate_in_group_buying = #{participateInGroupBuying,jdbcType=VARCHAR},
</if>
<if test="collectProducts != null">
collect_products = #{collectProducts,jdbcType=LONGVARCHAR},
</if>
<if test="initiateGroupOrder != null">
initiate_group_order = #{initiateGroupOrder,jdbcType=LONGVARCHAR},
</if>
</set>
where user_id = #{userId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.trade.entity.StuGoodsRecordInfo">
update stu_goods_record_info
set create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
participate_in_group_buying = #{participateInGroupBuying,jdbcType=VARCHAR},
collect_products = #{collectProducts,jdbcType=LONGVARCHAR},
initiate_group_order = #{initiateGroupOrder,jdbcType=LONGVARCHAR}
where user_id = #{userId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.trade.entity.StuGoodsRecordInfo">
update stu_goods_record_info
set create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
participate_in_group_buying = #{participateInGroupBuying,jdbcType=VARCHAR}
where user_id = #{userId,jdbcType=VARCHAR}
</update>
</mapper>

@ -0,0 +1,276 @@
<?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.StuSplicingOrdersInfoMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.trade.entity.StuSplicingOrdersInfo">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="goods_id" jdbcType="INTEGER" property="goodsId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="stop_time" jdbcType="TIMESTAMP" property="stopTime" />
<result column="goods_type" jdbcType="VARCHAR" property="goodsType" />
<result column="participate_in_group buying" jdbcType="VARCHAR" property="participateInGroupBuying" />
<result column="order_success" jdbcType="INTEGER" property="orderSuccess" />
<result column="miss_many_people" jdbcType="INTEGER" property="missManyPeople" />
</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, goods_id, create_time, user_id, stop_time, goods_type, "participate_in_group buying",
order_success, miss_many_people
</sql>
<select id="selectByExample" parameterType="com.sztzjy.trade.entity.StuSplicingOrdersInfoExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from stu_splicing_orders_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_splicing_orders_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from stu_splicing_orders_info
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.trade.entity.StuSplicingOrdersInfoExample">
delete from stu_splicing_orders_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.trade.entity.StuSplicingOrdersInfo">
insert into stu_splicing_orders_info (id, goods_id, create_time,
user_id, stop_time, goods_type,
"participate_in_group buying", order_success,
miss_many_people)
values (#{id,jdbcType=INTEGER}, #{goodsId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{userId,jdbcType=VARCHAR}, #{stopTime,jdbcType=TIMESTAMP}, #{goodsType,jdbcType=VARCHAR},
#{participateInGroupBuying,jdbcType=VARCHAR}, #{orderSuccess,jdbcType=INTEGER},
#{missManyPeople,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.trade.entity.StuSplicingOrdersInfo">
insert into stu_splicing_orders_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="goodsId != null">
goods_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="userId != null">
user_id,
</if>
<if test="stopTime != null">
stop_time,
</if>
<if test="goodsType != null">
goods_type,
</if>
<if test="participateInGroupBuying != null">
"participate_in_group buying",
</if>
<if test="orderSuccess != null">
order_success,
</if>
<if test="missManyPeople != null">
miss_many_people,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="goodsId != null">
#{goodsId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="stopTime != null">
#{stopTime,jdbcType=TIMESTAMP},
</if>
<if test="goodsType != null">
#{goodsType,jdbcType=VARCHAR},
</if>
<if test="participateInGroupBuying != null">
#{participateInGroupBuying,jdbcType=VARCHAR},
</if>
<if test="orderSuccess != null">
#{orderSuccess,jdbcType=INTEGER},
</if>
<if test="missManyPeople != null">
#{missManyPeople,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.trade.entity.StuSplicingOrdersInfoExample" resultType="java.lang.Long">
select count(*) from stu_splicing_orders_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update stu_splicing_orders_info
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.goodsId != null">
goods_id = #{record.goodsId,jdbcType=INTEGER},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.stopTime != null">
stop_time = #{record.stopTime,jdbcType=TIMESTAMP},
</if>
<if test="record.goodsType != null">
goods_type = #{record.goodsType,jdbcType=VARCHAR},
</if>
<if test="record.participateInGroupBuying != null">
"participate_in_group buying" = #{record.participateInGroupBuying,jdbcType=VARCHAR},
</if>
<if test="record.orderSuccess != null">
order_success = #{record.orderSuccess,jdbcType=INTEGER},
</if>
<if test="record.missManyPeople != null">
miss_many_people = #{record.missManyPeople,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_splicing_orders_info
set id = #{record.id,jdbcType=INTEGER},
goods_id = #{record.goodsId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
user_id = #{record.userId,jdbcType=VARCHAR},
stop_time = #{record.stopTime,jdbcType=TIMESTAMP},
goods_type = #{record.goodsType,jdbcType=VARCHAR},
"participate_in_group buying" = #{record.participateInGroupBuying,jdbcType=VARCHAR},
order_success = #{record.orderSuccess,jdbcType=INTEGER},
miss_many_people = #{record.missManyPeople,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.trade.entity.StuSplicingOrdersInfo">
update stu_splicing_orders_info
<set>
<if test="goodsId != null">
goods_id = #{goodsId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="stopTime != null">
stop_time = #{stopTime,jdbcType=TIMESTAMP},
</if>
<if test="goodsType != null">
goods_type = #{goodsType,jdbcType=VARCHAR},
</if>
<if test="participateInGroupBuying != null">
"participate_in_group buying" = #{participateInGroupBuying,jdbcType=VARCHAR},
</if>
<if test="orderSuccess != null">
order_success = #{orderSuccess,jdbcType=INTEGER},
</if>
<if test="missManyPeople != null">
miss_many_people = #{missManyPeople,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.trade.entity.StuSplicingOrdersInfo">
update stu_splicing_orders_info
set goods_id = #{goodsId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
user_id = #{userId,jdbcType=VARCHAR},
stop_time = #{stopTime,jdbcType=TIMESTAMP},
goods_type = #{goodsType,jdbcType=VARCHAR},
"participate_in_group buying" = #{participateInGroupBuying,jdbcType=VARCHAR},
order_success = #{orderSuccess,jdbcType=INTEGER},
miss_many_people = #{missManyPeople,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
Loading…
Cancel
Save