商品sku
parent
95ed6046ec
commit
b54775f50d
|
@ -0,0 +1,202 @@
|
|||
package com.nuyu.product.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 商品SKU对象 mall_product_sku_info
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-07
|
||||
*/
|
||||
@Data
|
||||
public class MallProductSkuInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer pageSize=10;
|
||||
private Integer pageNum=1;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
|
||||
/** 商品信息 */
|
||||
@Excel(name = "商品信息")
|
||||
private Long productId;
|
||||
|
||||
/** 商品规格 */
|
||||
@Excel(name = "商品规格")
|
||||
private String sku;
|
||||
|
||||
/** 商品库存 */
|
||||
@Excel(name = "商品库存")
|
||||
private Long stock;
|
||||
|
||||
/** 商品价格 */
|
||||
@Excel(name = "商品价格")
|
||||
private BigDecimal price;
|
||||
|
||||
/** 商品进价 */
|
||||
@Excel(name = "商品进价")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/** 商品售价 */
|
||||
@Excel(name = "商品售价")
|
||||
private BigDecimal sellingPrice;
|
||||
|
||||
/** 规格图片 */
|
||||
@Excel(name = "规格图片")
|
||||
private String image;
|
||||
|
||||
/** 编号 */
|
||||
@Excel(name = "编号")
|
||||
private String number;
|
||||
|
||||
/** 重量 */
|
||||
@Excel(name = "重量")
|
||||
private BigDecimal weight;
|
||||
|
||||
/** 体积 */
|
||||
@Excel(name = "体积")
|
||||
private BigDecimal volume;
|
||||
|
||||
/** 乐观锁 */
|
||||
@Excel(name = "乐观锁")
|
||||
private Long revision;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setProductId(Long productId)
|
||||
{
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public Long getProductId()
|
||||
{
|
||||
return productId;
|
||||
}
|
||||
public void setSku(String sku)
|
||||
{
|
||||
this.sku = sku;
|
||||
}
|
||||
|
||||
public String getSku()
|
||||
{
|
||||
return sku;
|
||||
}
|
||||
public void setStock(Long stock)
|
||||
{
|
||||
this.stock = stock;
|
||||
}
|
||||
|
||||
public Long getStock()
|
||||
{
|
||||
return stock;
|
||||
}
|
||||
public void setPrice(BigDecimal price)
|
||||
{
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice()
|
||||
{
|
||||
return price;
|
||||
}
|
||||
public void setPurchasePrice(BigDecimal purchasePrice)
|
||||
{
|
||||
this.purchasePrice = purchasePrice;
|
||||
}
|
||||
|
||||
public BigDecimal getPurchasePrice()
|
||||
{
|
||||
return purchasePrice;
|
||||
}
|
||||
public void setSellingPrice(BigDecimal sellingPrice)
|
||||
{
|
||||
this.sellingPrice = sellingPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getSellingPrice()
|
||||
{
|
||||
return sellingPrice;
|
||||
}
|
||||
public void setImage(String image)
|
||||
{
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public String getImage()
|
||||
{
|
||||
return image;
|
||||
}
|
||||
public void setNumber(String number)
|
||||
{
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getNumber()
|
||||
{
|
||||
return number;
|
||||
}
|
||||
public void setWeight(BigDecimal weight)
|
||||
{
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public BigDecimal getWeight()
|
||||
{
|
||||
return weight;
|
||||
}
|
||||
public void setVolume(BigDecimal volume)
|
||||
{
|
||||
this.volume = volume;
|
||||
}
|
||||
|
||||
public BigDecimal getVolume()
|
||||
{
|
||||
return volume;
|
||||
}
|
||||
public void setRevision(Long revision)
|
||||
{
|
||||
this.revision = revision;
|
||||
}
|
||||
|
||||
public Long getRevision()
|
||||
{
|
||||
return revision;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("productId", getProductId())
|
||||
.append("sku", getSku())
|
||||
.append("stock", getStock())
|
||||
.append("price", getPrice())
|
||||
.append("purchasePrice", getPurchasePrice())
|
||||
.append("sellingPrice", getSellingPrice())
|
||||
.append("image", getImage())
|
||||
.append("number", getNumber())
|
||||
.append("weight", getWeight())
|
||||
.append("volume", getVolume())
|
||||
.append("revision", getRevision())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,115 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.common.core.web.domain.AjaxResult;
|
||||
import com.muyu.product.service.MallProductSkuInfoService;
|
||||
import com.nuyu.product.domain.MallProductSkuInfo;
|
||||
import com.nuyu.product.domain.MallProductTypeInfo;
|
||||
import com.nuyu.product.req.BookReq;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 商品SKUController
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sku")
|
||||
public class MallProductSkuInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private MallProductSkuInfoService mallProductSkuInfoService;
|
||||
|
||||
/**
|
||||
* 查询商品SKU列表
|
||||
*/
|
||||
@RequiresPermissions("product:sku:list")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(MallProductSkuInfo mallProductSkuInfo){
|
||||
PageInfo<MallProductSkuInfo> info=mallProductSkuInfoService.list(mallProductSkuInfo);
|
||||
return AjaxResult.success(info);
|
||||
}
|
||||
// public Result<TableDataInfo> list(MallProductSkuInfo mallProductSkuInfo)
|
||||
// {
|
||||
// startPage();
|
||||
// List<MallProductSkuInfo> list = mallProductSkuInfoService.selectMallProductSkuInfoList(mallProductSkuInfo);
|
||||
// return getDataTable(list);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 导出商品SKU列表
|
||||
*/
|
||||
@RequiresPermissions("product:sku:export")
|
||||
@Log(title = "商品SKU", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MallProductSkuInfo mallProductSkuInfo)
|
||||
{
|
||||
List<MallProductSkuInfo> list = mallProductSkuInfoService.selectMallProductSkuInfoList(mallProductSkuInfo);
|
||||
ExcelUtil<MallProductSkuInfo> util = new ExcelUtil<MallProductSkuInfo>(MallProductSkuInfo.class);
|
||||
util.exportExcel(response, list, "商品SKU数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品SKU详细信息
|
||||
*/
|
||||
@RequiresPermissions("product:sku:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(mallProductSkuInfoService.selectMallProductSkuInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商品SKU
|
||||
*/
|
||||
@RequiresPermissions("product:sku:add")
|
||||
@Log(title = "商品SKU", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody MallProductSkuInfo mallProductSkuInfo)
|
||||
{
|
||||
return toAjax(mallProductSkuInfoService.insertMallProductSkuInfo(mallProductSkuInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品SKU
|
||||
*/
|
||||
@RequiresPermissions("product:sku:edit")
|
||||
@Log(title = "商品SKU", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody MallProductSkuInfo mallProductSkuInfo)
|
||||
{
|
||||
return toAjax(mallProductSkuInfoService.updateMallProductSkuInfo(mallProductSkuInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品SKU
|
||||
*/
|
||||
@RequiresPermissions("product:sku:remove")
|
||||
@Log(title = "商品SKU", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(mallProductSkuInfoService.deleteMallProductSkuInfoByIds(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.nuyu.product.domain.MallProductSkuInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 商品SKUMapper接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-07
|
||||
*/
|
||||
@Mapper
|
||||
public interface MallProductSkuInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询商品SKU
|
||||
*
|
||||
* @param id 商品SKU主键
|
||||
* @return 商品SKU
|
||||
*/
|
||||
public MallProductSkuInfo selectMallProductSkuInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询商品SKU列表
|
||||
*
|
||||
* @param mallProductSkuInfo 商品SKU
|
||||
* @return 商品SKU集合
|
||||
*/
|
||||
public List<MallProductSkuInfo> selectMallProductSkuInfoList(MallProductSkuInfo mallProductSkuInfo);
|
||||
|
||||
/**
|
||||
* 新增商品SKU
|
||||
*
|
||||
* @param mallProductSkuInfo 商品SKU
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMallProductSkuInfo(MallProductSkuInfo mallProductSkuInfo);
|
||||
|
||||
/**
|
||||
* 修改商品SKU
|
||||
*
|
||||
* @param mallProductSkuInfo 商品SKU
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMallProductSkuInfo(MallProductSkuInfo mallProductSkuInfo);
|
||||
|
||||
/**
|
||||
* 删除商品SKU
|
||||
*
|
||||
* @param id 商品SKU主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMallProductSkuInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除商品SKU
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMallProductSkuInfoByIds(Long[] ids);
|
||||
|
||||
List<MallProductSkuInfo> list(MallProductSkuInfo mallProductSkuInfo);
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
package com.muyu.product.service.Impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.product.mapper.MallProductSkuInfoMapper;
|
||||
import com.muyu.product.service.MallProductSkuInfoService;
|
||||
import com.nuyu.product.domain.MallProductRuleInfo;
|
||||
import com.nuyu.product.domain.MallProductSkuInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* 商品SKUService业务层处理
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-07
|
||||
*/
|
||||
@Service
|
||||
public class MallProductSkuInfoServiceImpl implements MallProductSkuInfoService
|
||||
{
|
||||
@Autowired
|
||||
private MallProductSkuInfoMapper mallProductSkuInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询商品SKU
|
||||
*
|
||||
* @param id 商品SKU主键
|
||||
* @return 商品SKU
|
||||
*/
|
||||
@Override
|
||||
public MallProductSkuInfo selectMallProductSkuInfoById(Long id)
|
||||
{
|
||||
return mallProductSkuInfoMapper.selectMallProductSkuInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品SKU列表
|
||||
*
|
||||
* @param mallProductSkuInfo 商品SKU
|
||||
* @return 商品SKU
|
||||
*/
|
||||
@Override
|
||||
public List<MallProductSkuInfo> selectMallProductSkuInfoList(MallProductSkuInfo mallProductSkuInfo)
|
||||
{
|
||||
return mallProductSkuInfoMapper.selectMallProductSkuInfoList(mallProductSkuInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商品SKU
|
||||
*
|
||||
* @param mallProductSkuInfo 商品SKU
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMallProductSkuInfo(MallProductSkuInfo mallProductSkuInfo)
|
||||
{
|
||||
mallProductSkuInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return mallProductSkuInfoMapper.insertMallProductSkuInfo(mallProductSkuInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品SKU
|
||||
*
|
||||
* @param mallProductSkuInfo 商品SKU
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMallProductSkuInfo(MallProductSkuInfo mallProductSkuInfo)
|
||||
{
|
||||
mallProductSkuInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return mallProductSkuInfoMapper.updateMallProductSkuInfo(mallProductSkuInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品SKU
|
||||
*
|
||||
* @param ids 需要删除的商品SKU主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMallProductSkuInfoByIds(Long[] ids)
|
||||
{
|
||||
return mallProductSkuInfoMapper.deleteMallProductSkuInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品SKU信息
|
||||
*
|
||||
* @param id 商品SKU主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMallProductSkuInfoById(Long id)
|
||||
{
|
||||
return mallProductSkuInfoMapper.deleteMallProductSkuInfoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<MallProductSkuInfo> list(MallProductSkuInfo mallProductSkuInfo) {
|
||||
PageHelper.startPage(mallProductSkuInfo.getPageNum(),mallProductSkuInfo.getPageSize());
|
||||
List<MallProductSkuInfo> products = mallProductSkuInfoMapper.list(mallProductSkuInfo);
|
||||
PageInfo<MallProductSkuInfo> pageInfo = new PageInfo<>(products);
|
||||
return pageInfo;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.nuyu.product.domain.MallProductSkuInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 商品SKUService接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-07
|
||||
*/
|
||||
public interface MallProductSkuInfoService
|
||||
{
|
||||
/**
|
||||
* 查询商品SKU
|
||||
*
|
||||
* @param id 商品SKU主键
|
||||
* @return 商品SKU
|
||||
*/
|
||||
public MallProductSkuInfo selectMallProductSkuInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询商品SKU列表
|
||||
*
|
||||
* @param mallProductSkuInfo 商品SKU
|
||||
* @return 商品SKU集合
|
||||
*/
|
||||
public List<MallProductSkuInfo> selectMallProductSkuInfoList(MallProductSkuInfo mallProductSkuInfo);
|
||||
|
||||
/**
|
||||
* 新增商品SKU
|
||||
*
|
||||
* @param mallProductSkuInfo 商品SKU
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMallProductSkuInfo(MallProductSkuInfo mallProductSkuInfo);
|
||||
|
||||
/**
|
||||
* 修改商品SKU
|
||||
*
|
||||
* @param mallProductSkuInfo 商品SKU
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMallProductSkuInfo(MallProductSkuInfo mallProductSkuInfo);
|
||||
|
||||
/**
|
||||
* 批量删除商品SKU
|
||||
*
|
||||
* @param ids 需要删除的商品SKU主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMallProductSkuInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除商品SKU信息
|
||||
*
|
||||
* @param id 商品SKU主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMallProductSkuInfoById(Long id);
|
||||
|
||||
PageInfo<MallProductSkuInfo> list(MallProductSkuInfo mallProductSkuInfo);
|
||||
}
|
|
@ -0,0 +1,125 @@
|
|||
<?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.muyu.product.mapper.MallProductSkuInfoMapper">
|
||||
|
||||
<resultMap type="com.nuyu.product.domain.MallProductSkuInfo" id="MallProductSkuInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="sku" column="sku" />
|
||||
<result property="stock" column="stock" />
|
||||
<result property="price" column="price" />
|
||||
<result property="purchasePrice" column="purchase_price" />
|
||||
<result property="sellingPrice" column="selling_price" />
|
||||
<result property="image" column="image" />
|
||||
<result property="number" column="number" />
|
||||
<result property="weight" column="weight" />
|
||||
<result property="volume" column="volume" />
|
||||
<result property="revision" column="revision" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMallProductSkuInfoVo">
|
||||
select id, product_id, sku, stock, price, purchase_price, selling_price, image, number, weight, volume, revision, create_by, create_time, update_by, update_time from mall_product_sku_info
|
||||
</sql>
|
||||
|
||||
<select id="selectMallProductSkuInfoList" parameterType="com.nuyu.product.domain.MallProductSkuInfo" resultMap="MallProductSkuInfoResult">
|
||||
<include refid="selectMallProductSkuInfoVo"/>
|
||||
<where>
|
||||
<if test="stock != null "> and stock = #{stock}</if>
|
||||
<if test="price != null "> and price = #{price}</if>
|
||||
<if test="purchasePrice != null "> and purchase_price = #{purchasePrice}</if>
|
||||
<if test="sellingPrice != null "> and selling_price = #{sellingPrice}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMallProductSkuInfoById" parameterType="Long" resultMap="MallProductSkuInfoResult">
|
||||
<include refid="selectMallProductSkuInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.nuyu.product.domain.MallProductSkuInfo">
|
||||
<include refid="selectMallProductSkuInfoVo"/>
|
||||
<where>
|
||||
<if test="stock != null "> and stock = #{stock}</if>
|
||||
<if test="price != null "> and price = #{price}</if>
|
||||
<if test="purchasePrice != null "> and purchase_price = #{purchasePrice}</if>
|
||||
<if test="sellingPrice != null "> and selling_price = #{sellingPrice}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertMallProductSkuInfo" parameterType="com.nuyu.product.domain.MallProductSkuInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into mall_product_sku_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="sku != null and sku != ''">sku,</if>
|
||||
<if test="stock != null">stock,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="purchasePrice != null">purchase_price,</if>
|
||||
<if test="sellingPrice != null">selling_price,</if>
|
||||
<if test="image != null and image != ''">image,</if>
|
||||
<if test="number != null and number != ''">number,</if>
|
||||
<if test="weight != null">weight,</if>
|
||||
<if test="volume != null">volume,</if>
|
||||
<if test="revision != null">revision,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="sku != null and sku != ''">#{sku},</if>
|
||||
<if test="stock != null">#{stock},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="purchasePrice != null">#{purchasePrice},</if>
|
||||
<if test="sellingPrice != null">#{sellingPrice},</if>
|
||||
<if test="image != null and image != ''">#{image},</if>
|
||||
<if test="number != null and number != ''">#{number},</if>
|
||||
<if test="weight != null">#{weight},</if>
|
||||
<if test="volume != null">#{volume},</if>
|
||||
<if test="revision != null">#{revision},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMallProductSkuInfo" parameterType="com.nuyu.product.domain.MallProductSkuInfo">
|
||||
update mall_product_sku_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="sku != null and sku != ''">sku = #{sku},</if>
|
||||
<if test="stock != null">stock = #{stock},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="purchasePrice != null">purchase_price = #{purchasePrice},</if>
|
||||
<if test="sellingPrice != null">selling_price = #{sellingPrice},</if>
|
||||
<if test="image != null and image != ''">image = #{image},</if>
|
||||
<if test="number != null and number != ''">number = #{number},</if>
|
||||
<if test="weight != null">weight = #{weight},</if>
|
||||
<if test="volume != null">volume = #{volume},</if>
|
||||
<if test="revision != null">revision = #{revision},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMallProductSkuInfoById" parameterType="Long">
|
||||
delete from mall_product_sku_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMallProductSkuInfoByIds" parameterType="String">
|
||||
delete from mall_product_sku_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue