diff --git a/ms-biz/src/main/java/com/ms/api/service/ProductToDsItemFailService.java b/ms-biz/src/main/java/com/ms/api/service/ProductToDsItemFailService.java new file mode 100644 index 00000000..5fe769f9 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/api/service/ProductToDsItemFailService.java @@ -0,0 +1,21 @@ +package com.ms.api.service; + +import com.ms.dal.entity.ProductToDsItemFail; + +/** + * + */ +public interface ProductToDsItemFailService { + + int deleteByPrimaryKey(Long id); + + int insert(ProductToDsItemFail record); + + int insertSelective(ProductToDsItemFail record); + + ProductToDsItemFail selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(ProductToDsItemFail record); + + int updateByPrimaryKey(ProductToDsItemFail record); +} diff --git a/ms-biz/src/main/java/com/ms/api/service/impl/ProductToDsItemFailServiceImpl.java b/ms-biz/src/main/java/com/ms/api/service/impl/ProductToDsItemFailServiceImpl.java new file mode 100644 index 00000000..e5d6135e --- /dev/null +++ b/ms-biz/src/main/java/com/ms/api/service/impl/ProductToDsItemFailServiceImpl.java @@ -0,0 +1,53 @@ +package com.ms.api.service.impl; + +import com.ms.dal.entity.ProductToDsItemFail; +import com.ms.api.service.ProductToDsItemFailService; +import com.ms.dal.mapper.ProductToDsItemFailMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * + */ +@Service +public class ProductToDsItemFailServiceImpl implements ProductToDsItemFailService{ + + @Autowired + private ProductToDsItemFailMapper productToDsItemFailMapper; + + @Override + public int deleteByPrimaryKey(Long id) { + return productToDsItemFailMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(ProductToDsItemFail record) { + return productToDsItemFailMapper.insert(record); + } + + @Override + public int insertSelective(ProductToDsItemFail record) { + return productToDsItemFailMapper.insertSelective(record); + } + + @Override + public ProductToDsItemFail selectByPrimaryKey(Long id) { + return productToDsItemFailMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(ProductToDsItemFail record) { + return productToDsItemFailMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(ProductToDsItemFail record) { + return productToDsItemFailMapper.updateByPrimaryKey(record); + } + +} + + + + diff --git a/ms-dal/src/main/java/com/ms/dal/entity/ProductToDsItemFail.java b/ms-dal/src/main/java/com/ms/dal/entity/ProductToDsItemFail.java new file mode 100644 index 00000000..1a4ee3c8 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/entity/ProductToDsItemFail.java @@ -0,0 +1,59 @@ +package com.ms.dal.entity; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 1688商品与抖店商品分销关系失败记录用于重试 + * @TableName product_to_ds_item_fail + */ +@Data +public class ProductToDsItemFail implements Serializable { + /** + * 自增id + */ + private Long productToDsItemFailId; + + /** + * 店铺id + */ + private Long shopId; + + /** + * 抖店商品id + */ + private String productId; + + /** + * 1688商品id + */ + private String sourceItemId; + + /** + * 1688卖家id + */ + private String sourceSellerId; + + /** + * 来源 + */ + private String source; + + /** + * 货源平台 + */ + private String sourcePlatform; + + /** + * 创建时间 + */ + private Date gmtCreate; + + /** + * 修改时间 + */ + private Date gmtModified; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/ProductToDsItemFailMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/ProductToDsItemFailMapper.java new file mode 100644 index 00000000..298d9e60 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/mapper/ProductToDsItemFailMapper.java @@ -0,0 +1,26 @@ +package com.ms.dal.mapper; + +import com.ms.dal.entity.ProductToDsItemFail; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Entity com.ms.dal.entity.ProductToDsItemFail + */ +@Mapper +public interface ProductToDsItemFailMapper { + + int deleteByPrimaryKey(Long id); + + int insert(ProductToDsItemFail record); + + int insertOrUpdate(ProductToDsItemFail record); + + int insertSelective(ProductToDsItemFail record); + + ProductToDsItemFail selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(ProductToDsItemFail record); + + int updateByPrimaryKey(ProductToDsItemFail record); + +} diff --git a/ms-dal/src/main/resources/mapper/ProductToDsItemFailMapper.xml b/ms-dal/src/main/resources/mapper/ProductToDsItemFailMapper.xml new file mode 100644 index 00000000..066ade3c --- /dev/null +++ b/ms-dal/src/main/resources/mapper/ProductToDsItemFailMapper.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + product_to_ds_item_fail_id,shop_id,product_id, + source_item_id,source_seller_id,source, + source_platform,gmt_create,gmt_modified + + + + + + delete from product_to_ds_item_fail + where product_to_ds_item_fail_id = #{productToDsItemFailId,jdbcType=BIGINT} + + + insert into product_to_ds_item_fail + ( product_to_ds_item_fail_id,shop_id,product_id + ,source_item_id,source_seller_id,source + ,source_platform,gmt_create,gmt_modified + ) + values (#{productToDsItemFailId,jdbcType=BIGINT},#{shopId,jdbcType=BIGINT},#{productId,jdbcType=VARCHAR} + ,#{sourceItemId,jdbcType=VARCHAR},#{sourceSellerId,jdbcType=VARCHAR},#{source,jdbcType=VARCHAR} + ,#{sourcePlatform,jdbcType=VARCHAR},#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP} + ) + + + insert into product_to_ds_item_fail + + product_to_ds_item_fail_id, + shop_id, + product_id, + source_item_id, + source_seller_id, + source, + source_platform, + gmt_create, + gmt_modified, + + + #{productToDsItemFailId,jdbcType=BIGINT}, + #{shopId,jdbcType=BIGINT}, + #{productId,jdbcType=VARCHAR}, + #{sourceItemId,jdbcType=VARCHAR}, + #{sourceSellerId,jdbcType=VARCHAR}, + #{source,jdbcType=VARCHAR}, + #{sourcePlatform,jdbcType=VARCHAR}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + ON DUPLICATE KEY UPDATE + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + product_id = #{productId,jdbcType=VARCHAR}, + + + source_item_id = #{sourceItemId,jdbcType=VARCHAR}, + + + source_seller_id = #{sourceSellerId,jdbcType=VARCHAR}, + + + source = #{source,jdbcType=VARCHAR}, + + + source_platform = #{sourcePlatform,jdbcType=VARCHAR}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + + + insert into product_to_ds_item_fail + + product_to_ds_item_fail_id, + shop_id, + product_id, + source_item_id, + source_seller_id, + source, + source_platform, + gmt_create, + gmt_modified, + + + #{productToDsItemFailId,jdbcType=BIGINT}, + #{shopId,jdbcType=BIGINT}, + #{productId,jdbcType=VARCHAR}, + #{sourceItemId,jdbcType=VARCHAR}, + #{sourceSellerId,jdbcType=VARCHAR}, + #{source,jdbcType=VARCHAR}, + #{sourcePlatform,jdbcType=VARCHAR}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + + + update product_to_ds_item_fail + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + product_id = #{productId,jdbcType=VARCHAR}, + + + source_item_id = #{sourceItemId,jdbcType=VARCHAR}, + + + source_seller_id = #{sourceSellerId,jdbcType=VARCHAR}, + + + source = #{source,jdbcType=VARCHAR}, + + + source_platform = #{sourcePlatform,jdbcType=VARCHAR}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + where product_to_ds_item_fail_id = #{productToDsItemFailId,jdbcType=BIGINT} + + + update product_to_ds_item_fail + set + shop_id = #{shopId,jdbcType=BIGINT}, + product_id = #{productId,jdbcType=VARCHAR}, + source_item_id = #{sourceItemId,jdbcType=VARCHAR}, + source_seller_id = #{sourceSellerId,jdbcType=VARCHAR}, + source = #{source,jdbcType=VARCHAR}, + source_platform = #{sourcePlatform,jdbcType=VARCHAR}, + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} + where product_to_ds_item_fail_id = #{productToDsItemFailId,jdbcType=BIGINT} + +