Commit a308c699 authored by macro's avatar macro
Browse files

商品SKU功能优化

parent 765affaa
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
package com.macro.mall.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.github.pagehelper.PageHelper;
import com.macro.mall.dao.*;
import com.macro.mall.dto.PmsProductParam;
......@@ -8,7 +9,6 @@ import com.macro.mall.dto.PmsProductResult;
import com.macro.mall.mapper.*;
import com.macro.mall.model.*;
import com.macro.mall.service.PmsProductService;
import io.swagger.annotations.Example;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -21,6 +21,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 商品管理Service实现类
......@@ -71,7 +72,7 @@ public class PmsProductServiceImpl implements PmsProductService {
PmsProduct product = productParam;
product.setId(null);
productMapper.insertSelective(product);
//根据促销类型设置价格:、阶梯价格、满减价格
//根据促销类型设置价格:会员价格、阶梯价格、满减价格
Long productId = product.getId();
//会员价格
relateAndInsertList(memberPriceDao, productParam.getMemberPriceList(), productId);
......@@ -139,11 +140,7 @@ public class PmsProductServiceImpl implements PmsProductService {
productFullReductionMapper.deleteByExample(fullReductionExample);
relateAndInsertList(productFullReductionDao, productParam.getProductFullReductionList(), id);
//修改sku库存信息
PmsSkuStockExample skuStockExample = new PmsSkuStockExample();
skuStockExample.createCriteria().andProductIdEqualTo(id);
skuStockMapper.deleteByExample(skuStockExample);
handleSkuStockCode(productParam.getSkuStockList(),id);
relateAndInsertList(skuStockDao, productParam.getSkuStockList(), id);
handleUpdateSkuStockList(id, productParam);
//修改商品参数,添加自定义商品规格
PmsProductAttributeValueExample productAttributeValueExample = new PmsProductAttributeValueExample();
productAttributeValueExample.createCriteria().andProductIdEqualTo(id);
......@@ -163,6 +160,49 @@ public class PmsProductServiceImpl implements PmsProductService {
return count;
}
private void handleUpdateSkuStockList(Long id, PmsProductParam productParam) {
//当前的sku信息
List<PmsSkuStock> currSkuList = productParam.getSkuStockList();
//当前没有sku直接删除
if(CollUtil.isEmpty(currSkuList)){
PmsSkuStockExample skuStockExample = new PmsSkuStockExample();
skuStockExample.createCriteria().andProductIdEqualTo(id);
skuStockMapper.deleteByExample(skuStockExample);
return;
}
//获取初始sku信息
PmsSkuStockExample skuStockExample = new PmsSkuStockExample();
skuStockExample.createCriteria().andProductIdEqualTo(id);
List<PmsSkuStock> oriStuList = skuStockMapper.selectByExample(skuStockExample);
//获取新增sku信息
List<PmsSkuStock> insertSkuList = currSkuList.stream().filter(item->item.getId()==null).collect(Collectors.toList());
//获取需要更新的sku信息
List<PmsSkuStock> updateSkuList = currSkuList.stream().filter(item->item.getId()!=null).collect(Collectors.toList());
List<Long> updateSkuIds = updateSkuList.stream().map(PmsSkuStock::getId).collect(Collectors.toList());
//获取需要删除的sku信息
List<PmsSkuStock> removeSkuList = oriStuList.stream().filter(item-> !updateSkuIds.contains(item.getId())).collect(Collectors.toList());
handleSkuStockCode(insertSkuList,id);
handleSkuStockCode(updateSkuList,id);
//新增sku
if(CollUtil.isNotEmpty(insertSkuList)){
relateAndInsertList(skuStockDao, insertSkuList, id);
}
//删除sku
if(CollUtil.isNotEmpty(removeSkuList)){
List<Long> removeSkuIds = removeSkuList.stream().map(PmsSkuStock::getId).collect(Collectors.toList());
PmsSkuStockExample removeExample = new PmsSkuStockExample();
removeExample.createCriteria().andIdIn(removeSkuIds);
skuStockMapper.deleteByExample(removeExample);
}
//修改sku
if(CollUtil.isNotEmpty(updateSkuList)){
for (PmsSkuStock pmsSkuStock : updateSkuList) {
skuStockMapper.updateByPrimaryKeySelective(pmsSkuStock);
}
}
}
@Override
public List<PmsProduct> list(PmsProductQueryParam productQueryParam, Integer pageSize, Integer pageNum) {
PageHelper.startPage(pageNum, pageSize);
......@@ -260,70 +300,6 @@ public class PmsProductServiceImpl implements PmsProductService {
return productMapper.selectByExample(productExample);
}
/**
* @deprecated 旧版创建
*/
public int createOld(PmsProductParam productParam) {
int count;
//创建商品
PmsProduct product = productParam;
product.setId(null);
productMapper.insertSelective(product);
//根据促销类型设置价格:、阶梯价格、满减价格
Long productId = product.getId();
//会员价格
List<PmsMemberPrice> memberPriceList = productParam.getMemberPriceList();
if (!CollectionUtils.isEmpty(memberPriceList)) {
for (PmsMemberPrice pmsMemberPrice : memberPriceList) {
pmsMemberPrice.setId(null);
pmsMemberPrice.setProductId(productId);
}
memberPriceDao.insertList(memberPriceList);
}
//阶梯价格
List<PmsProductLadder> productLadderList = productParam.getProductLadderList();
if (!CollectionUtils.isEmpty(productLadderList)) {
for (PmsProductLadder productLadder : productLadderList) {
productLadder.setId(null);
productLadder.setProductId(productId);
}
productLadderDao.insertList(productLadderList);
}
//满减价格
List<PmsProductFullReduction> productFullReductionList = productParam.getProductFullReductionList();
if (!CollectionUtils.isEmpty(productFullReductionList)) {
for (PmsProductFullReduction productFullReduction : productFullReductionList) {
productFullReduction.setId(null);
productFullReduction.setProductId(productId);
}
productFullReductionDao.insertList(productFullReductionList);
}
//添加sku库存信息
List<PmsSkuStock> skuStockList = productParam.getSkuStockList();
if (!CollectionUtils.isEmpty(skuStockList)) {
for (PmsSkuStock skuStock : skuStockList) {
skuStock.setId(null);
skuStock.setProductId(productId);
}
skuStockDao.insertList(skuStockList);
}
//添加商品参数,添加自定义商品规格
List<PmsProductAttributeValue> productAttributeValueList = productParam.getProductAttributeValueList();
if (!CollectionUtils.isEmpty(productAttributeValueList)) {
for (PmsProductAttributeValue productAttributeValue : productAttributeValueList) {
productAttributeValue.setId(null);
productAttributeValue.setProductId(productId);
}
productAttributeValueDao.insertList(productAttributeValueList);
}
//关联专题
relateAndInsertList(subjectProductRelationDao, productParam.getSubjectProductRelationList(), productId);
//关联优选
relateAndInsertList(prefrenceAreaProductRelationDao, productParam.getPrefrenceAreaProductRelationList(), productId);
count = 1;
return count;
}
/**
* 建立和插入关系表操作
*
......
......@@ -74,9 +74,6 @@
oi.product_price item_product_price,
oi.product_quantity item_product_quantity,
oi.product_attr item_product_attr,
oi.sp1 item_sp1,
oi.sp2 item_sp2,
oi.sp3 item_sp3,
oh.id history_id,
oh.operate_man history_operate_man,
oh.create_time history_create_time,
......
......@@ -24,7 +24,7 @@
l.id ladder_id,l.product_id ladder_product_id,l.discount ladder_discount,l.count ladder_count,l.price ladder_price,
pf.id full_id,pf.product_id full_product_id,pf.full_price full_full_price,pf.reduce_price full_reduce_price,
m.id member_id,m.product_id member_product_id,m.member_level_id member_member_level_id,m.member_price member_member_price,m.member_level_name member_member_level_name,
s.id sku_id,s.product_id sku_product_id,s.price sku_price,s.low_stock sku_low_stock,s.pic sku_pic,s.sale sku_sale,s.sku_code sku_sku_code,s.sp1 sku_sp1,s.sp2 sku_sp2,s.sp3 sku_sp3,s.stock sku_stock,
s.id sku_id,s.product_id sku_product_id,s.price sku_price,s.low_stock sku_low_stock,s.pic sku_pic,s.sale sku_sale,s.sku_code sku_sku_code,s.stock sku_stock,s.sp_data sku_sp_data,
a.id attribute_id,a.product_id attribute_product_id,a.product_attribute_id attribute_product_attribute_id,a.value attribute_value
FROM pms_product p
LEFT JOIN pms_product_category pc on pc.id = p.product_category_id
......
......@@ -2,22 +2,20 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.macro.mall.dao.PmsSkuStockDao">
<insert id="insertList">
INSERT INTO pms_sku_stock (product_id, sku_code, price, stock, low_stock, sp1, sp2, sp3, pic, sale) VALUES
INSERT INTO pms_sku_stock (product_id, sku_code, price, stock, low_stock, pic, sale, sp_data) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.productId,jdbcType=BIGINT},
#{item.skuCode,jdbcType=VARCHAR},
#{item.price,jdbcType=DECIMAL},
#{item.stock,jdbcType=INTEGER},
#{item.lowStock,jdbcType=INTEGER},
#{item.sp1,jdbcType=VARCHAR},
#{item.sp2,jdbcType=VARCHAR},
#{item.sp3,jdbcType=VARCHAR},
#{item.pic,jdbcType=VARCHAR},
#{item.sale,jdbcType=INTEGER})
#{item.sale,jdbcType=INTEGER},
#{item.spData,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="replaceList">
REPLACE INTO pms_sku_stock (id,product_id, sku_code, price, stock, low_stock, sp1, sp2, sp3, pic, sale) VALUES
REPLACE INTO pms_sku_stock (id,product_id, sku_code, price, stock, low_stock,pic, sale, sp_data) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.id,jdbcType=BIGINT},
#{item.productId,jdbcType=BIGINT},
......@@ -25,11 +23,9 @@
#{item.price,jdbcType=DECIMAL},
#{item.stock,jdbcType=INTEGER},
#{item.lowStock,jdbcType=INTEGER},
#{item.sp1,jdbcType=VARCHAR},
#{item.sp2,jdbcType=VARCHAR},
#{item.sp3,jdbcType=VARCHAR},
#{item.pic,jdbcType=VARCHAR},
#{item.sale,jdbcType=INTEGER})
#{item.sale,jdbcType=INTEGER},
#{item.spData,jdbcType=VARCHAR})
</foreach>
</insert>
</mapper>
\ No newline at end of file
......@@ -20,15 +20,6 @@ public class OmsCartItem implements Serializable {
@ApiModelProperty(value = "添加到购物车的价格")
private BigDecimal price;
@ApiModelProperty(value = "销售属性1")
private String sp1;
@ApiModelProperty(value = "销售属性2")
private String sp2;
@ApiModelProperty(value = "销售属性3")
private String sp3;
@ApiModelProperty(value = "商品主图")
private String productPic;
......@@ -113,30 +104,6 @@ public class OmsCartItem implements Serializable {
this.price = price;
}
public String getSp1() {
return sp1;
}
public void setSp1(String sp1) {
this.sp1 = sp1;
}
public String getSp2() {
return sp2;
}
public void setSp2(String sp2) {
this.sp2 = sp2;
}
public String getSp3() {
return sp3;
}
public void setSp3(String sp3) {
this.sp3 = sp3;
}
public String getProductPic() {
return productPic;
}
......@@ -245,9 +212,6 @@ public class OmsCartItem implements Serializable {
sb.append(", memberId=").append(memberId);
sb.append(", quantity=").append(quantity);
sb.append(", price=").append(price);
sb.append(", sp1=").append(sp1);
sb.append(", sp2=").append(sp2);
sb.append(", sp3=").append(sp3);
sb.append(", productPic=").append(productPic);
sb.append(", productName=").append(productName);
sb.append(", productSubTitle=").append(productSubTitle);
......
......@@ -466,216 +466,6 @@ public class OmsCartItemExample {
return (Criteria) this;
}
public Criteria andSp1IsNull() {
addCriterion("sp1 is null");
return (Criteria) this;
}
public Criteria andSp1IsNotNull() {
addCriterion("sp1 is not null");
return (Criteria) this;
}
public Criteria andSp1EqualTo(String value) {
addCriterion("sp1 =", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1NotEqualTo(String value) {
addCriterion("sp1 <>", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1GreaterThan(String value) {
addCriterion("sp1 >", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1GreaterThanOrEqualTo(String value) {
addCriterion("sp1 >=", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1LessThan(String value) {
addCriterion("sp1 <", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1LessThanOrEqualTo(String value) {
addCriterion("sp1 <=", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1Like(String value) {
addCriterion("sp1 like", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1NotLike(String value) {
addCriterion("sp1 not like", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1In(List<String> values) {
addCriterion("sp1 in", values, "sp1");
return (Criteria) this;
}
public Criteria andSp1NotIn(List<String> values) {
addCriterion("sp1 not in", values, "sp1");
return (Criteria) this;
}
public Criteria andSp1Between(String value1, String value2) {
addCriterion("sp1 between", value1, value2, "sp1");
return (Criteria) this;
}
public Criteria andSp1NotBetween(String value1, String value2) {
addCriterion("sp1 not between", value1, value2, "sp1");
return (Criteria) this;
}
public Criteria andSp2IsNull() {
addCriterion("sp2 is null");
return (Criteria) this;
}
public Criteria andSp2IsNotNull() {
addCriterion("sp2 is not null");
return (Criteria) this;
}
public Criteria andSp2EqualTo(String value) {
addCriterion("sp2 =", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2NotEqualTo(String value) {
addCriterion("sp2 <>", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2GreaterThan(String value) {
addCriterion("sp2 >", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2GreaterThanOrEqualTo(String value) {
addCriterion("sp2 >=", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2LessThan(String value) {
addCriterion("sp2 <", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2LessThanOrEqualTo(String value) {
addCriterion("sp2 <=", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2Like(String value) {
addCriterion("sp2 like", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2NotLike(String value) {
addCriterion("sp2 not like", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2In(List<String> values) {
addCriterion("sp2 in", values, "sp2");
return (Criteria) this;
}
public Criteria andSp2NotIn(List<String> values) {
addCriterion("sp2 not in", values, "sp2");
return (Criteria) this;
}
public Criteria andSp2Between(String value1, String value2) {
addCriterion("sp2 between", value1, value2, "sp2");
return (Criteria) this;
}
public Criteria andSp2NotBetween(String value1, String value2) {
addCriterion("sp2 not between", value1, value2, "sp2");
return (Criteria) this;
}
public Criteria andSp3IsNull() {
addCriterion("sp3 is null");
return (Criteria) this;
}
public Criteria andSp3IsNotNull() {
addCriterion("sp3 is not null");
return (Criteria) this;
}
public Criteria andSp3EqualTo(String value) {
addCriterion("sp3 =", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3NotEqualTo(String value) {
addCriterion("sp3 <>", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3GreaterThan(String value) {
addCriterion("sp3 >", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3GreaterThanOrEqualTo(String value) {
addCriterion("sp3 >=", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3LessThan(String value) {
addCriterion("sp3 <", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3LessThanOrEqualTo(String value) {
addCriterion("sp3 <=", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3Like(String value) {
addCriterion("sp3 like", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3NotLike(String value) {
addCriterion("sp3 not like", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3In(List<String> values) {
addCriterion("sp3 in", values, "sp3");
return (Criteria) this;
}
public Criteria andSp3NotIn(List<String> values) {
addCriterion("sp3 not in", values, "sp3");
return (Criteria) this;
}
public Criteria andSp3Between(String value1, String value2) {
addCriterion("sp3 between", value1, value2, "sp3");
return (Criteria) this;
}
public Criteria andSp3NotBetween(String value1, String value2) {
addCriterion("sp3 not between", value1, value2, "sp3");
return (Criteria) this;
}
public Criteria andProductPicIsNull() {
addCriterion("product_pic is null");
return (Criteria) this;
......
......@@ -38,13 +38,6 @@ public class OmsOrderItem implements Serializable {
@ApiModelProperty(value = "商品分类id")
private Long productCategoryId;
@ApiModelProperty(value = "商品的销售属性")
private String sp1;
private String sp2;
private String sp3;
@ApiModelProperty(value = "商品促销名称")
private String promotionName;
......@@ -173,30 +166,6 @@ public class OmsOrderItem implements Serializable {
this.productCategoryId = productCategoryId;
}
public String getSp1() {
return sp1;
}
public void setSp1(String sp1) {
this.sp1 = sp1;
}
public String getSp2() {
return sp2;
}
public void setSp2(String sp2) {
this.sp2 = sp2;
}
public String getSp3() {
return sp3;
}
public void setSp3(String sp3) {
this.sp3 = sp3;
}
public String getPromotionName() {
return promotionName;
}
......@@ -280,9 +249,6 @@ public class OmsOrderItem implements Serializable {
sb.append(", productSkuId=").append(productSkuId);
sb.append(", productSkuCode=").append(productSkuCode);
sb.append(", productCategoryId=").append(productCategoryId);
sb.append(", sp1=").append(sp1);
sb.append(", sp2=").append(sp2);
sb.append(", sp3=").append(sp3);
sb.append(", promotionName=").append(promotionName);
sb.append(", promotionAmount=").append(promotionAmount);
sb.append(", couponAmount=").append(couponAmount);
......
......@@ -945,216 +945,6 @@ public class OmsOrderItemExample {
return (Criteria) this;
}
public Criteria andSp1IsNull() {
addCriterion("sp1 is null");
return (Criteria) this;
}
public Criteria andSp1IsNotNull() {
addCriterion("sp1 is not null");
return (Criteria) this;
}
public Criteria andSp1EqualTo(String value) {
addCriterion("sp1 =", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1NotEqualTo(String value) {
addCriterion("sp1 <>", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1GreaterThan(String value) {
addCriterion("sp1 >", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1GreaterThanOrEqualTo(String value) {
addCriterion("sp1 >=", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1LessThan(String value) {
addCriterion("sp1 <", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1LessThanOrEqualTo(String value) {
addCriterion("sp1 <=", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1Like(String value) {
addCriterion("sp1 like", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1NotLike(String value) {
addCriterion("sp1 not like", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1In(List<String> values) {
addCriterion("sp1 in", values, "sp1");
return (Criteria) this;
}
public Criteria andSp1NotIn(List<String> values) {
addCriterion("sp1 not in", values, "sp1");
return (Criteria) this;
}
public Criteria andSp1Between(String value1, String value2) {
addCriterion("sp1 between", value1, value2, "sp1");
return (Criteria) this;
}
public Criteria andSp1NotBetween(String value1, String value2) {
addCriterion("sp1 not between", value1, value2, "sp1");
return (Criteria) this;
}
public Criteria andSp2IsNull() {
addCriterion("sp2 is null");
return (Criteria) this;
}
public Criteria andSp2IsNotNull() {
addCriterion("sp2 is not null");
return (Criteria) this;
}
public Criteria andSp2EqualTo(String value) {
addCriterion("sp2 =", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2NotEqualTo(String value) {
addCriterion("sp2 <>", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2GreaterThan(String value) {
addCriterion("sp2 >", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2GreaterThanOrEqualTo(String value) {
addCriterion("sp2 >=", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2LessThan(String value) {
addCriterion("sp2 <", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2LessThanOrEqualTo(String value) {
addCriterion("sp2 <=", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2Like(String value) {
addCriterion("sp2 like", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2NotLike(String value) {
addCriterion("sp2 not like", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2In(List<String> values) {
addCriterion("sp2 in", values, "sp2");
return (Criteria) this;
}
public Criteria andSp2NotIn(List<String> values) {
addCriterion("sp2 not in", values, "sp2");
return (Criteria) this;
}
public Criteria andSp2Between(String value1, String value2) {
addCriterion("sp2 between", value1, value2, "sp2");
return (Criteria) this;
}
public Criteria andSp2NotBetween(String value1, String value2) {
addCriterion("sp2 not between", value1, value2, "sp2");
return (Criteria) this;
}
public Criteria andSp3IsNull() {
addCriterion("sp3 is null");
return (Criteria) this;
}
public Criteria andSp3IsNotNull() {
addCriterion("sp3 is not null");
return (Criteria) this;
}
public Criteria andSp3EqualTo(String value) {
addCriterion("sp3 =", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3NotEqualTo(String value) {
addCriterion("sp3 <>", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3GreaterThan(String value) {
addCriterion("sp3 >", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3GreaterThanOrEqualTo(String value) {
addCriterion("sp3 >=", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3LessThan(String value) {
addCriterion("sp3 <", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3LessThanOrEqualTo(String value) {
addCriterion("sp3 <=", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3Like(String value) {
addCriterion("sp3 like", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3NotLike(String value) {
addCriterion("sp3 not like", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3In(List<String> values) {
addCriterion("sp3 in", values, "sp3");
return (Criteria) this;
}
public Criteria andSp3NotIn(List<String> values) {
addCriterion("sp3 not in", values, "sp3");
return (Criteria) this;
}
public Criteria andSp3Between(String value1, String value2) {
addCriterion("sp3 between", value1, value2, "sp3");
return (Criteria) this;
}
public Criteria andSp3NotBetween(String value1, String value2) {
addCriterion("sp3 not between", value1, value2, "sp3");
return (Criteria) this;
}
public Criteria andPromotionNameIsNull() {
addCriterion("promotion_name is null");
return (Criteria) this;
......
......@@ -20,13 +20,6 @@ public class PmsSkuStock implements Serializable {
@ApiModelProperty(value = "预警库存")
private Integer lowStock;
@ApiModelProperty(value = "销售属性1")
private String sp1;
private String sp2;
private String sp3;
@ApiModelProperty(value = "展示图片")
private String pic;
......@@ -39,6 +32,9 @@ public class PmsSkuStock implements Serializable {
@ApiModelProperty(value = "锁定库存")
private Integer lockStock;
@ApiModelProperty(value = "商品销售属性,json格式")
private String spData;
private static final long serialVersionUID = 1L;
public Long getId() {
......@@ -89,30 +85,6 @@ public class PmsSkuStock implements Serializable {
this.lowStock = lowStock;
}
public String getSp1() {
return sp1;
}
public void setSp1(String sp1) {
this.sp1 = sp1;
}
public String getSp2() {
return sp2;
}
public void setSp2(String sp2) {
this.sp2 = sp2;
}
public String getSp3() {
return sp3;
}
public void setSp3(String sp3) {
this.sp3 = sp3;
}
public String getPic() {
return pic;
}
......@@ -145,6 +117,14 @@ public class PmsSkuStock implements Serializable {
this.lockStock = lockStock;
}
public String getSpData() {
return spData;
}
public void setSpData(String spData) {
this.spData = spData;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
......@@ -157,13 +137,11 @@ public class PmsSkuStock implements Serializable {
sb.append(", price=").append(price);
sb.append(", stock=").append(stock);
sb.append(", lowStock=").append(lowStock);
sb.append(", sp1=").append(sp1);
sb.append(", sp2=").append(sp2);
sb.append(", sp3=").append(sp3);
sb.append(", pic=").append(pic);
sb.append(", sale=").append(sale);
sb.append(", promotionPrice=").append(promotionPrice);
sb.append(", lockStock=").append(lockStock);
sb.append(", spData=").append(spData);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
......
......@@ -475,216 +475,6 @@ public class PmsSkuStockExample {
return (Criteria) this;
}
public Criteria andSp1IsNull() {
addCriterion("sp1 is null");
return (Criteria) this;
}
public Criteria andSp1IsNotNull() {
addCriterion("sp1 is not null");
return (Criteria) this;
}
public Criteria andSp1EqualTo(String value) {
addCriterion("sp1 =", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1NotEqualTo(String value) {
addCriterion("sp1 <>", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1GreaterThan(String value) {
addCriterion("sp1 >", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1GreaterThanOrEqualTo(String value) {
addCriterion("sp1 >=", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1LessThan(String value) {
addCriterion("sp1 <", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1LessThanOrEqualTo(String value) {
addCriterion("sp1 <=", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1Like(String value) {
addCriterion("sp1 like", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1NotLike(String value) {
addCriterion("sp1 not like", value, "sp1");
return (Criteria) this;
}
public Criteria andSp1In(List<String> values) {
addCriterion("sp1 in", values, "sp1");
return (Criteria) this;
}
public Criteria andSp1NotIn(List<String> values) {
addCriterion("sp1 not in", values, "sp1");
return (Criteria) this;
}
public Criteria andSp1Between(String value1, String value2) {
addCriterion("sp1 between", value1, value2, "sp1");
return (Criteria) this;
}
public Criteria andSp1NotBetween(String value1, String value2) {
addCriterion("sp1 not between", value1, value2, "sp1");
return (Criteria) this;
}
public Criteria andSp2IsNull() {
addCriterion("sp2 is null");
return (Criteria) this;
}
public Criteria andSp2IsNotNull() {
addCriterion("sp2 is not null");
return (Criteria) this;
}
public Criteria andSp2EqualTo(String value) {
addCriterion("sp2 =", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2NotEqualTo(String value) {
addCriterion("sp2 <>", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2GreaterThan(String value) {
addCriterion("sp2 >", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2GreaterThanOrEqualTo(String value) {
addCriterion("sp2 >=", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2LessThan(String value) {
addCriterion("sp2 <", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2LessThanOrEqualTo(String value) {
addCriterion("sp2 <=", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2Like(String value) {
addCriterion("sp2 like", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2NotLike(String value) {
addCriterion("sp2 not like", value, "sp2");
return (Criteria) this;
}
public Criteria andSp2In(List<String> values) {
addCriterion("sp2 in", values, "sp2");
return (Criteria) this;
}
public Criteria andSp2NotIn(List<String> values) {
addCriterion("sp2 not in", values, "sp2");
return (Criteria) this;
}
public Criteria andSp2Between(String value1, String value2) {
addCriterion("sp2 between", value1, value2, "sp2");
return (Criteria) this;
}
public Criteria andSp2NotBetween(String value1, String value2) {
addCriterion("sp2 not between", value1, value2, "sp2");
return (Criteria) this;
}
public Criteria andSp3IsNull() {
addCriterion("sp3 is null");
return (Criteria) this;
}
public Criteria andSp3IsNotNull() {
addCriterion("sp3 is not null");
return (Criteria) this;
}
public Criteria andSp3EqualTo(String value) {
addCriterion("sp3 =", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3NotEqualTo(String value) {
addCriterion("sp3 <>", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3GreaterThan(String value) {
addCriterion("sp3 >", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3GreaterThanOrEqualTo(String value) {
addCriterion("sp3 >=", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3LessThan(String value) {
addCriterion("sp3 <", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3LessThanOrEqualTo(String value) {
addCriterion("sp3 <=", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3Like(String value) {
addCriterion("sp3 like", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3NotLike(String value) {
addCriterion("sp3 not like", value, "sp3");
return (Criteria) this;
}
public Criteria andSp3In(List<String> values) {
addCriterion("sp3 in", values, "sp3");
return (Criteria) this;
}
public Criteria andSp3NotIn(List<String> values) {
addCriterion("sp3 not in", values, "sp3");
return (Criteria) this;
}
public Criteria andSp3Between(String value1, String value2) {
addCriterion("sp3 between", value1, value2, "sp3");
return (Criteria) this;
}
public Criteria andSp3NotBetween(String value1, String value2) {
addCriterion("sp3 not between", value1, value2, "sp3");
return (Criteria) this;
}
public Criteria andPicIsNull() {
addCriterion("pic is null");
return (Criteria) this;
......@@ -934,6 +724,76 @@ public class PmsSkuStockExample {
addCriterion("lock_stock not between", value1, value2, "lockStock");
return (Criteria) this;
}
public Criteria andSpDataIsNull() {
addCriterion("sp_data is null");
return (Criteria) this;
}
public Criteria andSpDataIsNotNull() {
addCriterion("sp_data is not null");
return (Criteria) this;
}
public Criteria andSpDataEqualTo(String value) {
addCriterion("sp_data =", value, "spData");
return (Criteria) this;
}
public Criteria andSpDataNotEqualTo(String value) {
addCriterion("sp_data <>", value, "spData");
return (Criteria) this;
}
public Criteria andSpDataGreaterThan(String value) {
addCriterion("sp_data >", value, "spData");
return (Criteria) this;
}
public Criteria andSpDataGreaterThanOrEqualTo(String value) {
addCriterion("sp_data >=", value, "spData");
return (Criteria) this;
}
public Criteria andSpDataLessThan(String value) {
addCriterion("sp_data <", value, "spData");
return (Criteria) this;
}
public Criteria andSpDataLessThanOrEqualTo(String value) {
addCriterion("sp_data <=", value, "spData");
return (Criteria) this;
}
public Criteria andSpDataLike(String value) {
addCriterion("sp_data like", value, "spData");
return (Criteria) this;
}
public Criteria andSpDataNotLike(String value) {
addCriterion("sp_data not like", value, "spData");
return (Criteria) this;
}
public Criteria andSpDataIn(List<String> values) {
addCriterion("sp_data in", values, "spData");
return (Criteria) this;
}
public Criteria andSpDataNotIn(List<String> values) {
addCriterion("sp_data not in", values, "spData");
return (Criteria) this;
}
public Criteria andSpDataBetween(String value1, String value2) {
addCriterion("sp_data between", value1, value2, "spData");
return (Criteria) this;
}
public Criteria andSpDataNotBetween(String value1, String value2) {
addCriterion("sp_data not between", value1, value2, "spData");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
......
......@@ -8,9 +8,6 @@
<result column="member_id" jdbcType="BIGINT" property="memberId" />
<result column="quantity" jdbcType="INTEGER" property="quantity" />
<result column="price" jdbcType="DECIMAL" property="price" />
<result column="sp1" jdbcType="VARCHAR" property="sp1" />
<result column="sp2" jdbcType="VARCHAR" property="sp2" />
<result column="sp3" jdbcType="VARCHAR" property="sp3" />
<result column="product_pic" jdbcType="VARCHAR" property="productPic" />
<result column="product_name" jdbcType="VARCHAR" property="productName" />
<result column="product_sub_title" jdbcType="VARCHAR" property="productSubTitle" />
......@@ -83,9 +80,9 @@
</where>
</sql>
<sql id="Base_Column_List">
id, product_id, product_sku_id, member_id, quantity, price, sp1, sp2, sp3, product_pic,
product_name, product_sub_title, product_sku_code, member_nickname, create_date,
modify_date, delete_status, product_category_id, product_brand, product_sn, product_attr
id, product_id, product_sku_id, member_id, quantity, price, product_pic, product_name,
product_sub_title, product_sku_code, member_nickname, create_date, modify_date, delete_status,
product_category_id, product_brand, product_sn, product_attr
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.OmsCartItemExample" resultMap="BaseResultMap">
select
......@@ -122,15 +119,13 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into oms_cart_item (product_id, product_sku_id, member_id,
quantity, price, sp1,
sp2, sp3, product_pic,
quantity, price, product_pic,
product_name, product_sub_title, product_sku_code,
member_nickname, create_date, modify_date,
delete_status, product_category_id, product_brand,
product_sn, product_attr)
values (#{productId,jdbcType=BIGINT}, #{productSkuId,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT},
#{quantity,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, #{sp1,jdbcType=VARCHAR},
#{sp2,jdbcType=VARCHAR}, #{sp3,jdbcType=VARCHAR}, #{productPic,jdbcType=VARCHAR},
#{quantity,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, #{productPic,jdbcType=VARCHAR},
#{productName,jdbcType=VARCHAR}, #{productSubTitle,jdbcType=VARCHAR}, #{productSkuCode,jdbcType=VARCHAR},
#{memberNickname,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{modifyDate,jdbcType=TIMESTAMP},
#{deleteStatus,jdbcType=INTEGER}, #{productCategoryId,jdbcType=BIGINT}, #{productBrand,jdbcType=VARCHAR},
......@@ -157,15 +152,6 @@
<if test="price != null">
price,
</if>
<if test="sp1 != null">
sp1,
</if>
<if test="sp2 != null">
sp2,
</if>
<if test="sp3 != null">
sp3,
</if>
<if test="productPic != null">
product_pic,
</if>
......@@ -219,15 +205,6 @@
<if test="price != null">
#{price,jdbcType=DECIMAL},
</if>
<if test="sp1 != null">
#{sp1,jdbcType=VARCHAR},
</if>
<if test="sp2 != null">
#{sp2,jdbcType=VARCHAR},
</if>
<if test="sp3 != null">
#{sp3,jdbcType=VARCHAR},
</if>
<if test="productPic != null">
#{productPic,jdbcType=VARCHAR},
</if>
......@@ -293,15 +270,6 @@
<if test="record.price != null">
price = #{record.price,jdbcType=DECIMAL},
</if>
<if test="record.sp1 != null">
sp1 = #{record.sp1,jdbcType=VARCHAR},
</if>
<if test="record.sp2 != null">
sp2 = #{record.sp2,jdbcType=VARCHAR},
</if>
<if test="record.sp3 != null">
sp3 = #{record.sp3,jdbcType=VARCHAR},
</if>
<if test="record.productPic != null">
product_pic = #{record.productPic,jdbcType=VARCHAR},
</if>
......@@ -351,9 +319,6 @@
member_id = #{record.memberId,jdbcType=BIGINT},
quantity = #{record.quantity,jdbcType=INTEGER},
price = #{record.price,jdbcType=DECIMAL},
sp1 = #{record.sp1,jdbcType=VARCHAR},
sp2 = #{record.sp2,jdbcType=VARCHAR},
sp3 = #{record.sp3,jdbcType=VARCHAR},
product_pic = #{record.productPic,jdbcType=VARCHAR},
product_name = #{record.productName,jdbcType=VARCHAR},
product_sub_title = #{record.productSubTitle,jdbcType=VARCHAR},
......@@ -388,15 +353,6 @@
<if test="price != null">
price = #{price,jdbcType=DECIMAL},
</if>
<if test="sp1 != null">
sp1 = #{sp1,jdbcType=VARCHAR},
</if>
<if test="sp2 != null">
sp2 = #{sp2,jdbcType=VARCHAR},
</if>
<if test="sp3 != null">
sp3 = #{sp3,jdbcType=VARCHAR},
</if>
<if test="productPic != null">
product_pic = #{productPic,jdbcType=VARCHAR},
</if>
......@@ -443,9 +399,6 @@
member_id = #{memberId,jdbcType=BIGINT},
quantity = #{quantity,jdbcType=INTEGER},
price = #{price,jdbcType=DECIMAL},
sp1 = #{sp1,jdbcType=VARCHAR},
sp2 = #{sp2,jdbcType=VARCHAR},
sp3 = #{sp3,jdbcType=VARCHAR},
product_pic = #{productPic,jdbcType=VARCHAR},
product_name = #{productName,jdbcType=VARCHAR},
product_sub_title = #{productSubTitle,jdbcType=VARCHAR},
......
......@@ -15,9 +15,6 @@
<result column="product_sku_id" jdbcType="BIGINT" property="productSkuId" />
<result column="product_sku_code" jdbcType="VARCHAR" property="productSkuCode" />
<result column="product_category_id" jdbcType="BIGINT" property="productCategoryId" />
<result column="sp1" jdbcType="VARCHAR" property="sp1" />
<result column="sp2" jdbcType="VARCHAR" property="sp2" />
<result column="sp3" jdbcType="VARCHAR" property="sp3" />
<result column="promotion_name" jdbcType="VARCHAR" property="promotionName" />
<result column="promotion_amount" jdbcType="DECIMAL" property="promotionAmount" />
<result column="coupon_amount" jdbcType="DECIMAL" property="couponAmount" />
......@@ -88,8 +85,8 @@
<sql id="Base_Column_List">
id, order_id, order_sn, product_id, product_pic, product_name, product_brand, product_sn,
product_price, product_quantity, product_sku_id, product_sku_code, product_category_id,
sp1, sp2, sp3, promotion_name, promotion_amount, coupon_amount, integration_amount,
real_amount, gift_integration, gift_growth, product_attr
promotion_name, promotion_amount, coupon_amount, integration_amount, real_amount,
gift_integration, gift_growth, product_attr
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.OmsOrderItemExample" resultMap="BaseResultMap">
select
......@@ -129,18 +126,16 @@
product_pic, product_name, product_brand,
product_sn, product_price, product_quantity,
product_sku_id, product_sku_code, product_category_id,
sp1, sp2, sp3, promotion_name,
promotion_amount, coupon_amount, integration_amount,
real_amount, gift_integration, gift_growth,
product_attr)
promotion_name, promotion_amount, coupon_amount,
integration_amount, real_amount, gift_integration,
gift_growth, product_attr)
values (#{orderId,jdbcType=BIGINT}, #{orderSn,jdbcType=VARCHAR}, #{productId,jdbcType=BIGINT},
#{productPic,jdbcType=VARCHAR}, #{productName,jdbcType=VARCHAR}, #{productBrand,jdbcType=VARCHAR},
#{productSn,jdbcType=VARCHAR}, #{productPrice,jdbcType=DECIMAL}, #{productQuantity,jdbcType=INTEGER},
#{productSkuId,jdbcType=BIGINT}, #{productSkuCode,jdbcType=VARCHAR}, #{productCategoryId,jdbcType=BIGINT},
#{sp1,jdbcType=VARCHAR}, #{sp2,jdbcType=VARCHAR}, #{sp3,jdbcType=VARCHAR}, #{promotionName,jdbcType=VARCHAR},
#{promotionAmount,jdbcType=DECIMAL}, #{couponAmount,jdbcType=DECIMAL}, #{integrationAmount,jdbcType=DECIMAL},
#{realAmount,jdbcType=DECIMAL}, #{giftIntegration,jdbcType=INTEGER}, #{giftGrowth,jdbcType=INTEGER},
#{productAttr,jdbcType=VARCHAR})
#{promotionName,jdbcType=VARCHAR}, #{promotionAmount,jdbcType=DECIMAL}, #{couponAmount,jdbcType=DECIMAL},
#{integrationAmount,jdbcType=DECIMAL}, #{realAmount,jdbcType=DECIMAL}, #{giftIntegration,jdbcType=INTEGER},
#{giftGrowth,jdbcType=INTEGER}, #{productAttr,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.OmsOrderItem">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
......@@ -184,15 +179,6 @@
<if test="productCategoryId != null">
product_category_id,
</if>
<if test="sp1 != null">
sp1,
</if>
<if test="sp2 != null">
sp2,
</if>
<if test="sp3 != null">
sp3,
</if>
<if test="promotionName != null">
promotion_name,
</if>
......@@ -255,15 +241,6 @@
<if test="productCategoryId != null">
#{productCategoryId,jdbcType=BIGINT},
</if>
<if test="sp1 != null">
#{sp1,jdbcType=VARCHAR},
</if>
<if test="sp2 != null">
#{sp2,jdbcType=VARCHAR},
</if>
<if test="sp3 != null">
#{sp3,jdbcType=VARCHAR},
</if>
<if test="promotionName != null">
#{promotionName,jdbcType=VARCHAR},
</if>
......@@ -338,15 +315,6 @@
<if test="record.productCategoryId != null">
product_category_id = #{record.productCategoryId,jdbcType=BIGINT},
</if>
<if test="record.sp1 != null">
sp1 = #{record.sp1,jdbcType=VARCHAR},
</if>
<if test="record.sp2 != null">
sp2 = #{record.sp2,jdbcType=VARCHAR},
</if>
<if test="record.sp3 != null">
sp3 = #{record.sp3,jdbcType=VARCHAR},
</if>
<if test="record.promotionName != null">
promotion_name = #{record.promotionName,jdbcType=VARCHAR},
</if>
......@@ -391,9 +359,6 @@
product_sku_id = #{record.productSkuId,jdbcType=BIGINT},
product_sku_code = #{record.productSkuCode,jdbcType=VARCHAR},
product_category_id = #{record.productCategoryId,jdbcType=BIGINT},
sp1 = #{record.sp1,jdbcType=VARCHAR},
sp2 = #{record.sp2,jdbcType=VARCHAR},
sp3 = #{record.sp3,jdbcType=VARCHAR},
promotion_name = #{record.promotionName,jdbcType=VARCHAR},
promotion_amount = #{record.promotionAmount,jdbcType=DECIMAL},
coupon_amount = #{record.couponAmount,jdbcType=DECIMAL},
......@@ -445,15 +410,6 @@
<if test="productCategoryId != null">
product_category_id = #{productCategoryId,jdbcType=BIGINT},
</if>
<if test="sp1 != null">
sp1 = #{sp1,jdbcType=VARCHAR},
</if>
<if test="sp2 != null">
sp2 = #{sp2,jdbcType=VARCHAR},
</if>
<if test="sp3 != null">
sp3 = #{sp3,jdbcType=VARCHAR},
</if>
<if test="promotionName != null">
promotion_name = #{promotionName,jdbcType=VARCHAR},
</if>
......@@ -495,9 +451,6 @@
product_sku_id = #{productSkuId,jdbcType=BIGINT},
product_sku_code = #{productSkuCode,jdbcType=VARCHAR},
product_category_id = #{productCategoryId,jdbcType=BIGINT},
sp1 = #{sp1,jdbcType=VARCHAR},
sp2 = #{sp2,jdbcType=VARCHAR},
sp3 = #{sp3,jdbcType=VARCHAR},
promotion_name = #{promotionName,jdbcType=VARCHAR},
promotion_amount = #{promotionAmount,jdbcType=DECIMAL},
coupon_amount = #{couponAmount,jdbcType=DECIMAL},
......
......@@ -8,13 +8,11 @@
<result column="price" jdbcType="DECIMAL" property="price" />
<result column="stock" jdbcType="INTEGER" property="stock" />
<result column="low_stock" jdbcType="INTEGER" property="lowStock" />
<result column="sp1" jdbcType="VARCHAR" property="sp1" />
<result column="sp2" jdbcType="VARCHAR" property="sp2" />
<result column="sp3" jdbcType="VARCHAR" property="sp3" />
<result column="pic" jdbcType="VARCHAR" property="pic" />
<result column="sale" jdbcType="INTEGER" property="sale" />
<result column="promotion_price" jdbcType="DECIMAL" property="promotionPrice" />
<result column="lock_stock" jdbcType="INTEGER" property="lockStock" />
<result column="sp_data" jdbcType="VARCHAR" property="spData" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
......@@ -75,8 +73,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, product_id, sku_code, price, stock, low_stock, sp1, sp2, sp3, pic, sale, promotion_price,
lock_stock
id, product_id, sku_code, price, stock, low_stock, pic, sale, promotion_price, lock_stock,
sp_data
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.PmsSkuStockExample" resultMap="BaseResultMap">
select
......@@ -113,13 +111,13 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into pms_sku_stock (product_id, sku_code, price,
stock, low_stock, sp1,
sp2, sp3, pic, sale,
promotion_price, lock_stock)
stock, low_stock, pic,
sale, promotion_price, lock_stock,
sp_data)
values (#{productId,jdbcType=BIGINT}, #{skuCode,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL},
#{stock,jdbcType=INTEGER}, #{lowStock,jdbcType=INTEGER}, #{sp1,jdbcType=VARCHAR},
#{sp2,jdbcType=VARCHAR}, #{sp3,jdbcType=VARCHAR}, #{pic,jdbcType=VARCHAR}, #{sale,jdbcType=INTEGER},
#{promotionPrice,jdbcType=DECIMAL}, #{lockStock,jdbcType=INTEGER})
#{stock,jdbcType=INTEGER}, #{lowStock,jdbcType=INTEGER}, #{pic,jdbcType=VARCHAR},
#{sale,jdbcType=INTEGER}, #{promotionPrice,jdbcType=DECIMAL}, #{lockStock,jdbcType=INTEGER},
#{spData,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.PmsSkuStock">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
......@@ -142,15 +140,6 @@
<if test="lowStock != null">
low_stock,
</if>
<if test="sp1 != null">
sp1,
</if>
<if test="sp2 != null">
sp2,
</if>
<if test="sp3 != null">
sp3,
</if>
<if test="pic != null">
pic,
</if>
......@@ -163,6 +152,9 @@
<if test="lockStock != null">
lock_stock,
</if>
<if test="spData != null">
sp_data,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productId != null">
......@@ -180,15 +172,6 @@
<if test="lowStock != null">
#{lowStock,jdbcType=INTEGER},
</if>
<if test="sp1 != null">
#{sp1,jdbcType=VARCHAR},
</if>
<if test="sp2 != null">
#{sp2,jdbcType=VARCHAR},
</if>
<if test="sp3 != null">
#{sp3,jdbcType=VARCHAR},
</if>
<if test="pic != null">
#{pic,jdbcType=VARCHAR},
</if>
......@@ -201,6 +184,9 @@
<if test="lockStock != null">
#{lockStock,jdbcType=INTEGER},
</if>
<if test="spData != null">
#{spData,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.PmsSkuStockExample" resultType="java.lang.Long">
......@@ -230,15 +216,6 @@
<if test="record.lowStock != null">
low_stock = #{record.lowStock,jdbcType=INTEGER},
</if>
<if test="record.sp1 != null">
sp1 = #{record.sp1,jdbcType=VARCHAR},
</if>
<if test="record.sp2 != null">
sp2 = #{record.sp2,jdbcType=VARCHAR},
</if>
<if test="record.sp3 != null">
sp3 = #{record.sp3,jdbcType=VARCHAR},
</if>
<if test="record.pic != null">
pic = #{record.pic,jdbcType=VARCHAR},
</if>
......@@ -251,6 +228,9 @@
<if test="record.lockStock != null">
lock_stock = #{record.lockStock,jdbcType=INTEGER},
</if>
<if test="record.spData != null">
sp_data = #{record.spData,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -264,13 +244,11 @@
price = #{record.price,jdbcType=DECIMAL},
stock = #{record.stock,jdbcType=INTEGER},
low_stock = #{record.lowStock,jdbcType=INTEGER},
sp1 = #{record.sp1,jdbcType=VARCHAR},
sp2 = #{record.sp2,jdbcType=VARCHAR},
sp3 = #{record.sp3,jdbcType=VARCHAR},
pic = #{record.pic,jdbcType=VARCHAR},
sale = #{record.sale,jdbcType=INTEGER},
promotion_price = #{record.promotionPrice,jdbcType=DECIMAL},
lock_stock = #{record.lockStock,jdbcType=INTEGER}
lock_stock = #{record.lockStock,jdbcType=INTEGER},
sp_data = #{record.spData,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -293,15 +271,6 @@
<if test="lowStock != null">
low_stock = #{lowStock,jdbcType=INTEGER},
</if>
<if test="sp1 != null">
sp1 = #{sp1,jdbcType=VARCHAR},
</if>
<if test="sp2 != null">
sp2 = #{sp2,jdbcType=VARCHAR},
</if>
<if test="sp3 != null">
sp3 = #{sp3,jdbcType=VARCHAR},
</if>
<if test="pic != null">
pic = #{pic,jdbcType=VARCHAR},
</if>
......@@ -314,6 +283,9 @@
<if test="lockStock != null">
lock_stock = #{lockStock,jdbcType=INTEGER},
</if>
<if test="spData != null">
sp_data = #{spData,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
......@@ -324,13 +296,11 @@
price = #{price,jdbcType=DECIMAL},
stock = #{stock,jdbcType=INTEGER},
low_stock = #{lowStock,jdbcType=INTEGER},
sp1 = #{sp1,jdbcType=VARCHAR},
sp2 = #{sp2,jdbcType=VARCHAR},
sp3 = #{sp3,jdbcType=VARCHAR},
pic = #{pic,jdbcType=VARCHAR},
sale = #{sale,jdbcType=INTEGER},
promotion_price = #{promotionPrice,jdbcType=DECIMAL},
lock_stock = #{lockStock,jdbcType=INTEGER}
lock_stock = #{lockStock,jdbcType=INTEGER},
sp_data = #{spData,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
......@@ -60,14 +60,8 @@ public class OmsCartItemServiceImpl implements OmsCartItemService {
OmsCartItemExample example = new OmsCartItemExample();
OmsCartItemExample.Criteria criteria = example.createCriteria().andMemberIdEqualTo(cartItem.getMemberId())
.andProductIdEqualTo(cartItem.getProductId()).andDeleteStatusEqualTo(0);
if (!StringUtils.isEmpty(cartItem.getSp1())) {
criteria.andSp1EqualTo(cartItem.getSp1());
}
if (!StringUtils.isEmpty(cartItem.getSp2())) {
criteria.andSp2EqualTo(cartItem.getSp2());
}
if (!StringUtils.isEmpty(cartItem.getSp3())) {
criteria.andSp3EqualTo(cartItem.getSp3());
if (!StringUtils.isEmpty(cartItem.getProductSkuId())) {
criteria.andProductSkuIdEqualTo(cartItem.getProductSkuId());
}
List<OmsCartItem> cartItemList = cartItemMapper.selectByExample(example);
if (!CollectionUtils.isEmpty(cartItemList)) {
......
......@@ -5,20 +5,18 @@
insert into oms_order_item (order_id, order_sn, product_id,
product_pic, product_name, product_brand,
product_sn, product_price, product_quantity,
product_sku_id, product_category_id, product_sku_code,
sp1, sp2, sp3, promotion_name,
product_sku_id, product_category_id, product_sku_code,promotion_name,
promotion_amount, coupon_amount, integration_amount,
real_amount) values
real_amount,product_attr) values
<foreach collection="list" item="item" separator="," index="index">
(#{item.orderId,jdbcType=BIGINT}, #{item.orderSn,jdbcType=VARCHAR}, #{item.productId,jdbcType=BIGINT},
#{item.productPic,jdbcType=VARCHAR}, #{item.productName,jdbcType=VARCHAR}, #{item.productBrand,jdbcType=VARCHAR},
#{item.productSn,jdbcType=VARCHAR}, #{item.productPrice,jdbcType=DECIMAL}, #{item.productQuantity,jdbcType=INTEGER},
#{item.productSkuId,jdbcType=BIGINT}, #{item.productCategoryId,jdbcType=BIGINT}, #{item.productSkuCode,jdbcType=VARCHAR},
#{item.sp1,jdbcType=VARCHAR}, #{item.sp2,jdbcType=VARCHAR}, #{item.sp3,jdbcType=VARCHAR},
#{item.promotionName,jdbcType=VARCHAR},
#{item.promotionAmount,jdbcType=DECIMAL}, #{item.couponAmount,jdbcType=DECIMAL},
#{item.integrationAmount,jdbcType=DECIMAL},
#{item.realAmount,jdbcType=DECIMAL})
#{item.realAmount,jdbcType=DECIMAL},#{item.productAttr,jdbcType=VARCHAR})
</foreach>
</insert>
</mapper>
\ No newline at end of file
......@@ -31,9 +31,6 @@
ps.id sku_id,
ps.sku_code sku_code,
ps.price sku_price,
ps.sp1 sku_sp1,
ps.sp2 sku_sp2,
ps.sp3 sku_sp3,
ps.stock sku_stock,
ps.pic sku_pic
FROM
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment