Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
Z
zion
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
zion
Commits
4c5eaf10
提交
4c5eaf10
authored
1月 13, 2020
作者:
zgy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
热门推荐
上级
c8ed5a9a
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
286 行增加
和
3 行删除
+286
-3
TbCfStationItemController.java
...zion/chinafrica/controller/TbCfStationItemController.java
+11
-0
TbCfRecommendDao.java
...ava/com/diaoyun/zion/chinafrica/dao/TbCfRecommendDao.java
+14
-0
TbCfRecommendEntity.java
...m/diaoyun/zion/chinafrica/entity/TbCfRecommendEntity.java
+119
-0
TbCfStationItemService.java
...aoyun/zion/chinafrica/service/TbCfStationItemService.java
+9
-3
TbCfStationItemServiceImpl.java
...n/chinafrica/service/impl/TbCfStationItemServiceImpl.java
+32
-0
TbCfRecommendDao.xml
src/main/resources/mapper/TbCfRecommendDao.xml
+101
-0
没有找到文件。
src/main/java/com/diaoyun/zion/chinafrica/controller/TbCfStationItemController.java
浏览文件 @
4c5eaf10
...
@@ -172,5 +172,16 @@ public class TbCfStationItemController {
...
@@ -172,5 +172,16 @@ public class TbCfStationItemController {
return
tbCfStationItemService
.
delCollection
(
collectionIds
);
return
tbCfStationItemService
.
delCollection
(
collectionIds
);
}
}
/**
* 热门推荐
*
* @return
*/
@ApiOperation
(
"热门推荐"
)
@GetMapping
(
"/queryHotRecommended"
)
public
Result
queryHotRecommended
()
{
return
tbCfStationItemService
.
queryHotRecommended
();
}
}
}
src/main/java/com/diaoyun/zion/chinafrica/dao/TbCfRecommendDao.java
0 → 100644
浏览文件 @
4c5eaf10
package
com
.
diaoyun
.
zion
.
chinafrica
.
dao
;
import
com.diaoyun.zion.chinafrica.entity.TbCfRecommendEntity
;
import
com.diaoyun.zion.master.dao.BaseDao
;
/**
* Dao
*
* @author lipengjun
* @date 2020-01-13 15:00:49
*/
public
interface
TbCfRecommendDao
extends
BaseDao
<
TbCfRecommendEntity
>
{
}
src/main/java/com/diaoyun/zion/chinafrica/entity/TbCfRecommendEntity.java
0 → 100644
浏览文件 @
4c5eaf10
package
com
.
diaoyun
.
zion
.
chinafrica
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 实体
* 表名 tb_cf_recommend
*
* @author lipengjun
* @date 2020-01-13 15:00:49
*/
public
class
TbCfRecommendEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 推荐ID
*/
private
String
id
;
/**
* 热门推荐
*/
private
String
recommend
;
/**
* 备注
*/
private
String
remark
;
/**
* 删除标志
*/
private
Integer
delFlag
;
/**
* 创建时间
*/
private
Date
createtime
;
/**
* 更新时间
*/
private
Date
updatetime
;
/**
* 设置:推荐ID
*/
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
/**
* 获取:推荐ID
*/
public
String
getId
()
{
return
id
;
}
/**
* 设置:热门推荐
*/
public
void
setRecommend
(
String
recommend
)
{
this
.
recommend
=
recommend
;
}
/**
* 获取:热门推荐
*/
public
String
getRecommend
()
{
return
recommend
;
}
/**
* 设置:备注
*/
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
/**
* 获取:备注
*/
public
String
getRemark
()
{
return
remark
;
}
/**
* 设置:删除标志
*/
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/service/TbCfStationItemService.java
浏览文件 @
4c5eaf10
...
@@ -102,14 +102,13 @@ public interface TbCfStationItemService {
...
@@ -102,14 +102,13 @@ public interface TbCfStationItemService {
* @param itemId
* @param itemId
* @return
* @return
*/
*/
Result
queryItemSku
(
String
itemId
,
String
userId
);
Result
queryItemSku
(
String
itemId
,
String
userId
);
/**
/**
*
* @param name
* @param name
* @return
* @return
*/
*/
Result
searchItems
(
String
name
,
String
order
);
Result
searchItems
(
String
name
,
String
order
);
/**
/**
* 查询一级分类的二级类目
* 查询一级分类的二级类目
...
@@ -161,5 +160,12 @@ public interface TbCfStationItemService {
...
@@ -161,5 +160,12 @@ public interface TbCfStationItemService {
*/
*/
Result
delCollection
(
String
[]
collectionIds
);
Result
delCollection
(
String
[]
collectionIds
);
/**
* 热门推荐
*
* @return
*/
Result
queryHotRecommended
();
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfStationItemServiceImpl.java
浏览文件 @
4c5eaf10
...
@@ -57,6 +57,9 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
...
@@ -57,6 +57,9 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
@Autowired
@Autowired
private
TbCfDescripitonDao
tbCfDescripitonDao
;
private
TbCfDescripitonDao
tbCfDescripitonDao
;
@Autowired
private
TbCfRecommendDao
tbCfRecommendDao
;
@Override
@Override
public
TbCfStationItemEntity
queryObject
(
String
itemId
)
{
public
TbCfStationItemEntity
queryObject
(
String
itemId
)
{
return
tbCfStationItemDao
.
queryObject
(
itemId
);
return
tbCfStationItemDao
.
queryObject
(
itemId
);
...
@@ -398,5 +401,34 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
...
@@ -398,5 +401,34 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
return
result
;
return
result
;
}
}
/**
* 热门推荐
*
* @return
*/
@Override
public
Result
queryHotRecommended
()
{
Result
result
=
new
Result
();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
String
>
list
=
new
ArrayList
<>();
try
{
List
<
TbCfRecommendEntity
>
recommendList
=
tbCfRecommendDao
.
queryList
(
null
);
int
count
=
0
;
for
(
TbCfRecommendEntity
recommendEntity
:
recommendList
)
{
list
.
add
(
recommendEntity
.
getRecommend
());
count
++;
if
(
count
>
5
)
{
break
;
}
}
map
.
put
(
"recommended"
,
list
);
result
.
setData
(
map
).
setMessage
(
ResultCodeEnum
.
SUCCESS
.
getDesc
());
}
catch
(
Exception
e
)
{
result
.
setCode
(
ResultCodeEnum
.
SERVICE_ERROR
.
getCode
()).
setMessage
(
e
.
getMessage
());
}
return
result
;
}
}
}
src/main/resources/mapper/TbCfRecommendDao.xml
0 → 100644
浏览文件 @
4c5eaf10
<?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.TbCfRecommendDao"
>
<resultMap
type=
"com.diaoyun.zion.chinafrica.entity.TbCfRecommendEntity"
id=
"tbCfRecommendMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"recommend"
column=
"recommend"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"delFlag"
column=
"del_flag"
/>
<result
property=
"createtime"
column=
"createTime"
/>
<result
property=
"updatetime"
column=
"updateTime"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfRecommendEntity"
>
select
`id`,
`recommend`,
`remark`,
`del_flag`,
`createTime`,
`updateTime`
from tb_cf_recommend
where id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfRecommendEntity"
>
select
`id`,
`recommend`,
`remark`,
`del_flag`,
`createTime`,
`updateTime`
from tb_cf_recommend
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=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_recommend
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.TbCfRecommendEntity"
>
insert into tb_cf_recommend(
`id`,
`recommend`,
`remark`,
`del_flag`,
`createTime`,
`updateTime`)
values(
#{id},
#{recommend},
#{remark},
#{delFlag},
#{createtime},
#{updatetime})
</insert>
<update
id=
"update"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfRecommendEntity"
>
update tb_cf_recommend
<set>
<if
test=
"recommend != null"
>
`recommend` = #{recommend},
</if>
<if
test=
"remark != null"
>
`remark` = #{remark},
</if>
<if
test=
"delFlag != null"
>
`del_flag` = #{delFlag},
</if>
<if
test=
"createtime != null"
>
`createTime` = #{createtime},
</if>
<if
test=
"updatetime != null"
>
`updateTime` = #{updatetime}
</if>
</set>
where id = #{id}
</update>
<delete
id=
"delete"
>
delete from tb_cf_recommend where id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from tb_cf_recommend where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论