Commit 40db8101 authored by shiyu's avatar shiyu

上传商品sku

parent 84f93740
......@@ -129,7 +129,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/admin/sysFinance/**", "anon");
filterChainDefinitionMap.put("/admin/groupPurchase/**", "anon");
filterChainDefinitionMap.put("/admin/invitationCode/**", "anon");
filterChainDefinitionMap.put("/admin/itemSku/**", "anon");
filterChainDefinitionMap.put("/admin/invitationCode/**", "anon");
filterChainDefinitionMap.put("/admin/**", "anon");
......
package com.wwdz.ch.admin.controller;
import com.alibaba.fastjson.JSON;
import com.wwdz.ch.admin.service.SysItemSkuService;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.distribution.ItemSkuRequestDto;
import com.xxdxxs.service.FormHandler;
import com.xxdxxs.validation.Validator;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/admin/itemSku")
public class SysItemSkuController {
private static final Logger logger = LoggerFactory.getLogger(SysItemSkuController.class);
@Autowired
SysItemSkuService sysItemSkuService;
@ApiOperation(value = "上传商品sku")
@PostMapping("/create")
public Result create(@RequestBody ItemSkuRequestDto dto) {
logger.info("上传商品sku, 请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("itemId", "商品id").must().number()
.set("name", "名称").must().string()
.end();
if (!validator.isValid()) {
return Result.failed(validator.getErrorInfo());
}
return sysItemSkuService.create(dto);
}
}
package com.wwdz.ch.admin.impl;
import com.wwdz.ch.admin.service.SysItemSkuService;
import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.consts.MediaTypeEnum;
import com.wwdz.ch.core.storage.QiniuStorage;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.MediaUtil;
import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.core.util.UUID;
import com.wwdz.ch.db.dao.distribution.ItemSkuDao;
import com.wwdz.ch.db.domain.distribution.ItemSku;
import com.wwdz.ch.db.dto.request.distribution.ItemSkuRequestDto;
import com.xxdxxs.utils.CommonUtils;
import com.xxdxxs.utils.EntityMapper;
import com.xxdxxs.utils.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Arrays;
import java.util.Date;
@Service
public class SysItemSkuServiceImpl implements SysItemSkuService {
private static final Logger logger = LoggerFactory.getLogger(SysItemSkuServiceImpl.class);
@Autowired
ItemSkuDao itemSkuDao;
@Autowired
QiniuStorage qiniuStorage;
@Override
public Result create(ItemSkuRequestDto dto) {
try {
ItemSku itemSku = new ItemSku();
EntityMapper.copyAttribute(dto, itemSku);
itemSku.setSkuCode(UUID.fastUUID().toString(true));
itemSku.setPrice(PriceUtil.convertPriceFromStr(StringUtils.isEmpty(dto.getPrice())?"0":dto.getPrice()));
itemSku.setImages(dto.getImages());
if (StringUtils.hasLength(dto.getVideos())) {
itemSku.setVideos(getVideosImage(dto.getVideos()));
}
Date now = new Date();
itemSku.setCreateTime(now);
itemSku.setUpdateTime(now);
itemSku.setIsDeleted(false);
itemSkuDao.insert(itemSku);
return Result.success();
} catch (Exception e) {
logger.error("上传商品sku error : {}", e);
}
return Result.failed();
}
private String getVideosImage(String videos) {
String video = "";
String[] images = videos.split(";");
StringBuffer stringBuffer = new StringBuffer();
Arrays.stream(images).forEach(image -> {
if (stringBuffer.length() != 0) {
stringBuffer.append(";");
}
try {
String cutImage = MediaUtil.getImageByCutVedio(image);
logger.info(">>>>>> 截取视频第一帧图片url = {} <<<<<<<", cutImage);
URL url = new URL(cutImage);
InputStream inputStream = url.openStream();
BufferedImage bufferedImage = ImageIO.read(inputStream);
String keyName = CommConsts.UPLOAD_PRE_DIRECTORY + CommonUtils.getUUID() + "_" + bufferedImage.getWidth() + "x" + bufferedImage.getHeight() + "." + MediaTypeEnum.IMAGE_JPG.getExt();
InputStream imageStream = bufferedImageToInputStream(bufferedImage, MediaTypeEnum.IMAGE_JPG.getExt());
qiniuStorage.store(imageStream, 1, MediaTypeEnum.IMAGE_JPG.getMime(), keyName);
String urlOfSize = qiniuStorage.generateUrl(keyName);
stringBuffer.append(image).append(",").append(urlOfSize);
} catch (Exception e) {
stringBuffer.append(image);
logger.error("视频图片上传失败", e);
}
});
video = stringBuffer.toString();
return video;
}
/**
* 将BufferedImage转换为InputStream
*
* @param image 数据源
* @param type 图片格式
* @return
*/
private static InputStream bufferedImageToInputStream(BufferedImage image, String type) {
try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
ImageIO.write(image, type, os);
return new ByteArrayInputStream(os.toByteArray());
} catch (IOException e) {
logger.error("bufferedImageToInputStream 出错,原因: {}", e);
}
return null;
}
}
package com.wwdz.ch.admin.service;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.distribution.ItemSkuRequestDto;
public interface SysItemSkuService {
/**
* 上传商品sku
* @param dto
* @return
*/
Result create(ItemSkuRequestDto dto);
}
......@@ -231,6 +231,9 @@ public class MediaUtil {
return sb.toString();
}
public static void main(String[] args) {
String vedioUrl = "https://cdn.wanwudezhi.com/quanku/video/12d8a09d5ff14ec1af6604c3814c614a.mp4";
String url = getImageByCutVedio(vedioUrl);
......@@ -238,4 +241,7 @@ public class MediaUtil {
ImageInfo imageInfo = getImageSize(url);
System.out.println(imageInfo.formartString());
}
}
......@@ -52,4 +52,15 @@ public class StringUtil {
return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null;
}
/**
* 创建sku编码
* 商品id
* @return
*/
public static String createSkuCode(long itemId) {
/* String categoryIdStr = String.format("%03d", );
String skuCode = itemId + categoryIdStr + numStr;*/
return null;
}
}
package com.wwdz.ch.db.dao.distribution;
import com.wwdz.ch.db.domain.distribution.ItemSku;
import java.util.List;
public interface ItemSkuDao {
boolean insert(ItemSku itemSku);
List<ItemSku> findByItemId(long itemId);
boolean update(ItemSku itemSku);
}
package com.wwdz.ch.db.domain.distribution;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
* @author shiyu
* @date 2024/11/13
*/
@Data
public class ItemSku implements Entity {
private Long id;
/**
* sku编码
*/
private String skuCode;
/**
* 名称
*/
private String name;
/**
* 商品id
*/
private Long itemId;
/**
* 默认图
*/
private String defaultImage;
/**
* 价格
*/
private Long price;
/**
* 删除标识
*/
private Boolean isDeleted;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 图片
*/
private String images;
/**
* 视频
*/
private String videos;
/**
* 描述
*/
private String description;
private static final long serialVersionUID = 1L;
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", skuCode=").append(skuCode);
sb.append(", name=").append(name);
sb.append(", itemId=").append(itemId);
sb.append(", defaultImage=").append(defaultImage);
sb.append(", price=").append(price);
sb.append(", isDeleted=").append(isDeleted);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", images=").append(images);
sb.append(", videos=").append(videos);
sb.append(", description=").append(description);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
ItemSku other = (ItemSku) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getSkuCode() == null ? other.getSkuCode() == null : this.getSkuCode().equals(other.getSkuCode()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getItemId() == null ? other.getItemId() == null : this.getItemId().equals(other.getItemId()))
&& (this.getDefaultImage() == null ? other.getDefaultImage() == null : this.getDefaultImage().equals(other.getDefaultImage()))
&& (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
&& (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getImages() == null ? other.getImages() == null : this.getImages().equals(other.getImages()))
&& (this.getVideos() == null ? other.getVideos() == null : this.getVideos().equals(other.getVideos()))
&& (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getSkuCode() == null) ? 0 : getSkuCode().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getItemId() == null) ? 0 : getItemId().hashCode());
result = prime * result + ((getDefaultImage() == null) ? 0 : getDefaultImage().hashCode());
result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getImages() == null) ? 0 : getImages().hashCode());
result = prime * result + ((getVideos() == null) ? 0 : getVideos().hashCode());
result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "BIGINT", false),
skuCode("sku_code", "skuCode", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
itemId("item_id", "itemId", "BIGINT", false),
defaultImage("default_image", "defaultImage", "VARCHAR", false),
price("price", "price", "BIGINT", false),
isDeleted("is_deleted", "isDeleted", "BIT", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false),
images("images", "images", "LONGVARCHAR", false),
videos("videos", "videos", "LONGVARCHAR", false),
description("description", "description", "LONGVARCHAR", false);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String BEGINNING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String ENDING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String column;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final boolean isColumnNameDelimited;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String javaProperty;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String jdbcType;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String value() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getValue() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJavaProperty() {
return this.javaProperty;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJdbcType() {
return this.jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
}
}
\ No newline at end of file
package com.wwdz.ch.db.domain.distribution;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class ItemSkuExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public ItemSkuExample() {
oredCriteria = new ArrayList<Criteria>();
}
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;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public ItemSkuExample orderBy(String orderByClause) {
this.setOrderByClause(orderByClause);
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public ItemSkuExample orderBy(String ... orderByClauses) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < orderByClauses.length; i++) {
sb.append(orderByClauses[i]);
if (i < orderByClauses.length - 1) {
sb.append(" , ");
}
}
this.setOrderByClause(sb.toString());
return this;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria(this);
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Criteria newAndCreateCriteria() {
ItemSkuExample example = new ItemSkuExample();
return example.createCriteria();
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
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;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdNotEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString());
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 andSkuCodeIsNull() {
addCriterion("sku_code is null");
return (Criteria) this;
}
public Criteria andSkuCodeIsNotNull() {
addCriterion("sku_code is not null");
return (Criteria) this;
}
public Criteria andSkuCodeEqualTo(String value) {
addCriterion("sku_code =", value, "skuCode");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSkuCodeEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("sku_code = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSkuCodeNotEqualTo(String value) {
addCriterion("sku_code <>", value, "skuCode");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSkuCodeNotEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("sku_code <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSkuCodeGreaterThan(String value) {
addCriterion("sku_code >", value, "skuCode");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSkuCodeGreaterThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("sku_code > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSkuCodeGreaterThanOrEqualTo(String value) {
addCriterion("sku_code >=", value, "skuCode");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSkuCodeGreaterThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("sku_code >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSkuCodeLessThan(String value) {
addCriterion("sku_code <", value, "skuCode");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSkuCodeLessThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("sku_code < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSkuCodeLessThanOrEqualTo(String value) {
addCriterion("sku_code <=", value, "skuCode");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSkuCodeLessThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("sku_code <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSkuCodeLike(String value) {
addCriterion("sku_code like", value, "skuCode");
return (Criteria) this;
}
public Criteria andSkuCodeNotLike(String value) {
addCriterion("sku_code not like", value, "skuCode");
return (Criteria) this;
}
public Criteria andSkuCodeIn(List<String> values) {
addCriterion("sku_code in", values, "skuCode");
return (Criteria) this;
}
public Criteria andSkuCodeNotIn(List<String> values) {
addCriterion("sku_code not in", values, "skuCode");
return (Criteria) this;
}
public Criteria andSkuCodeBetween(String value1, String value2) {
addCriterion("sku_code between", value1, value2, "skuCode");
return (Criteria) this;
}
public Criteria andSkuCodeNotBetween(String value1, String value2) {
addCriterion("sku_code not between", value1, value2, "skuCode");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andNameEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("`name` = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andNameNotEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("`name` <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andNameGreaterThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("`name` > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andNameGreaterThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("`name` >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andNameLessThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("`name` < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andNameLessThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("`name` <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andItemIdIsNull() {
addCriterion("item_id is null");
return (Criteria) this;
}
public Criteria andItemIdIsNotNull() {
addCriterion("item_id is not null");
return (Criteria) this;
}
public Criteria andItemIdEqualTo(Long value) {
addCriterion("item_id =", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("item_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdNotEqualTo(Long value) {
addCriterion("item_id <>", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdNotEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("item_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdGreaterThan(Long value) {
addCriterion("item_id >", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdGreaterThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("item_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdGreaterThanOrEqualTo(Long value) {
addCriterion("item_id >=", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdGreaterThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("item_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdLessThan(Long value) {
addCriterion("item_id <", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdLessThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("item_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdLessThanOrEqualTo(Long value) {
addCriterion("item_id <=", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdLessThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("item_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdIn(List<Long> values) {
addCriterion("item_id in", values, "itemId");
return (Criteria) this;
}
public Criteria andItemIdNotIn(List<Long> values) {
addCriterion("item_id not in", values, "itemId");
return (Criteria) this;
}
public Criteria andItemIdBetween(Long value1, Long value2) {
addCriterion("item_id between", value1, value2, "itemId");
return (Criteria) this;
}
public Criteria andItemIdNotBetween(Long value1, Long value2) {
addCriterion("item_id not between", value1, value2, "itemId");
return (Criteria) this;
}
public Criteria andDefaultImageIsNull() {
addCriterion("default_image is null");
return (Criteria) this;
}
public Criteria andDefaultImageIsNotNull() {
addCriterion("default_image is not null");
return (Criteria) this;
}
public Criteria andDefaultImageEqualTo(String value) {
addCriterion("default_image =", value, "defaultImage");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDefaultImageEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("default_image = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDefaultImageNotEqualTo(String value) {
addCriterion("default_image <>", value, "defaultImage");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDefaultImageNotEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("default_image <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDefaultImageGreaterThan(String value) {
addCriterion("default_image >", value, "defaultImage");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDefaultImageGreaterThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("default_image > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDefaultImageGreaterThanOrEqualTo(String value) {
addCriterion("default_image >=", value, "defaultImage");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDefaultImageGreaterThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("default_image >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDefaultImageLessThan(String value) {
addCriterion("default_image <", value, "defaultImage");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDefaultImageLessThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("default_image < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDefaultImageLessThanOrEqualTo(String value) {
addCriterion("default_image <=", value, "defaultImage");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andDefaultImageLessThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("default_image <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andDefaultImageLike(String value) {
addCriterion("default_image like", value, "defaultImage");
return (Criteria) this;
}
public Criteria andDefaultImageNotLike(String value) {
addCriterion("default_image not like", value, "defaultImage");
return (Criteria) this;
}
public Criteria andDefaultImageIn(List<String> values) {
addCriterion("default_image in", values, "defaultImage");
return (Criteria) this;
}
public Criteria andDefaultImageNotIn(List<String> values) {
addCriterion("default_image not in", values, "defaultImage");
return (Criteria) this;
}
public Criteria andDefaultImageBetween(String value1, String value2) {
addCriterion("default_image between", value1, value2, "defaultImage");
return (Criteria) this;
}
public Criteria andDefaultImageNotBetween(String value1, String value2) {
addCriterion("default_image not between", value1, value2, "defaultImage");
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(Long value) {
addCriterion("price =", value, "price");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPriceEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("price = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPriceNotEqualTo(Long value) {
addCriterion("price <>", value, "price");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPriceNotEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("price <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPriceGreaterThan(Long value) {
addCriterion("price >", value, "price");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPriceGreaterThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("price > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPriceGreaterThanOrEqualTo(Long value) {
addCriterion("price >=", value, "price");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPriceGreaterThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("price >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPriceLessThan(Long value) {
addCriterion("price <", value, "price");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPriceLessThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("price < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPriceLessThanOrEqualTo(Long value) {
addCriterion("price <=", value, "price");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andPriceLessThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("price <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andPriceIn(List<Long> values) {
addCriterion("price in", values, "price");
return (Criteria) this;
}
public Criteria andPriceNotIn(List<Long> values) {
addCriterion("price not in", values, "price");
return (Criteria) this;
}
public Criteria andPriceBetween(Long value1, Long value2) {
addCriterion("price between", value1, value2, "price");
return (Criteria) this;
}
public Criteria andPriceNotBetween(Long value1, Long value2) {
addCriterion("price not between", value1, value2, "price");
return (Criteria) this;
}
public Criteria andIsDeletedIsNull() {
addCriterion("is_deleted is null");
return (Criteria) this;
}
public Criteria andIsDeletedIsNotNull() {
addCriterion("is_deleted is not null");
return (Criteria) this;
}
public Criteria andIsDeletedEqualTo(Boolean value) {
addCriterion("is_deleted =", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("is_deleted = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedNotEqualTo(Boolean value) {
addCriterion("is_deleted <>", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedNotEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("is_deleted <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedGreaterThan(Boolean value) {
addCriterion("is_deleted >", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedGreaterThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("is_deleted > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedGreaterThanOrEqualTo(Boolean value) {
addCriterion("is_deleted >=", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedGreaterThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("is_deleted >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedLessThan(Boolean value) {
addCriterion("is_deleted <", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedLessThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("is_deleted < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedLessThanOrEqualTo(Boolean value) {
addCriterion("is_deleted <=", value, "isDeleted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsDeletedLessThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("is_deleted <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsDeletedIn(List<Boolean> values) {
addCriterion("is_deleted in", values, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedNotIn(List<Boolean> values) {
addCriterion("is_deleted not in", values, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedBetween(Boolean value1, Boolean value2) {
addCriterion("is_deleted between", value1, value2, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedNotBetween(Boolean value1, Boolean value2) {
addCriterion("is_deleted not between", value1, value2, "isDeleted");
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;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("create_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeNotEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("create_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("create_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("create_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("create_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("create_time <= ").append(column.getEscapedColumnName()).toString());
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 andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("update_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeNotEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("update_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("update_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("update_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("update_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanOrEqualToColumn(ItemSku.Column column) {
addCriterion(new StringBuilder("update_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private ItemSkuExample example;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
protected Criteria(ItemSkuExample example) {
super();
this.example = example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public ItemSkuExample example() {
return this.example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIf(boolean ifAdd, ICriteriaAdd add) {
if (ifAdd) {
add.add(this);
}
return this;
}
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public interface ICriteriaAdd {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Criteria add(Criteria add);
}
}
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);
}
}
}
\ No newline at end of file
package com.wwdz.ch.db.dto.request.distribution;
import com.wwdz.ch.db.dto.request.BaseRequestDto;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class ItemSkuRequestDto extends BaseRequestDto implements Entity {
private Long id;
/**
* sku编码
*/
private String skuCode;
/**
* 名称
*/
private String name;
/**
* 商品id
*/
private Long itemId;
/**
* 默认图
*/
private String defaultImage;
/**
* 价格,单位元
*/
private String price;
/**
* 删除标识
*/
private Boolean isDeleted;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 图片
*/
private String images;
/**
* 视频
*/
private String videos;
/**
* 描述
*/
private String description;
}
package com.wwdz.ch.db.impl.distribution;
import com.wwdz.ch.db.dao.distribution.ItemSkuDao;
import com.wwdz.ch.db.domain.distribution.ItemSku;
import com.wwdz.ch.db.domain.distribution.ItemSkuExample;
import com.wwdz.ch.db.mapper.distribution.ItemSkuMapper;
import com.xxdxxs.db.component.JdbcHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class ItemSkuDaoImpl implements ItemSkuDao {
@Autowired
ItemSkuMapper itemSkuMapper;
@Override
public boolean insert(ItemSku itemSku) {
return itemSkuMapper.insert(itemSku) > 0;
}
@Override
public List<ItemSku> findByItemId(long itemId) {
ItemSkuExample example = new ItemSkuExample();
ItemSkuExample.Criteria criteria = example.createCriteria();
criteria.andItemIdEqualTo(itemId);
example.setOrderByClause("create_time desc");
return itemSkuMapper.selectByExample(example);
}
@Override
public boolean update(ItemSku itemSku) {
ItemSkuExample example = new ItemSkuExample();
ItemSkuExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(itemSku.getItemId(), criteria :: andItemIdEqualTo);
JdbcHelper.ifPresent(itemSku.getSkuCode(), criteria :: andSkuCodeEqualTo);
return itemSkuMapper.updateByExampleSelective(itemSku, example) > 0;
}
}
package com.wwdz.ch.db.mapper.distribution;
import com.wwdz.ch.db.domain.distribution.ItemSku;
import com.wwdz.ch.db.domain.distribution.ItemSkuExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface ItemSkuMapper {
long countByExample(ItemSkuExample example);
int deleteByExample(ItemSkuExample example);
int deleteByPrimaryKey(Long id);
int insert(ItemSku record);
int insertSelective(ItemSku record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ItemSku selectOneByExample(ItemSkuExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ItemSku selectOneByExampleSelective(@Param("example") ItemSkuExample example, @Param("selective") ItemSku.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ItemSku selectOneByExampleWithBLOBs(ItemSkuExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<ItemSku> selectByExampleSelective(@Param("example") ItemSkuExample example, @Param("selective") ItemSku.Column ... selective);
List<ItemSku> selectByExampleWithBLOBs(ItemSkuExample example);
List<ItemSku> selectByExample(ItemSkuExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item_sku
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ItemSku selectByPrimaryKeySelective(@Param("id") Long id, @Param("selective") ItemSku.Column ... selective);
ItemSku selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") ItemSku record, @Param("example") ItemSkuExample example);
int updateByExampleWithBLOBs(@Param("record") ItemSku record, @Param("example") ItemSkuExample example);
int updateByExample(@Param("record") ItemSku record, @Param("example") ItemSkuExample example);
int updateByPrimaryKeySelective(ItemSku record);
int updateByPrimaryKeyWithBLOBs(ItemSku record);
int updateByPrimaryKey(ItemSku record);
}
\ No newline at end of file
<?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.wwdz.ch.db.mapper.distribution.ItemSkuMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.distribution.ItemSku">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="sku_code" jdbcType="VARCHAR" property="skuCode" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="item_id" jdbcType="BIGINT" property="itemId" />
<result column="default_image" jdbcType="VARCHAR" property="defaultImage" />
<result column="price" jdbcType="BIGINT" property="price" />
<result column="is_deleted" jdbcType="BIT" property="isDeleted" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.wwdz.ch.db.domain.distribution.ItemSku">
<result column="images" jdbcType="LONGVARCHAR" property="images" />
<result column="videos" jdbcType="LONGVARCHAR" property="videos" />
<result column="description" jdbcType="LONGVARCHAR" property="description" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, sku_code, `name`, item_id, default_image, price, is_deleted, create_time, update_time
</sql>
<sql id="Blob_Column_List">
images, videos, description
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.wwdz.ch.db.domain.distribution.ItemSkuExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from item_sku
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.ItemSkuExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from item_sku
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExampleSelective" parameterType="map" resultMap="ResultMapWithBLOBs">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<if test="example.distinct">
distinct
</if>
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, sku_code, `name`, item_id, default_image, price, is_deleted, create_time, update_time,
images, videos, description
</otherwise>
</choose>
from item_sku
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from item_sku
where id = #{id,jdbcType=BIGINT}
</select>
<select id="selectByPrimaryKeySelective" parameterType="map" resultMap="ResultMapWithBLOBs">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, sku_code, `name`, item_id, default_image, price, is_deleted, create_time, update_time,
images, videos, description
</otherwise>
</choose>
from item_sku
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from item_sku
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.wwdz.ch.db.domain.distribution.ItemSkuExample">
delete from item_sku
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.distribution.ItemSku">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into item_sku (sku_code, `name`, item_id,
default_image, price, is_deleted,
create_time, update_time, images,
videos, description)
values (#{skuCode,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{itemId,jdbcType=BIGINT},
#{defaultImage,jdbcType=VARCHAR}, #{price,jdbcType=BIGINT}, #{isDeleted,jdbcType=BIT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{images,jdbcType=LONGVARCHAR},
#{videos,jdbcType=LONGVARCHAR}, #{description,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.ItemSku">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into item_sku
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="skuCode != null">
sku_code,
</if>
<if test="name != null">
`name`,
</if>
<if test="itemId != null">
item_id,
</if>
<if test="defaultImage != null">
default_image,
</if>
<if test="price != null">
price,
</if>
<if test="isDeleted != null">
is_deleted,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="images != null">
images,
</if>
<if test="videos != null">
videos,
</if>
<if test="description != null">
description,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="skuCode != null">
#{skuCode,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="itemId != null">
#{itemId,jdbcType=BIGINT},
</if>
<if test="defaultImage != null">
#{defaultImage,jdbcType=VARCHAR},
</if>
<if test="price != null">
#{price,jdbcType=BIGINT},
</if>
<if test="isDeleted != null">
#{isDeleted,jdbcType=BIT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="images != null">
#{images,jdbcType=LONGVARCHAR},
</if>
<if test="videos != null">
#{videos,jdbcType=LONGVARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.distribution.ItemSkuExample" resultType="java.lang.Long">
select count(*) from item_sku
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update item_sku
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.skuCode != null">
sku_code = #{record.skuCode,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.itemId != null">
item_id = #{record.itemId,jdbcType=BIGINT},
</if>
<if test="record.defaultImage != null">
default_image = #{record.defaultImage,jdbcType=VARCHAR},
</if>
<if test="record.price != null">
price = #{record.price,jdbcType=BIGINT},
</if>
<if test="record.isDeleted != null">
is_deleted = #{record.isDeleted,jdbcType=BIT},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.images != null">
images = #{record.images,jdbcType=LONGVARCHAR},
</if>
<if test="record.videos != null">
videos = #{record.videos,jdbcType=LONGVARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update item_sku
set id = #{record.id,jdbcType=BIGINT},
sku_code = #{record.skuCode,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
item_id = #{record.itemId,jdbcType=BIGINT},
default_image = #{record.defaultImage,jdbcType=VARCHAR},
price = #{record.price,jdbcType=BIGINT},
is_deleted = #{record.isDeleted,jdbcType=BIT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
images = #{record.images,jdbcType=LONGVARCHAR},
videos = #{record.videos,jdbcType=LONGVARCHAR},
description = #{record.description,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update item_sku
set id = #{record.id,jdbcType=BIGINT},
sku_code = #{record.skuCode,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
item_id = #{record.itemId,jdbcType=BIGINT},
default_image = #{record.defaultImage,jdbcType=VARCHAR},
price = #{record.price,jdbcType=BIGINT},
is_deleted = #{record.isDeleted,jdbcType=BIT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.distribution.ItemSku">
update item_sku
<set>
<if test="skuCode != null">
sku_code = #{skuCode,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="itemId != null">
item_id = #{itemId,jdbcType=BIGINT},
</if>
<if test="defaultImage != null">
default_image = #{defaultImage,jdbcType=VARCHAR},
</if>
<if test="price != null">
price = #{price,jdbcType=BIGINT},
</if>
<if test="isDeleted != null">
is_deleted = #{isDeleted,jdbcType=BIT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="images != null">
images = #{images,jdbcType=LONGVARCHAR},
</if>
<if test="videos != null">
videos = #{videos,jdbcType=LONGVARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.wwdz.ch.db.domain.distribution.ItemSku">
update item_sku
set sku_code = #{skuCode,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
item_id = #{itemId,jdbcType=BIGINT},
default_image = #{defaultImage,jdbcType=VARCHAR},
price = #{price,jdbcType=BIGINT},
is_deleted = #{isDeleted,jdbcType=BIT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
images = #{images,jdbcType=LONGVARCHAR},
videos = #{videos,jdbcType=LONGVARCHAR},
description = #{description,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.distribution.ItemSku">
update item_sku
set sku_code = #{skuCode,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
item_id = #{itemId,jdbcType=BIGINT},
default_image = #{defaultImage,jdbcType=VARCHAR},
price = #{price,jdbcType=BIGINT},
is_deleted = #{isDeleted,jdbcType=BIT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.distribution.ItemSkuExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<include refid="Base_Column_List" />
from item_sku
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
limit 1
</select>
<select id="selectOneByExampleWithBLOBs" parameterType="com.wwdz.ch.db.domain.distribution.ItemSkuExample" resultMap="ResultMapWithBLOBs">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from item_sku
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
limit 1
</select>
<select id="selectOneByExampleSelective" parameterType="map" resultMap="ResultMapWithBLOBs">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, sku_code, `name`, item_id, default_image, price, is_deleted, create_time, update_time,
images, videos, description
</otherwise>
</choose>
from item_sku
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
limit 1
</select>
</mapper>
\ No newline at end of file
Markdown is supported
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