Commit 303d8f91 authored by shiyu's avatar shiyu

es config

parent 421dc45b
package com.wwdz.ch.admin.controller;
import com.alibaba.fastjson.JSONObject;
import com.wwdz.ch.admin.annotation.RequiresPermissionsDesc;
import com.wwdz.ch.admin.entity.vo.CategoryVo;
import com.wwdz.ch.admin.entity.vo.CoinVo;
import com.wwdz.ch.admin.service.CoinService;
import com.wwdz.ch.admin.util.AuthSupport;
import com.wwdz.ch.core.type.ListResult;
import com.wwdz.ch.core.type.SimpleResult;
import com.wwdz.ch.db.domain.Category;
import com.wwdz.ch.db.dto.request.CoinRequestDto;
import com.xxdxxs.utils.JsonUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 钱币设置
*/
@RestController
@RequestMapping("/admin/setCoin")
public class SetCoinController {
private static final Logger logger = LoggerFactory.getLogger(SetCoinController.class);
@Autowired
private CoinService coinService;
@RequiresPermissions("admin:setCoin:findDetail")
@RequiresPermissionsDesc(menu = { "钱币列表", "钱币明细" }, button = "查询")
@PostMapping("/findDetail")
public SimpleResult<CoinVo> findDetail(@RequestBody CoinRequestDto coinRequestDto) {
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 钱币列表->钱币明细->查询,请求参数:parma:{}", coinRequestDto);
CoinVo coinVo = coinService.findDetails(coinRequestDto);
logger.info("【请求结束】钱币列表->钱币明细->查询:total:{}", JsonUtils.from(coinVo));
return new SimpleResult<>(coinVo);
}
@RequiresPermissions("admin:setCoin:update")
@RequiresPermissionsDesc(menu = { "钱币列表", "钱币设置" }, button = "更新")
@PostMapping("/update")
public Object update(@RequestBody CoinRequestDto coinRequestDto) {
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 钱币列表->钱币设置->更新,请求参数:parma:{}", coinRequestDto);
coinService.setCoin(coinRequestDto);
logger.info("【请求结束】钱币列表->钱币明细->更新");
return new SimpleResult<>(true);
}
}
package com.wwdz.ch.admin.entity.vo;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class CoinVo implements Entity {
private Long id;
/**
* 钱币名称
*/
private String name;
/**
* 钱币所属类目ID
*/
private Integer cid;
/**
* 是否上架
*/
private Boolean isOnSale;
/**
* 是否标准件
*/
private Boolean isStd;
/**
* 排序
*/
private Integer sort;
/**
* 商品分享朋友圈图片
*/
private String shareImage;
/**
* 价格, 要除以100
*/
private Long price;
/**
* 创建时间
*/
private Date created;
/**
* 来源类型(1系统2用户上传)
*/
private Boolean sourceType;
/**
* 更新时间
*/
private Date updated;
/**
* 逻辑删除
*/
private Boolean isDeleted;
/**
* 成交时间
*/
private String bidTime;
/**
* 备注说明
*/
private String remark;
/**
* 钱币额外信息
*/
private String extra;
/**
* 商品图片,分号分隔
*/
private String images;
/**
* 商品详细介绍,是富文本格式
*/
private String detail;
}
package com.wwdz.ch.admin.impl;
import com.wwdz.ch.admin.entity.vo.CoinVo;
import com.wwdz.ch.admin.service.CoinService;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.CoinRequestDto;
import com.wwdz.ch.db.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class CoinServiceImpl implements CoinService {
@Autowired
ItemService itemService;
@Override
public List<CoinVo> findList(CoinRequestDto coinRequestDto) {
return null;
}
@Override
public CoinVo findDetails(CoinRequestDto coinRequestDto) {
return null;
}
@Override
public Result setCoin(CoinRequestDto coinRequestDto) {
return null;
}
}
package com.wwdz.ch.admin.service; package com.wwdz.ch.admin.service;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.wwdz.ch.admin.entity.vo.ItemVo; import com.wwdz.ch.admin.entity.vo.ItemVo;
...@@ -120,10 +117,10 @@ public class AdminGoodsService { ...@@ -120,10 +117,10 @@ public class AdminGoodsService {
if (error != null) { if (error != null) {
return error; return error;
} }
Date now = new Date();
// 商品基本信息表Dts_goods // 商品基本信息表Dts_goods
item.setCreated(LocalDateTime.now()); item.setCreated(now);
item.setUpdated(LocalDateTime.now()); item.setUpdated(now);
item.setIsDeleted(false); item.setIsDeleted(false);
itemService.add(item); itemService.add(item);
......
package com.wwdz.ch.admin.service;
import com.wwdz.ch.admin.entity.vo.CoinVo;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.CoinRequestDto;
import java.util.List;
public interface CoinService {
List<CoinVo> findList(CoinRequestDto coinRequestDto);
CoinVo findDetails(CoinRequestDto coinRequestDto);
Result setCoin(CoinRequestDto coinRequestDto);
}
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<dependency> <dependency>
<groupId>co.elastic.clients</groupId> <groupId>co.elastic.clients</groupId>
<artifactId>elasticsearch-java</artifactId> <artifactId>elasticsearch-java</artifactId>
<version>8.1.2</version> <version>8.8.2</version>
</dependency> </dependency>
</dependencies> </dependencies>
......
package com.wwdz.ch.core.config;
import co.elastic.clients.elasticsearch.ElasticsearchAsyncClient;
import co.elastic.clients.elasticsearch.ElasticsearchClient;
import co.elastic.clients.json.jackson.JacksonJsonpMapper;
import co.elastic.clients.transport.rest_client.RestClientTransport;
import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
@Component
public class ElasticsearchConfig {
/**
* 多个ip用逗号隔开
*/
@Value("${spring.elasticsearch.jest.uris}")
private String elasticsearchUris;
/**
* 同步方式
* @return
*/
@Bean
public ElasticsearchClient elasticsearchClient() {
HttpHost[] httpHosts = toHttpHost();
RestClient restClient = RestClient.builder(httpHosts).build();
RestClientTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
return new ElasticsearchClient(transport);
}
/**
* 异步方式
* @return
*/
@Bean
public ElasticsearchAsyncClient elasticsearchAsyncClient() {
HttpHost[] httpHosts = toHttpHost();
RestClient restClient = RestClient.builder(httpHosts).build();
RestClientTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
return new ElasticsearchAsyncClient(transport);
}
/**
* 解析配置的字符串hosts,转为HttpHost对象数组
*
* @return
*/
private HttpHost[] toHttpHost() {
if (!StringUtils.hasLength(elasticsearchUris)) {
throw new RuntimeException("invalid elasticsearch configuration. elasticsearch.hosts不能为空!");
}
// 多个IP逗号隔开
String[] hostArray = elasticsearchUris.split(",");
HttpHost[] httpHosts = new HttpHost[hostArray.length];
HttpHost httpHost;
for (int i = 0; i < hostArray.length; i++) {
String[] strings = hostArray[i].split(":");
httpHost = new HttpHost(strings[0], Integer.parseInt(strings[1]), "http");
httpHosts[i] = httpHost;
}
return httpHosts;
}
}
package com.wwdz.ch.core.consts;
/**
* 返回结果码枚举
*/
public enum ResultCode {
SUCCESS(1000, "成功"),
FAILED(4000, "操作失败"),
UNKNOWN_USER(4001, "请先登录"),
INVALID_FILE(4002, "文件类型不正确"),
LOGIN_FAILED(4003, "登录失败"),
INTERCEPTED(4004, "该订单已被拦截"),
WAIT_STAGE_RETURN(4005, "该订单状态待驿站取回不能进行当前操作"),
NOT_PLAYER(4030,"没有此用户"),
RPC_EXCEPTION(5001, "RPC接口调用异常"),
INTERAL_ERROR(5005, "内部错误"),
UPLOAD_IMAGE_ERRROR(5006, "传图错误"),
INVALID_DATA(5007, "数据不合法"),
UPLOAD_IMAGE_EXITS_ERRROR(55555, "图片没有上传成功"),
PARAM_ERROR(5011, "参数错误"),
TOO_MANY_REQUEST(5011,"请求频繁,请稍后试"),
ILLEGAL_REQUEST(5012,"非法请求"),
PARSE_ERROR(5013,"数据解析异常"),
DUPLICATE_SUBMIT(5014,"重复提交"),
SQL_EXECPTION(5015,"sql执行异常"),
DEL_DATA_FAILED(5016, "删除数据失败"),
UPDATE_DATA_FAILED(5019, "更新数据失败"),
SENTINEL_WAIT(5017,"页面访问太火爆了,请稍后重试!"),
GET_LOCK_FAILED(5018, "获取分布式锁失败"),
CHECK_FAIL(6005,"验证失败"),
AUCTION_INFO_ERROR(8111,"加载失败,请重试"),
AUCTION_ITEM_LIMIT(8601,"访问过于频繁,请稍后再试"),
NO_RECEIVE_ADDRESS(8701,"请联系客服完善退货地址"),
//2023-05-05新增
VERIFY_CODE_IS_EXIST(21006, "验证码{0}秒内不重复发送"),
VERIFY_CODE_IS_INVAILD(21007, "验证码过期"),
VERIFY_CODE_IS_ERROR(21008, "验证码错误"),
/**
* 用户名或密码错误
*/
LOGIN_ERROR(21009, "用户名或密码错误"),
/**
* 当前用户无权限访问
*/
ACCESS_DENIED(21010, "当前用户无权限访问"),
/**
* 账号不存在
*/
LOGIN_ACCOUNT_ERROR(21011, "账号不存在"),
/**
* 账号未启用
*/
LOGIN_ACCOUNT_UNENABLED(21012, "用户已被禁用"),
;
int code;
String message;
ResultCode(int code, String message) {
this.code = code;
this.message = message;
}
public int getCode() {
return code;
}
public String getMessage() {
return message;
}
}
package com.wwdz.ch.core.entity;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Map;
@Data
public class EsSearchParam implements Entity {
private Map<String, String> paramMap;
private String content;
private String sortField;
private Boolean isDesc = true;
private int page = 1;
private int size = 20;
public EsSearchParam(Map<String, String> paramMap, String content, String sortField, Boolean isDesc, int page, int size) {
this.paramMap = paramMap;
this.content = content;
this.sortField = sortField;
this.isDesc = isDesc;
this.page = page;
this.size = size;
}
public EsSearchParam(String content, String sortField, Boolean isDesc, int page, int size) {
this.content = content;
this.sortField = sortField;
this.isDesc = isDesc;
this.page = page;
this.size = size;
}
public EsSearchParam(String content, int page, int size) {
this.content = content;
this.page = page;
this.size = size;
}
public EsSearchParam of(String content, int page, int size) {
return new EsSearchParam(content, page, size);
}
}
package com.wwdz.ch.core.type;
import com.wwdz.ch.core.consts.ResultCode;
import com.xxdxxs.entity.Entity;
import lombok.Data;
@Data
public class Result<T> implements Entity {
private Integer errno;
private Boolean success;
private String errmsg;
private T data;
public Result(Integer errno, String msg, T body) {
this.errno = errno;
this.errmsg = msg;
this.data = body;
}
public Result(Integer errno, String msg) {
this.errno = errno;
this.errmsg = msg;
}
public Result(Boolean successful, T body) {
this.success = successful;
this.data = body;
}
public Result(Integer errno, Boolean successful, String msg) {
this.errno = errno;
this.success = successful;
this.errmsg = msg;
}
public Result(Integer errno, Boolean successful, String msg, T body) {
this.errno = errno;
this.success = successful;
this.errmsg = msg;
this.data = body;
}
public Result(Integer errno, Boolean successful, T body) {
this.errno = errno;
this.success = successful;
this.data = body;
}
public Result(Boolean successful) {
this.success = successful;
}
public static<T> Result<T> success() {
return new Result<>(ResultCode.SUCCESS.getCode(), true, ResultCode.SUCCESS.getMessage());
}
public static<T> Result<T> success(T body) {
return new Result<>(ResultCode.SUCCESS.getCode(), true, body);
}
public static <T>Result<T> failed() {
return new Result<>(false);
}
public static<T> Result<T> failed(Integer code, String msg) {
return new Result<>(code, false,msg, null);
}
public static<T> Result<T> failed(ResultCode resultCode) {
return new Result<>(resultCode.getCode(), false,resultCode.getMessage(), null);
}
public static<T> Result<T> failed(String errormsg) {
return failed(ResultCode.FAILED.getCode(), errormsg);
}
public Integer getErrno() {
return errno;
}
public void setErrno(Integer errno) {
this.errno = errno;
}
public Boolean getSuccess() {
return success;
}
public void setSuccess(Boolean success) {
this.success = success;
}
public String getErrmsg() {
return errmsg;
}
public void setErrmsg(String errmsg) {
this.errmsg = errmsg;
}
public void setData(T data) {
this.data = data;
}
public T getData() {
return data;
}
}
...@@ -15,6 +15,8 @@ public class SimpleResult<T> extends BaseResult{ ...@@ -15,6 +15,8 @@ public class SimpleResult<T> extends BaseResult{
this.msg = msg; this.msg = msg;
} }
public T getData() { public T getData() {
return data; return data;
} }
......
package com.wwdz.ch.core.util;
import co.elastic.clients.elasticsearch.ElasticsearchClient;
import co.elastic.clients.elasticsearch._types.SortOrder;
import co.elastic.clients.elasticsearch.core.GetRequest;
import co.elastic.clients.elasticsearch.core.GetResponse;
import co.elastic.clients.elasticsearch.core.SearchRequest;
import co.elastic.clients.elasticsearch.core.SearchResponse;
import co.elastic.clients.util.ObjectBuilder;
import com.wwdz.ch.core.entity.EsSearchParam;
import com.wwdz.ch.db.bean.CoinOfEs;
import com.xxdxxs.entity.Entity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
@Component
public class ElasticsearchUtil {
private static final Logger logger = LoggerFactory.getLogger(ElasticsearchUtil.class);
private final static String INDEX = "quanku";
@Autowired
ElasticsearchClient elasticsearchClient;
public List<? extends Entity> findDocument(EsSearchParam esSearchParam) {
try {
int page = esSearchParam.getPage();
int size = esSearchParam.getSize();
int from = (page - 1) * size;
SearchRequest.Builder builder = new SearchRequest.Builder();
builder.index(INDEX);
builder.from(from);
builder.size(size);
builder.sort(f -> f.field(o -> o.field("coin_id")
.order(SortOrder.Desc)));
SearchRequest searchRequest = SearchRequest.of((Function<SearchRequest.Builder, ObjectBuilder<SearchRequest>>) builder);
SearchResponse<CoinOfEs> searchResponse = elasticsearchClient.search(searchRequest, CoinOfEs.class);
GetResponse<CoinOfEs> response = elasticsearchClient.get(s -> s.index("quanku")
.id("e051445c-ae8c-47ef-ab18-97b34025d49a"), CoinOfEs.class);
logger.info("getResponse:{}", response.source());
if (response.found()) {
CoinOfEs coinOfEs = response.source();
assert coinOfEs != null;
logger.info("coin name= {} ", coinOfEs.getName());
}
} catch (Exception e) {
e.printStackTrace();
}
return Collections.emptyList();
}
}
...@@ -93,6 +93,18 @@ ...@@ -93,6 +93,18 @@
<version>1.6.1</version> <version>1.6.1</version>
</dependency> </dependency>
<dependency>
<groupId>com.github.xxdxxs</groupId>
<artifactId>xxdxxs</artifactId>
<version>1.0.2-RELEASE</version>
<exclusions>
<exclusion>
<artifactId>druid</artifactId>
<groupId>com.alibaba</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>com.itfsw</groupId> <groupId>com.itfsw</groupId>
<artifactId>mybatis-generator-plugin</artifactId> <artifactId>mybatis-generator-plugin</artifactId>
......
package com.wwdz.ch.db.bean;
import com.xxdxxs.entity.Entity;
import lombok.Data;
@Data
public class CoinOfEs implements Entity {
/**
* 钱币id
*/
private String coin_id;
/**
* 钱币名称
*/
private String name;
/**
* 置顶图片
*/
private String top_image_path;
/**
* 价格
*/
private String price;
}
...@@ -2,51 +2,18 @@ package com.wwdz.ch.db.dao; ...@@ -2,51 +2,18 @@ package com.wwdz.ch.db.dao;
import com.wwdz.ch.db.domain.Item; import com.wwdz.ch.db.domain.Item;
import com.wwdz.ch.db.domain.ItemExample; import com.wwdz.ch.db.domain.ItemExample;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@Mapper
public interface ItemMapper { public interface ItemMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
long countByExample(ItemExample example); long countByExample(ItemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
int deleteByExample(ItemExample example); int deleteByExample(ItemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
int insert(Item record); int insert(Item record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
int insertSelective(Item record); int insertSelective(Item record);
/** /**
...@@ -85,20 +52,8 @@ public interface ItemMapper { ...@@ -85,20 +52,8 @@ public interface ItemMapper {
*/ */
List<Item> selectByExampleSelective(@Param("example") ItemExample example, @Param("selective") Item.Column ... selective); List<Item> selectByExampleSelective(@Param("example") ItemExample example, @Param("selective") Item.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
List<Item> selectByExampleWithBLOBs(ItemExample example); List<Item> selectByExampleWithBLOBs(ItemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
List<Item> selectByExample(ItemExample example); List<Item> selectByExample(ItemExample example);
/** /**
...@@ -110,60 +65,18 @@ public interface ItemMapper { ...@@ -110,60 +65,18 @@ public interface ItemMapper {
*/ */
Item selectByPrimaryKeySelective(@Param("id") Long id, @Param("selective") Item.Column ... selective); Item selectByPrimaryKeySelective(@Param("id") Long id, @Param("selective") Item.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
Item selectByPrimaryKey(Long id); Item selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") Item record, @Param("example") ItemExample example); int updateByExampleSelective(@Param("record") Item record, @Param("example") ItemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
int updateByExampleWithBLOBs(@Param("record") Item record, @Param("example") ItemExample example); int updateByExampleWithBLOBs(@Param("record") Item record, @Param("example") ItemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
int updateByExample(@Param("record") Item record, @Param("example") ItemExample example); int updateByExample(@Param("record") Item record, @Param("example") ItemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(Item record); int updateByPrimaryKeySelective(Item record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
int updateByPrimaryKeyWithBLOBs(Item record); int updateByPrimaryKeyWithBLOBs(Item record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
int updateByPrimaryKey(Item record); int updateByPrimaryKey(Item record);
/** /**
......
package com.wwdz.ch.db.domain; package com.wwdz.ch.db.domain;
import java.time.LocalDateTime; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Objects; import java.util.Date;
import lombok.Data;
public class Item { /**
/** * @author shiyu
* * @date 2023/07/19
* This field was generated by MyBatis Generator.
* This field corresponds to the database column item.id
*
* @mbg.generated
*/ */
@Data
public class Item implements Serializable {
private Long id; private Long id;
/** /**
* * 钱币名称
* This field was generated by MyBatis Generator.
* This field corresponds to the database column item.name
*
* @mbg.generated
*/ */
private String name; private String name;
/** /**
* * 钱币所属类目ID
* This field was generated by MyBatis Generator.
* This field corresponds to the database column item.cid
*
* @mbg.generated
*/ */
private Integer cid; private Integer cid;
/** /**
* * 是否上架
* This field was generated by MyBatis Generator.
* This field corresponds to the database column item.is_on_sale
*
* @mbg.generated
*/ */
private Boolean isOnSale; private Boolean isOnSale;
/** /**
* * 是否标准件
* This field was generated by MyBatis Generator.
* This field corresponds to the database column item.is_std
*
* @mbg.generated
*/ */
private Boolean isStd; private Boolean isStd;
/** /**
* * 排序
* This field was generated by MyBatis Generator.
* This field corresponds to the database column item.sort
*
* @mbg.generated
*/ */
private Integer sort; private Integer sort;
/** /**
* * 商品分享朋友圈图片
* This field was generated by MyBatis Generator.
* This field corresponds to the database column item.share_image
*
* @mbg.generated
*/ */
private String shareImage; private String shareImage;
/** /**
* * 价格, 要除以100
* This field was generated by MyBatis Generator.
* This field corresponds to the database column item.price
*
* @mbg.generated
*/ */
private Long price; private Long price;
/** /**
* * 创建时间
* This field was generated by MyBatis Generator.
* This field corresponds to the database column item.created
*
* @mbg.generated
*/
private LocalDateTime created;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column item.updated
*
* @mbg.generated
*/
private LocalDateTime updated;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column item.is_deleted
*
* @mbg.generated
*/ */
private Boolean isDeleted; private Date created;
/** /**
* * 来源类型(1系统2用户上传)
* This field was generated by MyBatis Generator.
* This field corresponds to the database column item.extra
*
* @mbg.generated
*/ */
private String extra; private Boolean sourceType;
/** /**
* * 更新时间
* This field was generated by MyBatis Generator.
* This field corresponds to the database column item.images
*
* @mbg.generated
*/ */
private String images; private Date updated;
/** /**
* * 逻辑删除
* This field was generated by MyBatis Generator.
* This field corresponds to the database column item.detail
*
* @mbg.generated
*/ */
private String detail; private Boolean isDeleted;
/** /**
* 成交时间 * 成交时间
...@@ -138,309 +75,108 @@ public class Item { ...@@ -138,309 +75,108 @@ public class Item {
private String bidTime; private String bidTime;
/** /**
* This method was generated by MyBatis Generator. * 备注说明
* This method returns the value of the database column item.id
*
* @return the value of item.id
*
* @mbg.generated
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column item.id
*
* @param id the value for item.id
*
* @mbg.generated
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column item.name
*
* @return the value of item.name
*
* @mbg.generated
*/
public String getName() {
return name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column item.name
*
* @param name the value for item.name
*
* @mbg.generated
*/
public void setName(String name) {
this.name = name;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column item.cid
*
* @return the value of item.cid
*
* @mbg.generated
*/
public Integer getCid() {
return cid;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column item.cid
*
* @param cid the value for item.cid
*
* @mbg.generated
*/
public void setCid(Integer cid) {
this.cid = cid;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column item.is_on_sale
*
* @return the value of item.is_on_sale
*
* @mbg.generated
*/ */
public Boolean getIsOnSale() { private String remark;
return isOnSale;
}
/** /**
* This method was generated by MyBatis Generator. * 钱币额外信息
* This method sets the value of the database column item.is_on_sale
*
* @param isOnSale the value for item.is_on_sale
*
* @mbg.generated
*/ */
public void setIsOnSale(Boolean isOnSale) { private String extra;
this.isOnSale = isOnSale;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column item.is_std
*
* @return the value of item.is_std
*
* @mbg.generated
*/
public Boolean getIsStd() {
return isStd;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column item.is_std
*
* @param isStd the value for item.is_std
*
* @mbg.generated
*/
public void setIsStd(Boolean isStd) {
this.isStd = isStd;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column item.sort
*
* @return the value of item.sort
*
* @mbg.generated
*/
public Integer getSort() {
return sort;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column item.sort
*
* @param sort the value for item.sort
*
* @mbg.generated
*/
public void setSort(Integer sort) {
this.sort = sort;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column item.share_image
*
* @return the value of item.share_image
*
* @mbg.generated
*/
public String getShareImage() {
return shareImage;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column item.share_image
*
* @param shareImage the value for item.share_image
*
* @mbg.generated
*/
public void setShareImage(String shareImage) {
this.shareImage = shareImage;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column item.price
*
* @return the value of item.price
*
* @mbg.generated
*/
public Long getPrice() {
return price;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column item.price
*
* @param price the value for item.price
*
* @mbg.generated
*/
public void setPrice(Long price) {
this.price = price;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column item.created
*
* @return the value of item.created
*
* @mbg.generated
*/
public LocalDateTime getCreated() {
return created;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column item.created
*
* @param created the value for item.created
*
* @mbg.generated
*/
public void setCreated(LocalDateTime created) {
this.created = created;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column item.updated
*
* @return the value of item.updated
*
* @mbg.generated
*/
public LocalDateTime getUpdated() {
return updated;
}
/** /**
* This method was generated by MyBatis Generator. * 商品图片,分号分隔
* This method sets the value of the database column item.updated
*
* @param updated the value for item.updated
*
* @mbg.generated
*/ */
public void setUpdated(LocalDateTime updated) { private String images;
this.updated = updated;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column item.is_deleted
*
* @return the value of item.is_deleted
*
* @mbg.generated
*/
public Boolean getIsDeleted() {
return isDeleted;
}
/** /**
* This method was generated by MyBatis Generator. * 商品详细介绍,是富文本格式
* This method sets the value of the database column item.is_deleted
*
* @param isDeleted the value for item.is_deleted
*
* @mbg.generated
*/ */
public void setIsDeleted(Boolean isDeleted) { private String detail;
this.isDeleted = isDeleted;
}
public String getExtra() {
return extra;
}
public void setExtra(String extra) {
this.extra = extra;
}
public String getImages() {
return images;
}
public void setImages(String images) {
this.images = images;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
public Boolean getDeleted() {
return isDeleted;
}
public void setDeleted(Boolean deleted) {
isDeleted = deleted;
}
public String getBidTime() {
return bidTime;
}
public void setBidTime(String bidTime) { private static final long serialVersionUID = 1L;
this.bidTime = bidTime;
@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(", name=").append(name);
sb.append(", cid=").append(cid);
sb.append(", isOnSale=").append(isOnSale);
sb.append(", isStd=").append(isStd);
sb.append(", sort=").append(sort);
sb.append(", shareImage=").append(shareImage);
sb.append(", price=").append(price);
sb.append(", created=").append(created);
sb.append(", sourceType=").append(sourceType);
sb.append(", updated=").append(updated);
sb.append(", isDeleted=").append(isDeleted);
sb.append(", bidTime=").append(bidTime);
sb.append(", remark=").append(remark);
sb.append(", extra=").append(extra);
sb.append(", images=").append(images);
sb.append(", detail=").append(detail);
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;
}
Item other = (Item) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getCid() == null ? other.getCid() == null : this.getCid().equals(other.getCid()))
&& (this.getIsOnSale() == null ? other.getIsOnSale() == null : this.getIsOnSale().equals(other.getIsOnSale()))
&& (this.getIsStd() == null ? other.getIsStd() == null : this.getIsStd().equals(other.getIsStd()))
&& (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort()))
&& (this.getShareImage() == null ? other.getShareImage() == null : this.getShareImage().equals(other.getShareImage()))
&& (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
&& (this.getCreated() == null ? other.getCreated() == null : this.getCreated().equals(other.getCreated()))
&& (this.getSourceType() == null ? other.getSourceType() == null : this.getSourceType().equals(other.getSourceType()))
&& (this.getUpdated() == null ? other.getUpdated() == null : this.getUpdated().equals(other.getUpdated()))
&& (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
&& (this.getBidTime() == null ? other.getBidTime() == null : this.getBidTime().equals(other.getBidTime()))
&& (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
&& (this.getExtra() == null ? other.getExtra() == null : this.getExtra().equals(other.getExtra()))
&& (this.getImages() == null ? other.getImages() == null : this.getImages().equals(other.getImages()))
&& (this.getDetail() == null ? other.getDetail() == null : this.getDetail().equals(other.getDetail()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getCid() == null) ? 0 : getCid().hashCode());
result = prime * result + ((getIsOnSale() == null) ? 0 : getIsOnSale().hashCode());
result = prime * result + ((getIsStd() == null) ? 0 : getIsStd().hashCode());
result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode());
result = prime * result + ((getShareImage() == null) ? 0 : getShareImage().hashCode());
result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
result = prime * result + ((getCreated() == null) ? 0 : getCreated().hashCode());
result = prime * result + ((getSourceType() == null) ? 0 : getSourceType().hashCode());
result = prime * result + ((getUpdated() == null) ? 0 : getUpdated().hashCode());
result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
result = prime * result + ((getBidTime() == null) ? 0 : getBidTime().hashCode());
result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
result = prime * result + ((getExtra() == null) ? 0 : getExtra().hashCode());
result = prime * result + ((getImages() == null) ? 0 : getImages().hashCode());
result = prime * result + ((getDetail() == null) ? 0 : getDetail().hashCode());
return result;
} }
/** /**
...@@ -460,12 +196,14 @@ public class Item { ...@@ -460,12 +196,14 @@ public class Item {
shareImage("share_image", "shareImage", "VARCHAR", false), shareImage("share_image", "shareImage", "VARCHAR", false),
price("price", "price", "BIGINT", false), price("price", "price", "BIGINT", false),
created("created", "created", "TIMESTAMP", false), created("created", "created", "TIMESTAMP", false),
sourceType("source_type", "sourceType", "BIT", false),
updated("updated", "updated", "TIMESTAMP", false), updated("updated", "updated", "TIMESTAMP", false),
isDeleted("is_deleted", "isDeleted", "BIT", false), isDeleted("is_deleted", "isDeleted", "BIT", false),
bidTime("bid_time", "bidTime", "VARCHAR", false),
remark("remark", "remark", "VARCHAR", false),
extra("extra", "extra", "LONGVARCHAR", false), extra("extra", "extra", "LONGVARCHAR", false),
images("images", "images", "LONGVARCHAR", false), images("images", "images", "LONGVARCHAR", false),
detail("detail", "detail", "LONGVARCHAR", false), detail("detail", "detail", "LONGVARCHAR", false);
bidTime("bid_time", "bidTime", "VARCHAR", true);
/** /**
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
......
package com.wwdz.ch.db.domain; package com.wwdz.ch.db.domain;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
public class ItemExample { public class ItemExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table item
*
* @mbg.generated
*/
protected String orderByClause; protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table item
*
* @mbg.generated
*/
protected boolean distinct; protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table item
*
* @mbg.generated
*/
protected List<Criteria> oredCriteria; protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
public ItemExample() { public ItemExample() {
oredCriteria = new ArrayList<Criteria>(); oredCriteria = new ArrayList<Criteria>();
} }
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
public void setOrderByClause(String orderByClause) { public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause; this.orderByClause = orderByClause;
} }
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
public String getOrderByClause() { public String getOrderByClause() {
return orderByClause; return orderByClause;
} }
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
public void setDistinct(boolean distinct) { public void setDistinct(boolean distinct) {
this.distinct = distinct; this.distinct = distinct;
} }
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
public boolean isDistinct() { public boolean isDistinct() {
return distinct; return distinct;
} }
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
public List<Criteria> getOredCriteria() { public List<Criteria> getOredCriteria() {
return oredCriteria; return oredCriteria;
} }
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
public void or(Criteria criteria) { public void or(Criteria criteria) {
oredCriteria.add(criteria); oredCriteria.add(criteria);
} }
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
public Criteria or() { public Criteria or() {
Criteria criteria = createCriteriaInternal(); Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria); oredCriteria.add(criteria);
...@@ -142,12 +76,6 @@ public class ItemExample { ...@@ -142,12 +76,6 @@ public class ItemExample {
return this; return this;
} }
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
public Criteria createCriteria() { public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal(); Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) { if (oredCriteria.size() == 0) {
...@@ -156,23 +84,11 @@ public class ItemExample { ...@@ -156,23 +84,11 @@ public class ItemExample {
return criteria; return criteria;
} }
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
protected Criteria createCriteriaInternal() { protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria(this); Criteria criteria = new Criteria(this);
return criteria; return criteria;
} }
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
*/
public void clear() { public void clear() {
oredCriteria.clear(); oredCriteria.clear();
orderByClause = null; orderByClause = null;
...@@ -191,12 +107,6 @@ public class ItemExample { ...@@ -191,12 +107,6 @@ public class ItemExample {
return example.createCriteria(); return example.createCriteria();
} }
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table item
*
* @mbg.generated
*/
protected abstract static class GeneratedCriteria { protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria; protected List<Criterion> criteria;
...@@ -1324,7 +1234,7 @@ public class ItemExample { ...@@ -1324,7 +1234,7 @@ public class ItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreatedEqualTo(LocalDateTime value) { public Criteria andCreatedEqualTo(Date value) {
addCriterion("created =", value, "created"); addCriterion("created =", value, "created");
return (Criteria) this; return (Criteria) this;
} }
...@@ -1341,7 +1251,7 @@ public class ItemExample { ...@@ -1341,7 +1251,7 @@ public class ItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreatedNotEqualTo(LocalDateTime value) { public Criteria andCreatedNotEqualTo(Date value) {
addCriterion("created <>", value, "created"); addCriterion("created <>", value, "created");
return (Criteria) this; return (Criteria) this;
} }
...@@ -1358,7 +1268,7 @@ public class ItemExample { ...@@ -1358,7 +1268,7 @@ public class ItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreatedGreaterThan(LocalDateTime value) { public Criteria andCreatedGreaterThan(Date value) {
addCriterion("created >", value, "created"); addCriterion("created >", value, "created");
return (Criteria) this; return (Criteria) this;
} }
...@@ -1375,7 +1285,7 @@ public class ItemExample { ...@@ -1375,7 +1285,7 @@ public class ItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreatedGreaterThanOrEqualTo(LocalDateTime value) { public Criteria andCreatedGreaterThanOrEqualTo(Date value) {
addCriterion("created >=", value, "created"); addCriterion("created >=", value, "created");
return (Criteria) this; return (Criteria) this;
} }
...@@ -1392,7 +1302,7 @@ public class ItemExample { ...@@ -1392,7 +1302,7 @@ public class ItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreatedLessThan(LocalDateTime value) { public Criteria andCreatedLessThan(Date value) {
addCriterion("created <", value, "created"); addCriterion("created <", value, "created");
return (Criteria) this; return (Criteria) this;
} }
...@@ -1409,7 +1319,7 @@ public class ItemExample { ...@@ -1409,7 +1319,7 @@ public class ItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreatedLessThanOrEqualTo(LocalDateTime value) { public Criteria andCreatedLessThanOrEqualTo(Date value) {
addCriterion("created <=", value, "created"); addCriterion("created <=", value, "created");
return (Criteria) this; return (Criteria) this;
} }
...@@ -1426,26 +1336,158 @@ public class ItemExample { ...@@ -1426,26 +1336,158 @@ public class ItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreatedIn(List<LocalDateTime> values) { public Criteria andCreatedIn(List<Date> values) {
addCriterion("created in", values, "created"); addCriterion("created in", values, "created");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreatedNotIn(List<LocalDateTime> values) { public Criteria andCreatedNotIn(List<Date> values) {
addCriterion("created not in", values, "created"); addCriterion("created not in", values, "created");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreatedBetween(LocalDateTime value1, LocalDateTime value2) { public Criteria andCreatedBetween(Date value1, Date value2) {
addCriterion("created between", value1, value2, "created"); addCriterion("created between", value1, value2, "created");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreatedNotBetween(LocalDateTime value1, LocalDateTime value2) { public Criteria andCreatedNotBetween(Date value1, Date value2) {
addCriterion("created not between", value1, value2, "created"); addCriterion("created not between", value1, value2, "created");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSourceTypeIsNull() {
addCriterion("source_type is null");
return (Criteria) this;
}
public Criteria andSourceTypeIsNotNull() {
addCriterion("source_type is not null");
return (Criteria) this;
}
public Criteria andSourceTypeEqualTo(Boolean value) {
addCriterion("source_type =", value, "sourceType");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSourceTypeEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("source_type = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSourceTypeNotEqualTo(Boolean value) {
addCriterion("source_type <>", value, "sourceType");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSourceTypeNotEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("source_type <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSourceTypeGreaterThan(Boolean value) {
addCriterion("source_type >", value, "sourceType");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSourceTypeGreaterThanColumn(Item.Column column) {
addCriterion(new StringBuilder("source_type > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSourceTypeGreaterThanOrEqualTo(Boolean value) {
addCriterion("source_type >=", value, "sourceType");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSourceTypeGreaterThanOrEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("source_type >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSourceTypeLessThan(Boolean value) {
addCriterion("source_type <", value, "sourceType");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSourceTypeLessThanColumn(Item.Column column) {
addCriterion(new StringBuilder("source_type < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSourceTypeLessThanOrEqualTo(Boolean value) {
addCriterion("source_type <=", value, "sourceType");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSourceTypeLessThanOrEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("source_type <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSourceTypeIn(List<Boolean> values) {
addCriterion("source_type in", values, "sourceType");
return (Criteria) this;
}
public Criteria andSourceTypeNotIn(List<Boolean> values) {
addCriterion("source_type not in", values, "sourceType");
return (Criteria) this;
}
public Criteria andSourceTypeBetween(Boolean value1, Boolean value2) {
addCriterion("source_type between", value1, value2, "sourceType");
return (Criteria) this;
}
public Criteria andSourceTypeNotBetween(Boolean value1, Boolean value2) {
addCriterion("source_type not between", value1, value2, "sourceType");
return (Criteria) this;
}
public Criteria andUpdatedIsNull() { public Criteria andUpdatedIsNull() {
addCriterion("updated is null"); addCriterion("updated is null");
return (Criteria) this; return (Criteria) this;
...@@ -1456,7 +1498,7 @@ public class ItemExample { ...@@ -1456,7 +1498,7 @@ public class ItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdatedEqualTo(LocalDateTime value) { public Criteria andUpdatedEqualTo(Date value) {
addCriterion("updated =", value, "updated"); addCriterion("updated =", value, "updated");
return (Criteria) this; return (Criteria) this;
} }
...@@ -1473,7 +1515,7 @@ public class ItemExample { ...@@ -1473,7 +1515,7 @@ public class ItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdatedNotEqualTo(LocalDateTime value) { public Criteria andUpdatedNotEqualTo(Date value) {
addCriterion("updated <>", value, "updated"); addCriterion("updated <>", value, "updated");
return (Criteria) this; return (Criteria) this;
} }
...@@ -1490,7 +1532,7 @@ public class ItemExample { ...@@ -1490,7 +1532,7 @@ public class ItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdatedGreaterThan(LocalDateTime value) { public Criteria andUpdatedGreaterThan(Date value) {
addCriterion("updated >", value, "updated"); addCriterion("updated >", value, "updated");
return (Criteria) this; return (Criteria) this;
} }
...@@ -1507,7 +1549,7 @@ public class ItemExample { ...@@ -1507,7 +1549,7 @@ public class ItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdatedGreaterThanOrEqualTo(LocalDateTime value) { public Criteria andUpdatedGreaterThanOrEqualTo(Date value) {
addCriterion("updated >=", value, "updated"); addCriterion("updated >=", value, "updated");
return (Criteria) this; return (Criteria) this;
} }
...@@ -1524,7 +1566,7 @@ public class ItemExample { ...@@ -1524,7 +1566,7 @@ public class ItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdatedLessThan(LocalDateTime value) { public Criteria andUpdatedLessThan(Date value) {
addCriterion("updated <", value, "updated"); addCriterion("updated <", value, "updated");
return (Criteria) this; return (Criteria) this;
} }
...@@ -1541,7 +1583,7 @@ public class ItemExample { ...@@ -1541,7 +1583,7 @@ public class ItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdatedLessThanOrEqualTo(LocalDateTime value) { public Criteria andUpdatedLessThanOrEqualTo(Date value) {
addCriterion("updated <=", value, "updated"); addCriterion("updated <=", value, "updated");
return (Criteria) this; return (Criteria) this;
} }
...@@ -1558,22 +1600,22 @@ public class ItemExample { ...@@ -1558,22 +1600,22 @@ public class ItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdatedIn(List<LocalDateTime> values) { public Criteria andUpdatedIn(List<Date> values) {
addCriterion("updated in", values, "updated"); addCriterion("updated in", values, "updated");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdatedNotIn(List<LocalDateTime> values) { public Criteria andUpdatedNotIn(List<Date> values) {
addCriterion("updated not in", values, "updated"); addCriterion("updated not in", values, "updated");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdatedBetween(LocalDateTime value1, LocalDateTime value2) { public Criteria andUpdatedBetween(Date value1, Date value2) {
addCriterion("updated between", value1, value2, "updated"); addCriterion("updated between", value1, value2, "updated");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdatedNotBetween(LocalDateTime value1, LocalDateTime value2) { public Criteria andUpdatedNotBetween(Date value1, Date value2) {
addCriterion("updated not between", value1, value2, "updated"); addCriterion("updated not between", value1, value2, "updated");
return (Criteria) this; return (Criteria) this;
} }
...@@ -1709,14 +1751,292 @@ public class ItemExample { ...@@ -1709,14 +1751,292 @@ public class ItemExample {
addCriterion("is_deleted not between", value1, value2, "isDeleted"); addCriterion("is_deleted not between", value1, value2, "isDeleted");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andBidTimeIsNull() {
addCriterion("bid_time is null");
return (Criteria) this;
}
public Criteria andBidTimeIsNotNull() {
addCriterion("bid_time is not null");
return (Criteria) this;
}
public Criteria andBidTimeEqualTo(String value) {
addCriterion("bid_time =", value, "bidTime");
return (Criteria) this;
} }
/** /**
* This class was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This class corresponds to the database table item * This method corresponds to the database table item
* *
* @mbg.generated do_not_delete_during_merge * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBidTimeEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("bid_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBidTimeNotEqualTo(String value) {
addCriterion("bid_time <>", value, "bidTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBidTimeNotEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("bid_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBidTimeGreaterThan(String value) {
addCriterion("bid_time >", value, "bidTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBidTimeGreaterThanColumn(Item.Column column) {
addCriterion(new StringBuilder("bid_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBidTimeGreaterThanOrEqualTo(String value) {
addCriterion("bid_time >=", value, "bidTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBidTimeGreaterThanOrEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("bid_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBidTimeLessThan(String value) {
addCriterion("bid_time <", value, "bidTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBidTimeLessThanColumn(Item.Column column) {
addCriterion(new StringBuilder("bid_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBidTimeLessThanOrEqualTo(String value) {
addCriterion("bid_time <=", value, "bidTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBidTimeLessThanOrEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("bid_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBidTimeLike(String value) {
addCriterion("bid_time like", value, "bidTime");
return (Criteria) this;
}
public Criteria andBidTimeNotLike(String value) {
addCriterion("bid_time not like", value, "bidTime");
return (Criteria) this;
}
public Criteria andBidTimeIn(List<String> values) {
addCriterion("bid_time in", values, "bidTime");
return (Criteria) this;
}
public Criteria andBidTimeNotIn(List<String> values) {
addCriterion("bid_time not in", values, "bidTime");
return (Criteria) this;
}
public Criteria andBidTimeBetween(String value1, String value2) {
addCriterion("bid_time between", value1, value2, "bidTime");
return (Criteria) this;
}
public Criteria andBidTimeNotBetween(String value1, String value2) {
addCriterion("bid_time not between", value1, value2, "bidTime");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
public Criteria andRemarkEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("remark = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRemarkNotEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("remark <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRemarkGreaterThanColumn(Item.Column column) {
addCriterion(new StringBuilder("remark > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRemarkGreaterThanOrEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("remark >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRemarkLessThanColumn(Item.Column column) {
addCriterion(new StringBuilder("remark < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andRemarkLessThanOrEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("remark <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {
/** /**
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
...@@ -1783,12 +2103,6 @@ public class ItemExample { ...@@ -1783,12 +2103,6 @@ public class ItemExample {
} }
} }
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table item
*
* @mbg.generated
*/
public static class Criterion { public static class Criterion {
private String condition; private String condition;
......
package com.wwdz.ch.db.dto.request;
import com.xxdxxs.entity.Entity;
import lombok.Data;
@Data
public class BaseRequestDto implements Entity {
public Integer page = 1;
public Integer size = 20;
private String sortColumn;
private String order;
}
package com.wwdz.ch.db.dto.request;
import com.xxdxxs.entity.Entity;
import lombok.Data;
@Data
public class CoinRequestDto extends BaseRequestDto implements Entity {
private String name;
/**
* 钱币所属分类
*/
private String cid;
/**
* 直径
*/
private String diameter;
/**
* 厚度
*/
private String thickness;
/**
* 质量(重量)
*/
private String weight;
/**
* 是否标准件
* 0否;1是
*/
private Integer isStd;
/**
* 图片
*/
private String imgBaseStr;
private String remark;
}
...@@ -9,6 +9,7 @@ import org.springframework.util.StringUtils; ...@@ -9,6 +9,7 @@ import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
...@@ -117,17 +118,18 @@ public class ItemService { ...@@ -117,17 +118,18 @@ public class ItemService {
} }
public int updateById(Item item) { public int updateById(Item item) {
item.setUpdated(LocalDateTime.now()); item.setUpdated(new Date());
return itemMapper.updateByPrimaryKeySelective(item); return itemMapper.updateByPrimaryKeySelective(item);
} }
public void deleteById(Long id) { public void deleteById(Long id) {
itemMapper.logicalDeleteByPrimaryKey(id); // itemMapper.logicalDeleteByPrimaryKey(id);
} }
public void add(Item item) { public void add(Item item) {
item.setCreated(LocalDateTime.now()); Date now = new Date();
item.setUpdated(LocalDateTime.now()); item.setCreated(now);
item.setUpdated(now);
itemMapper.insertSelective(item); itemMapper.insertSelective(item);
} }
......
...@@ -2,10 +2,6 @@ ...@@ -2,10 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.wwdz.ch.db.dao.ItemMapper"> <mapper namespace="com.wwdz.ch.db.dao.ItemMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.Item"> <resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.Item">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" /> <result column="name" jdbcType="VARCHAR" property="name" />
<result column="cid" jdbcType="INTEGER" property="cid" /> <result column="cid" jdbcType="INTEGER" property="cid" />
...@@ -15,24 +11,18 @@ ...@@ -15,24 +11,18 @@
<result column="share_image" jdbcType="VARCHAR" property="shareImage" /> <result column="share_image" jdbcType="VARCHAR" property="shareImage" />
<result column="price" jdbcType="BIGINT" property="price" /> <result column="price" jdbcType="BIGINT" property="price" />
<result column="created" jdbcType="TIMESTAMP" property="created" /> <result column="created" jdbcType="TIMESTAMP" property="created" />
<result column="source_type" jdbcType="BIT" property="sourceType" />
<result column="updated" jdbcType="TIMESTAMP" property="updated" /> <result column="updated" jdbcType="TIMESTAMP" property="updated" />
<result column="is_deleted" jdbcType="BIT" property="isDeleted" /> <result column="is_deleted" jdbcType="BIT" property="isDeleted" />
<result column="bid_time" jdbcType="VARCHAR" property="bidTime" /> <result column="bid_time" jdbcType="VARCHAR" property="bidTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.wwdz.ch.db.domain.Item"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.wwdz.ch.db.domain.Item">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<result column="extra" jdbcType="LONGVARCHAR" property="extra" /> <result column="extra" jdbcType="LONGVARCHAR" property="extra" />
<result column="images" jdbcType="LONGVARCHAR" property="images" /> <result column="images" jdbcType="LONGVARCHAR" property="images" />
<result column="detail" jdbcType="LONGVARCHAR" property="detail" /> <result column="detail" jdbcType="LONGVARCHAR" property="detail" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where> <where>
<foreach collection="oredCriteria" item="criteria" separator="or"> <foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid"> <if test="criteria.valid">
...@@ -62,10 +52,6 @@ ...@@ -62,10 +52,6 @@
</where> </where>
</sql> </sql>
<sql id="Update_By_Example_Where_Clause"> <sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where> <where>
<foreach collection="example.oredCriteria" item="criteria" separator="or"> <foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid"> <if test="criteria.valid">
...@@ -95,29 +81,18 @@ ...@@ -95,29 +81,18 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!-- id, `name`, cid, is_on_sale, is_std, sort, share_image, price, created, source_type,
WARNING - @mbg.generated updated, is_deleted, bid_time, remark
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, `name`, cid, is_on_sale, is_std, sort, share_image, price, created, updated,
is_deleted, bid_time
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
extra, images, detail extra, images, detail
</sql> </sql>
<select id="selectByExampleWithBLOBs" parameterType="com.wwdz.ch.db.domain.ItemExample" resultMap="ResultMapWithBLOBs"> <select id="selectByExampleWithBLOBs" parameterType="com.wwdz.ch.db.domain.ItemExample" resultMap="ResultMapWithBLOBs">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select select
<if test="distinct"> <if test="distinct">
distinct distinct
</if> </if>
'true' as QUERYID,
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
, ,
<include refid="Blob_Column_List" /> <include refid="Blob_Column_List" />
...@@ -130,14 +105,11 @@ ...@@ -130,14 +105,11 @@
</if> </if>
</select> </select>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.ItemExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.wwdz.ch.db.domain.ItemExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select select
<if test="distinct"> <if test="distinct">
distinct distinct
</if> </if>
'true' as QUERYID,
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from item from item
<if test="_parameter != null"> <if test="_parameter != null">
...@@ -154,18 +126,19 @@ ...@@ -154,18 +126,19 @@
@project https://github.com/itfsw/mybatis-generator-plugin @project https://github.com/itfsw/mybatis-generator-plugin
--> -->
select select
'true' as QUERYID,
<if test="example.distinct"> <if test="example.distinct">
distinct distinct
</if> </if>
<choose> <choose>
<when test="selective != null and selective.length > 0"> <when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=","> <foreach collection="selective" item="column" separator=",">
${column.escapedColumnName} ${column.escapedColumnName}
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, `name`, cid, is_on_sale, is_std, sort, share_image, price, created, updated, id, `name`, cid, is_on_sale, is_std, sort, share_image, price, created, source_type,
is_deleted, extra, images, detail updated, is_deleted, bid_time, remark, extra, images, detail
</otherwise> </otherwise>
</choose> </choose>
from item from item
...@@ -177,10 +150,6 @@ ...@@ -177,10 +150,6 @@
</if> </if>
</select> </select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
, ,
...@@ -196,61 +165,47 @@ ...@@ -196,61 +165,47 @@
--> -->
select select
<choose> <choose>
<when test="selective != null and selective.length > 0"> <when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=","> <foreach collection="selective" item="column" separator=",">
${column.escapedColumnName} ${column.escapedColumnName}
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, `name`, cid, is_on_sale, is_std, sort, share_image, price, created, updated, id, `name`, cid, is_on_sale, is_std, sort, share_image, price, created, source_type,
is_deleted, extra, images, detail updated, is_deleted, bid_time, remark, extra, images, detail
</otherwise> </otherwise>
</choose> </choose>
from item from item
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from item delete from item
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</delete> </delete>
<delete id="deleteByExample" parameterType="com.wwdz.ch.db.domain.ItemExample"> <delete id="deleteByExample" parameterType="com.wwdz.ch.db.domain.ItemExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from item delete from item
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.Item"> <insert id="insert" parameterType="com.wwdz.ch.db.domain.Item">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into item (`name`, cid, is_on_sale, insert into item (`name`, cid, is_on_sale,
is_std, sort, share_image, is_std, sort, share_image,
price, created, updated, price, created, source_type,
is_deleted, extra, images, updated, is_deleted, bid_time,
detail, bid_time) remark, extra, images,
detail)
values (#{name,jdbcType=VARCHAR}, #{cid,jdbcType=INTEGER}, #{isOnSale,jdbcType=BIT}, values (#{name,jdbcType=VARCHAR}, #{cid,jdbcType=INTEGER}, #{isOnSale,jdbcType=BIT},
#{isStd,jdbcType=BIT}, #{sort,jdbcType=INTEGER}, #{shareImage,jdbcType=VARCHAR}, #{isStd,jdbcType=BIT}, #{sort,jdbcType=INTEGER}, #{shareImage,jdbcType=VARCHAR},
#{price,jdbcType=BIGINT}, #{created,jdbcType=TIMESTAMP}, #{updated,jdbcType=TIMESTAMP}, #{price,jdbcType=BIGINT}, #{created,jdbcType=TIMESTAMP}, #{sourceType,jdbcType=BIT},
#{isDeleted,jdbcType=BIT}, #{extra,jdbcType=LONGVARCHAR}, #{images,jdbcType=LONGVARCHAR}, #{updated,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}, #{bidTime,jdbcType=VARCHAR},
#{detail,jdbcType=LONGVARCHAR}, #{bidTime,jdbcType=VARCHAR}) #{remark,jdbcType=VARCHAR}, #{extra,jdbcType=LONGVARCHAR}, #{images,jdbcType=LONGVARCHAR},
#{detail,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.Item"> <insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.Item">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
...@@ -280,12 +235,21 @@ ...@@ -280,12 +235,21 @@
<if test="created != null"> <if test="created != null">
created, created,
</if> </if>
<if test="sourceType != null">
source_type,
</if>
<if test="updated != null"> <if test="updated != null">
updated, updated,
</if> </if>
<if test="isDeleted != null"> <if test="isDeleted != null">
is_deleted, is_deleted,
</if> </if>
<if test="bidTime != null">
bid_time,
</if>
<if test="remark != null">
remark,
</if>
<if test="extra != null"> <if test="extra != null">
extra, extra,
</if> </if>
...@@ -295,9 +259,6 @@ ...@@ -295,9 +259,6 @@
<if test="detail != null"> <if test="detail != null">
detail, detail,
</if> </if>
<if test="bidTime != null">
`bid_time`,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null"> <if test="name != null">
...@@ -324,12 +285,21 @@ ...@@ -324,12 +285,21 @@
<if test="created != null"> <if test="created != null">
#{created,jdbcType=TIMESTAMP}, #{created,jdbcType=TIMESTAMP},
</if> </if>
<if test="sourceType != null">
#{sourceType,jdbcType=BIT},
</if>
<if test="updated != null"> <if test="updated != null">
#{updated,jdbcType=TIMESTAMP}, #{updated,jdbcType=TIMESTAMP},
</if> </if>
<if test="isDeleted != null"> <if test="isDeleted != null">
#{isDeleted,jdbcType=BIT}, #{isDeleted,jdbcType=BIT},
</if> </if>
<if test="bidTime != null">
#{bidTime,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="extra != null"> <if test="extra != null">
#{extra,jdbcType=LONGVARCHAR}, #{extra,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -339,26 +309,15 @@ ...@@ -339,26 +309,15 @@
<if test="detail != null"> <if test="detail != null">
#{detail,jdbcType=LONGVARCHAR}, #{detail,jdbcType=LONGVARCHAR},
</if> </if>
<if test="bidTime != null">
#{bidTime,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.ItemExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.wwdz.ch.db.domain.ItemExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from item select count(*) from item
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
</select> </select>
<update id="updateByExampleSelective" parameterType="map"> <update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update item update item
<set> <set>
<if test="record.id != null"> <if test="record.id != null">
...@@ -388,12 +347,21 @@ ...@@ -388,12 +347,21 @@
<if test="record.created != null"> <if test="record.created != null">
created = #{record.created,jdbcType=TIMESTAMP}, created = #{record.created,jdbcType=TIMESTAMP},
</if> </if>
<if test="record.sourceType != null">
source_type = #{record.sourceType,jdbcType=BIT},
</if>
<if test="record.updated != null"> <if test="record.updated != null">
updated = #{record.updated,jdbcType=TIMESTAMP}, updated = #{record.updated,jdbcType=TIMESTAMP},
</if> </if>
<if test="record.isDeleted != null"> <if test="record.isDeleted != null">
is_deleted = #{record.isDeleted,jdbcType=BIT}, is_deleted = #{record.isDeleted,jdbcType=BIT},
</if> </if>
<if test="record.bidTime != null">
bid_time = #{record.bidTime,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.extra != null"> <if test="record.extra != null">
extra = #{record.extra,jdbcType=LONGVARCHAR}, extra = #{record.extra,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -403,19 +371,12 @@ ...@@ -403,19 +371,12 @@
<if test="record.detail != null"> <if test="record.detail != null">
detail = #{record.detail,jdbcType=LONGVARCHAR}, detail = #{record.detail,jdbcType=LONGVARCHAR},
</if> </if>
<if test="record.bidTime != null">
`bid_time` = #{record.bidTime,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
</update> </update>
<update id="updateByExampleWithBLOBs" parameterType="map"> <update id="updateByExampleWithBLOBs" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update item update item
set id = #{record.id,jdbcType=BIGINT}, set id = #{record.id,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR}, `name` = #{record.name,jdbcType=VARCHAR},
...@@ -426,21 +387,19 @@ ...@@ -426,21 +387,19 @@
share_image = #{record.shareImage,jdbcType=VARCHAR}, share_image = #{record.shareImage,jdbcType=VARCHAR},
price = #{record.price,jdbcType=BIGINT}, price = #{record.price,jdbcType=BIGINT},
created = #{record.created,jdbcType=TIMESTAMP}, created = #{record.created,jdbcType=TIMESTAMP},
source_type = #{record.sourceType,jdbcType=BIT},
updated = #{record.updated,jdbcType=TIMESTAMP}, updated = #{record.updated,jdbcType=TIMESTAMP},
is_deleted = #{record.isDeleted,jdbcType=BIT}, is_deleted = #{record.isDeleted,jdbcType=BIT},
bid_time = #{record.bidTime,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
extra = #{record.extra,jdbcType=LONGVARCHAR}, extra = #{record.extra,jdbcType=LONGVARCHAR},
images = #{record.images,jdbcType=LONGVARCHAR}, images = #{record.images,jdbcType=LONGVARCHAR},
detail = #{record.detail,jdbcType=LONGVARCHAR}, detail = #{record.detail,jdbcType=LONGVARCHAR}
bid_time = #{record.bidTime,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
</update> </update>
<update id="updateByExample" parameterType="map"> <update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update item update item
set id = #{record.id,jdbcType=BIGINT}, set id = #{record.id,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR}, `name` = #{record.name,jdbcType=VARCHAR},
...@@ -451,18 +410,16 @@ ...@@ -451,18 +410,16 @@
share_image = #{record.shareImage,jdbcType=VARCHAR}, share_image = #{record.shareImage,jdbcType=VARCHAR},
price = #{record.price,jdbcType=BIGINT}, price = #{record.price,jdbcType=BIGINT},
created = #{record.created,jdbcType=TIMESTAMP}, created = #{record.created,jdbcType=TIMESTAMP},
source_type = #{record.sourceType,jdbcType=BIT},
updated = #{record.updated,jdbcType=TIMESTAMP}, updated = #{record.updated,jdbcType=TIMESTAMP},
is_deleted = #{record.isDeleted,jdbcType=BIT}, is_deleted = #{record.isDeleted,jdbcType=BIT},
bid_time = #{record.bidTime,jdbcType=VARCHAR} bid_time = #{record.bidTime,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
</update> </update>
<update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.Item"> <update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.Item">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update item update item
<set> <set>
<if test="name != null"> <if test="name != null">
...@@ -489,12 +446,21 @@ ...@@ -489,12 +446,21 @@
<if test="created != null"> <if test="created != null">
created = #{created,jdbcType=TIMESTAMP}, created = #{created,jdbcType=TIMESTAMP},
</if> </if>
<if test="sourceType != null">
source_type = #{sourceType,jdbcType=BIT},
</if>
<if test="updated != null"> <if test="updated != null">
updated = #{updated,jdbcType=TIMESTAMP}, updated = #{updated,jdbcType=TIMESTAMP},
</if> </if>
<if test="isDeleted != null"> <if test="isDeleted != null">
is_deleted = #{isDeleted,jdbcType=BIT}, is_deleted = #{isDeleted,jdbcType=BIT},
</if> </if>
<if test="bidTime != null">
bid_time = #{bidTime,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="extra != null"> <if test="extra != null">
extra = #{extra,jdbcType=LONGVARCHAR}, extra = #{extra,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -504,17 +470,10 @@ ...@@ -504,17 +470,10 @@
<if test="detail != null"> <if test="detail != null">
detail = #{detail,jdbcType=LONGVARCHAR}, detail = #{detail,jdbcType=LONGVARCHAR},
</if> </if>
<if test="bidTime != null">
bid_time = #{bidTime,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.wwdz.ch.db.domain.Item"> <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.wwdz.ch.db.domain.Item">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update item update item
set `name` = #{name,jdbcType=VARCHAR}, set `name` = #{name,jdbcType=VARCHAR},
cid = #{cid,jdbcType=INTEGER}, cid = #{cid,jdbcType=INTEGER},
...@@ -524,19 +483,17 @@ ...@@ -524,19 +483,17 @@
share_image = #{shareImage,jdbcType=VARCHAR}, share_image = #{shareImage,jdbcType=VARCHAR},
price = #{price,jdbcType=BIGINT}, price = #{price,jdbcType=BIGINT},
created = #{created,jdbcType=TIMESTAMP}, created = #{created,jdbcType=TIMESTAMP},
source_type = #{sourceType,jdbcType=BIT},
updated = #{updated,jdbcType=TIMESTAMP}, updated = #{updated,jdbcType=TIMESTAMP},
is_deleted = #{isDeleted,jdbcType=BIT}, is_deleted = #{isDeleted,jdbcType=BIT},
bid_time = #{bidTime,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
extra = #{extra,jdbcType=LONGVARCHAR}, extra = #{extra,jdbcType=LONGVARCHAR},
images = #{images,jdbcType=LONGVARCHAR}, images = #{images,jdbcType=LONGVARCHAR},
detail = #{detail,jdbcType=LONGVARCHAR}, detail = #{detail,jdbcType=LONGVARCHAR}
bid_time = #{bidTime,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.Item"> <update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.Item">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update item update item
set `name` = #{name,jdbcType=VARCHAR}, set `name` = #{name,jdbcType=VARCHAR},
cid = #{cid,jdbcType=INTEGER}, cid = #{cid,jdbcType=INTEGER},
...@@ -546,9 +503,11 @@ ...@@ -546,9 +503,11 @@
share_image = #{shareImage,jdbcType=VARCHAR}, share_image = #{shareImage,jdbcType=VARCHAR},
price = #{price,jdbcType=BIGINT}, price = #{price,jdbcType=BIGINT},
created = #{created,jdbcType=TIMESTAMP}, created = #{created,jdbcType=TIMESTAMP},
source_type = #{sourceType,jdbcType=BIT},
updated = #{updated,jdbcType=TIMESTAMP}, updated = #{updated,jdbcType=TIMESTAMP},
is_deleted = #{isDeleted,jdbcType=BIT}, is_deleted = #{isDeleted,jdbcType=BIT},
bid_time = #{bidTime,jdbcType=VARCHAR} bid_time = #{bidTime,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.ItemExample" resultMap="BaseResultMap"> <select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.ItemExample" resultMap="BaseResultMap">
...@@ -558,6 +517,7 @@ ...@@ -558,6 +517,7 @@
@project https://github.com/itfsw/mybatis-generator-plugin @project https://github.com/itfsw/mybatis-generator-plugin
--> -->
select select
'true' as QUERYID,
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from item from item
<if test="_parameter != null"> <if test="_parameter != null">
...@@ -575,6 +535,7 @@ ...@@ -575,6 +535,7 @@
@project https://github.com/itfsw/mybatis-generator-plugin @project https://github.com/itfsw/mybatis-generator-plugin
--> -->
select select
'true' as QUERYID,
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
, ,
<include refid="Blob_Column_List" /> <include refid="Blob_Column_List" />
...@@ -594,15 +555,16 @@ ...@@ -594,15 +555,16 @@
@project https://github.com/itfsw/mybatis-generator-plugin @project https://github.com/itfsw/mybatis-generator-plugin
--> -->
select select
'true' as QUERYID,
<choose> <choose>
<when test="selective != null and selective.length > 0"> <when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=","> <foreach collection="selective" item="column" separator=",">
${column.escapedColumnName} ${column.escapedColumnName}
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, `name`, cid, is_on_sale, is_std, sort, share_image, price, created, updated, id, `name`, cid, is_on_sale, is_std, sort, share_image, price, created, source_type,
is_deleted, extra, images, detail, bid_time updated, is_deleted, bid_time, remark, extra, images, detail
</otherwise> </otherwise>
</choose> </choose>
from item from item
......
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