Commit b73c4f2e authored by shiyu's avatar shiyu

type->kind

parent 95513f3e
......@@ -5,11 +5,13 @@ import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.consts.CommonEnum;
import com.wwdz.ch.core.consts.MediaTypeEnum;
import com.wwdz.ch.core.storage.QiniuStorage;
import com.wwdz.ch.db.bean.ItemOfEs;
import com.wwdz.ch.db.dao.CoinsDao;
import com.wwdz.ch.db.dao.ItemDao;
import com.wwdz.ch.db.domain.Coins;
import com.wwdz.ch.db.domain.Item;
import com.wwdz.ch.db.dto.request.CoinRequestDto;
import com.wwdz.ch.db.es.ItemEsDao;
import com.xxdxxs.utils.CommonUtils;
import com.xxdxxs.utils.StringUtils;
import org.slf4j.Logger;
......@@ -28,6 +30,8 @@ import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.IntStream;
@Component
......@@ -44,6 +48,8 @@ public class SynCoinJob {
@Autowired
QiniuStorage qiniuStorage;
@Autowired
ItemEsDao itemEsDao;
public void execute() {
......@@ -52,7 +58,7 @@ public class SynCoinJob {
CoinRequestDto coinRequestDto = new CoinRequestDto();
coinRequestDto.setPage(1);
coinRequestDto.setLimit(100);
PageInfo<Item> pageInfo = itemDao.findByPage(coinRequestDto);
PageInfo<Item> pageInfo = itemDao.findPageExcludeFilter(coinRequestDto);
int totalPageNum = pageInfo.getPages();
logger.info("total page : {}, total : {}", totalPageNum, pageInfo.getTotal());
IntStream.rangeClosed(1, totalPageNum).parallel().forEach(i -> {
......@@ -102,7 +108,7 @@ public class SynCoinJob {
CoinRequestDto coinRequestDto = new CoinRequestDto();
coinRequestDto.setPage(1);
coinRequestDto.setLimit(100);
PageInfo<Item> pageInfo = itemDao.findByPage(coinRequestDto);
PageInfo<Item> pageInfo = itemDao.findPageExcludeFilter(coinRequestDto);
int totalPageNum = pageInfo.getPages();
logger.info("total page : {}, total : {}", totalPageNum, pageInfo.getTotal());
IntStream.rangeClosed(1, totalPageNum).parallel().forEach(i -> {
......@@ -168,4 +174,33 @@ public class SynCoinJob {
return null;
}
public void synItemToEs() {
try {
CoinRequestDto coinRequestDto = new CoinRequestDto();
coinRequestDto.setPage(1);
coinRequestDto.setLimit(100);
PageInfo<Item> pageInfo = itemDao.findPageExcludeFilter(coinRequestDto);
int totalPageNum = pageInfo.getPages();
logger.info("total page : {}, total : {}", totalPageNum, pageInfo.getTotal());
IntStream.rangeClosed(1, totalPageNum).parallel().forEach(i -> {
logger.info(">>>>>>>>>>>>>>>>> 当前同步数据的页码: {} 更新开始 <<<<<<<<<<<<<<<<<", i);
CoinRequestDto dto = new CoinRequestDto();
dto.setPage(i);
dto.setLimit(100);
List<Item> itemList = itemDao.findListByPage(dto);
itemEsDao.create(itemList);
logger.info(">>>>>>>>>>>>>>>>> 页码 = {}, 同步es 成功 ! <<<<<<<<<<<<<<<<<", i);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
});
logger.info(">>>>>>>>>>>>>>>>>数据同步es 完成 SUCCESS!!!!! <<<<<<<<<<<<<<<<<");
} catch (Exception e) {
logger.error("同步数据到es error {}", e);
}
}
}
package com.wwdz.ch.admin.impl;
import com.wwdz.ch.admin.job.SynCoinJob;
import com.wwdz.ch.core.entity.EsSearchParam;
import com.wwdz.ch.core.util.ElasticsearchUtil;
import com.wwdz.ch.db.bean.EsPageInfo;
import com.wwdz.ch.db.bean.ItemOfEs;
import com.wwdz.ch.db.dto.request.EsSearchRequestDto;
import com.wwdz.ch.db.es.ItemEsDao;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
......@@ -16,13 +23,30 @@ import java.util.List;
@RunWith(SpringJUnit4ClassRunner.class)
public class ElasticsearchUtilTest {
private static final Logger logger = LoggerFactory.getLogger(ElasticsearchUtilTest.class);
@Autowired
ElasticsearchUtil elasticsearchUtil;
@Autowired
ItemEsDao itemEsDao;
@Test
public void findDocument() {
EsSearchParam esSearchParam = EsSearchParam.of("清代");
esSearchParam.setContent("清代");
List list = elasticsearchUtil.findDocument(esSearchParam);
}
@Test
public void find() {
EsSearchRequestDto esSearchRequestDto = new EsSearchRequestDto();
esSearchRequestDto.setContent("清代");
esSearchRequestDto.setPage(1);
esSearchRequestDto.setSize(20);
EsPageInfo esPageInfo = itemEsDao.findList(esSearchRequestDto);
logger.info("esPageInfo = {}", esPageInfo);
}
}
\ No newline at end of file
package com.wwdz.ch.admin.impl;
import com.wwdz.ch.admin.job.SynCoinJob;
import com.wwdz.ch.db.es.ItemEsDao;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -15,8 +16,29 @@ public class SynCoinJobTest {
@Autowired
SynCoinJob synCoinJob;
@Autowired
ItemEsDao itemEsDao;
@Test
public void execute() {
synCoinJob.execute();
}
@Test
public void updateImage() throws Exception {
synCoinJob.updateImageUrlOfsSize();
}
@Test
public void createIndex() throws Exception {
itemEsDao.createIndex();
}
@Test
public void synToEs() throws Exception {
synCoinJob.synItemToEs();
}
}
\ No newline at end of file
......@@ -3,7 +3,7 @@ package com.wwdz.ch.core.consts;
/**
* 商品种类
*/
public enum ItemTypeEnum {
public enum ItemKindEnum {
COIN(1, "钱币"),
NEPHRITE(2, "和田玉"),
......@@ -12,15 +12,15 @@ public enum ItemTypeEnum {
private int code;
private String des;
ItemTypeEnum(int code, String des) {
ItemKindEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (ItemTypeEnum itemTypeEnum :ItemTypeEnum.values()) {
if (code == itemTypeEnum.getCode()) {
return itemTypeEnum.getDes();
for (ItemKindEnum itemKindEnum : ItemKindEnum.values()) {
if (code == itemKindEnum.getCode()) {
return itemKindEnum.getDes();
}
}
return null;
......
......@@ -73,4 +73,7 @@ public class ElasticsearchUtil {
}
return Collections.emptyList();
}
}
......@@ -17,6 +17,8 @@ public interface ItemDao {
PageInfo<Item> findByPage(CoinRequestDto coinRequestDto);
PageInfo<Item> findPageExcludeFilter(CoinRequestDto coinRequestDto);
Item findDetails(Long id);
boolean setCoin(Item item);
......@@ -35,6 +37,8 @@ public interface ItemDao {
int update(Item item);
PageInfo<Item> findByRandomPage(CoinRequestDto coinRequestDto);
/**
* 获取分类下的商品
......
......@@ -10,7 +10,7 @@ import lombok.Data;
/**
* @author shiyu
* @date 2023/08/16
* @date 2023/08/17
*/
@Data
public class Item implements Entity {
......@@ -104,7 +104,7 @@ public class Item implements Entity {
/**
* 商品种类1钱币
*/
private Integer type;
private Integer kind;
/**
* 商品额外信息
......@@ -157,7 +157,7 @@ public class Item implements Entity {
sb.append(", isSetted=").append(isSetted);
sb.append(", originalSourceUrl=").append(originalSourceUrl);
sb.append(", source=").append(source);
sb.append(", type=").append(type);
sb.append(", kind=").append(kind);
sb.append(", extra=").append(extra);
sb.append(", images=").append(images);
sb.append(", videos=").append(videos);
......@@ -198,7 +198,7 @@ public class Item implements Entity {
&& (this.getIsSetted() == null ? other.getIsSetted() == null : this.getIsSetted().equals(other.getIsSetted()))
&& (this.getOriginalSourceUrl() == null ? other.getOriginalSourceUrl() == null : this.getOriginalSourceUrl().equals(other.getOriginalSourceUrl()))
&& (this.getSource() == null ? other.getSource() == null : this.getSource().equals(other.getSource()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getKind() == null ? other.getKind() == null : this.getKind().equals(other.getKind()))
&& (this.getExtra() == null ? other.getExtra() == null : this.getExtra().equals(other.getExtra()))
&& (this.getImages() == null ? other.getImages() == null : this.getImages().equals(other.getImages()))
&& (this.getVideos() == null ? other.getVideos() == null : this.getVideos().equals(other.getVideos()))
......@@ -228,7 +228,7 @@ public class Item implements Entity {
result = prime * result + ((getIsSetted() == null) ? 0 : getIsSetted().hashCode());
result = prime * result + ((getOriginalSourceUrl() == null) ? 0 : getOriginalSourceUrl().hashCode());
result = prime * result + ((getSource() == null) ? 0 : getSource().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getKind() == null) ? 0 : getKind().hashCode());
result = prime * result + ((getExtra() == null) ? 0 : getExtra().hashCode());
result = prime * result + ((getImages() == null) ? 0 : getImages().hashCode());
result = prime * result + ((getVideos() == null) ? 0 : getVideos().hashCode());
......@@ -263,7 +263,7 @@ public class Item implements Entity {
isSetted("is_setted", "isSetted", "INTEGER", false),
originalSourceUrl("original_source_url", "originalSourceUrl", "VARCHAR", false),
source("source", "source", "INTEGER", true),
type("type", "type", "INTEGER", true),
kind("kind", "kind", "INTEGER", false),
extra("extra", "extra", "LONGVARCHAR", false),
images("images", "images", "LONGVARCHAR", false),
videos("videos", "videos", "LONGVARCHAR", false),
......
......@@ -2584,18 +2584,18 @@ public class ItemExample {
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("`type` is null");
public Criteria andKindIsNull() {
addCriterion("kind is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("`type` is not null");
public Criteria andKindIsNotNull() {
addCriterion("kind is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Integer value) {
addCriterion("`type` =", value, "type");
public Criteria andKindEqualTo(Integer value) {
addCriterion("kind =", value, "kind");
return (Criteria) this;
}
......@@ -2606,13 +2606,13 @@ public class ItemExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("`type` = ").append(column.getEscapedColumnName()).toString());
public Criteria andKindEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("kind = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("`type` <>", value, "type");
public Criteria andKindNotEqualTo(Integer value) {
addCriterion("kind <>", value, "kind");
return (Criteria) this;
}
......@@ -2623,13 +2623,13 @@ public class ItemExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeNotEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("`type` <> ").append(column.getEscapedColumnName()).toString());
public Criteria andKindNotEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("kind <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("`type` >", value, "type");
public Criteria andKindGreaterThan(Integer value) {
addCriterion("kind >", value, "kind");
return (Criteria) this;
}
......@@ -2640,13 +2640,13 @@ public class ItemExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeGreaterThanColumn(Item.Column column) {
addCriterion(new StringBuilder("`type` > ").append(column.getEscapedColumnName()).toString());
public Criteria andKindGreaterThanColumn(Item.Column column) {
addCriterion(new StringBuilder("kind > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("`type` >=", value, "type");
public Criteria andKindGreaterThanOrEqualTo(Integer value) {
addCriterion("kind >=", value, "kind");
return (Criteria) this;
}
......@@ -2657,13 +2657,13 @@ public class ItemExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeGreaterThanOrEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("`type` >= ").append(column.getEscapedColumnName()).toString());
public Criteria andKindGreaterThanOrEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("kind >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("`type` <", value, "type");
public Criteria andKindLessThan(Integer value) {
addCriterion("kind <", value, "kind");
return (Criteria) this;
}
......@@ -2674,13 +2674,13 @@ public class ItemExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeLessThanColumn(Item.Column column) {
addCriterion(new StringBuilder("`type` < ").append(column.getEscapedColumnName()).toString());
public Criteria andKindLessThanColumn(Item.Column column) {
addCriterion(new StringBuilder("kind < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("`type` <=", value, "type");
public Criteria andKindLessThanOrEqualTo(Integer value) {
addCriterion("kind <=", value, "kind");
return (Criteria) this;
}
......@@ -2691,28 +2691,28 @@ public class ItemExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andTypeLessThanOrEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("`type` <= ").append(column.getEscapedColumnName()).toString());
public Criteria andKindLessThanOrEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("kind <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("`type` in", values, "type");
public Criteria andKindIn(List<Integer> values) {
addCriterion("kind in", values, "kind");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("`type` not in", values, "type");
public Criteria andKindNotIn(List<Integer> values) {
addCriterion("kind not in", values, "kind");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("`type` between", value1, value2, "type");
public Criteria andKindBetween(Integer value1, Integer value2) {
addCriterion("kind between", value1, value2, "kind");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("`type` not between", value1, value2, "type");
public Criteria andKindNotBetween(Integer value1, Integer value2) {
addCriterion("kind not between", value1, value2, "kind");
return (Criteria) this;
}
}
......
......@@ -81,7 +81,7 @@ public class CoinRequestDto extends BaseRequestDto implements Entity {
/**
* 商品种类1钱币
*/
private Integer type;
private Integer kind;
/**
* 商品视频, 分号分隔
......
......@@ -4,16 +4,21 @@ import co.elastic.clients.elasticsearch.ElasticsearchClient;
import co.elastic.clients.elasticsearch._types.SortOrder;
import co.elastic.clients.elasticsearch._types.query_dsl.MatchQuery;
import co.elastic.clients.elasticsearch._types.query_dsl.Query;
import co.elastic.clients.elasticsearch.core.SearchRequest;
import co.elastic.clients.elasticsearch.core.SearchResponse;
import co.elastic.clients.elasticsearch.core.*;
import co.elastic.clients.elasticsearch.core.bulk.BulkOperation;
import co.elastic.clients.elasticsearch.core.bulk.CreateOperation;
import co.elastic.clients.elasticsearch.core.search.Hit;
import co.elastic.clients.elasticsearch.indices.CreateIndexResponse;
import co.elastic.clients.elasticsearch.indices.DeleteIndexResponse;
import com.wwdz.ch.db.bean.EsPageInfo;
import com.wwdz.ch.db.bean.ItemOfEs;
import com.wwdz.ch.db.domain.Item;
import com.wwdz.ch.db.dto.request.EsSearchRequestDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
......@@ -22,11 +27,40 @@ public class ItemEsDao {
private static final Logger logger = LoggerFactory.getLogger(ItemEsDao.class);
private final static String INDEX = "quanku_new";
private final static String INDEX = "quanku_temp";
@Resource(name="clientByPasswd")
ElasticsearchClient elasticsearchClient;
public void createIndex() {
boolean flag = false;
try {
flag = elasticsearchClient.exists(req -> req.index(INDEX)).value();
if (flag){
logger.info("索引 {} 已经存在!", INDEX);
} else {
CreateResponse createResponse = elasticsearchClient.create(req -> req.index(INDEX));
logger.info("创建索引的响应结果:{}", createResponse);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public void deleteIndex() {
boolean flag = false;
try {
flag = elasticsearchClient.exists(req -> req.index(INDEX)).value();
if (flag){
DeleteResponse deleteResponse = elasticsearchClient.delete(req -> req.index(INDEX));
logger.info("索引 {} 删除结果 :{} ", INDEX, deleteResponse);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public EsPageInfo findList(EsSearchRequestDto esSearchRequestDto) {
EsPageInfo esPageInfo = null;
......@@ -65,4 +99,33 @@ public class ItemEsDao {
return esPageInfo;
}
public void create(List<Item> itemList) {
// 批量添加数据
List<BulkOperation> opts = new ArrayList<>();
for (Item item : itemList) {
CreateOperation<Item> optObj = new CreateOperation.Builder<Item>()
.index(INDEX)
.id(String.valueOf(item.getId()))
.document(item)
.build();
BulkOperation opt = new BulkOperation.Builder()
.create(optObj)
.build();
opts.add(opt);
}
BulkRequest bulkRequest = new BulkRequest.Builder()
.operations(opts)
.build();
try {
BulkResponse bulk = elasticsearchClient.bulk(bulkRequest);
logger.info("ES批量新增数据 : {}, 数量:{}" , bulk);
} catch (IOException e) {
logger.info("ES批量新增数据 error" , e);
}
}
}
......@@ -17,6 +17,7 @@ import org.springframework.util.StringUtils;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.IntStream;
@Repository
public class ItemDaoImpl implements ItemDao {
......@@ -84,6 +85,15 @@ public class ItemDaoImpl implements ItemDao {
}
@Override
public PageInfo<Item> findPageExcludeFilter(CoinRequestDto coinRequestDto) {
ItemExample example = new ItemExample();
PageHelper.startPage(coinRequestDto.getPage(), coinRequestDto.getLimit());
List<Item> list = itemMapper.selectByExampleWithBLOBs(example);
return new PageInfo<>(list);
}
@Override
public Item findDetails(Long id) {
ItemExample example = new ItemExample();
......@@ -168,7 +178,11 @@ public class ItemDaoImpl implements ItemDao {
return itemMapper.updateByPrimaryKeySelective(item);
}
@Override
public PageInfo<Item> findByRandomPage(CoinRequestDto coinRequestDto) {
IntStream.range(0, 767372).parallel().boxed().findAny().get();
return null;
}
//-------------------------初始代码--------------------------//
......
......@@ -68,7 +68,6 @@ public interface ItemMapper {
*/
Item selectByPrimaryKeySelective(@Param("id") Long id, @Param("selective") Item.Column ... selective);
Item selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") Item record, @Param("example") ItemExample example);
......
......@@ -20,7 +20,7 @@
<result column="is_setted" jdbcType="INTEGER" property="isSetted" />
<result column="original_source_url" jdbcType="VARCHAR" property="originalSourceUrl" />
<result column="source" jdbcType="INTEGER" property="source" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="kind" jdbcType="INTEGER" property="kind" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.wwdz.ch.db.domain.Item">
<result column="extra" jdbcType="LONGVARCHAR" property="extra" />
......@@ -92,7 +92,7 @@
<sql id="Base_Column_List">
id, `name`, cid, is_on_sale, is_std, sort, share_image, top_image, price, create_time,
source_type, update_time, is_deleted, bid_time, remark, is_setted, original_source_url,
`source`, `type`
`source`, kind
</sql>
<sql id="Blob_Column_List">
extra, images, videos, detail, original_extra
......@@ -149,7 +149,7 @@
<otherwise>
id, `name`, cid, is_on_sale, is_std, sort, share_image, top_image, price, create_time,
source_type, update_time, is_deleted, bid_time, remark, is_setted, original_source_url,
`source`, `type`, extra, images, videos, detail, original_extra
`source`, kind, extra, images, videos, detail, original_extra
</otherwise>
</choose>
from item
......@@ -184,7 +184,7 @@
<otherwise>
id, `name`, cid, is_on_sale, is_std, sort, share_image, top_image, price, create_time,
source_type, update_time, is_deleted, bid_time, remark, is_setted, original_source_url,
`source`, `type`, extra, images, videos, detail, original_extra
`source`, kind, extra, images, videos, detail, original_extra
</otherwise>
</choose>
from item
......@@ -209,7 +209,7 @@
top_image, price, create_time,
source_type, update_time, is_deleted,
bid_time, remark, is_setted,
original_source_url, `source`, `type`,
original_source_url, `source`, kind,
extra, images, videos,
detail, original_extra)
values (#{name,jdbcType=VARCHAR}, #{cid,jdbcType=INTEGER}, #{isOnSale,jdbcType=BIT},
......@@ -217,7 +217,7 @@
#{topImage,jdbcType=VARCHAR}, #{price,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{sourceType,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT},
#{bidTime,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{isSetted,jdbcType=INTEGER},
#{originalSourceUrl,jdbcType=VARCHAR}, #{source,jdbcType=INTEGER}, #{type,jdbcType=INTEGER},
#{originalSourceUrl,jdbcType=VARCHAR}, #{source,jdbcType=INTEGER}, #{kind,jdbcType=INTEGER},
#{extra,jdbcType=LONGVARCHAR}, #{images,jdbcType=LONGVARCHAR}, #{videos,jdbcType=LONGVARCHAR},
#{detail,jdbcType=LONGVARCHAR}, #{originalExtra,jdbcType=LONGVARCHAR})
</insert>
......@@ -278,8 +278,8 @@
<if test="source != null">
`source`,
</if>
<if test="type != null">
`type`,
<if test="kind != null">
kind,
</if>
<if test="extra != null">
extra,
......@@ -349,8 +349,8 @@
<if test="source != null">
#{source,jdbcType=INTEGER},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
<if test="kind != null">
#{kind,jdbcType=INTEGER},
</if>
<if test="extra != null">
#{extra,jdbcType=LONGVARCHAR},
......@@ -432,8 +432,8 @@
<if test="record.source != null">
`source` = #{record.source,jdbcType=INTEGER},
</if>
<if test="record.type != null">
`type` = #{record.type,jdbcType=INTEGER},
<if test="record.kind != null">
kind = #{record.kind,jdbcType=INTEGER},
</if>
<if test="record.extra != null">
extra = #{record.extra,jdbcType=LONGVARCHAR},
......@@ -475,7 +475,7 @@
is_setted = #{record.isSetted,jdbcType=INTEGER},
original_source_url = #{record.originalSourceUrl,jdbcType=VARCHAR},
`source` = #{record.source,jdbcType=INTEGER},
`type` = #{record.type,jdbcType=INTEGER},
kind = #{record.kind,jdbcType=INTEGER},
extra = #{record.extra,jdbcType=LONGVARCHAR},
images = #{record.images,jdbcType=LONGVARCHAR},
videos = #{record.videos,jdbcType=LONGVARCHAR},
......@@ -505,7 +505,7 @@
is_setted = #{record.isSetted,jdbcType=INTEGER},
original_source_url = #{record.originalSourceUrl,jdbcType=VARCHAR},
`source` = #{record.source,jdbcType=INTEGER},
`type` = #{record.type,jdbcType=INTEGER}
kind = #{record.kind,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -564,8 +564,8 @@
<if test="source != null">
`source` = #{source,jdbcType=INTEGER},
</if>
<if test="type != null">
`type` = #{type,jdbcType=INTEGER},
<if test="kind != null">
kind = #{kind,jdbcType=INTEGER},
</if>
<if test="extra != null">
extra = #{extra,jdbcType=LONGVARCHAR},
......@@ -604,7 +604,7 @@
is_setted = #{isSetted,jdbcType=INTEGER},
original_source_url = #{originalSourceUrl,jdbcType=VARCHAR},
`source` = #{source,jdbcType=INTEGER},
`type` = #{type,jdbcType=INTEGER},
kind = #{kind,jdbcType=INTEGER},
extra = #{extra,jdbcType=LONGVARCHAR},
images = #{images,jdbcType=LONGVARCHAR},
videos = #{videos,jdbcType=LONGVARCHAR},
......@@ -631,7 +631,7 @@
is_setted = #{isSetted,jdbcType=INTEGER},
original_source_url = #{originalSourceUrl,jdbcType=VARCHAR},
`source` = #{source,jdbcType=INTEGER},
`type` = #{type,jdbcType=INTEGER}
kind = #{kind,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.ItemExample" resultMap="BaseResultMap">
......@@ -689,7 +689,7 @@
<otherwise>
id, `name`, cid, is_on_sale, is_std, sort, share_image, top_image, price, create_time,
source_type, update_time, is_deleted, bid_time, remark, is_setted, original_source_url,
`source`, `type`, extra, images, videos, detail, original_extra
`source`, kind, extra, images, videos, detail, original_extra
</otherwise>
</choose>
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