刘俊驰 1 anno fa
parent
commit
fdbec57fe2

+ 27 - 4
mec-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/controller/ExportController.java

@@ -1,16 +1,19 @@
 package com.yonge.cooleshow.admin.controller;
 
 import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
 import com.yonge.cooleshow.admin.dto.OmsOrderQueryParam;
 import com.yonge.cooleshow.admin.dto.OrderDetailVo;
 import com.yonge.cooleshow.admin.service.OmsOrderService;
+import com.yonge.cooleshow.admin.service.PmsProductSkuStockRecordService;
+import com.yonge.cooleshow.admin.wrapper.PmsProductSkuStockRecordWrapper;
+import com.yonge.cooleshow.mall.common.api.CommonPage;
+import com.yonge.cooleshow.mall.common.api.CommonResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
@@ -23,6 +26,8 @@ public class ExportController {
     @Autowired
     private OmsOrderService orderService;
 
+    @Autowired
+    private PmsProductSkuStockRecordService pmsProductSkuStockRecordService;
     @ApiOperation("订单详情")
     @RequestMapping(value = "/orderDetail", method = RequestMethod.POST)
     public void orderDetail(@RequestBody OmsOrderQueryParam queryParam, HttpServletResponse response) throws IOException {
@@ -35,4 +40,22 @@ public class ExportController {
         response.setHeader("Content-disposition", "attachment;filename=订单详情.xlsx");
         EasyExcel.write(response.getOutputStream(), OrderDetailVo.class).sheet("订单详情").doWrite(orderList);
     }
+
+
+    @ApiOperation("商品库存入库记录")
+    @PostMapping(value = "/pmsProductSkuStockRecord")
+    public void getList(@RequestBody @Validated PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecordQuery query, HttpServletResponse response) throws IOException {
+        query.setPageSize(99999);
+        List<PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecord> productList = pmsProductSkuStockRecordService.list(query);
+        // 设置文本内省
+        response.setContentType("application/vnd.ms-excel");
+        // 设置字符编码
+        response.setCharacterEncoding("utf-8");
+        // 设置响应头
+        response.setHeader("Content-disposition", "attachment;filename=商品库存入库记录.xlsx");
+        EasyExcel.write(response.getOutputStream(), PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecord.class)
+            .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
+            .sheet("商品库存入库记录").doWrite(productList);
+    }
+
 }

+ 63 - 0
mec-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/controller/PmsProductSkuStockRecordController.java

@@ -0,0 +1,63 @@
+package com.yonge.cooleshow.admin.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.yonge.cooleshow.admin.dto.PmsProductParam;
+import com.yonge.cooleshow.admin.dto.PmsProductQueryParam;
+import com.yonge.cooleshow.admin.dto.PmsProductResult;
+import com.yonge.cooleshow.admin.service.PmsProductService;
+import com.yonge.cooleshow.admin.service.PmsProductSkuStockRecordService;
+import com.yonge.cooleshow.admin.wrapper.PmsProductSkuStockRecordWrapper;
+import com.yonge.cooleshow.mall.common.api.CommonPage;
+import com.yonge.cooleshow.mall.common.api.CommonResult;
+import com.yonge.cooleshow.mall.common.api.ResultCode;
+import com.yonge.cooleshow.mbg.model.PmsProduct;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 商品管理Controller
+ * Created by macro on 2018/4/26.
+ */
+@RestController
+@Api(tags = "PmsProductSkuStockRecordController", description = "商品库存入库记录")
+@RequestMapping("/PmsProductSkuStockRecord")
+public class PmsProductSkuStockRecordController {
+    @Autowired
+    private PmsProductSkuStockRecordService pmsProductSkuStockRecordService;
+
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation("商品库存入库记录")
+    @PostMapping(value = "/list")
+    public CommonResult<CommonPage<PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecord>> getList(@RequestBody
+                                      @Validated PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecordQuery query) {
+        List<PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecord> productList = pmsProductSkuStockRecordService.list(query);
+        return CommonResult.success(CommonPage.restPage(productList));
+    }
+
+    @ApiOperation("新增商品库存入库记录")
+    @RequestMapping(value = "/create", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult create(@RequestBody @Validated PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecord pmsProductSkuStockRecord) {
+
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null || sysUser.getId() == null) {
+            return CommonResult.failed(ResultCode.FORBIDDEN, "请登录");
+        }
+        pmsProductSkuStockRecord.setCreateBy(sysUser.getId().longValue());
+        int count = pmsProductSkuStockRecordService.create(pmsProductSkuStockRecord);
+        if (count > 0) {
+            return CommonResult.success(count);
+        } else {
+            return CommonResult.failed();
+        }
+    }
+}

+ 23 - 0
mec-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/dao/PmsProductSkuStockRecordDao.java

@@ -0,0 +1,23 @@
+package com.yonge.cooleshow.admin.dao;
+
+import com.yonge.cooleshow.admin.dto.HomeStatistical;
+import com.yonge.cooleshow.admin.dto.PmsProductQueryParam;
+import com.yonge.cooleshow.admin.dto.PmsProductResult;
+import com.yonge.cooleshow.admin.wrapper.PmsProductSkuStockRecordWrapper;
+import com.yonge.cooleshow.mbg.model.PmsProduct;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+/**
+ * 商品管理自定义Dao
+ * Created by macro on 2018/4/26.
+ */
+public interface PmsProductSkuStockRecordDao {
+
+    /**
+     * 列表
+     */
+    List<PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecord> list(@Param("param") PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecordQuery query);
+}

+ 33 - 0
mec-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/service/PmsProductSkuStockRecordService.java

@@ -0,0 +1,33 @@
+package com.yonge.cooleshow.admin.service;
+
+import com.yonge.cooleshow.admin.dto.HomeStatistical;
+import com.yonge.cooleshow.admin.dto.PmsProductParam;
+import com.yonge.cooleshow.admin.dto.PmsProductQueryParam;
+import com.yonge.cooleshow.admin.dto.PmsProductResult;
+import com.yonge.cooleshow.admin.wrapper.PmsProductSkuStockRecordWrapper;
+import com.yonge.cooleshow.mbg.model.PmsProduct;
+import org.springframework.transaction.annotation.Isolation;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 商品管理Service
+ * Created by macro on 2018/4/26.
+ */
+public interface PmsProductSkuStockRecordService {
+
+
+    /**
+     * 列表分页
+     *
+     */
+    List<PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecord> list(PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecordQuery query);
+
+    /**
+     * 新增
+     *
+     */
+    int create(PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecord pmsProductSkuStockRecord);
+}

+ 3 - 0
mec-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/service/PmsSkuStockService.java

@@ -4,6 +4,7 @@ import com.yonge.cooleshow.mbg.model.PmsSkuStock;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 商品SKU库存管理Service
@@ -20,4 +21,6 @@ public interface PmsSkuStockService {
      */
     @Transactional
     int update(Long pid, List<PmsSkuStock> skuStockList);
+
+    Map<Long,PmsSkuStock> getMapByIds(List<Long> skuIds);
 }

+ 91 - 0
mec-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/service/impl/PmsProductSkuStockRecordServiceImpl.java

@@ -0,0 +1,91 @@
+package com.yonge.cooleshow.admin.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.github.pagehelper.PageHelper;
+import com.ym.mec.common.exception.BizException;
+import com.yonge.cooleshow.admin.dao.PmsProductSkuStockRecordDao;
+import com.yonge.cooleshow.admin.service.PmsProductService;
+import com.yonge.cooleshow.admin.service.PmsProductSkuStockRecordService;
+import com.yonge.cooleshow.admin.service.PmsSkuStockService;
+import com.yonge.cooleshow.admin.wrapper.PmsProductSkuStockRecordWrapper;
+import com.yonge.cooleshow.mbg.mapper.PmsProductMapper;
+import com.yonge.cooleshow.mbg.mapper.PmsProductSkuStockRecordMapper;
+import com.yonge.cooleshow.mbg.mapper.PmsSkuStockMapper;
+import com.yonge.cooleshow.mbg.model.PmsProduct;
+import com.yonge.cooleshow.mbg.model.PmsProductSkuStockRecord;
+import com.yonge.cooleshow.mbg.model.PmsSkuStock;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Service
+public class PmsProductSkuStockRecordServiceImpl implements PmsProductSkuStockRecordService {
+
+    @Autowired
+    private PmsProductSkuStockRecordMapper pmsProductSkuStockRecordMapper;
+
+    @Autowired
+    private PmsProductSkuStockRecordDao pmsProductSkuStockRecordDao;
+
+    @Autowired
+    private PmsSkuStockService skuStockService;
+
+
+    @Autowired
+    private PmsSkuStockMapper pmsSkuStockMapper;
+
+    @Autowired
+    private PmsProductMapper pmsProductMapper;
+    /**
+     * 列表分页
+     *
+     * @param query
+     */
+    @Override
+    public List<PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecord> list(PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecordQuery query) {
+        PageHelper.startPage(query.getPageNum(), query.getPageSize());
+        List<PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecord> list = pmsProductSkuStockRecordDao.list(query);
+        if (CollectionUtils.isEmpty(list)) {
+            return list;
+        }
+        // sku id 集合
+        List<Long> skuIds = list.stream().map(PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecord::getProductSkuId).distinct().collect(Collectors.toList());
+        Map<Long, PmsSkuStock> skuStockMap = skuStockService.getMapByIds(skuIds);
+        list.forEach(item -> {
+            PmsSkuStock skuStock = skuStockMap.get(item.getProductSkuId());
+            if (skuStock != null) {
+                item.setProductSkuCode(skuStock.getSkuCode());
+            }
+        });
+
+        return list;
+
+    }
+
+    /**
+     * 新增
+     *
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int create(PmsProductSkuStockRecordWrapper.PmsProductSkuStockRecord pmsProductSkuStockRecord) {
+
+        //判断商品存在
+        PmsProduct pmsProduct = pmsProductMapper.selectByPrimaryKey(pmsProductSkuStockRecord.getProductId());
+        if (pmsProduct == null) {
+            throw new BizException("商品不存在");
+        }
+        //判断sku存在
+        PmsSkuStock pmsSkuStock = pmsSkuStockMapper.selectByPrimaryKey(pmsProductSkuStockRecord.getProductSkuId());
+        if (pmsSkuStock == null) {
+            throw new BizException("sku不存在");
+        }
+
+        return pmsProductSkuStockRecordMapper.insertSelective(JSON.parseObject(JSON.toJSONString(pmsProductSkuStockRecord), PmsProductSkuStockRecord.class));
+    }
+}

+ 18 - 0
mec-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/service/impl/PmsSkuStockServiceImpl.java

@@ -7,9 +7,13 @@ import com.yonge.cooleshow.mbg.model.PmsSkuStockExample;
 import com.yonge.cooleshow.admin.service.PmsSkuStockService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * 商品SKU库存管理Service实现类
@@ -36,4 +40,18 @@ public class PmsSkuStockServiceImpl implements PmsSkuStockService {
     public int update(Long pid, List<PmsSkuStock> skuStockList) {
         return skuStockDao.replaceList(skuStockList);
     }
+
+    @Override
+    public Map<Long, PmsSkuStock> getMapByIds(List<Long> skuIds) {
+        if (CollectionUtils.isEmpty(skuIds)) {
+            return new HashMap<>();
+        }
+        PmsSkuStockExample example = new PmsSkuStockExample();
+        example.createCriteria().andIdIn(skuIds);
+        List<PmsSkuStock> skuStockList = skuStockMapper.selectByExample(example);
+        if (CollectionUtils.isEmpty(skuStockList)) {
+            return new HashMap<>();
+        }
+        return skuStockList.stream().collect(Collectors.toMap(PmsSkuStock::getId, skuStock -> skuStock));
+    }
 }

+ 142 - 0
mec-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/wrapper/PmsProductSkuStockRecordWrapper.java

@@ -0,0 +1,142 @@
+package com.yonge.cooleshow.admin.wrapper;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.format.DateTimeFormat;
+import com.alibaba.excel.annotation.format.NumberFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class PmsProductSkuStockRecordWrapper {
+
+
+    @Data
+    @ApiModel("PmsProductSkuStockRecordQuery-商品库存入库记录")
+    public static class PmsProductSkuStockRecordQuery {
+
+        @ApiModelProperty("当前页")
+        private Integer pageNum =1;
+
+        @ApiModelProperty("分页行数")
+        private Integer pageSize =10;
+
+        @ApiModelProperty(value = "商品ID",required = true)
+        @NotNull(message = "商品ID不能为空")
+        private Long productId;
+
+        @ApiModelProperty("批次号")
+        private String id;
+
+        @ApiModelProperty("备查货号")
+        private String selectProductSn;
+
+        @ApiModelProperty("入库开始时间")
+        private Date startTime;
+
+        @ApiModelProperty("入库结束时间")
+        private Date endTime;
+
+    }
+
+
+
+    @Data
+    @ApiModel("PmsProductSkuStockRecord-商品库存入库记录")
+    public static class PmsProductSkuStockRecord {
+        /**
+         * id,批次号
+         */
+        @ApiModelProperty("批次号")
+
+        @ExcelProperty(value = "批次号",order = 1)
+        private Long id;
+
+        /**
+         * 商品ID
+         */
+        @ApiModelProperty("商品ID")
+        @NotNull(message = "商品ID不能为空")
+        @ExcelIgnore
+        private Long productId;
+
+        /**
+         * 商品skuId
+         */
+        @ApiModelProperty("商品skuId")
+        @NotNull(message = "商品skuId不能为空")
+        @ExcelIgnore
+        private Long productSkuId;
+
+
+        /**
+         * 商品skuId
+         */
+        @ApiModelProperty("商品sku编号")
+        @ExcelProperty(value = "sku编号",order = 3)
+        private String productSkuCode;
+
+        /**
+         * 备查货号
+         */
+        @ApiModelProperty("备查货号")
+        @NotNull(message = "备查货号不能为空")
+        @ExcelProperty(value = "备查货号",order = 2)
+        private String selectProductSn;
+
+        /**
+         * 内部库存
+         */
+        @ApiModelProperty("内部库存")
+        @NotNull(message = "内部库存不能为空")
+        @ExcelProperty(value = "内部库存",order = 4)
+        private Integer internalStock;
+
+        /**
+         * 内部销售库存
+         */
+        @ApiModelProperty("内部销售库存")
+        @ExcelProperty(value = "内部销售库存",order = 5)
+        private Integer internalSaleStock;
+
+        /**
+         * 税务库存
+         */
+        @ApiModelProperty("税务库存")
+        @NotNull(message = "税务库存不能为空")
+        @ExcelProperty(value = "税务库存",order = 6)
+        private Integer taxStock;
+
+        /**
+         * 税务库存
+         */
+        @ApiModelProperty("税务销售库存")
+        @ExcelProperty(value = "税务销售库存",order = 7)
+        private Integer taxSaleStock;
+
+        /**
+         * 采购价
+         */
+        @ApiModelProperty("采购价")
+        @NotNull(message = "采购价不能为空")
+        @ExcelProperty(value = "采购价",order = 8)
+//        @NumberFormat("#.##")
+        private BigDecimal price;
+
+
+        /**
+         * 创建时间
+         */
+        @ApiModelProperty("创建时间")
+        @ExcelProperty(value = "创建时间",order = 9)
+        @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
+        private Date createTime;
+
+        @ExcelIgnore
+        private Long createBy;
+    }
+}

+ 31 - 0
mec-mall/mall-admin/src/main/resources/config/mybatis/PmsProductSkuStockRecordDao.xml

@@ -0,0 +1,31 @@
+<?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.yonge.cooleshow.admin.dao.PmsProductSkuStockRecordDao">
+
+    <select id="list"
+            resultType="com.yonge.cooleshow.admin.wrapper.PmsProductSkuStockRecordWrapper$PmsProductSkuStockRecord">
+
+        SELECT
+        distinct t.*
+        FROM pms_product_sku_stock_record t
+        <where>
+            <if test="param.productId != null">
+                AND t.product_id = #{param.productId}
+            </if>
+            <if test="param.id != null and param.id != ''">
+                and t.id like concat('%',#{param.id},'%')
+            </if>
+            <if test="param.selectProductSn != null and param.selectProductSn != ''">
+                and t.select_product_sn like concat('%',#{param.selectProductSn},'%')
+            </if>
+            <if test="param.startTime != null">
+                and t.create_time &gt;= #{param.startTime}
+            </if>
+            <if test="param.endTime != null">
+                and t.create_time &lt;= #{param.endTime}
+            </if>
+
+        </where>
+
+    </select>
+</mapper>

+ 31 - 0
mec-mall/mall-mbg/src/main/java/com/yonge/cooleshow/mbg/mapper/PmsProductSkuStockRecordMapper.java

@@ -0,0 +1,31 @@
+package com.yonge.cooleshow.mbg.mapper;
+
+import java.util.List;
+
+import com.yonge.cooleshow.mbg.model.PmsProductSkuStockRecord;
+import com.yonge.cooleshow.mbg.model.PmsProductSkuStockRecordExample;
+import org.apache.ibatis.annotations.Param;
+
+public interface PmsProductSkuStockRecordMapper {
+    long countByExample(PmsProductSkuStockRecordExample example);
+
+    int deleteByExample(PmsProductSkuStockRecordExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(PmsProductSkuStockRecord record);
+
+    int insertSelective(PmsProductSkuStockRecord record);
+
+    List<PmsProductSkuStockRecord> selectByExample(PmsProductSkuStockRecordExample example);
+
+    PmsProductSkuStockRecord selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") PmsProductSkuStockRecord record, @Param("example") PmsProductSkuStockRecordExample example);
+
+    int updateByExample(@Param("record") PmsProductSkuStockRecord record, @Param("example") PmsProductSkuStockRecordExample example);
+
+    int updateByPrimaryKeySelective(PmsProductSkuStockRecord record);
+
+    int updateByPrimaryKey(PmsProductSkuStockRecord record);
+}

+ 66 - 0
mec-mall/mall-mbg/src/main/java/com/yonge/cooleshow/mbg/model/PmsProductSkuStockRecord.java

@@ -0,0 +1,66 @@
+package com.yonge.cooleshow.mbg.model;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import lombok.Data;
+
+/**
+ * 商品库存入库记录
+ */
+@Data
+public class PmsProductSkuStockRecord {
+    /**
+    * id,批次号
+    */
+    private Long id;
+
+    /**
+    * 商品ID
+    */
+    private Long productId;
+
+    /**
+    * 商品skuId
+    */
+    private Long productSkuId;
+
+    /**
+    * 备查货号
+    */
+    private String selectProductSn;
+
+    /**
+    * 内部库存
+    */
+    private Integer internalStock;
+
+    /**
+    * 内部销售库存
+    */
+    private Integer internalSaleStock;
+
+    /**
+    * 税务库存
+    */
+    private Integer taxStock;
+
+    /**
+    * 税务库存
+    */
+    private Integer taxSaleStock;
+
+    /**
+    * 采购价
+    */
+    private BigDecimal price;
+
+    /**
+    * 创建时间
+    */
+    private Date createTime;
+
+    /**
+    * 创建人
+    */
+    private Long createBy;
+}

+ 872 - 0
mec-mall/mall-mbg/src/main/java/com/yonge/cooleshow/mbg/model/PmsProductSkuStockRecordExample.java

@@ -0,0 +1,872 @@
+package com.yonge.cooleshow.mbg.model;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class PmsProductSkuStockRecordExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public PmsProductSkuStockRecordExample() {
+        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(Long value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Long value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Long value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Long value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Long value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Long> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Long> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Long value1, Long value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Long value1, Long value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductIdIsNull() {
+            addCriterion("product_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductIdIsNotNull() {
+            addCriterion("product_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductIdEqualTo(Long value) {
+            addCriterion("product_id =", value, "productId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductIdNotEqualTo(Long value) {
+            addCriterion("product_id <>", value, "productId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductIdGreaterThan(Long value) {
+            addCriterion("product_id >", value, "productId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("product_id >=", value, "productId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductIdLessThan(Long value) {
+            addCriterion("product_id <", value, "productId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductIdLessThanOrEqualTo(Long value) {
+            addCriterion("product_id <=", value, "productId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductIdIn(List<Long> values) {
+            addCriterion("product_id in", values, "productId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductIdNotIn(List<Long> values) {
+            addCriterion("product_id not in", values, "productId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductIdBetween(Long value1, Long value2) {
+            addCriterion("product_id between", value1, value2, "productId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductIdNotBetween(Long value1, Long value2) {
+            addCriterion("product_id not between", value1, value2, "productId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductSkuIdIsNull() {
+            addCriterion("product_sku_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductSkuIdIsNotNull() {
+            addCriterion("product_sku_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductSkuIdEqualTo(Long value) {
+            addCriterion("product_sku_id =", value, "productSkuId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductSkuIdNotEqualTo(Long value) {
+            addCriterion("product_sku_id <>", value, "productSkuId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductSkuIdGreaterThan(Long value) {
+            addCriterion("product_sku_id >", value, "productSkuId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductSkuIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("product_sku_id >=", value, "productSkuId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductSkuIdLessThan(Long value) {
+            addCriterion("product_sku_id <", value, "productSkuId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductSkuIdLessThanOrEqualTo(Long value) {
+            addCriterion("product_sku_id <=", value, "productSkuId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductSkuIdIn(List<Long> values) {
+            addCriterion("product_sku_id in", values, "productSkuId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductSkuIdNotIn(List<Long> values) {
+            addCriterion("product_sku_id not in", values, "productSkuId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductSkuIdBetween(Long value1, Long value2) {
+            addCriterion("product_sku_id between", value1, value2, "productSkuId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProductSkuIdNotBetween(Long value1, Long value2) {
+            addCriterion("product_sku_id not between", value1, value2, "productSkuId");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectProductSnIsNull() {
+            addCriterion("select_product_sn is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectProductSnIsNotNull() {
+            addCriterion("select_product_sn is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectProductSnEqualTo(String value) {
+            addCriterion("select_product_sn =", value, "selectProductSn");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectProductSnNotEqualTo(String value) {
+            addCriterion("select_product_sn <>", value, "selectProductSn");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectProductSnGreaterThan(String value) {
+            addCriterion("select_product_sn >", value, "selectProductSn");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectProductSnGreaterThanOrEqualTo(String value) {
+            addCriterion("select_product_sn >=", value, "selectProductSn");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectProductSnLessThan(String value) {
+            addCriterion("select_product_sn <", value, "selectProductSn");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectProductSnLessThanOrEqualTo(String value) {
+            addCriterion("select_product_sn <=", value, "selectProductSn");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectProductSnLike(String value) {
+            addCriterion("select_product_sn like", value, "selectProductSn");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectProductSnNotLike(String value) {
+            addCriterion("select_product_sn not like", value, "selectProductSn");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectProductSnIn(List<String> values) {
+            addCriterion("select_product_sn in", values, "selectProductSn");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectProductSnNotIn(List<String> values) {
+            addCriterion("select_product_sn not in", values, "selectProductSn");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectProductSnBetween(String value1, String value2) {
+            addCriterion("select_product_sn between", value1, value2, "selectProductSn");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectProductSnNotBetween(String value1, String value2) {
+            addCriterion("select_product_sn not between", value1, value2, "selectProductSn");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalStockIsNull() {
+            addCriterion("internal_stock is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalStockIsNotNull() {
+            addCriterion("internal_stock is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalStockEqualTo(Integer value) {
+            addCriterion("internal_stock =", value, "internalStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalStockNotEqualTo(Integer value) {
+            addCriterion("internal_stock <>", value, "internalStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalStockGreaterThan(Integer value) {
+            addCriterion("internal_stock >", value, "internalStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalStockGreaterThanOrEqualTo(Integer value) {
+            addCriterion("internal_stock >=", value, "internalStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalStockLessThan(Integer value) {
+            addCriterion("internal_stock <", value, "internalStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalStockLessThanOrEqualTo(Integer value) {
+            addCriterion("internal_stock <=", value, "internalStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalStockIn(List<Integer> values) {
+            addCriterion("internal_stock in", values, "internalStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalStockNotIn(List<Integer> values) {
+            addCriterion("internal_stock not in", values, "internalStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalStockBetween(Integer value1, Integer value2) {
+            addCriterion("internal_stock between", value1, value2, "internalStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalStockNotBetween(Integer value1, Integer value2) {
+            addCriterion("internal_stock not between", value1, value2, "internalStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalSaleStockIsNull() {
+            addCriterion("internal_sale_stock is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalSaleStockIsNotNull() {
+            addCriterion("internal_sale_stock is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalSaleStockEqualTo(Integer value) {
+            addCriterion("internal_sale_stock =", value, "internalSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalSaleStockNotEqualTo(Integer value) {
+            addCriterion("internal_sale_stock <>", value, "internalSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalSaleStockGreaterThan(Integer value) {
+            addCriterion("internal_sale_stock >", value, "internalSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalSaleStockGreaterThanOrEqualTo(Integer value) {
+            addCriterion("internal_sale_stock >=", value, "internalSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalSaleStockLessThan(Integer value) {
+            addCriterion("internal_sale_stock <", value, "internalSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalSaleStockLessThanOrEqualTo(Integer value) {
+            addCriterion("internal_sale_stock <=", value, "internalSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalSaleStockIn(List<Integer> values) {
+            addCriterion("internal_sale_stock in", values, "internalSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalSaleStockNotIn(List<Integer> values) {
+            addCriterion("internal_sale_stock not in", values, "internalSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalSaleStockBetween(Integer value1, Integer value2) {
+            addCriterion("internal_sale_stock between", value1, value2, "internalSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andInternalSaleStockNotBetween(Integer value1, Integer value2) {
+            addCriterion("internal_sale_stock not between", value1, value2, "internalSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxStockIsNull() {
+            addCriterion("tax_stock is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxStockIsNotNull() {
+            addCriterion("tax_stock is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxStockEqualTo(Integer value) {
+            addCriterion("tax_stock =", value, "taxStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxStockNotEqualTo(Integer value) {
+            addCriterion("tax_stock <>", value, "taxStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxStockGreaterThan(Integer value) {
+            addCriterion("tax_stock >", value, "taxStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxStockGreaterThanOrEqualTo(Integer value) {
+            addCriterion("tax_stock >=", value, "taxStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxStockLessThan(Integer value) {
+            addCriterion("tax_stock <", value, "taxStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxStockLessThanOrEqualTo(Integer value) {
+            addCriterion("tax_stock <=", value, "taxStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxStockIn(List<Integer> values) {
+            addCriterion("tax_stock in", values, "taxStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxStockNotIn(List<Integer> values) {
+            addCriterion("tax_stock not in", values, "taxStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxStockBetween(Integer value1, Integer value2) {
+            addCriterion("tax_stock between", value1, value2, "taxStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxStockNotBetween(Integer value1, Integer value2) {
+            addCriterion("tax_stock not between", value1, value2, "taxStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxSaleStockIsNull() {
+            addCriterion("tax_sale_stock is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxSaleStockIsNotNull() {
+            addCriterion("tax_sale_stock is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxSaleStockEqualTo(Integer value) {
+            addCriterion("tax_sale_stock =", value, "taxSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxSaleStockNotEqualTo(Integer value) {
+            addCriterion("tax_sale_stock <>", value, "taxSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxSaleStockGreaterThan(Integer value) {
+            addCriterion("tax_sale_stock >", value, "taxSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxSaleStockGreaterThanOrEqualTo(Integer value) {
+            addCriterion("tax_sale_stock >=", value, "taxSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxSaleStockLessThan(Integer value) {
+            addCriterion("tax_sale_stock <", value, "taxSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxSaleStockLessThanOrEqualTo(Integer value) {
+            addCriterion("tax_sale_stock <=", value, "taxSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxSaleStockIn(List<Integer> values) {
+            addCriterion("tax_sale_stock in", values, "taxSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxSaleStockNotIn(List<Integer> values) {
+            addCriterion("tax_sale_stock not in", values, "taxSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxSaleStockBetween(Integer value1, Integer value2) {
+            addCriterion("tax_sale_stock between", value1, value2, "taxSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaxSaleStockNotBetween(Integer value1, Integer value2) {
+            addCriterion("tax_sale_stock not between", value1, value2, "taxSaleStock");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceIsNull() {
+            addCriterion("price is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceIsNotNull() {
+            addCriterion("price is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceEqualTo(BigDecimal value) {
+            addCriterion("price =", value, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceNotEqualTo(BigDecimal value) {
+            addCriterion("price <>", value, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceGreaterThan(BigDecimal value) {
+            addCriterion("price >", value, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceGreaterThanOrEqualTo(BigDecimal value) {
+            addCriterion("price >=", value, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceLessThan(BigDecimal value) {
+            addCriterion("price <", value, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceLessThanOrEqualTo(BigDecimal value) {
+            addCriterion("price <=", value, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceIn(List<BigDecimal> values) {
+            addCriterion("price in", values, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceNotIn(List<BigDecimal> values) {
+            addCriterion("price not in", values, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceBetween(BigDecimal value1, BigDecimal value2) {
+            addCriterion("price between", value1, value2, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceNotBetween(BigDecimal value1, BigDecimal value2) {
+            addCriterion("price not between", value1, value2, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateByIsNull() {
+            addCriterion("create_by is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateByIsNotNull() {
+            addCriterion("create_by is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateByEqualTo(Long value) {
+            addCriterion("create_by =", value, "createBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateByNotEqualTo(Long value) {
+            addCriterion("create_by <>", value, "createBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateByGreaterThan(Long value) {
+            addCriterion("create_by >", value, "createBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateByGreaterThanOrEqualTo(Long value) {
+            addCriterion("create_by >=", value, "createBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateByLessThan(Long value) {
+            addCriterion("create_by <", value, "createBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateByLessThanOrEqualTo(Long value) {
+            addCriterion("create_by <=", value, "createBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateByIn(List<Long> values) {
+            addCriterion("create_by in", values, "createBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateByNotIn(List<Long> values) {
+            addCriterion("create_by not in", values, "createBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateByBetween(Long value1, Long value2) {
+            addCriterion("create_by between", value1, value2, "createBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateByNotBetween(Long value1, Long value2) {
+            addCriterion("create_by not between", value1, value2, "createBy");
+            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);
+        }
+    }
+}

+ 316 - 0
mec-mall/mall-mbg/src/main/resources/config/mybatis/PmsProductSkuStockRecordMapper.xml

@@ -0,0 +1,316 @@
+<?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.yonge.cooleshow.mbg.mapper.PmsProductSkuStockRecordMapper">
+  <resultMap id="BaseResultMap" type="com.yonge.cooleshow.mbg.model.PmsProductSkuStockRecord">
+    <!--@mbg.generated-->
+    <!--@Table pms_product_sku_stock_record-->
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="product_id" jdbcType="BIGINT" property="productId" />
+    <result column="product_sku_id" jdbcType="BIGINT" property="productSkuId" />
+    <result column="select_product_sn" jdbcType="VARCHAR" property="selectProductSn" />
+    <result column="internal_stock" jdbcType="INTEGER" property="internalStock" />
+    <result column="internal_sale_stock" jdbcType="INTEGER" property="internalSaleStock" />
+    <result column="tax_stock" jdbcType="INTEGER" property="taxStock" />
+    <result column="tax_sale_stock" jdbcType="INTEGER" property="taxSaleStock" />
+    <result column="price" jdbcType="DECIMAL" property="price" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="create_by" jdbcType="BIGINT" property="createBy" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--@mbg.generated-->
+    <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">
+    <!--@mbg.generated-->
+    <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">
+    <!--@mbg.generated-->
+    id, product_id, product_sku_id, select_product_sn, internal_stock, internal_sale_stock, 
+    tax_stock, tax_sale_stock, price, create_time, create_by
+  </sql>
+  <select id="selectByExample" parameterType="com.yonge.cooleshow.mbg.model.PmsProductSkuStockRecordExample" resultMap="BaseResultMap">
+    <!--@mbg.generated-->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from pms_product_sku_stock_record
+    <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.Long" resultMap="BaseResultMap">
+    <!--@mbg.generated-->
+    select 
+    <include refid="Base_Column_List" />
+    from pms_product_sku_stock_record
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    <!--@mbg.generated-->
+    delete from pms_product_sku_stock_record
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.yonge.cooleshow.mbg.model.PmsProductSkuStockRecordExample">
+    <!--@mbg.generated-->
+    delete from pms_product_sku_stock_record
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yonge.cooleshow.mbg.model.PmsProductSkuStockRecord" useGeneratedKeys="true">
+    <!--@mbg.generated-->
+    insert into pms_product_sku_stock_record (product_id, product_sku_id, select_product_sn, 
+      internal_stock, internal_sale_stock, tax_stock, 
+      tax_sale_stock, price, create_time, 
+      create_by)
+    values (#{productId,jdbcType=BIGINT}, #{productSkuId,jdbcType=BIGINT}, #{selectProductSn,jdbcType=VARCHAR}, 
+      #{internalStock,jdbcType=INTEGER}, #{internalSaleStock,jdbcType=INTEGER}, #{taxStock,jdbcType=INTEGER}, 
+      #{taxSaleStock,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{createBy,jdbcType=BIGINT})
+  </insert>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yonge.cooleshow.mbg.model.PmsProductSkuStockRecord" useGeneratedKeys="true">
+    <!--@mbg.generated-->
+    insert into pms_product_sku_stock_record
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="productId != null">
+        product_id,
+      </if>
+      <if test="productSkuId != null">
+        product_sku_id,
+      </if>
+      <if test="selectProductSn != null and selectProductSn != ''">
+        select_product_sn,
+      </if>
+      <if test="internalStock != null">
+        internal_stock,
+      </if>
+      <if test="internalSaleStock != null">
+        internal_sale_stock,
+      </if>
+      <if test="taxStock != null">
+        tax_stock,
+      </if>
+      <if test="taxSaleStock != null">
+        tax_sale_stock,
+      </if>
+      <if test="price != null">
+        price,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="createBy != null">
+        create_by,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="productId != null">
+        #{productId,jdbcType=BIGINT},
+      </if>
+      <if test="productSkuId != null">
+        #{productSkuId,jdbcType=BIGINT},
+      </if>
+      <if test="selectProductSn != null and selectProductSn != ''">
+        #{selectProductSn,jdbcType=VARCHAR},
+      </if>
+      <if test="internalStock != null">
+        #{internalStock,jdbcType=INTEGER},
+      </if>
+      <if test="internalSaleStock != null">
+        #{internalSaleStock,jdbcType=INTEGER},
+      </if>
+      <if test="taxStock != null">
+        #{taxStock,jdbcType=INTEGER},
+      </if>
+      <if test="taxSaleStock != null">
+        #{taxSaleStock,jdbcType=INTEGER},
+      </if>
+      <if test="price != null">
+        #{price,jdbcType=DECIMAL},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createBy != null">
+        #{createBy,jdbcType=BIGINT},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.yonge.cooleshow.mbg.model.PmsProductSkuStockRecordExample" resultType="java.lang.Long">
+    <!--@mbg.generated-->
+    select count(*) from pms_product_sku_stock_record
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--@mbg.generated-->
+    update pms_product_sku_stock_record
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.productId != null">
+        product_id = #{record.productId,jdbcType=BIGINT},
+      </if>
+      <if test="record.productSkuId != null">
+        product_sku_id = #{record.productSkuId,jdbcType=BIGINT},
+      </if>
+      <if test="record.selectProductSn != null">
+        select_product_sn = #{record.selectProductSn,jdbcType=VARCHAR},
+      </if>
+      <if test="record.internalStock != null">
+        internal_stock = #{record.internalStock,jdbcType=INTEGER},
+      </if>
+      <if test="record.internalSaleStock != null">
+        internal_sale_stock = #{record.internalSaleStock,jdbcType=INTEGER},
+      </if>
+      <if test="record.taxStock != null">
+        tax_stock = #{record.taxStock,jdbcType=INTEGER},
+      </if>
+      <if test="record.taxSaleStock != null">
+        tax_sale_stock = #{record.taxSaleStock,jdbcType=INTEGER},
+      </if>
+      <if test="record.price != null">
+        price = #{record.price,jdbcType=DECIMAL},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.createBy != null">
+        create_by = #{record.createBy,jdbcType=BIGINT},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--@mbg.generated-->
+    update pms_product_sku_stock_record
+    set id = #{record.id,jdbcType=BIGINT},
+      product_id = #{record.productId,jdbcType=BIGINT},
+      product_sku_id = #{record.productSkuId,jdbcType=BIGINT},
+      select_product_sn = #{record.selectProductSn,jdbcType=VARCHAR},
+      internal_stock = #{record.internalStock,jdbcType=INTEGER},
+      internal_sale_stock = #{record.internalSaleStock,jdbcType=INTEGER},
+      tax_stock = #{record.taxStock,jdbcType=INTEGER},
+      tax_sale_stock = #{record.taxSaleStock,jdbcType=INTEGER},
+      price = #{record.price,jdbcType=DECIMAL},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      create_by = #{record.createBy,jdbcType=BIGINT}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.yonge.cooleshow.mbg.model.PmsProductSkuStockRecord">
+    <!--@mbg.generated-->
+    update pms_product_sku_stock_record
+    <set>
+      <if test="productId != null">
+        product_id = #{productId,jdbcType=BIGINT},
+      </if>
+      <if test="productSkuId != null">
+        product_sku_id = #{productSkuId,jdbcType=BIGINT},
+      </if>
+      <if test="selectProductSn != null and selectProductSn != ''">
+        select_product_sn = #{selectProductSn,jdbcType=VARCHAR},
+      </if>
+      <if test="internalStock != null">
+        internal_stock = #{internalStock,jdbcType=INTEGER},
+      </if>
+      <if test="internalSaleStock != null">
+        internal_sale_stock = #{internalSaleStock,jdbcType=INTEGER},
+      </if>
+      <if test="taxStock != null">
+        tax_stock = #{taxStock,jdbcType=INTEGER},
+      </if>
+      <if test="taxSaleStock != null">
+        tax_sale_stock = #{taxSaleStock,jdbcType=INTEGER},
+      </if>
+      <if test="price != null">
+        price = #{price,jdbcType=DECIMAL},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createBy != null">
+        create_by = #{createBy,jdbcType=BIGINT},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.yonge.cooleshow.mbg.model.PmsProductSkuStockRecord">
+    <!--@mbg.generated-->
+    update pms_product_sku_stock_record
+    set product_id = #{productId,jdbcType=BIGINT},
+      product_sku_id = #{productSkuId,jdbcType=BIGINT},
+      select_product_sn = #{selectProductSn,jdbcType=VARCHAR},
+      internal_stock = #{internalStock,jdbcType=INTEGER},
+      internal_sale_stock = #{internalSaleStock,jdbcType=INTEGER},
+      tax_stock = #{taxStock,jdbcType=INTEGER},
+      tax_sale_stock = #{taxSaleStock,jdbcType=INTEGER},
+      price = #{price,jdbcType=DECIMAL},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      create_by = #{createBy,jdbcType=BIGINT}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>