项目十二:商品信息管理和销售管理
parent
023927f3a1
commit
3b2b4bfa84
@ -0,0 +1,125 @@
|
||||
package com.sztzjy.trade.controller.stu;
|
||||
|
||||
import com.sztzjy.trade.annotation.AnonymousAccess;
|
||||
import com.sztzjy.trade.entity.StuGoodsCommentInfo;
|
||||
import com.sztzjy.trade.entity.dto.StuGoodsInfoDTO;
|
||||
import com.sztzjy.trade.service.StuGoodsManageCenterService;
|
||||
import com.sztzjy.trade.util.ResultEntity;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/11/1 13:20
|
||||
*/
|
||||
@RequestMapping("api/stu/manageCenter")
|
||||
@RestController
|
||||
@Api(tags = "商品管理中心")
|
||||
public class StuGoodsManageCenterController {
|
||||
@Resource
|
||||
StuGoodsManageCenterService manageCenterService;
|
||||
|
||||
@ApiOperation("商品列表展示")
|
||||
@PostMapping("/getGoodsList")
|
||||
@AnonymousAccess
|
||||
public ResultEntity getMyOrderInfo(@ApiParam("用户ID") String userId,
|
||||
@ApiParam("当前页") Integer index,
|
||||
@ApiParam("每页条数") Integer size){
|
||||
|
||||
return new ResultEntity(HttpStatus.OK,"商品列表展示",manageCenterService.getGoodsList(userId,index,size));
|
||||
}
|
||||
|
||||
@ApiOperation("商品销售管理列表展示")
|
||||
@PostMapping("/getGoodsSalesManagementList")
|
||||
@AnonymousAccess
|
||||
public ResultEntity getGoodsSalesManagementList(@ApiParam("用户ID") String userId,
|
||||
@ApiParam("当前页") Integer index,
|
||||
@ApiParam("每页条数") Integer size){
|
||||
|
||||
return new ResultEntity(HttpStatus.OK,"商品销售管理列表展示",manageCenterService.getGoodsSalesManagementList(userId,index,size));
|
||||
}
|
||||
|
||||
@ApiOperation("保存")
|
||||
@PostMapping("/save")
|
||||
@AnonymousAccess
|
||||
public ResultEntity save(@RequestBody StuGoodsInfoDTO stuGoodsInfoDTO,
|
||||
@ApiParam("商品主图片")@RequestParam(required = false) MultipartFile file,
|
||||
@ApiParam("轮播图集合")@RequestParam(required = false) List<MultipartFile> files){
|
||||
|
||||
Integer result = manageCenterService.save(stuGoodsInfoDTO, file, files);
|
||||
if(result>0){
|
||||
return new ResultEntity(HttpStatus.OK,"保存成功");
|
||||
}else {
|
||||
return new ResultEntity(HttpStatus.OK,"保存失败,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping("/add")
|
||||
@AnonymousAccess
|
||||
public ResultEntity add(@RequestBody StuGoodsInfoDTO stuGoodsInfoDTO,
|
||||
@ApiParam("商品主图片") MultipartFile file,
|
||||
@ApiParam("轮播图集合")@RequestParam(required = false) List<MultipartFile> files){
|
||||
|
||||
Integer result = manageCenterService.add(stuGoodsInfoDTO, file, files);
|
||||
if(result>0){
|
||||
return new ResultEntity(HttpStatus.OK,"新增成功");
|
||||
}else {
|
||||
return new ResultEntity(HttpStatus.OK,"新增失败,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("编辑")
|
||||
@PostMapping("/update")
|
||||
@AnonymousAccess
|
||||
public ResultEntity update(@RequestBody StuGoodsInfoDTO stuGoodsInfoDTO,
|
||||
@ApiParam("商品主图片") MultipartFile file,
|
||||
@ApiParam("轮播图集合")@RequestParam(required = false) List<MultipartFile> files){
|
||||
|
||||
Integer result = manageCenterService.update(stuGoodsInfoDTO, file, files);
|
||||
if(result>0){
|
||||
return new ResultEntity(HttpStatus.OK,"编辑成功");
|
||||
}else {
|
||||
return new ResultEntity(HttpStatus.OK,"编辑失败,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("下架")
|
||||
@PostMapping("/remove")
|
||||
@AnonymousAccess
|
||||
public ResultEntity remove(Integer id){
|
||||
|
||||
Integer result = manageCenterService.remove(id);
|
||||
if(result>0){
|
||||
return new ResultEntity(HttpStatus.OK,"上架成功");
|
||||
}else {
|
||||
return new ResultEntity(HttpStatus.OK,"上架失败,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("上架")
|
||||
@PostMapping("/listing")
|
||||
@AnonymousAccess
|
||||
public ResultEntity listing(@ApiParam("商品ID") Integer id,
|
||||
@ApiParam("上架数量") Integer number,
|
||||
@ApiParam("上架所需资金") String requiredFunds,
|
||||
@ApiParam("账户余额") String balance){
|
||||
|
||||
Integer result = manageCenterService.listing(id,number,requiredFunds,balance);
|
||||
if(result>0){
|
||||
return new ResultEntity(HttpStatus.OK,"上架成功");
|
||||
}else {
|
||||
return new ResultEntity(HttpStatus.OK,"上架失败,请联系管理员");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package com.sztzjy.trade.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 商品评论举报信息表
|
||||
*
|
||||
* @author whb
|
||||
* stu_comment_report_info
|
||||
*/
|
||||
public class StuCommentReportInfo {
|
||||
@ApiModelProperty(notes = "ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(notes = "评论ID")
|
||||
private Integer commentId;
|
||||
|
||||
@ApiModelProperty(notes = "举报类型")
|
||||
private String reportType;
|
||||
|
||||
@ApiModelProperty(notes = "举报原因")
|
||||
private String reportReason;
|
||||
|
||||
@ApiModelProperty(notes = "用户ID")
|
||||
private String userId;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@ApiModelProperty(notes = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getCommentId() {
|
||||
return commentId;
|
||||
}
|
||||
|
||||
public void setCommentId(Integer commentId) {
|
||||
this.commentId = commentId;
|
||||
}
|
||||
|
||||
public String getReportType() {
|
||||
return reportType;
|
||||
}
|
||||
|
||||
public void setReportType(String reportType) {
|
||||
this.reportType = reportType == null ? null : reportType.trim();
|
||||
}
|
||||
|
||||
public String getReportReason() {
|
||||
return reportReason;
|
||||
}
|
||||
|
||||
public void setReportReason(String reportReason) {
|
||||
this.reportReason = reportReason == null ? null : reportReason.trim();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,590 @@
|
||||
package com.sztzjy.trade.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class StuCommentReportInfoExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public StuCommentReportInfoExample() {
|
||||
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 andCommentIdIsNull() {
|
||||
addCriterion("comment_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCommentIdIsNotNull() {
|
||||
addCriterion("comment_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCommentIdEqualTo(Integer value) {
|
||||
addCriterion("comment_id =", value, "commentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCommentIdNotEqualTo(Integer value) {
|
||||
addCriterion("comment_id <>", value, "commentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCommentIdGreaterThan(Integer value) {
|
||||
addCriterion("comment_id >", value, "commentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCommentIdGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("comment_id >=", value, "commentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCommentIdLessThan(Integer value) {
|
||||
addCriterion("comment_id <", value, "commentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCommentIdLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("comment_id <=", value, "commentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCommentIdIn(List<Integer> values) {
|
||||
addCriterion("comment_id in", values, "commentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCommentIdNotIn(List<Integer> values) {
|
||||
addCriterion("comment_id not in", values, "commentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCommentIdBetween(Integer value1, Integer value2) {
|
||||
addCriterion("comment_id between", value1, value2, "commentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCommentIdNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("comment_id not between", value1, value2, "commentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportTypeIsNull() {
|
||||
addCriterion("report_type is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportTypeIsNotNull() {
|
||||
addCriterion("report_type is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportTypeEqualTo(String value) {
|
||||
addCriterion("report_type =", value, "reportType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportTypeNotEqualTo(String value) {
|
||||
addCriterion("report_type <>", value, "reportType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportTypeGreaterThan(String value) {
|
||||
addCriterion("report_type >", value, "reportType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportTypeGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("report_type >=", value, "reportType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportTypeLessThan(String value) {
|
||||
addCriterion("report_type <", value, "reportType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportTypeLessThanOrEqualTo(String value) {
|
||||
addCriterion("report_type <=", value, "reportType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportTypeLike(String value) {
|
||||
addCriterion("report_type like", value, "reportType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportTypeNotLike(String value) {
|
||||
addCriterion("report_type not like", value, "reportType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportTypeIn(List<String> values) {
|
||||
addCriterion("report_type in", values, "reportType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportTypeNotIn(List<String> values) {
|
||||
addCriterion("report_type not in", values, "reportType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportTypeBetween(String value1, String value2) {
|
||||
addCriterion("report_type between", value1, value2, "reportType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportTypeNotBetween(String value1, String value2) {
|
||||
addCriterion("report_type not between", value1, value2, "reportType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportReasonIsNull() {
|
||||
addCriterion("report_reason is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportReasonIsNotNull() {
|
||||
addCriterion("report_reason is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportReasonEqualTo(String value) {
|
||||
addCriterion("report_reason =", value, "reportReason");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportReasonNotEqualTo(String value) {
|
||||
addCriterion("report_reason <>", value, "reportReason");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportReasonGreaterThan(String value) {
|
||||
addCriterion("report_reason >", value, "reportReason");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportReasonGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("report_reason >=", value, "reportReason");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportReasonLessThan(String value) {
|
||||
addCriterion("report_reason <", value, "reportReason");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportReasonLessThanOrEqualTo(String value) {
|
||||
addCriterion("report_reason <=", value, "reportReason");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportReasonLike(String value) {
|
||||
addCriterion("report_reason like", value, "reportReason");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportReasonNotLike(String value) {
|
||||
addCriterion("report_reason not like", value, "reportReason");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportReasonIn(List<String> values) {
|
||||
addCriterion("report_reason in", values, "reportReason");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportReasonNotIn(List<String> values) {
|
||||
addCriterion("report_reason not in", values, "reportReason");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportReasonBetween(String value1, String value2) {
|
||||
addCriterion("report_reason between", value1, value2, "reportReason");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andReportReasonNotBetween(String value1, String value2) {
|
||||
addCriterion("report_reason not between", value1, value2, "reportReason");
|
||||
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 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 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,100 @@
|
||||
package com.sztzjy.trade.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
/**
|
||||
* 商品促销定价表
|
||||
*
|
||||
* @author whb
|
||||
* stu_goods_promotion_pricing
|
||||
*/
|
||||
public class StuGoodsPromotionPricing {
|
||||
@ApiModelProperty(notes = "ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(notes = "商品ID")
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(notes = "促销名称")
|
||||
private String promotionName;
|
||||
|
||||
@ApiModelProperty(notes = "重量")
|
||||
private BigDecimal weight;
|
||||
|
||||
@ApiModelProperty(notes = "促销成本价")
|
||||
private BigDecimal promotionCostPrice;
|
||||
|
||||
@ApiModelProperty(notes = "最高价")
|
||||
private BigDecimal maximumPrice;
|
||||
|
||||
@ApiModelProperty(notes = "促销定价")
|
||||
private BigDecimal fixAPrice;
|
||||
|
||||
@ApiModelProperty(notes = "用户ID")
|
||||
private String userId;
|
||||
|
||||
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 String getPromotionName() {
|
||||
return promotionName;
|
||||
}
|
||||
|
||||
public void setPromotionName(String promotionName) {
|
||||
this.promotionName = promotionName == null ? null : promotionName.trim();
|
||||
}
|
||||
|
||||
public BigDecimal getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(BigDecimal weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public BigDecimal getPromotionCostPrice() {
|
||||
return promotionCostPrice;
|
||||
}
|
||||
|
||||
public void setPromotionCostPrice(BigDecimal promotionCostPrice) {
|
||||
this.promotionCostPrice = promotionCostPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getMaximumPrice() {
|
||||
return maximumPrice;
|
||||
}
|
||||
|
||||
public void setMaximumPrice(BigDecimal maximumPrice) {
|
||||
this.maximumPrice = maximumPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getFixAPrice() {
|
||||
return fixAPrice;
|
||||
}
|
||||
|
||||
public void setFixAPrice(BigDecimal fixAPrice) {
|
||||
this.fixAPrice = fixAPrice;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId == null ? null : userId.trim();
|
||||
}
|
||||
}
|
@ -0,0 +1,700 @@
|
||||
package com.sztzjy.trade.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class StuGoodsPromotionPricingExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public StuGoodsPromotionPricingExample() {
|
||||
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 andPromotionNameIsNull() {
|
||||
addCriterion("promotion_name is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionNameIsNotNull() {
|
||||
addCriterion("promotion_name is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionNameEqualTo(String value) {
|
||||
addCriterion("promotion_name =", value, "promotionName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionNameNotEqualTo(String value) {
|
||||
addCriterion("promotion_name <>", value, "promotionName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionNameGreaterThan(String value) {
|
||||
addCriterion("promotion_name >", value, "promotionName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionNameGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("promotion_name >=", value, "promotionName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionNameLessThan(String value) {
|
||||
addCriterion("promotion_name <", value, "promotionName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionNameLessThanOrEqualTo(String value) {
|
||||
addCriterion("promotion_name <=", value, "promotionName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionNameLike(String value) {
|
||||
addCriterion("promotion_name like", value, "promotionName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionNameNotLike(String value) {
|
||||
addCriterion("promotion_name not like", value, "promotionName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionNameIn(List<String> values) {
|
||||
addCriterion("promotion_name in", values, "promotionName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionNameNotIn(List<String> values) {
|
||||
addCriterion("promotion_name not in", values, "promotionName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionNameBetween(String value1, String value2) {
|
||||
addCriterion("promotion_name between", value1, value2, "promotionName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionNameNotBetween(String value1, String value2) {
|
||||
addCriterion("promotion_name not between", value1, value2, "promotionName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWeightIsNull() {
|
||||
addCriterion("weight is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWeightIsNotNull() {
|
||||
addCriterion("weight is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWeightEqualTo(BigDecimal value) {
|
||||
addCriterion("weight =", value, "weight");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWeightNotEqualTo(BigDecimal value) {
|
||||
addCriterion("weight <>", value, "weight");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWeightGreaterThan(BigDecimal value) {
|
||||
addCriterion("weight >", value, "weight");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWeightGreaterThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("weight >=", value, "weight");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWeightLessThan(BigDecimal value) {
|
||||
addCriterion("weight <", value, "weight");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWeightLessThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("weight <=", value, "weight");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWeightIn(List<BigDecimal> values) {
|
||||
addCriterion("weight in", values, "weight");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWeightNotIn(List<BigDecimal> values) {
|
||||
addCriterion("weight not in", values, "weight");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWeightBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("weight between", value1, value2, "weight");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWeightNotBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("weight not between", value1, value2, "weight");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionCostPriceIsNull() {
|
||||
addCriterion("promotion_cost_price is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionCostPriceIsNotNull() {
|
||||
addCriterion("promotion_cost_price is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionCostPriceEqualTo(BigDecimal value) {
|
||||
addCriterion("promotion_cost_price =", value, "promotionCostPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionCostPriceNotEqualTo(BigDecimal value) {
|
||||
addCriterion("promotion_cost_price <>", value, "promotionCostPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionCostPriceGreaterThan(BigDecimal value) {
|
||||
addCriterion("promotion_cost_price >", value, "promotionCostPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionCostPriceGreaterThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("promotion_cost_price >=", value, "promotionCostPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionCostPriceLessThan(BigDecimal value) {
|
||||
addCriterion("promotion_cost_price <", value, "promotionCostPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionCostPriceLessThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("promotion_cost_price <=", value, "promotionCostPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionCostPriceIn(List<BigDecimal> values) {
|
||||
addCriterion("promotion_cost_price in", values, "promotionCostPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionCostPriceNotIn(List<BigDecimal> values) {
|
||||
addCriterion("promotion_cost_price not in", values, "promotionCostPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionCostPriceBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("promotion_cost_price between", value1, value2, "promotionCostPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotionCostPriceNotBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("promotion_cost_price not between", value1, value2, "promotionCostPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMaximumPriceIsNull() {
|
||||
addCriterion("maximum_price is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMaximumPriceIsNotNull() {
|
||||
addCriterion("maximum_price is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMaximumPriceEqualTo(BigDecimal value) {
|
||||
addCriterion("maximum_price =", value, "maximumPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMaximumPriceNotEqualTo(BigDecimal value) {
|
||||
addCriterion("maximum_price <>", value, "maximumPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMaximumPriceGreaterThan(BigDecimal value) {
|
||||
addCriterion("maximum_price >", value, "maximumPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMaximumPriceGreaterThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("maximum_price >=", value, "maximumPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMaximumPriceLessThan(BigDecimal value) {
|
||||
addCriterion("maximum_price <", value, "maximumPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMaximumPriceLessThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("maximum_price <=", value, "maximumPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMaximumPriceIn(List<BigDecimal> values) {
|
||||
addCriterion("maximum_price in", values, "maximumPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMaximumPriceNotIn(List<BigDecimal> values) {
|
||||
addCriterion("maximum_price not in", values, "maximumPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMaximumPriceBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("maximum_price between", value1, value2, "maximumPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMaximumPriceNotBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("maximum_price not between", value1, value2, "maximumPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFixAPriceIsNull() {
|
||||
addCriterion("fix_a_price is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFixAPriceIsNotNull() {
|
||||
addCriterion("fix_a_price is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFixAPriceEqualTo(BigDecimal value) {
|
||||
addCriterion("fix_a_price =", value, "fixAPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFixAPriceNotEqualTo(BigDecimal value) {
|
||||
addCriterion("fix_a_price <>", value, "fixAPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFixAPriceGreaterThan(BigDecimal value) {
|
||||
addCriterion("fix_a_price >", value, "fixAPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFixAPriceGreaterThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("fix_a_price >=", value, "fixAPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFixAPriceLessThan(BigDecimal value) {
|
||||
addCriterion("fix_a_price <", value, "fixAPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFixAPriceLessThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("fix_a_price <=", value, "fixAPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFixAPriceIn(List<BigDecimal> values) {
|
||||
addCriterion("fix_a_price in", values, "fixAPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFixAPriceNotIn(List<BigDecimal> values) {
|
||||
addCriterion("fix_a_price not in", values, "fixAPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFixAPriceBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("fix_a_price between", value1, value2, "fixAPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFixAPriceNotBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("fix_a_price not between", value1, value2, "fixAPrice");
|
||||
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 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,75 @@
|
||||
package com.sztzjy.trade.entity.dto;
|
||||
|
||||
import com.sztzjy.trade.entity.StuGoodsPromotionPricing;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/11/1 16:33
|
||||
*/
|
||||
@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 matchingGroups;
|
||||
|
||||
@ApiModelProperty(notes = "商品主图片")
|
||||
private String goodsMainImage;
|
||||
|
||||
@ApiModelProperty(notes = "轮播图(多个逗号隔开)")
|
||||
private String carouselImage;
|
||||
|
||||
@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 String goodsIntroduction;
|
||||
|
||||
@ApiModelProperty(notes = "规格与包装")
|
||||
private String specificationPackaging;
|
||||
|
||||
@ApiModelProperty(notes = "商品定价促销种类集合")
|
||||
private List<StuGoodsPromotionPricing> promotionPricingList;
|
||||
|
||||
@ApiModelProperty(notes = "用户ID")
|
||||
private String userId;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.sztzjy.trade.mapper;
|
||||
|
||||
import com.sztzjy.trade.entity.StuCommentReportInfo;
|
||||
import com.sztzjy.trade.entity.StuCommentReportInfoExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface StuCommentReportInfoMapper {
|
||||
long countByExample(StuCommentReportInfoExample example);
|
||||
|
||||
int deleteByExample(StuCommentReportInfoExample example);
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(StuCommentReportInfo record);
|
||||
|
||||
int insertSelective(StuCommentReportInfo record);
|
||||
|
||||
List<StuCommentReportInfo> selectByExample(StuCommentReportInfoExample example);
|
||||
|
||||
StuCommentReportInfo selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") StuCommentReportInfo record, @Param("example") StuCommentReportInfoExample example);
|
||||
|
||||
int updateByExample(@Param("record") StuCommentReportInfo record, @Param("example") StuCommentReportInfoExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(StuCommentReportInfo record);
|
||||
|
||||
int updateByPrimaryKey(StuCommentReportInfo record);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.sztzjy.trade.mapper;
|
||||
|
||||
import com.sztzjy.trade.entity.StuGoodsPromotionPricing;
|
||||
import com.sztzjy.trade.entity.StuGoodsPromotionPricingExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface StuGoodsPromotionPricingMapper {
|
||||
long countByExample(StuGoodsPromotionPricingExample example);
|
||||
|
||||
int deleteByExample(StuGoodsPromotionPricingExample example);
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(StuGoodsPromotionPricing record);
|
||||
|
||||
int insertSelective(StuGoodsPromotionPricing record);
|
||||
|
||||
List<StuGoodsPromotionPricing> selectByExample(StuGoodsPromotionPricingExample example);
|
||||
|
||||
StuGoodsPromotionPricing selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") StuGoodsPromotionPricing record, @Param("example") StuGoodsPromotionPricingExample example);
|
||||
|
||||
int updateByExample(@Param("record") StuGoodsPromotionPricing record, @Param("example") StuGoodsPromotionPricingExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(StuGoodsPromotionPricing record);
|
||||
|
||||
int updateByPrimaryKey(StuGoodsPromotionPricing record);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.sztzjy.trade.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sztzjy.trade.entity.StuGoodSalesManage;
|
||||
import com.sztzjy.trade.entity.StuGoodsInfo;
|
||||
import com.sztzjy.trade.entity.dto.StuGoodsInfoDTO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/11/1 13:21
|
||||
*/
|
||||
public interface StuGoodsManageCenterService {
|
||||
PageInfo<StuGoodsInfo> getGoodsList(String userId, Integer index, Integer size);
|
||||
|
||||
PageInfo<StuGoodSalesManage> getGoodsSalesManagementList(String userId, Integer index, Integer size);
|
||||
|
||||
Integer save(StuGoodsInfoDTO stuGoodsInfoDTO, MultipartFile file, List<MultipartFile> files);
|
||||
|
||||
Integer add(StuGoodsInfoDTO stuGoodsInfoDTO, MultipartFile file, List<MultipartFile> files);
|
||||
|
||||
Integer update(StuGoodsInfoDTO stuGoodsInfoDTO, MultipartFile file, List<MultipartFile> files);
|
||||
|
||||
Integer remove(Integer id);
|
||||
|
||||
Integer listing(Integer id, Integer number, String requiredFunds,String balance);
|
||||
}
|
@ -0,0 +1,317 @@
|
||||
package com.sztzjy.trade.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sztzjy.trade.config.exception.handler.ServiceException;
|
||||
import com.sztzjy.trade.entity.*;
|
||||
import com.sztzjy.trade.entity.dto.StuGoodsInfoDTO;
|
||||
import com.sztzjy.trade.mapper.StuGoodsInfoMapper;
|
||||
import com.sztzjy.trade.mapper.StuGoodsPromotionPricingMapper;
|
||||
import com.sztzjy.trade.mapper.StuGoodsSalesManageMapper;
|
||||
import com.sztzjy.trade.service.StuGoodsManageCenterService;
|
||||
import com.sztzjy.trade.util.ConvertUtil;
|
||||
import com.sztzjy.trade.util.PageUtil;
|
||||
import com.sztzjy.trade.util.file.IFileUtil;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/11/1 13:21
|
||||
*/
|
||||
@Service
|
||||
public class StuGoodsManageCenterServiceImpl implements StuGoodsManageCenterService {
|
||||
@Resource
|
||||
StuGoodsInfoMapper goodsInfoMapper;
|
||||
@Resource
|
||||
StuGoodsSalesManageMapper salesManageMapper;
|
||||
@Resource
|
||||
IFileUtil fileUtil;
|
||||
@Resource
|
||||
ConvertUtil convertUtil;
|
||||
@Resource
|
||||
StuGoodsPromotionPricingMapper promotionPricingMapper;
|
||||
@Override
|
||||
public PageInfo getGoodsList(String userId, Integer index, Integer size) {
|
||||
//查询默认商品和用户新增商品信息
|
||||
StuGoodsInfoExample goodsInfoExample=new StuGoodsInfoExample();
|
||||
goodsInfoExample.createCriteria()
|
||||
.andUserIdEqualTo(userId)
|
||||
.andSubmitStateEqualTo(1);
|
||||
List<StuGoodsInfo> stuGoodsInfos = goodsInfoMapper.selectByExample(goodsInfoExample);
|
||||
return PageUtil.pageHelper(stuGoodsInfos,index,size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo getGoodsSalesManagementList(String userId, Integer index, Integer size) {
|
||||
StuGoodsSalesManageExample goodsSalesManageExample=new StuGoodsSalesManageExample();
|
||||
goodsSalesManageExample.createCriteria()
|
||||
.andUserIdEqualTo(userId);
|
||||
List<StuGoodsSalesManage> stuGoodsSalesManages = salesManageMapper.selectByExample(goodsSalesManageExample);
|
||||
return PageUtil.pageHelper(stuGoodsSalesManages,index,size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer save(StuGoodsInfoDTO stuGoodsInfoDTO, MultipartFile file, List<MultipartFile> files) {
|
||||
|
||||
//主图片上传
|
||||
String upload="";
|
||||
if(!file.isEmpty()){
|
||||
upload = fileUtil.upload(file);
|
||||
}
|
||||
stuGoodsInfoDTO.setGoodsMainImage(upload);
|
||||
|
||||
//轮播图批量上传
|
||||
StuGoodsInfoDTO stuGoodsInfoDTO1=new StuGoodsInfoDTO();
|
||||
if(!files.isEmpty()){
|
||||
stuGoodsInfoDTO1 = insertBatch(stuGoodsInfoDTO, files);
|
||||
}
|
||||
|
||||
//关键词拼接
|
||||
String join = String.join(",", stuGoodsInfoDTO1.getProductKeyword());
|
||||
StuGoodsInfo stuGoodsInfo = convertUtil.DTOToEntity(stuGoodsInfoDTO1, StuGoodsInfo.class);
|
||||
stuGoodsInfo.setProductKeyword(join);
|
||||
|
||||
List<StuGoodsPromotionPricing> promotionPricingList = stuGoodsInfoDTO.getPromotionPricingList();
|
||||
//判断是否已有保存但未提交的数据
|
||||
if(stuGoodsInfoDTO.getId()==null){ //第一次保存 添加数据
|
||||
Integer uuid= UUID.randomUUID().toString().replaceAll("-","").hashCode();
|
||||
uuid = uuid < 0 ? -uuid : uuid;//String.hashCode() 值会为空
|
||||
stuGoodsInfo.setId(uuid);
|
||||
|
||||
//商品定价促销信息添加
|
||||
if(!promotionPricingList.isEmpty()){
|
||||
for (int i = 0; i < promotionPricingList.size(); i++) {
|
||||
StuGoodsPromotionPricing stuGoodsPromotionPricing = promotionPricingList.get(i);
|
||||
|
||||
Integer proId= UUID.randomUUID().toString().replaceAll("-","").hashCode();
|
||||
proId = proId < 0 ? -proId : proId;//String.hashCode() 值会为空
|
||||
stuGoodsPromotionPricing.setId(proId);
|
||||
stuGoodsPromotionPricing.setGoodsId(uuid);
|
||||
stuGoodsPromotionPricing.setUserId(stuGoodsInfoDTO.getUserId());
|
||||
|
||||
promotionPricingMapper.insert(stuGoodsPromotionPricing);
|
||||
}
|
||||
}
|
||||
|
||||
//设置提交状态
|
||||
stuGoodsInfo.setSubmitState(0);
|
||||
//商品信息添加
|
||||
return goodsInfoMapper.insert(stuGoodsInfo);
|
||||
|
||||
}else { //不是第一次保存 修改信息
|
||||
|
||||
//判断商品定价促销信息是否已有保存信息
|
||||
if(!promotionPricingList.isEmpty()){
|
||||
for (int i = 0; i < promotionPricingList.size(); i++) {
|
||||
StuGoodsPromotionPricing stuGoodsPromotionPricing = promotionPricingList.get(i);
|
||||
if(stuGoodsPromotionPricing.getId()==null){ //第一次保存 添加数据
|
||||
Integer proId= UUID.randomUUID().toString().replaceAll("-","").hashCode();
|
||||
proId = proId < 0 ? -proId : proId;//String.hashCode() 值会为空
|
||||
stuGoodsPromotionPricing.setId(proId);
|
||||
stuGoodsPromotionPricing.setGoodsId(stuGoodsInfoDTO.getId());
|
||||
stuGoodsPromotionPricing.setUserId(stuGoodsInfoDTO.getUserId());
|
||||
|
||||
promotionPricingMapper.insert(stuGoodsPromotionPricing);
|
||||
}else { //更新数据
|
||||
stuGoodsPromotionPricing.setGoodsId(stuGoodsInfoDTO.getId());
|
||||
stuGoodsPromotionPricing.setUserId(stuGoodsInfoDTO.getUserId());
|
||||
promotionPricingMapper.updateByPrimaryKey(stuGoodsPromotionPricing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return goodsInfoMapper.updateByPrimaryKey(stuGoodsInfo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer add(StuGoodsInfoDTO stuGoodsInfoDTO, MultipartFile file, List<MultipartFile> files) {
|
||||
//主图片上传
|
||||
String upload= fileUtil.upload(file);
|
||||
stuGoodsInfoDTO.setGoodsMainImage(upload);
|
||||
|
||||
//轮播图批量上传
|
||||
StuGoodsInfoDTO stuGoodsInfoDTO1 = insertBatch(stuGoodsInfoDTO, files);
|
||||
|
||||
//关键词拼接
|
||||
String join = String.join(",", stuGoodsInfoDTO1.getProductKeyword());
|
||||
StuGoodsInfo stuGoodsInfo = convertUtil.DTOToEntity(stuGoodsInfoDTO1, StuGoodsInfo.class);
|
||||
stuGoodsInfo.setProductKeyword(join);
|
||||
|
||||
List<StuGoodsPromotionPricing> promotionPricingList = stuGoodsInfoDTO.getPromotionPricingList();
|
||||
//判断是否已有保存但未提交的数据
|
||||
if(stuGoodsInfoDTO.getId()==null){ //第一次提交 添加数据
|
||||
Integer uuid= UUID.randomUUID().toString().replaceAll("-","").hashCode();
|
||||
uuid = uuid < 0 ? -uuid : uuid;//String.hashCode() 值会为空
|
||||
stuGoodsInfo.setId(uuid);
|
||||
|
||||
//商品定价促销信息添加
|
||||
if(!promotionPricingList.isEmpty()){
|
||||
for (int i = 0; i < promotionPricingList.size(); i++) {
|
||||
StuGoodsPromotionPricing stuGoodsPromotionPricing = promotionPricingList.get(i);
|
||||
|
||||
Integer proId= UUID.randomUUID().toString().replaceAll("-","").hashCode();
|
||||
proId = proId < 0 ? -proId : proId;//String.hashCode() 值会为空
|
||||
stuGoodsPromotionPricing.setId(proId);
|
||||
stuGoodsPromotionPricing.setGoodsId(uuid);
|
||||
stuGoodsPromotionPricing.setUserId(stuGoodsInfoDTO.getUserId());
|
||||
|
||||
promotionPricingMapper.insert(stuGoodsPromotionPricing);
|
||||
}
|
||||
}
|
||||
//设置提交状态
|
||||
stuGoodsInfo.setSubmitState(1);
|
||||
|
||||
//商品信息添加
|
||||
return goodsInfoMapper.insert(stuGoodsInfo);
|
||||
|
||||
}else { //已有保存信息,则更新信息
|
||||
//判断商品定价促销信息是否已有保存信息
|
||||
if(!promotionPricingList.isEmpty()){
|
||||
for (int i = 0; i < promotionPricingList.size(); i++) {
|
||||
StuGoodsPromotionPricing stuGoodsPromotionPricing = promotionPricingList.get(i);
|
||||
if(stuGoodsPromotionPricing.getId()==null){ //第一次保存 添加数据
|
||||
Integer proId= UUID.randomUUID().toString().replaceAll("-","").hashCode();
|
||||
proId = proId < 0 ? -proId : proId;//String.hashCode() 值会为空
|
||||
stuGoodsPromotionPricing.setId(proId);
|
||||
stuGoodsPromotionPricing.setGoodsId(stuGoodsInfoDTO.getId());
|
||||
stuGoodsPromotionPricing.setUserId(stuGoodsInfoDTO.getUserId());
|
||||
|
||||
promotionPricingMapper.insert(stuGoodsPromotionPricing);
|
||||
}else { //更新数据
|
||||
stuGoodsPromotionPricing.setGoodsId(stuGoodsInfoDTO.getId());
|
||||
stuGoodsPromotionPricing.setUserId(stuGoodsInfoDTO.getUserId());
|
||||
promotionPricingMapper.updateByPrimaryKey(stuGoodsPromotionPricing);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stuGoodsInfo.setSubmitState(1);
|
||||
return goodsInfoMapper.updateByPrimaryKey(stuGoodsInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer update(StuGoodsInfoDTO stuGoodsInfoDTO, MultipartFile file, List<MultipartFile> files) {
|
||||
//主图片上传
|
||||
String upload= fileUtil.upload(file);
|
||||
stuGoodsInfoDTO.setGoodsMainImage(upload);
|
||||
|
||||
//轮播图批量上传
|
||||
StuGoodsInfoDTO stuGoodsInfoDTO1 = insertBatch(stuGoodsInfoDTO, files);
|
||||
|
||||
//关键词拼接
|
||||
String join = String.join(",", stuGoodsInfoDTO1.getProductKeyword());
|
||||
StuGoodsInfo stuGoodsInfo = convertUtil.DTOToEntity(stuGoodsInfoDTO1, StuGoodsInfo.class);
|
||||
stuGoodsInfo.setProductKeyword(join);
|
||||
|
||||
//更新商品定价促销信息
|
||||
List<StuGoodsPromotionPricing> promotionPricingList = stuGoodsInfoDTO.getPromotionPricingList();
|
||||
for (int i = 0; i < promotionPricingList.size(); i++) {
|
||||
promotionPricingMapper.updateByPrimaryKey(promotionPricingList.get(i));
|
||||
}
|
||||
return goodsInfoMapper.updateByPrimaryKey(stuGoodsInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer remove(Integer id) {
|
||||
StuGoodsInfo stuGoodsInfo = goodsInfoMapper.selectByPrimaryKey(id);
|
||||
|
||||
//下架商品,将商品销售管理表中该商品信息隐藏
|
||||
StuGoodsSalesManageExample salesManageExample=new StuGoodsSalesManageExample();
|
||||
salesManageExample.createCriteria().andGoodsIdEqualTo(id);
|
||||
List<StuGoodsSalesManage> stuGoodsSalesManages = salesManageMapper.selectByExample(salesManageExample);
|
||||
|
||||
stuGoodsSalesManages.get(0).setState(0);
|
||||
salesManageMapper.updateByPrimaryKey(stuGoodsSalesManages.get(0));
|
||||
|
||||
//更新商品上下架状态
|
||||
stuGoodsInfo.setOnlineState(0);
|
||||
return goodsInfoMapper.updateByPrimaryKey(stuGoodsInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer listing(Integer id, Integer number, String requiredFunds,String balance) {
|
||||
StuGoodsInfo stuGoodsInfo = goodsInfoMapper.selectByPrimaryKey(id);
|
||||
//判断商品是否已上架
|
||||
if(stuGoodsInfo.getOnlineState()==1){
|
||||
throw new ServiceException(HttpStatus.ACCEPTED,"商品已上架,请勿重复上架");
|
||||
}
|
||||
|
||||
//去掉末尾的0比较精度
|
||||
BigDecimal bigDecimal = BigDecimal.valueOf(Double.parseDouble(requiredFunds)).stripTrailingZeros(); //所需资金
|
||||
BigDecimal bigDecimal1 = BigDecimal.valueOf(Double.parseDouble(balance)).stripTrailingZeros(); //账户余额
|
||||
|
||||
if(bigDecimal1.compareTo(bigDecimal)<0){
|
||||
throw new ServiceException(HttpStatus.ACCEPTED,"余额不足");
|
||||
}
|
||||
|
||||
StuGoodsSalesManageExample salesManageExample=new StuGoodsSalesManageExample();
|
||||
salesManageExample.createCriteria().andGoodsIdEqualTo(id);
|
||||
List<StuGoodsSalesManage> stuGoodsSalesManages = salesManageMapper.selectByExample(salesManageExample);
|
||||
|
||||
//判断该商品是否已有上架记录
|
||||
if(!stuGoodsSalesManages.isEmpty()){
|
||||
StuGoodsSalesManage stuGoodsSalesManage = stuGoodsSalesManages.get(0);
|
||||
//只需更新上架数量、库存数量
|
||||
stuGoodsSalesManage.setOnlineTotal(number);
|
||||
stuGoodsSalesManage.setAvailableInventoryQuantity(number);
|
||||
stuGoodsSalesManage.setState(1);
|
||||
|
||||
return salesManageMapper.updateByPrimaryKey(stuGoodsSalesManage);
|
||||
}else {
|
||||
//添加完整数据
|
||||
StuGoodsSalesManage stuGoodsSalesManage=new StuGoodsSalesManage();
|
||||
Integer uuId= UUID.randomUUID().toString().replaceAll("-","").hashCode();
|
||||
uuId = uuId < 0 ? -uuId : uuId;//String.hashCode() 值会为空
|
||||
stuGoodsSalesManage.setId(uuId);
|
||||
stuGoodsSalesManage.setGoodsId(id);
|
||||
stuGoodsSalesManage.setGoodsName(stuGoodsInfo.getGoodsName());
|
||||
stuGoodsSalesManage.setGoodsType(stuGoodsInfo.getGoodsType());
|
||||
stuGoodsSalesManage.setGoodsSubclass(stuGoodsInfo.getGoodsSubclass());
|
||||
stuGoodsSalesManage.setOnlineTotal(number);
|
||||
stuGoodsSalesManage.setAvailableInventoryQuantity(number);
|
||||
stuGoodsSalesManage.setSoldQuantity("0");
|
||||
stuGoodsSalesManage.setSalesVolume("0");
|
||||
stuGoodsSalesManage.setGrossMargin("0");
|
||||
stuGoodsSalesManage.setNumberOfComments(0);
|
||||
stuGoodsSalesManage.setNumberOfLikes(0);
|
||||
stuGoodsSalesManage.setNumberOfCollections(0);
|
||||
stuGoodsSalesManage.setNumberOfShares(0);
|
||||
stuGoodsSalesManage.setOnlineTime(new Date());
|
||||
stuGoodsSalesManage.setState(1);
|
||||
stuGoodsSalesManage.setUserId(stuGoodsInfo.getUserId());
|
||||
|
||||
return salesManageMapper.insert(stuGoodsSalesManage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 轮播图-批量上传
|
||||
* @param stuGoodsInfoDTO
|
||||
* @param files
|
||||
*/
|
||||
private StuGoodsInfoDTO insertBatch(StuGoodsInfoDTO stuGoodsInfoDTO, List<MultipartFile> files) {
|
||||
StringBuilder imageUpload = new StringBuilder();
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
String upload = fileUtil.upload(files.get(i));
|
||||
if(i==files.size()-1){
|
||||
imageUpload.append(upload);
|
||||
}else {
|
||||
imageUpload.append(upload).append(",");
|
||||
}
|
||||
}
|
||||
stuGoodsInfoDTO.setCarouselImage(imageUpload.toString());
|
||||
|
||||
return stuGoodsInfoDTO;
|
||||
}
|
||||
}
|
@ -0,0 +1,228 @@
|
||||
<?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.StuCommentReportInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sztzjy.trade.entity.StuCommentReportInfo">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="comment_id" jdbcType="INTEGER" property="commentId" />
|
||||
<result column="report_type" jdbcType="VARCHAR" property="reportType" />
|
||||
<result column="report_reason" jdbcType="VARCHAR" property="reportReason" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
</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, comment_id, report_type, report_reason, user_id, create_time
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.sztzjy.trade.entity.StuCommentReportInfoExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from stu_comment_report_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_comment_report_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from stu_comment_report_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.sztzjy.trade.entity.StuCommentReportInfoExample">
|
||||
delete from stu_comment_report_info
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.sztzjy.trade.entity.StuCommentReportInfo">
|
||||
insert into stu_comment_report_info (id, comment_id, report_type,
|
||||
report_reason, user_id, create_time
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{commentId,jdbcType=INTEGER}, #{reportType,jdbcType=VARCHAR},
|
||||
#{reportReason,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.sztzjy.trade.entity.StuCommentReportInfo">
|
||||
insert into stu_comment_report_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="commentId != null">
|
||||
comment_id,
|
||||
</if>
|
||||
<if test="reportType != null">
|
||||
report_type,
|
||||
</if>
|
||||
<if test="reportReason != null">
|
||||
report_reason,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="commentId != null">
|
||||
#{commentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="reportType != null">
|
||||
#{reportType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="reportReason != null">
|
||||
#{reportReason,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.sztzjy.trade.entity.StuCommentReportInfoExample" resultType="java.lang.Long">
|
||||
select count(*) from stu_comment_report_info
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update stu_comment_report_info
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.commentId != null">
|
||||
comment_id = #{record.commentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.reportType != null">
|
||||
report_type = #{record.reportType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.reportReason != null">
|
||||
report_reason = #{record.reportReason,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update stu_comment_report_info
|
||||
set id = #{record.id,jdbcType=INTEGER},
|
||||
comment_id = #{record.commentId,jdbcType=INTEGER},
|
||||
report_type = #{record.reportType,jdbcType=VARCHAR},
|
||||
report_reason = #{record.reportReason,jdbcType=VARCHAR},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.trade.entity.StuCommentReportInfo">
|
||||
update stu_comment_report_info
|
||||
<set>
|
||||
<if test="commentId != null">
|
||||
comment_id = #{commentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="reportType != null">
|
||||
report_type = #{reportType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="reportReason != null">
|
||||
report_reason = #{reportReason,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.sztzjy.trade.entity.StuCommentReportInfo">
|
||||
update stu_comment_report_info
|
||||
set comment_id = #{commentId,jdbcType=INTEGER},
|
||||
report_type = #{reportType,jdbcType=VARCHAR},
|
||||
report_reason = #{reportReason,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,259 @@
|
||||
<?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.StuGoodsPromotionPricingMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sztzjy.trade.entity.StuGoodsPromotionPricing">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column=" goods_id" jdbcType="INTEGER" property="goodsId" />
|
||||
<result column="promotion_name" jdbcType="VARCHAR" property="promotionName" />
|
||||
<result column="weight" jdbcType="DECIMAL" property="weight" />
|
||||
<result column="promotion_cost_price" jdbcType="DECIMAL" property="promotionCostPrice" />
|
||||
<result column="maximum_price" jdbcType="DECIMAL" property="maximumPrice" />
|
||||
<result column="fix_a_price" jdbcType="DECIMAL" property="fixAPrice" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, " goods_id", promotion_name, weight, promotion_cost_price, maximum_price, fix_a_price,
|
||||
user_id
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.sztzjy.trade.entity.StuGoodsPromotionPricingExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from stu_goods_promotion_pricing
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from stu_goods_promotion_pricing
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from stu_goods_promotion_pricing
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.sztzjy.trade.entity.StuGoodsPromotionPricingExample">
|
||||
delete from stu_goods_promotion_pricing
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.sztzjy.trade.entity.StuGoodsPromotionPricing">
|
||||
insert into stu_goods_promotion_pricing (id, " goods_id", promotion_name,
|
||||
weight, promotion_cost_price, maximum_price,
|
||||
fix_a_price, user_id)
|
||||
values (#{id,jdbcType=INTEGER}, #{goodsId,jdbcType=INTEGER}, #{promotionName,jdbcType=VARCHAR},
|
||||
#{weight,jdbcType=DECIMAL}, #{promotionCostPrice,jdbcType=DECIMAL}, #{maximumPrice,jdbcType=DECIMAL},
|
||||
#{fixAPrice,jdbcType=DECIMAL}, #{userId,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.sztzjy.trade.entity.StuGoodsPromotionPricing">
|
||||
insert into stu_goods_promotion_pricing
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="goodsId != null">
|
||||
" goods_id",
|
||||
</if>
|
||||
<if test="promotionName != null">
|
||||
promotion_name,
|
||||
</if>
|
||||
<if test="weight != null">
|
||||
weight,
|
||||
</if>
|
||||
<if test="promotionCostPrice != null">
|
||||
promotion_cost_price,
|
||||
</if>
|
||||
<if test="maximumPrice != null">
|
||||
maximum_price,
|
||||
</if>
|
||||
<if test="fixAPrice != null">
|
||||
fix_a_price,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</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="promotionName != null">
|
||||
#{promotionName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="weight != null">
|
||||
#{weight,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="promotionCostPrice != null">
|
||||
#{promotionCostPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="maximumPrice != null">
|
||||
#{maximumPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="fixAPrice != null">
|
||||
#{fixAPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.sztzjy.trade.entity.StuGoodsPromotionPricingExample" resultType="java.lang.Long">
|
||||
select count(*) from stu_goods_promotion_pricing
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update stu_goods_promotion_pricing
|
||||
<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.promotionName != null">
|
||||
promotion_name = #{record.promotionName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.weight != null">
|
||||
weight = #{record.weight,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.promotionCostPrice != null">
|
||||
promotion_cost_price = #{record.promotionCostPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.maximumPrice != null">
|
||||
maximum_price = #{record.maximumPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.fixAPrice != null">
|
||||
fix_a_price = #{record.fixAPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update stu_goods_promotion_pricing
|
||||
set id = #{record.id,jdbcType=INTEGER},
|
||||
" goods_id" = #{record.goodsId,jdbcType=INTEGER},
|
||||
promotion_name = #{record.promotionName,jdbcType=VARCHAR},
|
||||
weight = #{record.weight,jdbcType=DECIMAL},
|
||||
promotion_cost_price = #{record.promotionCostPrice,jdbcType=DECIMAL},
|
||||
maximum_price = #{record.maximumPrice,jdbcType=DECIMAL},
|
||||
fix_a_price = #{record.fixAPrice,jdbcType=DECIMAL},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.trade.entity.StuGoodsPromotionPricing">
|
||||
update stu_goods_promotion_pricing
|
||||
<set>
|
||||
<if test="goodsId != null">
|
||||
" goods_id" = #{goodsId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="promotionName != null">
|
||||
promotion_name = #{promotionName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="weight != null">
|
||||
weight = #{weight,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="promotionCostPrice != null">
|
||||
promotion_cost_price = #{promotionCostPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="maximumPrice != null">
|
||||
maximum_price = #{maximumPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="fixAPrice != null">
|
||||
fix_a_price = #{fixAPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.sztzjy.trade.entity.StuGoodsPromotionPricing">
|
||||
update stu_goods_promotion_pricing
|
||||
set " goods_id" = #{goodsId,jdbcType=INTEGER},
|
||||
promotion_name = #{promotionName,jdbcType=VARCHAR},
|
||||
weight = #{weight,jdbcType=DECIMAL},
|
||||
promotion_cost_price = #{promotionCostPrice,jdbcType=DECIMAL},
|
||||
maximum_price = #{maximumPrice,jdbcType=DECIMAL},
|
||||
fix_a_price = #{fixAPrice,jdbcType=DECIMAL},
|
||||
user_id = #{userId,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
Loading…
Reference in New Issue