# Conflicts:
#	src/main/java/com/sztzjy/trade/controller/stu/StuGoodsTradingCenterController.java
#	src/main/java/com/sztzjy/trade/entity/StuGoodsOrderInfo.java
#	src/main/java/com/sztzjy/trade/mapper/StuGoodsOrderInfoMapper.java
#	src/main/java/com/sztzjy/trade/service/impl/StuGoodsTradingCenterServiceImpl.java
#	src/main/resources/mappers/StuGoodsOrderInfoMapper.xml
main
whb 5 months ago
commit 023927f3a1

@ -0,0 +1,17 @@
package com.sztzjy.trade.controller.stu;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author tz
* @date 2024/10/28 16:12
*/
@RequestMapping("api/stu/goodsManage")
@RestController
@Api(tags = "商品管理中心")
public class StuCommodityManageController {
}

@ -5,6 +5,7 @@ import com.sztzjy.trade.service.StuGoodsTradingCenterService;
import com.sztzjy.trade.util.ResultEntity; import com.sztzjy.trade.util.ResultEntity;
import com.sztzjy.trade.annotation.AnonymousAccess; import com.sztzjy.trade.annotation.AnonymousAccess;
import com.sztzjy.trade.entity.StuShoppingCartInfo; import com.sztzjy.trade.entity.StuShoppingCartInfo;
import com.sztzjy.trade.entity.dto.StuSettlementDTO;
import com.sztzjy.trade.service.StuGoodsTradingCenterService; import com.sztzjy.trade.service.StuGoodsTradingCenterService;
import com.sztzjy.trade.util.ResultEntity; import com.sztzjy.trade.util.ResultEntity;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
@ -106,6 +108,61 @@ public class StuGoodsTradingCenterController {
return new ResultEntity(HttpStatus.OK,"购物车信息", tradingCenterService.getShoppingCartInfo(userId,index,size)); return new ResultEntity(HttpStatus.OK,"购物车信息", tradingCenterService.getShoppingCartInfo(userId,index,size));
} }
@ApiOperation("购物车商品删除")
@PostMapping("/deleteShoppingCartInfo")
@AnonymousAccess
public ResultEntity deleteShoppingCartInfo(Integer id){
Integer result=tradingCenterService.deleteShoppingCartInfo(id);
if(result>1){return new ResultEntity(HttpStatus.OK,"删除成功");}
else {return new ResultEntity(HttpStatus.OK,"删除失败");}
}
@ApiOperation("购物车商品移入关注")
@PostMapping("/attention")
@AnonymousAccess
public ResultEntity attention(@ApiParam("商品ID") Integer id,
@ApiParam("移入关注传1移出关注传0") Integer attention){
Integer result=tradingCenterService.attention(id,attention);
if(result>1){return new ResultEntity(HttpStatus.OK,"关注成功");}
else {return new ResultEntity(HttpStatus.OK,"关注失败");}
}
@ApiOperation("余额展示")
@PostMapping("/getBalance")
@AnonymousAccess
public ResultEntity getBalance(String userId){
return new ResultEntity(HttpStatus.OK,"余额展示",tradingCenterService.getBalance(userId));
}
@ApiOperation("结算")
@PostMapping("/settlement")
@AnonymousAccess
public ResultEntity settlement(@RequestBody StuSettlementDTO stuSettlementDTO){
tradingCenterService.settlement(stuSettlementDTO);
return new ResultEntity(HttpStatus.OK,"支付成功");
}
@ApiOperation("我的订单列表展示")
@PostMapping("/getMyOrderInfo")
@AnonymousAccess
public ResultEntity getMyOrderInfo(@ApiParam("用户ID") String userId,
@ApiParam("当前页") Integer index,
@ApiParam("每页条数") Integer size,
@ApiParam("订单类型")@RequestParam(required = false) String orderType,
@ApiParam("商品名称,商品编号,订单编号")@RequestParam(required = false) String name){
return new ResultEntity(HttpStatus.OK,"我的订单展示",tradingCenterService.getMyOrderInfo(userId,index,size,orderType,name));
}
@ApiOperation("商品排序") @ApiOperation("商品排序")
@PostMapping("/goodsOrder") @PostMapping("/goodsOrder")

@ -2,7 +2,10 @@ package com.sztzjy.trade.entity;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;
/** /**
* *
* *
@ -32,6 +35,8 @@ public class StuGoodsOrderInfo {
private String consignee; private String consignee;
@ApiModelProperty(notes = "下单时间") @ApiModelProperty(notes = "下单时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date orderTime; private Date orderTime;
@ApiModelProperty(notes = "商品链接") @ApiModelProperty(notes = "商品链接")

@ -26,7 +26,7 @@ public class StuGoodsSalesManage {
private String goodsSubclass; private String goodsSubclass;
@ApiModelProperty(notes = "上架数量") @ApiModelProperty(notes = "上架数量")
private String onlineTotal; private Integer onlineTotal;
@ApiModelProperty(notes = "可用库存数量") @ApiModelProperty(notes = "可用库存数量")
private Integer availableInventoryQuantity; private Integer availableInventoryQuantity;
@ -101,12 +101,12 @@ public class StuGoodsSalesManage {
this.goodsSubclass = goodsSubclass == null ? null : goodsSubclass.trim(); this.goodsSubclass = goodsSubclass == null ? null : goodsSubclass.trim();
} }
public String getOnlineTotal() { public Integer getOnlineTotal() {
return onlineTotal; return onlineTotal;
} }
public void setOnlineTotal(String onlineTotal) { public void setOnlineTotal(Integer onlineTotal) {
this.onlineTotal = onlineTotal == null ? null : onlineTotal.trim(); this.onlineTotal = onlineTotal;
} }
public Integer getAvailableInventoryQuantity() { public Integer getAvailableInventoryQuantity() {

@ -445,62 +445,52 @@ public class StuGoodsSalesManageExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOnlineTotalEqualTo(String value) { public Criteria andOnlineTotalEqualTo(Integer value) {
addCriterion("online_total =", value, "onlineTotal"); addCriterion("online_total =", value, "onlineTotal");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOnlineTotalNotEqualTo(String value) { public Criteria andOnlineTotalNotEqualTo(Integer value) {
addCriterion("online_total <>", value, "onlineTotal"); addCriterion("online_total <>", value, "onlineTotal");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOnlineTotalGreaterThan(String value) { public Criteria andOnlineTotalGreaterThan(Integer value) {
addCriterion("online_total >", value, "onlineTotal"); addCriterion("online_total >", value, "onlineTotal");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOnlineTotalGreaterThanOrEqualTo(String value) { public Criteria andOnlineTotalGreaterThanOrEqualTo(Integer value) {
addCriterion("online_total >=", value, "onlineTotal"); addCriterion("online_total >=", value, "onlineTotal");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOnlineTotalLessThan(String value) { public Criteria andOnlineTotalLessThan(Integer value) {
addCriterion("online_total <", value, "onlineTotal"); addCriterion("online_total <", value, "onlineTotal");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOnlineTotalLessThanOrEqualTo(String value) { public Criteria andOnlineTotalLessThanOrEqualTo(Integer value) {
addCriterion("online_total <=", value, "onlineTotal"); addCriterion("online_total <=", value, "onlineTotal");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOnlineTotalLike(String value) { public Criteria andOnlineTotalIn(List<Integer> values) {
addCriterion("online_total like", value, "onlineTotal");
return (Criteria) this;
}
public Criteria andOnlineTotalNotLike(String value) {
addCriterion("online_total not like", value, "onlineTotal");
return (Criteria) this;
}
public Criteria andOnlineTotalIn(List<String> values) {
addCriterion("online_total in", values, "onlineTotal"); addCriterion("online_total in", values, "onlineTotal");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOnlineTotalNotIn(List<String> values) { public Criteria andOnlineTotalNotIn(List<Integer> values) {
addCriterion("online_total not in", values, "onlineTotal"); addCriterion("online_total not in", values, "onlineTotal");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOnlineTotalBetween(String value1, String value2) { public Criteria andOnlineTotalBetween(Integer value1, Integer value2) {
addCriterion("online_total between", value1, value2, "onlineTotal"); addCriterion("online_total between", value1, value2, "onlineTotal");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOnlineTotalNotBetween(String value1, String value2) { public Criteria andOnlineTotalNotBetween(Integer value1, Integer value2) {
addCriterion("online_total not between", value1, value2, "onlineTotal"); addCriterion("online_total not between", value1, value2, "onlineTotal");
return (Criteria) this; return (Criteria) this;
} }

@ -18,9 +18,15 @@ public class StuShoppingCartInfo {
@ApiModelProperty(notes = "商品名称") @ApiModelProperty(notes = "商品名称")
private String goodsName; private String goodsName;
@ApiModelProperty(notes = "商品类型")
private String goodsType;
@ApiModelProperty(notes = "商品图片") @ApiModelProperty(notes = "商品图片")
private String goodsImage; private String goodsImage;
@ApiModelProperty(notes = "商品链接")
private String goodsUrl;
@ApiModelProperty(notes = "单价") @ApiModelProperty(notes = "单价")
private BigDecimal unitPrice; private BigDecimal unitPrice;
@ -66,6 +72,14 @@ public class StuShoppingCartInfo {
this.goodsName = goodsName == null ? null : goodsName.trim(); this.goodsName = goodsName == null ? null : goodsName.trim();
} }
public String getGoodsType() {
return goodsType;
}
public void setGoodsType(String goodsType) {
this.goodsType = goodsType == null ? null : goodsType.trim();
}
public String getGoodsImage() { public String getGoodsImage() {
return goodsImage; return goodsImage;
} }
@ -74,6 +88,14 @@ public class StuShoppingCartInfo {
this.goodsImage = goodsImage == null ? null : goodsImage.trim(); this.goodsImage = goodsImage == null ? null : goodsImage.trim();
} }
public String getGoodsUrl() {
return goodsUrl;
}
public void setGoodsUrl(String goodsUrl) {
this.goodsUrl = goodsUrl == null ? null : goodsUrl.trim();
}
public BigDecimal getUnitPrice() { public BigDecimal getUnitPrice() {
return unitPrice; return unitPrice;
} }

@ -295,6 +295,76 @@ public class StuShoppingCartInfoExample {
return (Criteria) this; 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 andGoodsImageIsNull() { public Criteria andGoodsImageIsNull() {
addCriterion("goods_image is null"); addCriterion("goods_image is null");
return (Criteria) this; return (Criteria) this;
@ -365,6 +435,76 @@ public class StuShoppingCartInfoExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andGoodsUrlIsNull() {
addCriterion("goods_url is null");
return (Criteria) this;
}
public Criteria andGoodsUrlIsNotNull() {
addCriterion("goods_url is not null");
return (Criteria) this;
}
public Criteria andGoodsUrlEqualTo(String value) {
addCriterion("goods_url =", value, "goodsUrl");
return (Criteria) this;
}
public Criteria andGoodsUrlNotEqualTo(String value) {
addCriterion("goods_url <>", value, "goodsUrl");
return (Criteria) this;
}
public Criteria andGoodsUrlGreaterThan(String value) {
addCriterion("goods_url >", value, "goodsUrl");
return (Criteria) this;
}
public Criteria andGoodsUrlGreaterThanOrEqualTo(String value) {
addCriterion("goods_url >=", value, "goodsUrl");
return (Criteria) this;
}
public Criteria andGoodsUrlLessThan(String value) {
addCriterion("goods_url <", value, "goodsUrl");
return (Criteria) this;
}
public Criteria andGoodsUrlLessThanOrEqualTo(String value) {
addCriterion("goods_url <=", value, "goodsUrl");
return (Criteria) this;
}
public Criteria andGoodsUrlLike(String value) {
addCriterion("goods_url like", value, "goodsUrl");
return (Criteria) this;
}
public Criteria andGoodsUrlNotLike(String value) {
addCriterion("goods_url not like", value, "goodsUrl");
return (Criteria) this;
}
public Criteria andGoodsUrlIn(List<String> values) {
addCriterion("goods_url in", values, "goodsUrl");
return (Criteria) this;
}
public Criteria andGoodsUrlNotIn(List<String> values) {
addCriterion("goods_url not in", values, "goodsUrl");
return (Criteria) this;
}
public Criteria andGoodsUrlBetween(String value1, String value2) {
addCriterion("goods_url between", value1, value2, "goodsUrl");
return (Criteria) this;
}
public Criteria andGoodsUrlNotBetween(String value1, String value2) {
addCriterion("goods_url not between", value1, value2, "goodsUrl");
return (Criteria) this;
}
public Criteria andUnitPriceIsNull() { public Criteria andUnitPriceIsNull() {
addCriterion("unit_price is null"); addCriterion("unit_price is null");
return (Criteria) this; return (Criteria) this;

@ -0,0 +1,130 @@
package com.sztzjy.trade.entity;
import java.math.BigDecimal;
import java.util.UUID;
import com.sztzjy.trade.mapper.StuUserMapper;
import io.swagger.annotations.ApiModelProperty;
import javax.annotation.Resource;
/**
* -
*
* @author whb
* stu_trade_account_info
*/
public class StuTradeAccountInfo {
@ApiModelProperty(notes = "ID")
private Integer id;
@ApiModelProperty(notes = "账户名称")
private String accountName;
@ApiModelProperty(notes = "账户余额")
private BigDecimal accountBalance;
@ApiModelProperty(notes = "用户ID")
private String userId;
@ApiModelProperty(notes = "预留字段1")
private String reservedOne;
@ApiModelProperty(notes = "预留字段2")
private String reservedTwo;
@ApiModelProperty(notes = "预留字段3")
private String reservedThree;
@ApiModelProperty(notes = "预留字段4")
private String reservedFour;
@ApiModelProperty(notes = "预留字段5")
private String reservedFive;
@Resource
StuUserMapper stuUserMapper;
public StuTradeAccountInfo(String userId){
Integer uuid= UUID.randomUUID().toString().replaceAll("-","").hashCode();
uuid = uuid < 0 ? -uuid : uuid;//String.hashCode() 值会为空
this.id=uuid;
this.accountBalance=new BigDecimal(20000000);
this.userId=userId;
//查询用户名称
StuUser stuUser = stuUserMapper.selectByPrimaryKey(userId);
this.accountName=stuUser.getName();
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName == null ? null : accountName.trim();
}
public BigDecimal getAccountBalance() {
return accountBalance;
}
public void setAccountBalance(BigDecimal accountBalance) {
this.accountBalance = accountBalance;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId == null ? null : userId.trim();
}
public String getReservedOne() {
return reservedOne;
}
public void setReservedOne(String reservedOne) {
this.reservedOne = reservedOne == null ? null : reservedOne.trim();
}
public String getReservedTwo() {
return reservedTwo;
}
public void setReservedTwo(String reservedTwo) {
this.reservedTwo = reservedTwo == null ? null : reservedTwo.trim();
}
public String getReservedThree() {
return reservedThree;
}
public void setReservedThree(String reservedThree) {
this.reservedThree = reservedThree == null ? null : reservedThree.trim();
}
public String getReservedFour() {
return reservedFour;
}
public void setReservedFour(String reservedFour) {
this.reservedFour = reservedFour == null ? null : reservedFour.trim();
}
public String getReservedFive() {
return reservedFive;
}
public void setReservedFive(String reservedFive) {
this.reservedFive = reservedFive == null ? null : reservedFive.trim();
}
}

@ -0,0 +1,810 @@
package com.sztzjy.trade.entity;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class StuTradeAccountInfoExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public StuTradeAccountInfoExample() {
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 andAccountNameIsNull() {
addCriterion("account_name is null");
return (Criteria) this;
}
public Criteria andAccountNameIsNotNull() {
addCriterion("account_name is not null");
return (Criteria) this;
}
public Criteria andAccountNameEqualTo(String value) {
addCriterion("account_name =", value, "accountName");
return (Criteria) this;
}
public Criteria andAccountNameNotEqualTo(String value) {
addCriterion("account_name <>", value, "accountName");
return (Criteria) this;
}
public Criteria andAccountNameGreaterThan(String value) {
addCriterion("account_name >", value, "accountName");
return (Criteria) this;
}
public Criteria andAccountNameGreaterThanOrEqualTo(String value) {
addCriterion("account_name >=", value, "accountName");
return (Criteria) this;
}
public Criteria andAccountNameLessThan(String value) {
addCriterion("account_name <", value, "accountName");
return (Criteria) this;
}
public Criteria andAccountNameLessThanOrEqualTo(String value) {
addCriterion("account_name <=", value, "accountName");
return (Criteria) this;
}
public Criteria andAccountNameLike(String value) {
addCriterion("account_name like", value, "accountName");
return (Criteria) this;
}
public Criteria andAccountNameNotLike(String value) {
addCriterion("account_name not like", value, "accountName");
return (Criteria) this;
}
public Criteria andAccountNameIn(List<String> values) {
addCriterion("account_name in", values, "accountName");
return (Criteria) this;
}
public Criteria andAccountNameNotIn(List<String> values) {
addCriterion("account_name not in", values, "accountName");
return (Criteria) this;
}
public Criteria andAccountNameBetween(String value1, String value2) {
addCriterion("account_name between", value1, value2, "accountName");
return (Criteria) this;
}
public Criteria andAccountNameNotBetween(String value1, String value2) {
addCriterion("account_name not between", value1, value2, "accountName");
return (Criteria) this;
}
public Criteria andAccountBalanceIsNull() {
addCriterion("account_balance is null");
return (Criteria) this;
}
public Criteria andAccountBalanceIsNotNull() {
addCriterion("account_balance is not null");
return (Criteria) this;
}
public Criteria andAccountBalanceEqualTo(BigDecimal value) {
addCriterion("account_balance =", value, "accountBalance");
return (Criteria) this;
}
public Criteria andAccountBalanceNotEqualTo(BigDecimal value) {
addCriterion("account_balance <>", value, "accountBalance");
return (Criteria) this;
}
public Criteria andAccountBalanceGreaterThan(BigDecimal value) {
addCriterion("account_balance >", value, "accountBalance");
return (Criteria) this;
}
public Criteria andAccountBalanceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("account_balance >=", value, "accountBalance");
return (Criteria) this;
}
public Criteria andAccountBalanceLessThan(BigDecimal value) {
addCriterion("account_balance <", value, "accountBalance");
return (Criteria) this;
}
public Criteria andAccountBalanceLessThanOrEqualTo(BigDecimal value) {
addCriterion("account_balance <=", value, "accountBalance");
return (Criteria) this;
}
public Criteria andAccountBalanceIn(List<BigDecimal> values) {
addCriterion("account_balance in", values, "accountBalance");
return (Criteria) this;
}
public Criteria andAccountBalanceNotIn(List<BigDecimal> values) {
addCriterion("account_balance not in", values, "accountBalance");
return (Criteria) this;
}
public Criteria andAccountBalanceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("account_balance between", value1, value2, "accountBalance");
return (Criteria) this;
}
public Criteria andAccountBalanceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("account_balance not between", value1, value2, "accountBalance");
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 andReservedOneIsNull() {
addCriterion("reserved_one is null");
return (Criteria) this;
}
public Criteria andReservedOneIsNotNull() {
addCriterion("reserved_one is not null");
return (Criteria) this;
}
public Criteria andReservedOneEqualTo(String value) {
addCriterion("reserved_one =", value, "reservedOne");
return (Criteria) this;
}
public Criteria andReservedOneNotEqualTo(String value) {
addCriterion("reserved_one <>", value, "reservedOne");
return (Criteria) this;
}
public Criteria andReservedOneGreaterThan(String value) {
addCriterion("reserved_one >", value, "reservedOne");
return (Criteria) this;
}
public Criteria andReservedOneGreaterThanOrEqualTo(String value) {
addCriterion("reserved_one >=", value, "reservedOne");
return (Criteria) this;
}
public Criteria andReservedOneLessThan(String value) {
addCriterion("reserved_one <", value, "reservedOne");
return (Criteria) this;
}
public Criteria andReservedOneLessThanOrEqualTo(String value) {
addCriterion("reserved_one <=", value, "reservedOne");
return (Criteria) this;
}
public Criteria andReservedOneLike(String value) {
addCriterion("reserved_one like", value, "reservedOne");
return (Criteria) this;
}
public Criteria andReservedOneNotLike(String value) {
addCriterion("reserved_one not like", value, "reservedOne");
return (Criteria) this;
}
public Criteria andReservedOneIn(List<String> values) {
addCriterion("reserved_one in", values, "reservedOne");
return (Criteria) this;
}
public Criteria andReservedOneNotIn(List<String> values) {
addCriterion("reserved_one not in", values, "reservedOne");
return (Criteria) this;
}
public Criteria andReservedOneBetween(String value1, String value2) {
addCriterion("reserved_one between", value1, value2, "reservedOne");
return (Criteria) this;
}
public Criteria andReservedOneNotBetween(String value1, String value2) {
addCriterion("reserved_one not between", value1, value2, "reservedOne");
return (Criteria) this;
}
public Criteria andReservedTwoIsNull() {
addCriterion("reserved_two is null");
return (Criteria) this;
}
public Criteria andReservedTwoIsNotNull() {
addCriterion("reserved_two is not null");
return (Criteria) this;
}
public Criteria andReservedTwoEqualTo(String value) {
addCriterion("reserved_two =", value, "reservedTwo");
return (Criteria) this;
}
public Criteria andReservedTwoNotEqualTo(String value) {
addCriterion("reserved_two <>", value, "reservedTwo");
return (Criteria) this;
}
public Criteria andReservedTwoGreaterThan(String value) {
addCriterion("reserved_two >", value, "reservedTwo");
return (Criteria) this;
}
public Criteria andReservedTwoGreaterThanOrEqualTo(String value) {
addCriterion("reserved_two >=", value, "reservedTwo");
return (Criteria) this;
}
public Criteria andReservedTwoLessThan(String value) {
addCriterion("reserved_two <", value, "reservedTwo");
return (Criteria) this;
}
public Criteria andReservedTwoLessThanOrEqualTo(String value) {
addCriterion("reserved_two <=", value, "reservedTwo");
return (Criteria) this;
}
public Criteria andReservedTwoLike(String value) {
addCriterion("reserved_two like", value, "reservedTwo");
return (Criteria) this;
}
public Criteria andReservedTwoNotLike(String value) {
addCriterion("reserved_two not like", value, "reservedTwo");
return (Criteria) this;
}
public Criteria andReservedTwoIn(List<String> values) {
addCriterion("reserved_two in", values, "reservedTwo");
return (Criteria) this;
}
public Criteria andReservedTwoNotIn(List<String> values) {
addCriterion("reserved_two not in", values, "reservedTwo");
return (Criteria) this;
}
public Criteria andReservedTwoBetween(String value1, String value2) {
addCriterion("reserved_two between", value1, value2, "reservedTwo");
return (Criteria) this;
}
public Criteria andReservedTwoNotBetween(String value1, String value2) {
addCriterion("reserved_two not between", value1, value2, "reservedTwo");
return (Criteria) this;
}
public Criteria andReservedThreeIsNull() {
addCriterion("reserved_three is null");
return (Criteria) this;
}
public Criteria andReservedThreeIsNotNull() {
addCriterion("reserved_three is not null");
return (Criteria) this;
}
public Criteria andReservedThreeEqualTo(String value) {
addCriterion("reserved_three =", value, "reservedThree");
return (Criteria) this;
}
public Criteria andReservedThreeNotEqualTo(String value) {
addCriterion("reserved_three <>", value, "reservedThree");
return (Criteria) this;
}
public Criteria andReservedThreeGreaterThan(String value) {
addCriterion("reserved_three >", value, "reservedThree");
return (Criteria) this;
}
public Criteria andReservedThreeGreaterThanOrEqualTo(String value) {
addCriterion("reserved_three >=", value, "reservedThree");
return (Criteria) this;
}
public Criteria andReservedThreeLessThan(String value) {
addCriterion("reserved_three <", value, "reservedThree");
return (Criteria) this;
}
public Criteria andReservedThreeLessThanOrEqualTo(String value) {
addCriterion("reserved_three <=", value, "reservedThree");
return (Criteria) this;
}
public Criteria andReservedThreeLike(String value) {
addCriterion("reserved_three like", value, "reservedThree");
return (Criteria) this;
}
public Criteria andReservedThreeNotLike(String value) {
addCriterion("reserved_three not like", value, "reservedThree");
return (Criteria) this;
}
public Criteria andReservedThreeIn(List<String> values) {
addCriterion("reserved_three in", values, "reservedThree");
return (Criteria) this;
}
public Criteria andReservedThreeNotIn(List<String> values) {
addCriterion("reserved_three not in", values, "reservedThree");
return (Criteria) this;
}
public Criteria andReservedThreeBetween(String value1, String value2) {
addCriterion("reserved_three between", value1, value2, "reservedThree");
return (Criteria) this;
}
public Criteria andReservedThreeNotBetween(String value1, String value2) {
addCriterion("reserved_three not between", value1, value2, "reservedThree");
return (Criteria) this;
}
public Criteria andReservedFourIsNull() {
addCriterion("reserved_four is null");
return (Criteria) this;
}
public Criteria andReservedFourIsNotNull() {
addCriterion("reserved_four is not null");
return (Criteria) this;
}
public Criteria andReservedFourEqualTo(String value) {
addCriterion("reserved_four =", value, "reservedFour");
return (Criteria) this;
}
public Criteria andReservedFourNotEqualTo(String value) {
addCriterion("reserved_four <>", value, "reservedFour");
return (Criteria) this;
}
public Criteria andReservedFourGreaterThan(String value) {
addCriterion("reserved_four >", value, "reservedFour");
return (Criteria) this;
}
public Criteria andReservedFourGreaterThanOrEqualTo(String value) {
addCriterion("reserved_four >=", value, "reservedFour");
return (Criteria) this;
}
public Criteria andReservedFourLessThan(String value) {
addCriterion("reserved_four <", value, "reservedFour");
return (Criteria) this;
}
public Criteria andReservedFourLessThanOrEqualTo(String value) {
addCriterion("reserved_four <=", value, "reservedFour");
return (Criteria) this;
}
public Criteria andReservedFourLike(String value) {
addCriterion("reserved_four like", value, "reservedFour");
return (Criteria) this;
}
public Criteria andReservedFourNotLike(String value) {
addCriterion("reserved_four not like", value, "reservedFour");
return (Criteria) this;
}
public Criteria andReservedFourIn(List<String> values) {
addCriterion("reserved_four in", values, "reservedFour");
return (Criteria) this;
}
public Criteria andReservedFourNotIn(List<String> values) {
addCriterion("reserved_four not in", values, "reservedFour");
return (Criteria) this;
}
public Criteria andReservedFourBetween(String value1, String value2) {
addCriterion("reserved_four between", value1, value2, "reservedFour");
return (Criteria) this;
}
public Criteria andReservedFourNotBetween(String value1, String value2) {
addCriterion("reserved_four not between", value1, value2, "reservedFour");
return (Criteria) this;
}
public Criteria andReservedFiveIsNull() {
addCriterion("reserved_five is null");
return (Criteria) this;
}
public Criteria andReservedFiveIsNotNull() {
addCriterion("reserved_five is not null");
return (Criteria) this;
}
public Criteria andReservedFiveEqualTo(String value) {
addCriterion("reserved_five =", value, "reservedFive");
return (Criteria) this;
}
public Criteria andReservedFiveNotEqualTo(String value) {
addCriterion("reserved_five <>", value, "reservedFive");
return (Criteria) this;
}
public Criteria andReservedFiveGreaterThan(String value) {
addCriterion("reserved_five >", value, "reservedFive");
return (Criteria) this;
}
public Criteria andReservedFiveGreaterThanOrEqualTo(String value) {
addCriterion("reserved_five >=", value, "reservedFive");
return (Criteria) this;
}
public Criteria andReservedFiveLessThan(String value) {
addCriterion("reserved_five <", value, "reservedFive");
return (Criteria) this;
}
public Criteria andReservedFiveLessThanOrEqualTo(String value) {
addCriterion("reserved_five <=", value, "reservedFive");
return (Criteria) this;
}
public Criteria andReservedFiveLike(String value) {
addCriterion("reserved_five like", value, "reservedFive");
return (Criteria) this;
}
public Criteria andReservedFiveNotLike(String value) {
addCriterion("reserved_five not like", value, "reservedFive");
return (Criteria) this;
}
public Criteria andReservedFiveIn(List<String> values) {
addCriterion("reserved_five in", values, "reservedFive");
return (Criteria) this;
}
public Criteria andReservedFiveNotIn(List<String> values) {
addCriterion("reserved_five not in", values, "reservedFive");
return (Criteria) this;
}
public Criteria andReservedFiveBetween(String value1, String value2) {
addCriterion("reserved_five between", value1, value2, "reservedFive");
return (Criteria) this;
}
public Criteria andReservedFiveNotBetween(String value1, String value2) {
addCriterion("reserved_five not between", value1, value2, "reservedFive");
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,18 @@
package com.sztzjy.trade.entity.dto;
import com.sztzjy.trade.entity.StuShoppingCartInfo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* @author tz
* @date 2024/10/28 16:30
*/
@Data
public class StuSettlementDTO {
private List<StuShoppingCartInfo> shoppingCartInfos;
private BigDecimal amount;
private String userId;
}

@ -3,8 +3,10 @@ package com.sztzjy.trade.mapper;
import com.sztzjy.trade.entity.StuGoodsOrderInfo; import com.sztzjy.trade.entity.StuGoodsOrderInfo;
import com.sztzjy.trade.entity.StuGoodsOrderInfoExample; import com.sztzjy.trade.entity.StuGoodsOrderInfoExample;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface StuGoodsOrderInfoMapper { public interface StuGoodsOrderInfoMapper {
long countByExample(StuGoodsOrderInfoExample example); long countByExample(StuGoodsOrderInfoExample example);
@ -27,4 +29,8 @@ public interface StuGoodsOrderInfoMapper {
int updateByPrimaryKeySelective(StuGoodsOrderInfo record); int updateByPrimaryKeySelective(StuGoodsOrderInfo record);
int updateByPrimaryKey(StuGoodsOrderInfo record); int updateByPrimaryKey(StuGoodsOrderInfo record);
List<StuGoodsOrderInfo> selectMyOrderInfoList(@Param("userId")String userId,
@Param("orderType")String orderType,
@Param("name")String name);
} }

@ -1,12 +0,0 @@
package com.sztzjy.trade.mapper;
import org.apache.ibatis.annotations.Mapper;
/**
* @author tz
* @date 2024/8/16 15:46
*/
@Mapper
public class StuMapper {
}

@ -3,8 +3,10 @@ package com.sztzjy.trade.mapper;
import com.sztzjy.trade.entity.StuShoppingCartInfo; import com.sztzjy.trade.entity.StuShoppingCartInfo;
import com.sztzjy.trade.entity.StuShoppingCartInfoExample; import com.sztzjy.trade.entity.StuShoppingCartInfoExample;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface StuShoppingCartInfoMapper { public interface StuShoppingCartInfoMapper {
long countByExample(StuShoppingCartInfoExample example); long countByExample(StuShoppingCartInfoExample example);
@ -33,6 +35,4 @@ public interface StuShoppingCartInfoMapper {
int updateByPrimaryKeyWithBLOBs(StuShoppingCartInfo record); int updateByPrimaryKeyWithBLOBs(StuShoppingCartInfo record);
int updateByPrimaryKey(StuShoppingCartInfo record); int updateByPrimaryKey(StuShoppingCartInfo record);
} }

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

@ -1,7 +1,10 @@
package com.sztzjy.trade.service; package com.sztzjy.trade.service;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sztzjy.trade.entity.StuGoodsOrderInfo;
import com.sztzjy.trade.entity.StuShoppingCartInfo; import com.sztzjy.trade.entity.StuShoppingCartInfo;
import com.sztzjy.trade.entity.dto.StuSettlementDTO;
import org.springframework.security.core.parameters.P;
import java.util.List; import java.util.List;
import com.sztzjy.trade.util.ResultEntity; import com.sztzjy.trade.util.ResultEntity;
@ -14,6 +17,17 @@ import com.sztzjy.trade.util.ResultEntity;
*/ */
public interface StuGoodsTradingCenterService { public interface StuGoodsTradingCenterService {
PageInfo<StuShoppingCartInfo> getShoppingCartInfo(String userId, Integer index, Integer size); PageInfo<StuShoppingCartInfo> getShoppingCartInfo(String userId, Integer index, Integer size);
Integer deleteShoppingCartInfo(Integer id);
Integer attention(Integer id,Integer attention);
String getBalance(String userId);
void settlement(StuSettlementDTO stuSettlementDTO);
PageInfo<StuGoodsOrderInfo> getMyOrderInfo(String userId,Integer index,Integer size, String orderType, String name);
ResultEntity getSmallAdPlacement(String userId); ResultEntity getSmallAdPlacement(String userId);
//所有商品查询 //所有商品查询

@ -5,16 +5,29 @@ import com.sztzjy.trade.entity.*;
import com.sztzjy.trade.entity.dto.StuGoodsSalesManageDTO; import com.sztzjy.trade.entity.dto.StuGoodsSalesManageDTO;
import com.sztzjy.trade.mapper.*; import com.sztzjy.trade.mapper.*;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sztzjy.trade.config.exception.handler.ServiceException;
import com.sztzjy.trade.entity.*;
import com.sztzjy.trade.entity.dto.StuSettlementDTO;
import com.sztzjy.trade.mapper.*;
import com.sztzjy.trade.service.StuGoodsTradingCenterService; import com.sztzjy.trade.service.StuGoodsTradingCenterService;
import com.sztzjy.trade.util.BigDecimalUtils;
import com.sztzjy.trade.util.ResultEntity; import com.sztzjy.trade.util.ResultEntity;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import com.sztzjy.trade.util.PageUtil; import com.sztzjy.trade.util.PageUtil;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.List;
import java.util.Random;
import java.util.UUID;
import java.util.Random;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -43,6 +56,14 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
@Autowired @Autowired
private StuGoodsCommentInfoMapper stuGoodsCommentInfoMapper; private StuGoodsCommentInfoMapper stuGoodsCommentInfoMapper;
@Resource
StuTradeAccountInfoMapper accountInfoMapper;
@Resource
StuGoodsSalesManageMapper goodsSalesManageMapper;
@Resource
BigDecimalUtils bigDecimalUtils;
@Resource
StuGoodsOrderInfoMapper orderInfoMapper;
//小广告位招租 //小广告位招租
@Override @Override
@ -104,8 +125,8 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
} }
@Override @Override
public PageInfo<StuShoppingCartInfo> getShoppingCartInfo(String userId, Integer index, Integer size) { public PageInfo getShoppingCartInfo(String userId, Integer index, Integer size) {
StuShoppingCartInfoExample cartInfoExample = new StuShoppingCartInfoExample(); StuShoppingCartInfoExample cartInfoExample=new StuShoppingCartInfoExample();
cartInfoExample.createCriteria().andUserIdEqualTo(userId); cartInfoExample.createCriteria().andUserIdEqualTo(userId);
@ -113,6 +134,118 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
return PageUtil.pageHelper(stuShoppingCartInfos, index, size); return PageUtil.pageHelper(stuShoppingCartInfos, index, size);
} }
@Override
public Integer deleteShoppingCartInfo(Integer id) {
return shoppingCartInfoMapper.deleteByPrimaryKey(id);
}
@Override
public Integer attention(Integer id,Integer attention) {
StuShoppingCartInfo stuShoppingCartInfo = shoppingCartInfoMapper.selectByPrimaryKey(id);
stuShoppingCartInfo.setAttentionState(attention);
return shoppingCartInfoMapper.updateByPrimaryKey(stuShoppingCartInfo);
}
@Override
public String getBalance(String userId) {
StuTradeAccountInfoExample accountInfoExample=new StuTradeAccountInfoExample();
accountInfoExample.createCriteria().andUserIdEqualTo(userId);
List<StuTradeAccountInfo> stuTradeAccountInfos = accountInfoMapper.selectByExample(accountInfoExample);
if(stuTradeAccountInfos.isEmpty()){ //设置默认值
StuTradeAccountInfo stuTradeAccountInfo=new StuTradeAccountInfo(userId);
accountInfoMapper.insert(stuTradeAccountInfo);
stuTradeAccountInfos.add(stuTradeAccountInfo);
}
//取到余额
BigDecimal accountBalance = stuTradeAccountInfos.get(0).getAccountBalance();
//转为千分计位格式
DecimalFormat formatter = new DecimalFormat("#,###.00");
return formatter.format(accountBalance);
}
@Override
public void settlement(StuSettlementDTO stuSettlementDTO) {
// TODO: 2024/10/28 1、查询账户余额,检验余额是否足够、
StuTradeAccountInfoExample accountInfoExample=new StuTradeAccountInfoExample();
accountInfoExample.createCriteria().andUserIdEqualTo(stuSettlementDTO.getUserId());
List<StuTradeAccountInfo> stuTradeAccountInfos = accountInfoMapper.selectByExample(accountInfoExample);
if(stuTradeAccountInfos.isEmpty()){ //设置默认值
StuTradeAccountInfo stuTradeAccountInfo=new StuTradeAccountInfo(stuSettlementDTO.getUserId());
accountInfoMapper.insert(stuTradeAccountInfo);
stuTradeAccountInfos.add(stuTradeAccountInfo);
}
//取到余额,去掉末尾的0比较精度
BigDecimal accountBalance = stuTradeAccountInfos.get(0).getAccountBalance().stripTrailingZeros();
BigDecimal bigDecimal = stuSettlementDTO.getAmount().stripTrailingZeros();
if(accountBalance.compareTo(bigDecimal)<0){
throw new ServiceException(HttpStatus.ACCEPTED,"余额不足");
}
// TODO: 2024/10/28 2、检验商品上架信息和库存信息
List<StuShoppingCartInfo> shoppingCartInfos = stuSettlementDTO.getShoppingCartInfos();
for (StuShoppingCartInfo stuShoppingCartInfo:shoppingCartInfos) {
//根据商品ID查询商品是否已下架
StuGoodsInfo stuGoodsInfo = stuGoodsInfoMapper.selectByPrimaryKey(stuShoppingCartInfo.getGoodsId());
if(stuGoodsInfo.getOnlineState()==0){
throw new ServiceException(HttpStatus.ACCEPTED,stuGoodsInfo.getGoodsName()+"商品已下架,请重新选择结算商品");
}
//根据商品ID查询商品库存是否足够
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()+"商品已售完,请重新选择结算商品");
}
}
// TODO: 2024/10/28 3、生成订单信息并删除所结算商品在购物车中的信息
for (StuShoppingCartInfo stuShoppingCartInfo:shoppingCartInfos) {
//生成订单信息
StuGoodsOrderInfo stuGoodsOrderInfo=new StuGoodsOrderInfo();
//赋值
Integer uuid= UUID.randomUUID().toString().replaceAll("-","").hashCode();
uuid = uuid < 0 ? -uuid : uuid;//String.hashCode() 值会为空
stuGoodsOrderInfo.setId(uuid);
stuGoodsOrderInfo.setGoodsId(stuShoppingCartInfo.getGoodsId());
stuGoodsOrderInfo.setOrderType(stuShoppingCartInfo.getGoodsType());
//生成订单编号,将当前时间戳与随机数相结合,生成相对唯一的订单号。
long timestamp = System.currentTimeMillis();
int randomNum = new Random().nextInt(10000); // 生成0-9999之间的随机数
// 订单号格式:时间戳-随机数
String format = String.format("%d-%04d", timestamp, randomNum);
stuGoodsOrderInfo.setOrderNumber(format);
stuGoodsOrderInfo.setGoodsName(stuShoppingCartInfo.getGoodsName());
stuGoodsOrderInfo.setShopName(stuShoppingCartInfo.getShopName());
stuGoodsOrderInfo.setConsignee(stuTradeAccountInfos.get(0).getAccountName());
stuGoodsOrderInfo.setOrderTime(new Date());
stuGoodsOrderInfo.setGoodsUrl(stuShoppingCartInfo.getGoodsUrl());
stuGoodsOrderInfo.setNumber(stuShoppingCartInfo.getNumber());
stuGoodsOrderInfo.setReceiptStatus(0);
stuGoodsOrderInfo.setCommentStatus(0);
stuGoodsOrderInfo.setUserId(stuShoppingCartInfo.getUserId());
orderInfoMapper.insert(stuGoodsOrderInfo);
//删除所结算商品在购物车中的信息
shoppingCartInfoMapper.deleteByPrimaryKey(stuShoppingCartInfo.getId());
}
// TODO: 2024/10/28 4、扣除余额
BigDecimal sub = bigDecimalUtils.sub(accountBalance.toString(), bigDecimal.toString());
stuTradeAccountInfos.get(0).setAccountBalance(sub);
accountInfoMapper.updateByPrimaryKey(stuTradeAccountInfos.get(0));
}
@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);
}
//大广告招租 //大广告招租
@Override @Override

@ -211,7 +211,7 @@
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
</select> </select>
<update id="updateByExampleSelective" parameterType="map"> <update id="updateByExampleSelective" parameterType="map">
update stu_goods_order_info update stu_goods_order_info
<set> <set>
<if test="record.id != null"> <if test="record.id != null">
@ -335,4 +335,18 @@
user_id = #{userId,jdbcType=VARCHAR} user_id = #{userId,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<select id="selectMyOrderInfoList" resultType="com.sztzjy.trade.entity.StuGoodsOrderInfo" resultMap="BaseResultMap">
SELECT id,order_type,order_number,goods_id,goods_name,shop_name,consignee,order_time,goods_url,number,receipt_status,comment_status,user_id
FROM stu_goods_order_info
WHERE user_id = #{userId}
<if test="orderType != null and orderType != ''">
AND order_type = #{orderType}
</if>
<if test="name != null and name != ''">
AND goods_name LIKE CONCAT('%', #{name}, '%') or
goods_id LIKE CONCAT('%', #{name}, '%') or
order_number LIKE CONCAT('%', #{name}, '%')
</if>
</select>
</mapper> </mapper>

@ -7,7 +7,7 @@
<result column="goods_name" jdbcType="VARCHAR" property="goodsName" /> <result column="goods_name" jdbcType="VARCHAR" property="goodsName" />
<result column="goods_type" jdbcType="VARCHAR" property="goodsType" /> <result column="goods_type" jdbcType="VARCHAR" property="goodsType" />
<result column="goods_subclass" jdbcType="VARCHAR" property="goodsSubclass" /> <result column="goods_subclass" jdbcType="VARCHAR" property="goodsSubclass" />
<result column="online_total" jdbcType="VARCHAR" property="onlineTotal" /> <result column="online_total" jdbcType="INTEGER" property="onlineTotal" />
<result column="available_inventory_quantity" jdbcType="INTEGER" property="availableInventoryQuantity" /> <result column="available_inventory_quantity" jdbcType="INTEGER" property="availableInventoryQuantity" />
<result column="sold_quantity" jdbcType="VARCHAR" property="soldQuantity" /> <result column="sold_quantity" jdbcType="VARCHAR" property="soldQuantity" />
<result column="sales_volume" jdbcType="VARCHAR" property="salesVolume" /> <result column="sales_volume" jdbcType="VARCHAR" property="salesVolume" />
@ -122,7 +122,7 @@
online_time, state, user_id online_time, state, user_id
) )
values (#{id,jdbcType=INTEGER}, #{goodsId,jdbcType=INTEGER}, #{goodsName,jdbcType=VARCHAR}, values (#{id,jdbcType=INTEGER}, #{goodsId,jdbcType=INTEGER}, #{goodsName,jdbcType=VARCHAR},
#{goodsType,jdbcType=VARCHAR}, #{goodsSubclass,jdbcType=VARCHAR}, #{onlineTotal,jdbcType=VARCHAR}, #{goodsType,jdbcType=VARCHAR}, #{goodsSubclass,jdbcType=VARCHAR}, #{onlineTotal,jdbcType=INTEGER},
#{availableInventoryQuantity,jdbcType=INTEGER}, #{soldQuantity,jdbcType=VARCHAR}, #{availableInventoryQuantity,jdbcType=INTEGER}, #{soldQuantity,jdbcType=VARCHAR},
#{salesVolume,jdbcType=VARCHAR}, #{grossMargin,jdbcType=VARCHAR}, #{numberOfComments,jdbcType=INTEGER}, #{salesVolume,jdbcType=VARCHAR}, #{grossMargin,jdbcType=VARCHAR}, #{numberOfComments,jdbcType=INTEGER},
#{numberOfLikes,jdbcType=INTEGER}, #{numberOfCollections,jdbcType=INTEGER}, #{numberOfShares,jdbcType=INTEGER}, #{numberOfLikes,jdbcType=INTEGER}, #{numberOfCollections,jdbcType=INTEGER}, #{numberOfShares,jdbcType=INTEGER},
@ -201,7 +201,7 @@
#{goodsSubclass,jdbcType=VARCHAR}, #{goodsSubclass,jdbcType=VARCHAR},
</if> </if>
<if test="onlineTotal != null"> <if test="onlineTotal != null">
#{onlineTotal,jdbcType=VARCHAR}, #{onlineTotal,jdbcType=INTEGER},
</if> </if>
<if test="availableInventoryQuantity != null"> <if test="availableInventoryQuantity != null">
#{availableInventoryQuantity,jdbcType=INTEGER}, #{availableInventoryQuantity,jdbcType=INTEGER},
@ -263,7 +263,7 @@
goods_subclass = #{record.goodsSubclass,jdbcType=VARCHAR}, goods_subclass = #{record.goodsSubclass,jdbcType=VARCHAR},
</if> </if>
<if test="record.onlineTotal != null"> <if test="record.onlineTotal != null">
online_total = #{record.onlineTotal,jdbcType=VARCHAR}, online_total = #{record.onlineTotal,jdbcType=INTEGER},
</if> </if>
<if test="record.availableInventoryQuantity != null"> <if test="record.availableInventoryQuantity != null">
available_inventory_quantity = #{record.availableInventoryQuantity,jdbcType=INTEGER}, available_inventory_quantity = #{record.availableInventoryQuantity,jdbcType=INTEGER},
@ -310,7 +310,7 @@
goods_name = #{record.goodsName,jdbcType=VARCHAR}, goods_name = #{record.goodsName,jdbcType=VARCHAR},
goods_type = #{record.goodsType,jdbcType=VARCHAR}, goods_type = #{record.goodsType,jdbcType=VARCHAR},
goods_subclass = #{record.goodsSubclass,jdbcType=VARCHAR}, goods_subclass = #{record.goodsSubclass,jdbcType=VARCHAR},
online_total = #{record.onlineTotal,jdbcType=VARCHAR}, online_total = #{record.onlineTotal,jdbcType=INTEGER},
available_inventory_quantity = #{record.availableInventoryQuantity,jdbcType=INTEGER}, available_inventory_quantity = #{record.availableInventoryQuantity,jdbcType=INTEGER},
sold_quantity = #{record.soldQuantity,jdbcType=VARCHAR}, sold_quantity = #{record.soldQuantity,jdbcType=VARCHAR},
sales_volume = #{record.salesVolume,jdbcType=VARCHAR}, sales_volume = #{record.salesVolume,jdbcType=VARCHAR},
@ -342,7 +342,7 @@
goods_subclass = #{goodsSubclass,jdbcType=VARCHAR}, goods_subclass = #{goodsSubclass,jdbcType=VARCHAR},
</if> </if>
<if test="onlineTotal != null"> <if test="onlineTotal != null">
online_total = #{onlineTotal,jdbcType=VARCHAR}, online_total = #{onlineTotal,jdbcType=INTEGER},
</if> </if>
<if test="availableInventoryQuantity != null"> <if test="availableInventoryQuantity != null">
available_inventory_quantity = #{availableInventoryQuantity,jdbcType=INTEGER}, available_inventory_quantity = #{availableInventoryQuantity,jdbcType=INTEGER},
@ -386,7 +386,7 @@
goods_name = #{goodsName,jdbcType=VARCHAR}, goods_name = #{goodsName,jdbcType=VARCHAR},
goods_type = #{goodsType,jdbcType=VARCHAR}, goods_type = #{goodsType,jdbcType=VARCHAR},
goods_subclass = #{goodsSubclass,jdbcType=VARCHAR}, goods_subclass = #{goodsSubclass,jdbcType=VARCHAR},
online_total = #{onlineTotal,jdbcType=VARCHAR}, online_total = #{onlineTotal,jdbcType=INTEGER},
available_inventory_quantity = #{availableInventoryQuantity,jdbcType=INTEGER}, available_inventory_quantity = #{availableInventoryQuantity,jdbcType=INTEGER},
sold_quantity = #{soldQuantity,jdbcType=VARCHAR}, sold_quantity = #{soldQuantity,jdbcType=VARCHAR},
sales_volume = #{salesVolume,jdbcType=VARCHAR}, sales_volume = #{salesVolume,jdbcType=VARCHAR},

@ -5,7 +5,9 @@
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id" />
<result column="goods_id" jdbcType="INTEGER" property="goodsId" /> <result column="goods_id" jdbcType="INTEGER" property="goodsId" />
<result column="goods_name" jdbcType="VARCHAR" property="goodsName" /> <result column="goods_name" jdbcType="VARCHAR" property="goodsName" />
<result column="goods_type" jdbcType="VARCHAR" property="goodsType" />
<result column="goods_image" jdbcType="VARCHAR" property="goodsImage" /> <result column="goods_image" jdbcType="VARCHAR" property="goodsImage" />
<result column="goods_url" jdbcType="VARCHAR" property="goodsUrl" />
<result column="unit_price" jdbcType="DECIMAL" property="unitPrice" /> <result column="unit_price" jdbcType="DECIMAL" property="unitPrice" />
<result column="number" jdbcType="INTEGER" property="number" /> <result column="number" jdbcType="INTEGER" property="number" />
<result column="subtotal" jdbcType="DECIMAL" property="subtotal" /> <result column="subtotal" jdbcType="DECIMAL" property="subtotal" />
@ -75,8 +77,8 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, goods_id, goods_name, goods_image, unit_price, number, subtotal, shop_name, attention_state, id, goods_id, goods_name, goods_type, goods_image, goods_url, unit_price, number,
user_id subtotal, shop_name, attention_state, user_id
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
goods_specification goods_specification
@ -131,13 +133,15 @@
</delete> </delete>
<insert id="insert" parameterType="com.sztzjy.trade.entity.StuShoppingCartInfo"> <insert id="insert" parameterType="com.sztzjy.trade.entity.StuShoppingCartInfo">
insert into stu_shopping_cart_info (id, goods_id, goods_name, insert into stu_shopping_cart_info (id, goods_id, goods_name,
goods_image, unit_price, number, goods_type, goods_image, goods_url,
subtotal, shop_name, attention_state, unit_price, number, subtotal,
user_id, goods_specification) shop_name, attention_state, user_id,
goods_specification)
values (#{id,jdbcType=INTEGER}, #{goodsId,jdbcType=INTEGER}, #{goodsName,jdbcType=VARCHAR}, values (#{id,jdbcType=INTEGER}, #{goodsId,jdbcType=INTEGER}, #{goodsName,jdbcType=VARCHAR},
#{goodsImage,jdbcType=VARCHAR}, #{unitPrice,jdbcType=DECIMAL}, #{number,jdbcType=INTEGER}, #{goodsType,jdbcType=VARCHAR}, #{goodsImage,jdbcType=VARCHAR}, #{goodsUrl,jdbcType=VARCHAR},
#{subtotal,jdbcType=DECIMAL}, #{shopName,jdbcType=VARCHAR}, #{attentionState,jdbcType=INTEGER}, #{unitPrice,jdbcType=DECIMAL}, #{number,jdbcType=INTEGER}, #{subtotal,jdbcType=DECIMAL},
#{userId,jdbcType=VARCHAR}, #{goodsSpecification,jdbcType=LONGVARCHAR}) #{shopName,jdbcType=VARCHAR}, #{attentionState,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR},
#{goodsSpecification,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.sztzjy.trade.entity.StuShoppingCartInfo"> <insert id="insertSelective" parameterType="com.sztzjy.trade.entity.StuShoppingCartInfo">
insert into stu_shopping_cart_info insert into stu_shopping_cart_info
@ -151,9 +155,15 @@
<if test="goodsName != null"> <if test="goodsName != null">
goods_name, goods_name,
</if> </if>
<if test="goodsType != null">
goods_type,
</if>
<if test="goodsImage != null"> <if test="goodsImage != null">
goods_image, goods_image,
</if> </if>
<if test="goodsUrl != null">
goods_url,
</if>
<if test="unitPrice != null"> <if test="unitPrice != null">
unit_price, unit_price,
</if> </if>
@ -186,9 +196,15 @@
<if test="goodsName != null"> <if test="goodsName != null">
#{goodsName,jdbcType=VARCHAR}, #{goodsName,jdbcType=VARCHAR},
</if> </if>
<if test="goodsType != null">
#{goodsType,jdbcType=VARCHAR},
</if>
<if test="goodsImage != null"> <if test="goodsImage != null">
#{goodsImage,jdbcType=VARCHAR}, #{goodsImage,jdbcType=VARCHAR},
</if> </if>
<if test="goodsUrl != null">
#{goodsUrl,jdbcType=VARCHAR},
</if>
<if test="unitPrice != null"> <if test="unitPrice != null">
#{unitPrice,jdbcType=DECIMAL}, #{unitPrice,jdbcType=DECIMAL},
</if> </if>
@ -230,9 +246,15 @@
<if test="record.goodsName != null"> <if test="record.goodsName != null">
goods_name = #{record.goodsName,jdbcType=VARCHAR}, goods_name = #{record.goodsName,jdbcType=VARCHAR},
</if> </if>
<if test="record.goodsType != null">
goods_type = #{record.goodsType,jdbcType=VARCHAR},
</if>
<if test="record.goodsImage != null"> <if test="record.goodsImage != null">
goods_image = #{record.goodsImage,jdbcType=VARCHAR}, goods_image = #{record.goodsImage,jdbcType=VARCHAR},
</if> </if>
<if test="record.goodsUrl != null">
goods_url = #{record.goodsUrl,jdbcType=VARCHAR},
</if>
<if test="record.unitPrice != null"> <if test="record.unitPrice != null">
unit_price = #{record.unitPrice,jdbcType=DECIMAL}, unit_price = #{record.unitPrice,jdbcType=DECIMAL},
</if> </if>
@ -264,7 +286,9 @@
set id = #{record.id,jdbcType=INTEGER}, set id = #{record.id,jdbcType=INTEGER},
goods_id = #{record.goodsId,jdbcType=INTEGER}, goods_id = #{record.goodsId,jdbcType=INTEGER},
goods_name = #{record.goodsName,jdbcType=VARCHAR}, goods_name = #{record.goodsName,jdbcType=VARCHAR},
goods_type = #{record.goodsType,jdbcType=VARCHAR},
goods_image = #{record.goodsImage,jdbcType=VARCHAR}, goods_image = #{record.goodsImage,jdbcType=VARCHAR},
goods_url = #{record.goodsUrl,jdbcType=VARCHAR},
unit_price = #{record.unitPrice,jdbcType=DECIMAL}, unit_price = #{record.unitPrice,jdbcType=DECIMAL},
number = #{record.number,jdbcType=INTEGER}, number = #{record.number,jdbcType=INTEGER},
subtotal = #{record.subtotal,jdbcType=DECIMAL}, subtotal = #{record.subtotal,jdbcType=DECIMAL},
@ -281,7 +305,9 @@
set id = #{record.id,jdbcType=INTEGER}, set id = #{record.id,jdbcType=INTEGER},
goods_id = #{record.goodsId,jdbcType=INTEGER}, goods_id = #{record.goodsId,jdbcType=INTEGER},
goods_name = #{record.goodsName,jdbcType=VARCHAR}, goods_name = #{record.goodsName,jdbcType=VARCHAR},
goods_type = #{record.goodsType,jdbcType=VARCHAR},
goods_image = #{record.goodsImage,jdbcType=VARCHAR}, goods_image = #{record.goodsImage,jdbcType=VARCHAR},
goods_url = #{record.goodsUrl,jdbcType=VARCHAR},
unit_price = #{record.unitPrice,jdbcType=DECIMAL}, unit_price = #{record.unitPrice,jdbcType=DECIMAL},
number = #{record.number,jdbcType=INTEGER}, number = #{record.number,jdbcType=INTEGER},
subtotal = #{record.subtotal,jdbcType=DECIMAL}, subtotal = #{record.subtotal,jdbcType=DECIMAL},
@ -301,9 +327,15 @@
<if test="goodsName != null"> <if test="goodsName != null">
goods_name = #{goodsName,jdbcType=VARCHAR}, goods_name = #{goodsName,jdbcType=VARCHAR},
</if> </if>
<if test="goodsType != null">
goods_type = #{goodsType,jdbcType=VARCHAR},
</if>
<if test="goodsImage != null"> <if test="goodsImage != null">
goods_image = #{goodsImage,jdbcType=VARCHAR}, goods_image = #{goodsImage,jdbcType=VARCHAR},
</if> </if>
<if test="goodsUrl != null">
goods_url = #{goodsUrl,jdbcType=VARCHAR},
</if>
<if test="unitPrice != null"> <if test="unitPrice != null">
unit_price = #{unitPrice,jdbcType=DECIMAL}, unit_price = #{unitPrice,jdbcType=DECIMAL},
</if> </if>
@ -332,7 +364,9 @@
update stu_shopping_cart_info update stu_shopping_cart_info
set goods_id = #{goodsId,jdbcType=INTEGER}, set goods_id = #{goodsId,jdbcType=INTEGER},
goods_name = #{goodsName,jdbcType=VARCHAR}, goods_name = #{goodsName,jdbcType=VARCHAR},
goods_type = #{goodsType,jdbcType=VARCHAR},
goods_image = #{goodsImage,jdbcType=VARCHAR}, goods_image = #{goodsImage,jdbcType=VARCHAR},
goods_url = #{goodsUrl,jdbcType=VARCHAR},
unit_price = #{unitPrice,jdbcType=DECIMAL}, unit_price = #{unitPrice,jdbcType=DECIMAL},
number = #{number,jdbcType=INTEGER}, number = #{number,jdbcType=INTEGER},
subtotal = #{subtotal,jdbcType=DECIMAL}, subtotal = #{subtotal,jdbcType=DECIMAL},
@ -346,7 +380,9 @@
update stu_shopping_cart_info update stu_shopping_cart_info
set goods_id = #{goodsId,jdbcType=INTEGER}, set goods_id = #{goodsId,jdbcType=INTEGER},
goods_name = #{goodsName,jdbcType=VARCHAR}, goods_name = #{goodsName,jdbcType=VARCHAR},
goods_type = #{goodsType,jdbcType=VARCHAR},
goods_image = #{goodsImage,jdbcType=VARCHAR}, goods_image = #{goodsImage,jdbcType=VARCHAR},
goods_url = #{goodsUrl,jdbcType=VARCHAR},
unit_price = #{unitPrice,jdbcType=DECIMAL}, unit_price = #{unitPrice,jdbcType=DECIMAL},
number = #{number,jdbcType=INTEGER}, number = #{number,jdbcType=INTEGER},
subtotal = #{subtotal,jdbcType=DECIMAL}, subtotal = #{subtotal,jdbcType=DECIMAL},

@ -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.StuTradeAccountInfoMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.trade.entity.StuTradeAccountInfo">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="account_name" jdbcType="VARCHAR" property="accountName" />
<result column="account_balance" jdbcType="DECIMAL" property="accountBalance" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="reserved_one" jdbcType="VARCHAR" property="reservedOne" />
<result column="reserved_two" jdbcType="VARCHAR" property="reservedTwo" />
<result column="reserved_three" jdbcType="VARCHAR" property="reservedThree" />
<result column="reserved_four" jdbcType="VARCHAR" property="reservedFour" />
<result column="reserved_five" jdbcType="VARCHAR" property="reservedFive" />
</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, account_name, account_balance, user_id, reserved_one, reserved_two, reserved_three,
reserved_four, reserved_five
</sql>
<select id="selectByExample" parameterType="com.sztzjy.trade.entity.StuTradeAccountInfoExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from stu_trade_account_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_trade_account_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from stu_trade_account_info
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.trade.entity.StuTradeAccountInfoExample">
delete from stu_trade_account_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.trade.entity.StuTradeAccountInfo">
insert into stu_trade_account_info (id, account_name, account_balance,
user_id, reserved_one, reserved_two,
reserved_three, reserved_four, reserved_five
)
values (#{id,jdbcType=INTEGER}, #{accountName,jdbcType=VARCHAR}, #{accountBalance,jdbcType=DECIMAL},
#{userId,jdbcType=VARCHAR}, #{reservedOne,jdbcType=VARCHAR}, #{reservedTwo,jdbcType=VARCHAR},
#{reservedThree,jdbcType=VARCHAR}, #{reservedFour,jdbcType=VARCHAR}, #{reservedFive,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.trade.entity.StuTradeAccountInfo">
insert into stu_trade_account_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="accountName != null">
account_name,
</if>
<if test="accountBalance != null">
account_balance,
</if>
<if test="userId != null">
user_id,
</if>
<if test="reservedOne != null">
reserved_one,
</if>
<if test="reservedTwo != null">
reserved_two,
</if>
<if test="reservedThree != null">
reserved_three,
</if>
<if test="reservedFour != null">
reserved_four,
</if>
<if test="reservedFive != null">
reserved_five,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="accountName != null">
#{accountName,jdbcType=VARCHAR},
</if>
<if test="accountBalance != null">
#{accountBalance,jdbcType=DECIMAL},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="reservedOne != null">
#{reservedOne,jdbcType=VARCHAR},
</if>
<if test="reservedTwo != null">
#{reservedTwo,jdbcType=VARCHAR},
</if>
<if test="reservedThree != null">
#{reservedThree,jdbcType=VARCHAR},
</if>
<if test="reservedFour != null">
#{reservedFour,jdbcType=VARCHAR},
</if>
<if test="reservedFive != null">
#{reservedFive,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.trade.entity.StuTradeAccountInfoExample" resultType="java.lang.Long">
select count(*) from stu_trade_account_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update stu_trade_account_info
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.accountName != null">
account_name = #{record.accountName,jdbcType=VARCHAR},
</if>
<if test="record.accountBalance != null">
account_balance = #{record.accountBalance,jdbcType=DECIMAL},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.reservedOne != null">
reserved_one = #{record.reservedOne,jdbcType=VARCHAR},
</if>
<if test="record.reservedTwo != null">
reserved_two = #{record.reservedTwo,jdbcType=VARCHAR},
</if>
<if test="record.reservedThree != null">
reserved_three = #{record.reservedThree,jdbcType=VARCHAR},
</if>
<if test="record.reservedFour != null">
reserved_four = #{record.reservedFour,jdbcType=VARCHAR},
</if>
<if test="record.reservedFive != null">
reserved_five = #{record.reservedFive,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_trade_account_info
set id = #{record.id,jdbcType=INTEGER},
account_name = #{record.accountName,jdbcType=VARCHAR},
account_balance = #{record.accountBalance,jdbcType=DECIMAL},
user_id = #{record.userId,jdbcType=VARCHAR},
reserved_one = #{record.reservedOne,jdbcType=VARCHAR},
reserved_two = #{record.reservedTwo,jdbcType=VARCHAR},
reserved_three = #{record.reservedThree,jdbcType=VARCHAR},
reserved_four = #{record.reservedFour,jdbcType=VARCHAR},
reserved_five = #{record.reservedFive,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.trade.entity.StuTradeAccountInfo">
update stu_trade_account_info
<set>
<if test="accountName != null">
account_name = #{accountName,jdbcType=VARCHAR},
</if>
<if test="accountBalance != null">
account_balance = #{accountBalance,jdbcType=DECIMAL},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="reservedOne != null">
reserved_one = #{reservedOne,jdbcType=VARCHAR},
</if>
<if test="reservedTwo != null">
reserved_two = #{reservedTwo,jdbcType=VARCHAR},
</if>
<if test="reservedThree != null">
reserved_three = #{reservedThree,jdbcType=VARCHAR},
</if>
<if test="reservedFour != null">
reserved_four = #{reservedFour,jdbcType=VARCHAR},
</if>
<if test="reservedFive != null">
reserved_five = #{reservedFive,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.trade.entity.StuTradeAccountInfo">
update stu_trade_account_info
set account_name = #{accountName,jdbcType=VARCHAR},
account_balance = #{accountBalance,jdbcType=DECIMAL},
user_id = #{userId,jdbcType=VARCHAR},
reserved_one = #{reservedOne,jdbcType=VARCHAR},
reserved_two = #{reservedTwo,jdbcType=VARCHAR},
reserved_three = #{reservedThree,jdbcType=VARCHAR},
reserved_four = #{reservedFour,jdbcType=VARCHAR},
reserved_five = #{reservedFive,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
Loading…
Cancel
Save