Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
Z
zion
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
zion
Commits
42803220
提交
42803220
authored
12月 31, 2019
作者:
zgy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成商品首页展示,商品详情,sku,商品搜索等功能
上级
109aa090
隐藏空白字符变更
内嵌
并排
正在显示
22 个修改的文件
包含
1682 行增加
和
84 行删除
+1682
-84
TbCfStationItemController.java
...zion/chinafrica/controller/TbCfStationItemController.java
+45
-6
TbCfCategoryDao.java
...java/com/diaoyun/zion/chinafrica/dao/TbCfCategoryDao.java
+24
-0
TbCfItemDescDao.java
...java/com/diaoyun/zion/chinafrica/dao/TbCfItemDescDao.java
+17
-0
TbCfItemSkusDao.java
...java/com/diaoyun/zion/chinafrica/dao/TbCfItemSkusDao.java
+25
-0
TbCfOptionDao.java
...n/java/com/diaoyun/zion/chinafrica/dao/TbCfOptionDao.java
+19
-0
TbCfStationItemDao.java
...a/com/diaoyun/zion/chinafrica/dao/TbCfStationItemDao.java
+2
-0
ItemSkuDetail.java
...ava/com/diaoyun/zion/chinafrica/entity/ItemSkuDetail.java
+38
-0
ItemSkuInfo.java
.../java/com/diaoyun/zion/chinafrica/entity/ItemSkuInfo.java
+66
-0
PageHomeItems.java
...ava/com/diaoyun/zion/chinafrica/entity/PageHomeItems.java
+39
-0
SkuDetail.java
...in/java/com/diaoyun/zion/chinafrica/entity/SkuDetail.java
+27
-0
TbCfCategoryEntity.java
...om/diaoyun/zion/chinafrica/entity/TbCfCategoryEntity.java
+170
-0
TbCfItemDescEntity.java
...om/diaoyun/zion/chinafrica/entity/TbCfItemDescEntity.java
+102
-0
TbCfItemSkusEntity.java
...om/diaoyun/zion/chinafrica/entity/TbCfItemSkusEntity.java
+216
-0
TbCfOptionEntity.java
.../com/diaoyun/zion/chinafrica/entity/TbCfOptionEntity.java
+153
-0
TbCfStationItemService.java
...aoyun/zion/chinafrica/service/TbCfStationItemService.java
+28
-1
TbCfStationItemServiceImpl.java
...n/chinafrica/service/impl/TbCfStationItemServiceImpl.java
+114
-5
application.yml
src/main/resources/application.yml
+2
-2
TbCfCategoryDao.xml
src/main/resources/mapper/TbCfCategoryDao.xml
+132
-0
TbCfItemDescDao.xml
src/main/resources/mapper/TbCfItemDescDao.xml
+105
-0
TbCfItemSkusDao.xml
src/main/resources/mapper/TbCfItemSkusDao.xml
+146
-0
TbCfOptionDao.xml
src/main/resources/mapper/TbCfOptionDao.xml
+124
-0
TbCfStationItemDao.xml
src/main/resources/mapper/TbCfStationItemDao.xml
+88
-70
没有找到文件。
src/main/java/com/diaoyun/zion/chinafrica/controller/TbCfStationItemController.java
浏览文件 @
42803220
...
...
@@ -17,12 +17,13 @@ import org.springframework.web.bind.annotation.*;
* @author lipengjun
* @date 2019-09-05 16:51:07
*/
@Api
(
tags
=
"商品独立站"
)
@Api
(
tags
=
"商品独立站"
)
@RestController
@RequestMapping
(
"/itemStation"
)
public
class
TbCfStationItemController
{
@Autowired
private
TbCfStationItemService
tbCfStationItemService
;
/*
@ApiOperation("获取商品独立站")
@GetMapping
...
...
@@ -38,15 +39,53 @@ public class TbCfStationItemController {
}*/
@ApiOperation
(
"统计商品点击量"
)
@PutMapping
(
"/item/{itemId}"
)
@ResponseBody
public
Result
updateItemNum
(
@ApiParam
(
value
=
"商品ID"
)
@PathVariable
(
"itemId"
)
String
itemId
)
{
public
Result
updateItemNum
(
@ApiParam
(
value
=
"商品ID"
)
@PathVariable
(
"itemId"
)
String
itemId
)
{
TbCfStationItemEntity
item
=
tbCfStationItemService
.
queryObject
(
itemId
);
if
(
item
!=
null
)
{
Long
start
=
item
.
getItemNum
();
if
(
item
!=
null
)
{
Long
start
=
item
.
getItemNum
();
item
.
setItemNum
(++
start
);
int
update
=
tbCfStationItemService
.
update
(
item
);
return
new
Result
(
update
,
ResultCodeEnum
.
SUCCESS
.
getDesc
());
}
return
new
Result
(
ResultCodeEnum
.
ERROR
.
getCode
(),
ResultCodeEnum
.
ERROR
.
getDesc
());
return
new
Result
(
ResultCodeEnum
.
ERROR
.
getCode
(),
ResultCodeEnum
.
ERROR
.
getDesc
());
}
/**
* 首页商品
*
* @return
*/
@ApiOperation
(
"首页商品"
)
@GetMapping
(
"/"
)
public
Result
queryPageHomeItems
()
{
return
tbCfStationItemService
.
queryPageHomeItems
();
}
/**
* 商品sku
*
* @param itemId
* @return
*/
@ApiOperation
(
"商品sku"
)
@GetMapping
(
"/queryItemSku/{itemId}"
)
public
Result
queryItemSku
(
@ApiParam
(
value
=
"商品ID"
)
@PathVariable
(
"itemId"
)
String
itemId
)
{
return
tbCfStationItemService
.
queryItemSku
(
itemId
);
}
/**
* 商品搜索
*
* @param name
* @return
*/
@ApiOperation
(
"商品搜索"
)
@GetMapping
(
"/searchItems/{name}"
)
public
Result
searchItems
(
@ApiParam
(
value
=
"名字"
)
@PathVariable
(
"name"
)
String
name
)
{
return
tbCfStationItemService
.
searchItems
(
name
);
}
}
src/main/java/com/diaoyun/zion/chinafrica/dao/TbCfCategoryDao.java
0 → 100644
浏览文件 @
42803220
package
com
.
diaoyun
.
zion
.
chinafrica
.
dao
;
import
com.diaoyun.zion.chinafrica.entity.TbCfCategoryEntity
;
import
com.diaoyun.zion.master.dao.BaseDao
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* Dao
*
* @author lipengjun
* @date 2019-12-26 15:10:48
*/
public
interface
TbCfCategoryDao
extends
BaseDao
<
TbCfCategoryEntity
>
{
List
<
TbCfCategoryEntity
>
queryByItemId
(
String
itemId
);
int
changStatus
(
String
itemId
);
int
changStatusBatch
(
String
[]
itemId
);
TbCfCategoryEntity
queryByOrderNum
(
@Param
(
"orderNum"
)
Integer
orderNum
,
@Param
(
"itemId"
)
String
itemId
);
}
src/main/java/com/diaoyun/zion/chinafrica/dao/TbCfItemDescDao.java
0 → 100644
浏览文件 @
42803220
package
com
.
diaoyun
.
zion
.
chinafrica
.
dao
;
import
com.diaoyun.zion.chinafrica.entity.TbCfItemDescEntity
;
import
com.diaoyun.zion.master.dao.BaseDao
;
/**
* Dao
*
* @author lipengjun
* @date 2019-12-23 14:28:47
*/
public
interface
TbCfItemDescDao
extends
BaseDao
<
TbCfItemDescEntity
>
{
int
changStatus
(
String
itemId
);
int
changStatusBatch
(
String
[]
itemId
);
}
src/main/java/com/diaoyun/zion/chinafrica/dao/TbCfItemSkusDao.java
0 → 100644
浏览文件 @
42803220
package
com
.
diaoyun
.
zion
.
chinafrica
.
dao
;
import
com.diaoyun.zion.chinafrica.entity.TbCfItemSkusEntity
;
import
com.diaoyun.zion.master.dao.BaseDao
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* Dao
*
* @author lipengjun
* @date 2019-12-24 17:10:28
*/
public
interface
TbCfItemSkusDao
extends
BaseDao
<
TbCfItemSkusEntity
>
{
List
<
TbCfItemSkusEntity
>
querySkusByItemId
(
String
itemId
);
int
changStatus
(
String
itemId
);
int
changStatusBatch
(
String
[]
itemId
);
TbCfItemSkusEntity
queryByOrderNum
(
@Param
(
"orderNum"
)
Integer
orderNum
,
@Param
(
"itemId"
)
String
itemId
);
int
deleteByItemId
(
String
itemId
);
}
src/main/java/com/diaoyun/zion/chinafrica/dao/TbCfOptionDao.java
0 → 100644
浏览文件 @
42803220
package
com
.
diaoyun
.
zion
.
chinafrica
.
dao
;
import
com.diaoyun.zion.chinafrica.entity.TbCfOptionEntity
;
import
com.diaoyun.zion.master.dao.BaseDao
;
/**
* 商品属性Dao
*
* @author lipengjun
* @date 2019-12-26 16:36:21
*/
public
interface
TbCfOptionDao
extends
BaseDao
<
TbCfOptionEntity
>
{
int
changStatus
(
String
itemId
);
int
changStatusBatch
(
String
[]
itemIds
);
int
deleteByItemId
(
String
itemId
);
}
src/main/java/com/diaoyun/zion/chinafrica/dao/TbCfStationItemDao.java
浏览文件 @
42803220
...
...
@@ -17,6 +17,7 @@ public interface TbCfStationItemDao extends BaseDao<TbCfStationItemEntity> {
/**
* 获取商品独立站
*
* @return
*/
List
<
TbCfStationItemEntity
>
getItemStationList
(
String
categoryId
);
...
...
@@ -28,6 +29,7 @@ public interface TbCfStationItemDao extends BaseDao<TbCfStationItemEntity> {
*/
List
<
TbCfStationItemEntity
>
getGoodsTypeList
(
String
categoryId
);
List
<
TbCfStationItemEntity
>
searchItems
(
String
name
);
}
src/main/java/com/diaoyun/zion/chinafrica/entity/ItemSkuDetail.java
0 → 100644
浏览文件 @
42803220
package
com
.
diaoyun
.
zion
.
chinafrica
.
entity
;
import
java.util.List
;
/**
* @Auther: wudepeng
* @Date: 2019/12/30
* @Description:商品sku
*/
public
class
ItemSkuDetail
{
private
String
categoryId
;
private
String
categoryName
;
private
List
<
TbCfItemSkusEntity
>
skuList
;
public
String
getCategoryId
()
{
return
categoryId
;
}
public
void
setCategoryId
(
String
categoryId
)
{
this
.
categoryId
=
categoryId
;
}
public
String
getCategoryName
()
{
return
categoryName
;
}
public
void
setCategoryName
(
String
categoryName
)
{
this
.
categoryName
=
categoryName
;
}
public
List
<
TbCfItemSkusEntity
>
getSkuList
()
{
return
skuList
;
}
public
void
setSkuList
(
List
<
TbCfItemSkusEntity
>
skuList
)
{
this
.
skuList
=
skuList
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/entity/ItemSkuInfo.java
0 → 100644
浏览文件 @
42803220
package
com
.
diaoyun
.
zion
.
chinafrica
.
entity
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* @Auther: wudepeng
* @Date: 2019/12/31
* @Description:
*/
public
class
ItemSkuInfo
{
private
String
id
;
private
String
itemId
;
private
BigDecimal
price
;
private
Integer
count
;
private
List
<
SkuDetail
>
skus
;
private
TbCfItemDescEntity
itemDesc
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getItemId
()
{
return
itemId
;
}
public
void
setItemId
(
String
itemId
)
{
this
.
itemId
=
itemId
;
}
public
BigDecimal
getPrice
()
{
return
price
;
}
public
void
setPrice
(
BigDecimal
price
)
{
this
.
price
=
price
;
}
public
Integer
getCount
()
{
return
count
;
}
public
void
setCount
(
Integer
count
)
{
this
.
count
=
count
;
}
public
List
<
SkuDetail
>
getSkus
()
{
return
skus
;
}
public
void
setSkus
(
List
<
SkuDetail
>
skus
)
{
this
.
skus
=
skus
;
}
public
TbCfItemDescEntity
getItemDesc
()
{
return
itemDesc
;
}
public
void
setItemDesc
(
TbCfItemDescEntity
itemDesc
)
{
this
.
itemDesc
=
itemDesc
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/entity/PageHomeItems.java
0 → 100644
浏览文件 @
42803220
package
com
.
diaoyun
.
zion
.
chinafrica
.
entity
;
import
java.util.List
;
/**
* @Auther: wudepeng
* @Date: 2019/12/30
* @Description:app首页商品
*/
public
class
PageHomeItems
{
private
String
categoryId
;
private
String
categoryName
;
private
List
<
TbCfStationItemEntity
>
itemInfo
;
public
String
getCategoryId
()
{
return
categoryId
;
}
public
void
setCategoryId
(
String
categoryId
)
{
this
.
categoryId
=
categoryId
;
}
public
String
getCategoryName
()
{
return
categoryName
;
}
public
void
setCategoryName
(
String
categoryName
)
{
this
.
categoryName
=
categoryName
;
}
public
List
<
TbCfStationItemEntity
>
getItemInfo
()
{
return
itemInfo
;
}
public
void
setItemInfo
(
List
<
TbCfStationItemEntity
>
itemInfo
)
{
this
.
itemInfo
=
itemInfo
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/entity/SkuDetail.java
0 → 100644
浏览文件 @
42803220
package
com
.
diaoyun
.
zion
.
chinafrica
.
entity
;
/**
* @Auther: wudepeng
* @Date: 2019/12/31
* @Description:
*/
public
class
SkuDetail
{
private
String
skuName
;
private
String
skuDesc
;
public
String
getSkuName
()
{
return
skuName
;
}
public
void
setSkuName
(
String
skuName
)
{
this
.
skuName
=
skuName
;
}
public
String
getSkuDesc
()
{
return
skuDesc
;
}
public
void
setSkuDesc
(
String
skuDesc
)
{
this
.
skuDesc
=
skuDesc
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/entity/TbCfCategoryEntity.java
0 → 100644
浏览文件 @
42803220
package
com
.
diaoyun
.
zion
.
chinafrica
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 实体
* 表名 tb_cf_category
*
* @author lipengjun
* @date 2019-12-26 21:20:36
*/
public
class
TbCfCategoryEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 商品规格ID
*/
private
String
categoryId
;
/**
* 规格名称
*/
private
String
categoryName
;
/**
* 规格详情
*/
private
String
categoryDesc
;
/**
* option
*/
private
String
option
;
/**
* 商品ID
*/
private
String
itemId
;
/**
* 排序
*/
private
Integer
orderNum
;
/**
* 删除标志 0:正常 1:已删除
*/
private
Integer
delFlag
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 设置:商品规格ID
*/
public
void
setCategoryId
(
String
categoryId
)
{
this
.
categoryId
=
categoryId
;
}
/**
* 获取:商品规格ID
*/
public
String
getCategoryId
()
{
return
categoryId
;
}
/**
* 设置:规格名称
*/
public
void
setCategoryName
(
String
categoryName
)
{
this
.
categoryName
=
categoryName
;
}
/**
* 获取:规格名称
*/
public
String
getCategoryName
()
{
return
categoryName
;
}
/**
* 设置:规格详情
*/
public
void
setCategoryDesc
(
String
categoryDesc
)
{
this
.
categoryDesc
=
categoryDesc
;
}
/**
* 获取:规格详情
*/
public
String
getCategoryDesc
()
{
return
categoryDesc
;
}
/**
* 设置:option
*/
public
void
setOption
(
String
option
)
{
this
.
option
=
option
;
}
/**
* 获取:option
*/
public
String
getOption
()
{
return
option
;
}
/**
* 设置:商品ID
*/
public
void
setItemId
(
String
itemId
)
{
this
.
itemId
=
itemId
;
}
/**
* 获取:商品ID
*/
public
String
getItemId
()
{
return
itemId
;
}
/**
* 设置:排序
*/
public
void
setOrderNum
(
Integer
orderNum
)
{
this
.
orderNum
=
orderNum
;
}
/**
* 获取:排序
*/
public
Integer
getOrderNum
()
{
return
orderNum
;
}
/**
* 设置:删除标志 0:正常 1:已删除
*/
public
void
setDelFlag
(
Integer
delFlag
)
{
this
.
delFlag
=
delFlag
;
}
/**
* 获取:删除标志 0:正常 1:已删除
*/
public
Integer
getDelFlag
()
{
return
delFlag
;
}
/**
* 设置:创建时间
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* 获取:创建时间
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* 设置:更新时间
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
/**
* 获取:更新时间
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/entity/TbCfItemDescEntity.java
0 → 100644
浏览文件 @
42803220
package
com
.
diaoyun
.
zion
.
chinafrica
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 实体
* 表名 tb_cf_item_desc
*
* @author lipengjun
* @date 2019-12-23 14:28:47
*/
public
class
TbCfItemDescEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 商品ID
*/
private
String
itemId
;
/**
* 商品描述
*/
private
String
itemDesc
;
/**
* 删除标志
*/
private
Integer
delFlag
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 设置:商品ID
*/
public
void
setItemId
(
String
itemId
)
{
this
.
itemId
=
itemId
;
}
/**
* 获取:商品ID
*/
public
String
getItemId
()
{
return
itemId
;
}
/**
* 设置:商品描述
*/
public
void
setItemDesc
(
String
itemDesc
)
{
this
.
itemDesc
=
itemDesc
;
}
/**
* 获取:商品描述
*/
public
String
getItemDesc
()
{
return
itemDesc
;
}
/**
* 设置:删除标志
*/
public
void
setDelFlag
(
Integer
delFlag
)
{
this
.
delFlag
=
delFlag
;
}
/**
* 获取:删除标志
*/
public
Integer
getDelFlag
()
{
return
delFlag
;
}
/**
* 设置:创建时间
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* 获取:创建时间
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* 设置:更新时间
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
/**
* 获取:更新时间
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/entity/TbCfItemSkusEntity.java
0 → 100644
浏览文件 @
42803220
package
com
.
diaoyun
.
zion
.
chinafrica
.
entity
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 实体
* 表名 tb_cf_item_skus
*
* @author lipengjun
* @date 2019-12-26 20:47:21
*/
public
class
TbCfItemSkusEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 商品规格ID
*/
private
String
id
;
/**
* 商品ID
*/
private
String
itemId
;
/**
* 数量
*/
private
Integer
skuCount
;
/**
* 规格名称
*/
private
String
skuName
;
/**
* 规格描述
*/
private
String
skuDesc
;
/**
* 价格
*/
private
BigDecimal
skuPrice
;
/**
* 属性IDS
*/
private
String
optionIds
;
/**
* 排序号
*/
private
Integer
orderNum
;
/**
* 删除标记
*/
private
Integer
delFlag
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 设置:商品规格ID
*/
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
/**
* 获取:商品规格ID
*/
public
String
getId
()
{
return
id
;
}
/**
* 设置:商品ID
*/
public
void
setItemId
(
String
itemId
)
{
this
.
itemId
=
itemId
;
}
/**
* 获取:商品ID
*/
public
String
getItemId
()
{
return
itemId
;
}
/**
* 设置:规格名称
*/
public
void
setSkuName
(
String
skuName
)
{
this
.
skuName
=
skuName
;
}
/**
* 获取:规格名称
*/
public
String
getSkuName
()
{
return
skuName
;
}
/**
* 设置:规格描述
*/
public
void
setSkuDesc
(
String
skuDesc
)
{
this
.
skuDesc
=
skuDesc
;
}
/**
* 获取:规格描述
*/
public
String
getSkuDesc
()
{
return
skuDesc
;
}
/**
* 设置:价格
*/
public
void
setSkuPrice
(
BigDecimal
skuPrice
)
{
this
.
skuPrice
=
skuPrice
;
}
/**
* 获取:价格
*/
public
BigDecimal
getSkuPrice
()
{
return
skuPrice
;
}
/**
* 设置:属性IDS
*/
public
void
setOptionIds
(
String
optionIds
)
{
this
.
optionIds
=
optionIds
;
}
/**
* 获取:属性IDS
*/
public
String
getOptionIds
()
{
return
optionIds
;
}
/**
* 设置:数量
*/
public
void
setSkuCount
(
Integer
skuCount
)
{
this
.
skuCount
=
skuCount
;
}
/**
* 获取:数量
*/
public
Integer
getSkuCount
()
{
return
skuCount
;
}
/**
* 设置:排序号
*/
public
void
setOrderNum
(
Integer
orderNum
)
{
this
.
orderNum
=
orderNum
;
}
/**
* 获取:排序号
*/
public
Integer
getOrderNum
()
{
return
orderNum
;
}
/**
* 设置:删除标记
*/
public
void
setDelFlag
(
Integer
delFlag
)
{
this
.
delFlag
=
delFlag
;
}
/**
* 获取:删除标记
*/
public
Integer
getDelFlag
()
{
return
delFlag
;
}
/**
* 设置:创建时间
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* 获取:创建时间
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* 设置:更新时间
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
/**
* 获取:更新时间
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/entity/TbCfOptionEntity.java
0 → 100644
浏览文件 @
42803220
package
com
.
diaoyun
.
zion
.
chinafrica
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 商品属性实体
* 表名 tb_cf_option
*
* @author lipengjun
* @date 2019-12-26 16:36:21
*/
public
class
TbCfOptionEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 商品属性
*/
private
String
optionId
;
/**
* 属性名
*/
private
String
optionName
;
/**
* 属性种类
*/
private
String
optiionSpecies
;
/**
* 商品ID
*/
private
String
itemId
;
/**
* 商品规格ID
*/
private
String
cid
;
/**
* 删除标志 0:正常 1:已删除
*/
private
Integer
delFlag
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 设置:商品属性
*/
public
void
setOptionId
(
String
optionId
)
{
this
.
optionId
=
optionId
;
}
/**
* 获取:商品属性
*/
public
String
getOptionId
()
{
return
optionId
;
}
/**
* 设置:属性名
*/
public
void
setOptionName
(
String
optionName
)
{
this
.
optionName
=
optionName
;
}
/**
* 获取:属性名
*/
public
String
getOptionName
()
{
return
optionName
;
}
/**
* 设置:属性种类
*/
public
void
setOptiionSpecies
(
String
optiionSpecies
)
{
this
.
optiionSpecies
=
optiionSpecies
;
}
/**
* 获取:属性种类
*/
public
String
getOptiionSpecies
()
{
return
optiionSpecies
;
}
/**
* 设置:商品ID
*/
public
void
setItemId
(
String
itemId
)
{
this
.
itemId
=
itemId
;
}
/**
* 获取:商品ID
*/
public
String
getItemId
()
{
return
itemId
;
}
/**
* 设置:商品规格ID
*/
public
void
setCid
(
String
cid
)
{
this
.
cid
=
cid
;
}
/**
* 获取:商品规格ID
*/
public
String
getCid
()
{
return
cid
;
}
/**
* 设置:删除标志 0:正常 1:已删除
*/
public
void
setDelFlag
(
Integer
delFlag
)
{
this
.
delFlag
=
delFlag
;
}
/**
* 获取:删除标志 0:正常 1:已删除
*/
public
Integer
getDelFlag
()
{
return
delFlag
;
}
/**
* 设置:创建时间
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* 获取:创建时间
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* 设置:更新时间
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
/**
* 获取:更新时间
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/TbCfStationItemService.java
浏览文件 @
42803220
...
...
@@ -2,6 +2,8 @@ package com.diaoyun.zion.chinafrica.service;
import
com.diaoyun.zion.chinafrica.entity.TbCfStationItemEntity
;
import
com.diaoyun.zion.master.base.Result
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -79,9 +81,34 @@ public interface TbCfStationItemService {
/**
* 获取商品独立站
*
* @param pageNum
* @param pageSize
* @return
*/
Result
getItemStationList
(
Integer
pageNum
,
Integer
pageSize
,
String
categoryId
);
Result
getItemStationList
(
Integer
pageNum
,
Integer
pageSize
,
String
categoryId
);
/**
* 首页商品
*
* @return
*/
Result
queryPageHomeItems
();
/**
* 商品sku
*
* @param itemId
* @return
*/
Result
queryItemSku
(
String
itemId
);
/**
* 商品搜索
*
* @param name
* @return
*/
Result
searchItems
(
String
name
);
}
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfStationItemServiceImpl.java
浏览文件 @
42803220
package
com
.
diaoyun
.
zion
.
chinafrica
.
service
.
impl
;
import
com.diaoyun.zion.chinafrica.dao.TbCfGoodstypeDao
;
import
com.diaoyun.zion.chinafrica.dao.TbCfItemDescDao
;
import
com.diaoyun.zion.chinafrica.dao.TbCfItemSkusDao
;
import
com.diaoyun.zion.chinafrica.dao.TbCfStationItemDao
;
import
com.diaoyun.zion.chinafrica.entity.TbCfPlatformEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfStationItemEntity
;
import
com.diaoyun.zion.chinafrica.entity.*
;
import
com.diaoyun.zion.chinafrica.service.TbCfStationItemService
;
import
com.diaoyun.zion.master.base.Result
;
import
com.diaoyun.zion.master.enums.ResultCodeEnum
;
import
com.diaoyun.zion.master.util.IdUtil
;
import
com.github.pagehelper.PageInfo
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -25,6 +32,14 @@ import static com.github.pagehelper.page.PageMethod.startPage;
public
class
TbCfStationItemServiceImpl
implements
TbCfStationItemService
{
@Autowired
private
TbCfStationItemDao
tbCfStationItemDao
;
@Autowired
private
TbCfItemDescDao
tbCfItemDescDao
;
@Autowired
private
TbCfGoodstypeDao
tbCfGoodstypeDao
;
@Autowired
private
TbCfItemSkusDao
tbCfItemSkusDao
;
@Override
public
TbCfStationItemEntity
queryObject
(
String
itemId
)
{
...
...
@@ -68,12 +83,106 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
}
@Override
public
Result
getItemStationList
(
Integer
pageNum
,
Integer
pageSize
,
String
categoryId
)
{
public
Result
getItemStationList
(
Integer
pageNum
,
Integer
pageSize
,
String
categoryId
)
{
Result
<
PageInfo
>
result
=
new
Result
<>();
startPage
(
pageNum
,
pageSize
);
List
<
TbCfStationItemEntity
>
tbCfStationItemList
=
tbCfStationItemDao
.
getItemStationList
(
categoryId
);
startPage
(
pageNum
,
pageSize
);
List
<
TbCfStationItemEntity
>
tbCfStationItemList
=
tbCfStationItemDao
.
getItemStationList
(
categoryId
);
PageInfo
<
TbCfStationItemEntity
>
pageInfo
=
new
PageInfo
<>(
tbCfStationItemList
);
result
.
setData
(
pageInfo
);
return
result
;
}
/**
* 首页商品
*
* @return
*/
@Override
public
Result
queryPageHomeItems
()
{
Result
result
=
new
Result
();
Map
<
String
,
Object
>
map
=
new
HashMap
();
List
<
PageHomeItems
>
pageHomeItemsList
=
new
ArrayList
<>();
try
{
List
<
TbCfGoodstypeEntity
>
categoryList
=
tbCfGoodstypeDao
.
queryList
(
null
);
PageHomeItems
pageHomeItems
=
new
PageHomeItems
();
for
(
TbCfGoodstypeEntity
category
:
categoryList
)
{
pageHomeItems
.
setCategoryId
(
category
.
getGoodstypeId
());
pageHomeItems
.
setCategoryName
(
category
.
getGoodstypeTitle
());
List
<
TbCfStationItemEntity
>
itemList
=
tbCfStationItemDao
.
getGoodsTypeList
(
category
.
getGoodstypeId
());
pageHomeItems
.
setItemInfo
(
itemList
);
pageHomeItemsList
.
add
(
pageHomeItems
);
}
map
.
put
(
"items"
,
pageHomeItemsList
);
result
.
setData
(
map
).
setMessage
(
ResultCodeEnum
.
SUCCESS
.
getDesc
());
}
catch
(
Exception
e
)
{
result
.
setCode
(
ResultCodeEnum
.
QUERY_ERROR
.
getCode
()).
setMessage
(
ResultCodeEnum
.
QUERY_ERROR
.
getDesc
());
}
return
result
;
}
/**
* 商品sku、详情
*
* @param itemId
* @return
*/
@Override
public
Result
queryItemSku
(
String
itemId
)
{
Result
result
=
new
Result
();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
try
{
List
<
TbCfItemSkusEntity
>
itemSkuList
=
tbCfItemSkusDao
.
querySkusByItemId
(
itemId
);
List
<
ItemSkuInfo
>
skuInfoList
=
new
ArrayList
<>();
for
(
TbCfItemSkusEntity
itemSkusEntity
:
itemSkuList
)
{
ItemSkuInfo
skuInfo
=
new
ItemSkuInfo
();
skuInfo
.
setId
(
itemSkusEntity
.
getId
());
skuInfo
.
setItemId
(
itemSkusEntity
.
getItemId
());
skuInfo
.
setPrice
(
itemSkusEntity
.
getSkuPrice
());
skuInfo
.
setCount
(
itemSkusEntity
.
getSkuCount
());
String
[]
name
=
itemSkusEntity
.
getSkuName
().
split
(
"/"
);
String
[]
desc
=
itemSkusEntity
.
getSkuDesc
().
split
(
"/"
);
List
<
SkuDetail
>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
name
.
length
;
i
++)
{
SkuDetail
skuDetail
=
new
SkuDetail
();
skuDetail
.
setSkuName
(
name
[
i
]);
skuDetail
.
setSkuDesc
(
desc
[
i
]);
list
.
add
(
skuDetail
);
}
skuInfo
.
setSkus
(
list
);
TbCfItemDescEntity
itemDesc
=
tbCfItemDescDao
.
queryObject
(
itemId
);
skuInfo
.
setItemDesc
(
itemDesc
);
skuInfoList
.
add
(
skuInfo
);
}
map
.
put
(
"itemDetail"
,
skuInfoList
);
result
.
setData
(
map
).
setMessage
(
ResultCodeEnum
.
SUCCESS
.
getDesc
());
}
catch
(
Exception
e
)
{
result
.
setCode
(
ResultCodeEnum
.
QUERY_ERROR
.
getCode
()).
setMessage
(
ResultCodeEnum
.
QUERY_ERROR
.
getDesc
());
}
return
result
;
}
/**
* 商品搜索
*
* @param name
* @return
*/
@Override
public
Result
searchItems
(
String
name
)
{
Result
result
=
new
Result
();
try
{
if
(
StringUtils
.
isBlank
(
name
))
{
result
.
setCode
(
ResultCodeEnum
.
QUERY_ERROR
.
getCode
()).
setMessage
(
"Search keywords cannot be empty!"
);
return
result
;
}
List
<
TbCfStationItemEntity
>
itemList
=
tbCfStationItemDao
.
searchItems
(
name
.
trim
());
result
.
setData
(
itemList
).
setMessage
(
ResultCodeEnum
.
SUCCESS
.
getDesc
());
}
catch
(
Exception
e
)
{
result
.
setCode
(
ResultCodeEnum
.
QUERY_ERROR
.
getCode
()).
setMessage
(
ResultCodeEnum
.
QUERY_ERROR
.
getDesc
());
}
return
result
;
}
}
src/main/resources/application.yml
浏览文件 @
42803220
...
...
@@ -42,9 +42,9 @@ spring:
# url: jdbc:mysql://47.106.242.175:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
# username: root
# password: diaoyun666
url
:
jdbc:mysql://
159.138.48.71
:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
url
:
jdbc:mysql://
47.106.242.175
:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
username
:
root
password
:
Diaoyunnuli.8
password
:
diaoyun666
# 连接池配置
initial-size
:
5
...
...
src/main/resources/mapper/TbCfCategoryDao.xml
0 → 100644
浏览文件 @
42803220
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.diaoyun.zion.chinafrica.dao.TbCfCategoryDao"
>
<resultMap
type=
"com.diaoyun.zion.chinafrica.entity.TbCfCategoryEntity"
id=
"tbCfCategoryMap"
>
<result
property=
"categoryId"
column=
"category_id"
/>
<result
property=
"categoryName"
column=
"category_name"
/>
<result
property=
"categoryDesc"
column=
"category_desc"
/>
<result
property=
"option"
column=
"option"
/>
<result
property=
"itemId"
column=
"item_id"
/>
<result
property=
"orderNum"
column=
"order_num"
/>
<result
property=
"delFlag"
column=
"del_flag"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfCategoryEntity"
>
select
`category_id`,
`category_name`,
`category_desc`,
`option`,
`item_id`,
`order_num`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_category
where category_id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfCategoryEntity"
>
select
`category_id`,
`category_name`,
`category_desc`,
`option`,
`item_id`,
`order_num`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_category
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
order by category_id desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_category
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<select
id=
"queryByOrderNum"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfCategoryEntity"
>
select * from tb_cf_category where order_num=#{orderNum} and item_id=#{itemId}
</select>
<insert
id=
"save"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfCategoryEntity"
>
insert into tb_cf_category(
`category_id`,
`category_name`,
`category_desc`,
`option`,
`item_id`,
`order_num`,
`del_flag`,
`create_time`,
`update_time`)
values(
#{categoryId},
#{categoryName},
#{categoryDesc},
#{option},
#{itemId},
#{orderNum},
#{delFlag},
#{createTime},
#{updateTime})
</insert>
<update
id=
"update"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfCategoryEntity"
>
update tb_cf_category
<set>
<if
test=
"categoryName != null"
>
`category_name` = #{categoryName},
</if>
<if
test=
"categoryDesc != null"
>
`category_desc` = #{categoryDesc},
</if>
<if
test=
"option != null"
>
`option` = #{option},
</if>
<if
test=
"itemId != null"
>
`item_id` = #{itemId},
</if>
<if
test=
"orderNum != null"
>
`order_num` = #{orderNum},
</if>
<if
test=
"delFlag != null"
>
`del_flag` = #{delFlag},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime}
</if>
</set>
where category_id = #{categoryId}
</update>
<update
id=
"changStatus"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfCategoryEntity"
>
update tb_cf_category set del_flag=0 where item_id=#{itemId}
</update>
<update
id=
"changStatusBatch"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfCategoryEntity"
>
update tb_cf_category set del_flag=0 where item_id in
<foreach
item=
"itemId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{itemId}
</foreach>
</update>
<select
id=
"queryByItemId"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfCategoryEntity"
>
select * from tb_cf_category where item_id=#{itemId} order by order_num asc
</select>
<delete
id=
"delete"
>
delete from tb_cf_category where category_id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from tb_cf_category where category_id in
<foreach
item=
"categoryId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{categoryId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mapper/TbCfItemDescDao.xml
0 → 100644
浏览文件 @
42803220
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.diaoyun.zion.chinafrica.dao.TbCfItemDescDao"
>
<resultMap
type=
"com.diaoyun.zion.chinafrica.entity.TbCfItemDescEntity"
id=
"tbCfItemDescMap"
>
<result
property=
"itemId"
column=
"item_id"
/>
<result
property=
"itemDesc"
column=
"item_desc"
/>
<result
property=
"delFlag"
column=
"del_flag"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfItemDescEntity"
>
select
`item_id`,
`item_desc`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_item_desc
where item_id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfItemDescEntity"
>
select
`item_id`,
`item_desc`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_item_desc
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
order by item_id desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_item_desc
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert
id=
"save"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfItemDescEntity"
>
insert into tb_cf_item_desc(
`item_id`,
`item_desc`,
`del_flag`,
`create_time`,
`update_time`)
values(
#{itemId},
#{itemDesc},
#{delFlag},
#{createTime},
#{updateTime})
</insert>
<update
id=
"update"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfItemDescEntity"
>
update tb_cf_item_desc
<set>
<if
test=
"itemDesc != null"
>
`item_desc` = #{itemDesc},
</if>
<if
test=
"delFlag != null"
>
`del_flag` = #{delFlag},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime}
</if>
</set>
where item_id = #{itemId}
</update>
<update
id=
"changStatus"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfItemDescEntity"
>
update tb_cf_item_desc set del_flag=0 where item_id=#{itemId}
</update>
<update
id=
"changStatusBatch"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfItemDescEntity"
>
update tb_cf_item_desc set del_flag=0 where item_id in
<foreach
item=
"itemId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{itemId}
</foreach>
</update>
<delete
id=
"delete"
>
delete from tb_cf_item_desc where item_id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from tb_cf_item_desc where item_id in
<foreach
item=
"itemId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{itemId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mapper/TbCfItemSkusDao.xml
0 → 100644
浏览文件 @
42803220
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.diaoyun.zion.chinafrica.dao.TbCfItemSkusDao"
>
<resultMap
type=
"com.diaoyun.zion.chinafrica.entity.TbCfItemSkusEntity"
id=
"tbCfItemSkusMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"itemId"
column=
"item_id"
/>
<result
property=
"skuName"
column=
"sku_name"
/>
<result
property=
"skuDesc"
column=
"sku_desc"
/>
<result
property=
"skuPrice"
column=
"sku_price"
/>
<result
property=
"optionIds"
column=
"option_ids"
/>
<result
property=
"skuCount"
column=
"sku_count"
/>
<result
property=
"orderNum"
column=
"order_num"
/>
<result
property=
"delFlag"
column=
"del_flag"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfItemSkusEntity"
>
select
`id`,
`item_id`,
`sku_name`,
`sku_desc`,
`sku_price`,
`option_ids`,
`sku_count`,
`order_num`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_item_skus
where id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfItemSkusEntity"
>
select
`id`,
`item_id`,
`sku_name`,
`sku_desc`,
`sku_price`,
`option_ids`,
`sku_count`,
`order_num`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_item_skus
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"querySkusByItemId"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfItemSkusEntity"
>
select * from tb_cf_item_skus where item_id=#{itemId} order by order_num asc
</select>
<select
id=
"queryByOrderNum"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfItemSkusEntity"
>
select * from tb_cf_item_skus where order_num=#{orderNum} and item_id=#{itemId}
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_item_skus
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert
id=
"save"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfItemSkusEntity"
>
insert into tb_cf_item_skus(
`id`,
`item_id`,
`sku_name`,
`sku_desc`,
`sku_price`,
`option_ids`,
`sku_count`,
`order_num`,
`del_flag`,
`create_time`,
`update_time`)
values(
#{id},
#{itemId},
#{skuName},
#{skuDesc},
#{skuPrice},
#{optionIds},
#{skuCount},
#{orderNum},
#{delFlag},
#{createTime},
#{updateTime})
</insert>
<update
id=
"update"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfItemSkusEntity"
>
update tb_cf_item_skus
<set>
<if
test=
"itemId != null"
>
`item_id` = #{itemId},
</if>
<if
test=
"skuName != null"
>
`sku_name` = #{skuName},
</if>
<if
test=
"skuDesc != null"
>
`sku_desc` = #{skuDesc},
</if>
<if
test=
"skuPrice != null"
>
`sku_price` = #{skuPrice},
</if>
<if
test=
"optionIds != null"
>
`option_ids` = #{optionIds},
</if>
<if
test=
"skuCount != null"
>
`sku_count` = #{skuCount},
</if>
<if
test=
"orderNum != null"
>
`order_num` = #{orderNum},
</if>
<if
test=
"delFlag != null"
>
`del_flag` = #{delFlag},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime}
</if>
</set>
where id = #{id}
</update>
<update
id=
"changStatus"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfItemSkusEntity"
>
update tb_cf_item_skus set del_flag=0 where item_id=#{itemId}
</update>
<update
id=
"changStatusBatch"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfItemSkusEntity"
>
update tb_cf_item_skus set del_flag=0 where item_id in
<foreach
item=
"itemId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{itemId}
</foreach>
</update>
<delete
id=
"delete"
>
delete from tb_cf_item_skus where id = #{value}
</delete>
<delete
id=
"deleteByItemId"
>
delete from tb_cf_item_skus where item_id = #{item_id}
</delete>
<delete
id=
"deleteBatch"
>
delete from tb_cf_item_skus where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mapper/TbCfOptionDao.xml
0 → 100644
浏览文件 @
42803220
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.diaoyun.zion.chinafrica.dao.TbCfOptionDao"
>
<resultMap
type=
"com.diaoyun.zion.chinafrica.entity.TbCfOptionEntity"
id=
"tbCfOptionMap"
>
<result
property=
"optionId"
column=
"option_id"
/>
<result
property=
"optionName"
column=
"option_name"
/>
<result
property=
"optiionSpecies"
column=
"optiion_species"
/>
<result
property=
"itemId"
column=
"item_id"
/>
<result
property=
"cid"
column=
"cid"
/>
<result
property=
"delFlag"
column=
"del_flag"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfOptionEntity"
>
select
`option_id`,
`option_name`,
`optiion_species`,
`item_id`,
`cid`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_option
where option_id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfOptionEntity"
>
select
`option_id`,
`option_name`,
`optiion_species`,
`item_id`,
`cid`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_option
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
order by option_id desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_option
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert
id=
"save"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfOptionEntity"
>
insert into tb_cf_option(
`option_id`,
`option_name`,
`optiion_species`,
`item_id`,
`cid`,
`del_flag`,
`create_time`,
`update_time`)
values(
#{optionId},
#{optionName},
#{optiionSpecies},
#{itemId},
#{cid},
#{delFlag},
#{createTime},
#{updateTime})
</insert>
<update
id=
"update"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfOptionEntity"
>
update tb_cf_option
<set>
<if
test=
"optionName != null"
>
`option_name` = #{optionName},
</if>
<if
test=
"optiionSpecies != null"
>
`optiion_species` = #{optiionSpecies},
</if>
<if
test=
"itemId != null"
>
`item_id` = #{itemId},
</if>
<if
test=
"cid != null"
>
`cid` = #{cid},
</if>
<if
test=
"delFlag != null"
>
`del_flag` = #{delFlag},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime}
</if>
</set>
where option_id = #{optionId}
</update>
<update
id=
"changStatus"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfOptionEntity"
>
update tb_cf_option set del_flag=0 where item_id=#{itemId}
</update>
<update
id=
"changStatusBatch"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfOptionEntity"
>
update tb_cf_option set del_flag=0 where item_id in
<foreach
item=
"itemId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{itemId}
</foreach>
</update>
<delete
id=
"delete"
>
delete from tb_cf_option where option_id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from tb_cf_option where option_id in
<foreach
item=
"optionId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{optionId}
</foreach>
</delete>
<delete
id=
"deleteByItemId"
>
delete from tb_cf_option where item_id =#{itemId}
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mapper/TbCfStationItemDao.xml
浏览文件 @
42803220
...
...
@@ -21,7 +21,7 @@
<result
property=
"itemDescritionId"
column=
"item_descrition_id"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfStationItemEntity"
>
<select
id=
"queryObject"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfStationItemEntity"
>
select
`item_id`,
`item_code`,
...
...
@@ -42,50 +42,50 @@
where item_id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfStationItemEntity"
>
select
`item_id`,
`item_code`,
`item_name`,
`item_brief`,
`item_category`,
`item_price`,
`item_url`,
`item_img`,
`item_num`,
`platform_code`,
`platform_name`,
`enable_flag`,
`create_time`,
`item_categorytwo`,
`item_descrition_id`
from tb_cf_station_item
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<select
id=
"queryList"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfStationItemEntity"
>
select
`item_id`,
`item_code`,
`item_name`,
`item_brief`,
`item_category`,
`item_price`,
`item_url`,
`item_img`,
`item_num`,
`platform_code`,
`platform_name`,
`enable_flag`,
`create_time`,
`item_categorytwo`,
`item_descrition_id`
from tb_cf_station_item
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
<otherwise>
order by item_id desc
</otherwise>
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_station_item
WHERE 1=1
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_station_item
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert
id=
"save"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfStationItemEntity"
>
</select>
<insert
id=
"save"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfStationItemEntity"
>
insert into tb_cf_station_item(
`item_id`,
`item_code`,
...
...
@@ -119,41 +119,41 @@
#{itemCategorytwo},
#{itemDescritionId})
</insert>
<update
id=
"update"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfStationItemEntity"
>
update tb_cf_station_item
<set>
<if
test=
"itemCode != null"
>
`item_code` = #{itemCode},
</if>
<if
test=
"itemName != null"
>
`item_name` = #{itemName},
</if>
<if
test=
"itemBrief != null"
>
`item_brief` = #{itemBrief},
</if>
<if
test=
"itemCategory != null"
>
`item_category` = #{itemCategory},
</if>
<if
test=
"itemPrice != null"
>
`item_price` = #{itemPrice},
</if>
<if
test=
"itemUrl != null"
>
`item_url` = #{itemUrl},
</if>
<if
test=
"itemImg != null"
>
`item_img` = #{itemImg},
</if>
<if
test=
"itemNum != null"
>
`item_num` = #{itemNum},
</if>
<if
test=
"platformCode != null"
>
`platform_code` = #{platformCode},
</if>
<if
test=
"platformName != null"
>
`platform_name` = #{platformName},
</if>
<if
test=
"enableFlag != null"
>
`enable_flag` = #{enableFlag},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"itemCategorytwo != null"
>
`item_categorytwo` = #{itemCategorytwo},
</if>
<if
test=
"itemDescritionId != null"
>
`item_descrition_id` = #{itemDescritionId}
</if>
</set>
where item_id = #{itemId}
</update>
<delete
id=
"delete"
>
<update
id=
"update"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfStationItemEntity"
>
update tb_cf_station_item
<set>
<if
test=
"itemCode != null"
>
`item_code` = #{itemCode},
</if>
<if
test=
"itemName != null"
>
`item_name` = #{itemName},
</if>
<if
test=
"itemBrief != null"
>
`item_brief` = #{itemBrief},
</if>
<if
test=
"itemCategory != null"
>
`item_category` = #{itemCategory},
</if>
<if
test=
"itemPrice != null"
>
`item_price` = #{itemPrice},
</if>
<if
test=
"itemUrl != null"
>
`item_url` = #{itemUrl},
</if>
<if
test=
"itemImg != null"
>
`item_img` = #{itemImg},
</if>
<if
test=
"itemNum != null"
>
`item_num` = #{itemNum},
</if>
<if
test=
"platformCode != null"
>
`platform_code` = #{platformCode},
</if>
<if
test=
"platformName != null"
>
`platform_name` = #{platformName},
</if>
<if
test=
"enableFlag != null"
>
`enable_flag` = #{enableFlag},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"itemCategorytwo != null"
>
`item_categorytwo` = #{itemCategorytwo},
</if>
<if
test=
"itemDescritionId != null"
>
`item_descrition_id` = #{itemDescritionId}
</if>
</set>
where item_id = #{itemId}
</update>
<delete
id=
"delete"
>
delete from tb_cf_station_item where item_id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from tb_cf_station_item where item_id in
<foreach
item=
"itemId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{itemId}
</foreach>
</delete>
<!--获取商品独立站-->
<select
id=
"getItemStationList"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfStationItemEntity"
>
<delete
id=
"deleteBatch"
>
delete from tb_cf_station_item where item_id in
<foreach
item=
"itemId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{itemId}
</foreach>
</delete>
<!--获取商品独立站-->
<select
id=
"getItemStationList"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfStationItemEntity"
>
select `item_id`,
`item_code`,
`item_name`,
...
...
@@ -174,8 +174,26 @@
order by item_num desc
</select>
<select
id=
"getGoodsTypeList"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfStationItemEntity"
>
<select
id=
"searchItems"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfStationItemEntity"
>
select
`item_id`,
`item_code`,
`item_name`,
`item_brief`,
`item_category`,
`item_price`,
`item_url`,
`item_img`,
`item_num`,
`platform_code`,
`platform_name`,
`enable_flag`,
`create_time`,
`item_categorytwo`,
`item_descrition_id`
from tb_cf_station_item where item_name like concat('%',#{name},'%') or item_brief like concat('%',#{name},'%') or item_tags like concat('%',#{name},'%')
</select>
<select
id=
"getGoodsTypeList"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfStationItemEntity"
>
select
`item_id`,
`item_code`,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论