Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
582142b0
提交
582142b0
authored
10月 23, 2019
作者:
zhengfg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改商品列表的SQL
上级
9f30b445
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
116 行增加
和
80 行删除
+116
-80
TbCfStationItemController.java
...va/com/platform/controller/TbCfStationItemController.java
+18
-7
TbCfStationItemEntity.java
.../main/java/com/platform/entity/TbCfStationItemEntity.java
+18
-1
TbCfStationItemServiceImpl.java
...com/platform/service/impl/TbCfStationItemServiceImpl.java
+1
-0
TbCfStationItemDao.xml
...rc/main/resources/com/platform/dao/TbCfStationItemDao.xml
+78
-72
tbcfstationitem.js
platform-admin/src/main/webapp/js/sys/tbcfstationitem.js
+1
-0
没有找到文件。
platform-admin/src/main/java/com/platform/controller/TbCfStationItemController.java
浏览文件 @
582142b0
...
@@ -37,6 +37,10 @@ public class TbCfStationItemController {
...
@@ -37,6 +37,10 @@ public class TbCfStationItemController {
private
TbCfGoodstwotypeService
tbCfGoodstwotypeService
;
private
TbCfGoodstwotypeService
tbCfGoodstwotypeService
;
@Autowired
@Autowired
private
TbCfDescripitonService
tbCfDescripitonService
;
private
TbCfDescripitonService
tbCfDescripitonService
;
private
Long
INIT_NUM
=
0L
;
private
Long
COUNT_NUM
=
1L
;
/**
/**
* 查看列表
* 查看列表
*/
*/
...
@@ -116,27 +120,34 @@ public class TbCfStationItemController {
...
@@ -116,27 +120,34 @@ public class TbCfStationItemController {
}
}
/**
/**
*
* @param typeId
* @param typeId
* @return 根据一级类目ID查询二级类目
* @return 根据一级类目ID查询二级类目
*/
*/
@RequestMapping
(
"/queryByItemType"
)
@RequestMapping
(
"/queryByItemType"
)
@ResponseBody
@ResponseBody
public
R
queryByItemType
(
@RequestParam
(
"typeId"
)
String
typeId
){
public
R
queryByItemType
(
@RequestParam
(
"typeId"
)
String
typeId
)
{
List
<
TbCfGoodstwotypeEntity
>
list
=
tbCfGoodstwotypeService
.
queryByTypeId
(
typeId
);
List
<
TbCfGoodstwotypeEntity
>
list
=
tbCfGoodstwotypeService
.
queryByTypeId
(
typeId
);
return
R
.
ok
().
put
(
"list"
,
list
);
return
R
.
ok
().
put
(
"list"
,
list
);
}
}
/**
/**
*
* @param typeTwoId
* @param typeTwoId
* @return 根据二级类目ID查询三级类目
* @return 根据二级类目ID查询三级类目
*/
*/
@RequestMapping
(
"/queryByItemTypeTwo"
)
@RequestMapping
(
"/queryByItemTypeTwo"
)
@ResponseBody
@ResponseBody
public
R
queryByItemTypeTwo
(
@RequestParam
(
"typeTwoId"
)
String
typeTwoId
)
{
public
R
queryByItemTypeTwo
(
@RequestParam
(
"typeTwoId"
)
String
typeTwoId
)
{
List
<
TbCfDescripitonEntity
>
descripiton
=
tbCfDescripitonService
.
queryByItemTypeTwo
(
typeTwoId
);
List
<
TbCfDescripitonEntity
>
descripiton
=
tbCfDescripitonService
.
queryByItemTypeTwo
(
typeTwoId
);
return
R
.
ok
().
put
(
"descripiton"
,
descripiton
);
return
R
.
ok
().
put
(
"descripiton"
,
descripiton
);
}
}
/* @RequestMapping("/updateItemNum")
@ResponseBody
public R updateItemNum(@RequestParam("itemId") String itemId) {
TbCfStationItemEntity item = tbCfStationItemService.queryObject(itemId);
Long num = item.getItemNum() + COUNT_NUM;
item.setItemNum(num);
tbCfStationItemService.update(item);
return R.ok();
}*/
}
}
platform-admin/src/main/java/com/platform/entity/TbCfStationItemEntity.java
浏览文件 @
582142b0
...
@@ -9,7 +9,7 @@ import java.util.Date;
...
@@ -9,7 +9,7 @@ import java.util.Date;
* 表名 tb_cf_station_item
* 表名 tb_cf_station_item
*
*
* @author lipengjun
* @author lipengjun
* @date 2019-10-2
1 15:13:28
* @date 2019-10-2
3 10:35:45
*/
*/
public
class
TbCfStationItemEntity
implements
Serializable
{
public
class
TbCfStationItemEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
@@ -46,6 +46,10 @@ public class TbCfStationItemEntity implements Serializable {
...
@@ -46,6 +46,10 @@ public class TbCfStationItemEntity implements Serializable {
* 商品图片
* 商品图片
*/
*/
private
String
itemImg
;
private
String
itemImg
;
/**
* 浏览人数
*/
private
Long
itemNum
;
/**
/**
* 所属平台
* 所属平台
*/
*/
...
@@ -175,6 +179,19 @@ public class TbCfStationItemEntity implements Serializable {
...
@@ -175,6 +179,19 @@ public class TbCfStationItemEntity implements Serializable {
public
String
getItemImg
()
{
public
String
getItemImg
()
{
return
itemImg
;
return
itemImg
;
}
}
/**
* 设置:浏览人数
*/
public
void
setItemNum
(
Long
itemNum
)
{
this
.
itemNum
=
itemNum
;
}
/**
* 获取:浏览人数
*/
public
Long
getItemNum
()
{
return
itemNum
;
}
/**
/**
* 设置:所属平台
* 设置:所属平台
*/
*/
...
...
platform-admin/src/main/java/com/platform/service/impl/TbCfStationItemServiceImpl.java
浏览文件 @
582142b0
...
@@ -41,6 +41,7 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
...
@@ -41,6 +41,7 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
public
int
save
(
TbCfStationItemEntity
tbCfStationItem
)
{
public
int
save
(
TbCfStationItemEntity
tbCfStationItem
)
{
tbCfStationItem
.
setItemId
(
IdUtil
.
createIdbyUUID
());
tbCfStationItem
.
setItemId
(
IdUtil
.
createIdbyUUID
());
tbCfStationItem
.
setCreateTime
(
new
Date
());
tbCfStationItem
.
setCreateTime
(
new
Date
());
tbCfStationItem
.
setItemNum
(
0L
);
return
tbCfStationItemDao
.
save
(
tbCfStationItem
);
return
tbCfStationItemDao
.
save
(
tbCfStationItem
);
}
}
...
...
platform-admin/src/main/resources/com/platform/dao/TbCfStationItemDao.xml
浏览文件 @
582142b0
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<result
property=
"itemPrice"
column=
"item_price"
/>
<result
property=
"itemPrice"
column=
"item_price"
/>
<result
property=
"itemUrl"
column=
"item_url"
/>
<result
property=
"itemUrl"
column=
"item_url"
/>
<result
property=
"itemImg"
column=
"item_img"
/>
<result
property=
"itemImg"
column=
"item_img"
/>
<result
column=
"item_num"
property=
"itemNum"
/>
<result
property=
"platformCode"
column=
"platform_code"
/>
<result
property=
"platformCode"
column=
"platform_code"
/>
<result
property=
"platformName"
column=
"platform_name"
/>
<result
property=
"platformName"
column=
"platform_name"
/>
<result
property=
"enableFlag"
column=
"enable_flag"
/>
<result
property=
"enableFlag"
column=
"enable_flag"
/>
...
@@ -20,7 +21,7 @@
...
@@ -20,7 +21,7 @@
<result
property=
"itemDescritionId"
column=
"item_descrition_id"
/>
<result
property=
"itemDescritionId"
column=
"item_descrition_id"
/>
</resultMap>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.platform.entity.TbCfStationItemEntity"
>
<select
id=
"queryObject"
resultType=
"com.platform.entity.TbCfStationItemEntity"
>
select
select
`item_id`,
`item_id`,
`item_code`,
`item_code`,
...
@@ -30,6 +31,7 @@
...
@@ -30,6 +31,7 @@
`item_price`,
`item_price`,
`item_url`,
`item_url`,
`item_img`,
`item_img`,
`item_num`,
`platform_code`,
`platform_code`,
`platform_name`,
`platform_name`,
`enable_flag`,
`enable_flag`,
...
@@ -40,57 +42,58 @@
...
@@ -40,57 +42,58 @@
where item_id = #{id}
where item_id = #{id}
</select>
</select>
<select
id=
"queryList"
resultType=
"com.platform.entity.TbCfStationItemEntityExtends"
>
<select
id=
"queryList"
resultType=
"com.platform.entity.TbCfStationItemEntityExtends"
>
SELECT
SELECT
i.item_id,
i.item_id,
i.item_code,
i.item_code,
i.item_name,
i.item_name,
i.item_brief,
i.item_brief,
i.item_category,
i.item_category,
i.item_price,
i.item_price,
i.item_url,
i.item_url,
i.item_img,
i.item_img,
i.platform_code,
i.item_num,
i.platform_name,
i.platform_code,
i.enable_flag,
i.platform_name,
i.create_time,
i.enable_flag,
i.item_categorytwo,
i.create_time,
i.item_descrition_id,
i.item_categorytwo,
d.descripition_name dname,
i.item_descrition_id,
t.goodstwotype_title title,
d.descripition_name dname,
o.goodstype_title goodtype
t.goodstwotype_title title,
FROM
o.goodstype_title goodtype
tb_cf_station_item i
FROM
left JOIN tb_cf_goodstype o ON o.goodstype_id = i.item_category
tb_cf_station_item i
left JOIN tb_cf_goodstwotype t ON i.item_categorytwo=t.goodstwotype_id
left JOIN tb_cf_goodstype o ON o.goodstype_id = i.item_category
left JOIN tb_cf_descripiton d ON i.item_descrition_id = d.descripition_id
left JOIN tb_cf_goodstwotype t ON i.item_categorytwo=t.goodstwotype_id
WHERE 1=1
left JOIN tb_cf_descripiton d ON i.item_descrition_id = d.descripition_id
<if
test=
"name != null and name.trim() != ''"
>
WHERE 1=1
AND name LIKE concat('%',#{name},'%')
<if
test=
"name != null and name.trim() != ''"
>
</if>
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
order by ${sidx} ${order}
</when>
</when>
<otherwise>
<otherwise>
order by i.create_time
desc
order by i.create_time desc
</otherwise>
</otherwise>
</choose>
</choose>
<if
test=
"offset != null and limit != null"
>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
limit #{offset}, #{limit}
</if>
</if>
</select>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_station_item
select count(*) from tb_cf_station_item
WHERE 1=1
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
AND name LIKE concat('%',#{name},'%')
</if>
</if>
</select>
</select>
<insert
id=
"save"
parameterType=
"com.platform.entity.TbCfStationItemEntity"
>
<insert
id=
"save"
parameterType=
"com.platform.entity.TbCfStationItemEntity"
>
insert into tb_cf_station_item(
insert into tb_cf_station_item(
`item_id`,
`item_id`,
`item_code`,
`item_code`,
...
@@ -100,6 +103,7 @@
...
@@ -100,6 +103,7 @@
`item_price`,
`item_price`,
`item_url`,
`item_url`,
`item_img`,
`item_img`,
`item_num`,
`platform_code`,
`platform_code`,
`platform_name`,
`platform_name`,
`enable_flag`,
`enable_flag`,
...
@@ -115,6 +119,7 @@
...
@@ -115,6 +119,7 @@
#{itemPrice},
#{itemPrice},
#{itemUrl},
#{itemUrl},
#{itemImg},
#{itemImg},
#{itemNum},
#{platformCode},
#{platformCode},
#{platformName},
#{platformName},
#{enableFlag},
#{enableFlag},
...
@@ -122,38 +127,39 @@
...
@@ -122,38 +127,39 @@
#{itemCategorytwo},
#{itemCategorytwo},
#{itemDescritionId})
#{itemDescritionId})
</insert>
</insert>
<update
id=
"update"
parameterType=
"com.platform.entity.TbCfStationItemEntity"
>
<update
id=
"update"
parameterType=
"com.platform.entity.TbCfStationItemEntity"
>
update tb_cf_station_item
update tb_cf_station_item
<set>
<set>
<if
test=
"itemCode != null"
>
`item_code` = #{itemCode},
</if>
<if
test=
"itemCode != null"
>
`item_code` = #{itemCode},
</if>
<if
test=
"itemName != null"
>
`item_name` = #{itemName},
</if>
<if
test=
"itemName != null"
>
`item_name` = #{itemName},
</if>
<if
test=
"itemBrief != null"
>
`item_brief` = #{itemBrief},
</if>
<if
test=
"itemBrief != null"
>
`item_brief` = #{itemBrief},
</if>
<if
test=
"itemCategory != null"
>
`item_category` = #{itemCategory},
</if>
<if
test=
"itemCategory != null"
>
`item_category` = #{itemCategory},
</if>
<if
test=
"itemPrice != null"
>
`item_price` = #{itemPrice},
</if>
<if
test=
"itemPrice != null"
>
`item_price` = #{itemPrice},
</if>
<if
test=
"itemUrl != null"
>
`item_url` = #{itemUrl},
</if>
<if
test=
"itemUrl != null"
>
`item_url` = #{itemUrl},
</if>
<if
test=
"itemImg != null"
>
`item_img` = #{itemImg},
</if>
<if
test=
"itemImg != null"
>
`item_img` = #{itemImg},
</if>
<if
test=
"platformCode != null"
>
`platform_code` = #{platformCode},
</if>
<if
test=
"itemNum != null"
>
item_num=#{itemNum},
</if>
<if
test=
"platformName != null"
>
`platform_name` = #{platformName},
</if>
<if
test=
"platformCode != null"
>
`platform_code` = #{platformCode},
</if>
<if
test=
"enableFlag != null"
>
`enable_flag` = #{enableFlag},
</if>
<if
test=
"platformName != null"
>
`platform_name` = #{platformName},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"enableFlag != null"
>
`enable_flag` = #{enableFlag},
</if>
<if
test=
"itemCategorytwo != null"
>
`item_categorytwo` = #{itemCategorytwo},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"itemDescritionId != null"
>
`item_descrition_id` = #{itemDescritionId}
</if>
<if
test=
"itemCategorytwo != null"
>
`item_categorytwo` = #{itemCategorytwo},
</if>
</set>
<if
test=
"itemDescritionId != null"
>
`item_descrition_id` = #{itemDescritionId}
</if>
where item_id = #{itemId}
</set>
</update>
where item_id = #{itemId}
</update>
<delete
id=
"delete"
>
<delete
id=
"delete"
>
delete from tb_cf_station_item where item_id = #{value}
delete from tb_cf_station_item where item_id = #{value}
</delete>
</delete>
<delete
id=
"deleteBatch"
>
<delete
id=
"deleteBatch"
>
delete from tb_cf_station_item where item_id in
delete from tb_cf_station_item where item_id in
<foreach
item=
"itemId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"itemId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{itemId}
#{itemId}
</foreach>
</foreach>
</delete>
</delete>
</mapper>
</mapper>
\ No newline at end of file
platform-admin/src/main/webapp/js/sys/tbcfstationitem.js
浏览文件 @
582142b0
...
@@ -9,6 +9,7 @@ $(function () {
...
@@ -9,6 +9,7 @@ $(function () {
{
label
:
'商品链接'
,
name
:
'itemUrl'
,
index
:
'item_url'
,
width
:
80
,
formatter
:
linkFormat
},
{
label
:
'商品链接'
,
name
:
'itemUrl'
,
index
:
'item_url'
,
width
:
80
,
formatter
:
linkFormat
},
{
label
:
'商品图片'
,
name
:
'itemImg'
,
index
:
'item_img'
,
width
:
80
,
formatter
:
imageFormat
},
{
label
:
'商品图片'
,
name
:
'itemImg'
,
index
:
'item_img'
,
width
:
80
,
formatter
:
imageFormat
},
{
label
:
'商品价格'
,
name
:
'itemPrice'
,
index
:
'item_price'
,
width
:
80
},
{
label
:
'商品价格'
,
name
:
'itemPrice'
,
index
:
'item_price'
,
width
:
80
},
{
label
:
'点击量'
,
name
:
'itemNum'
,
index
:
'item_num'
,
width
:
80
},
{
label
:
'所属平台'
,
name
:
'platformCode'
,
index
:
'platform_code'
,
width
:
80
},
{
label
:
'所属平台'
,
name
:
'platformCode'
,
index
:
'platform_code'
,
width
:
80
},
{
label
:
'平台名'
,
name
:
'platformName'
,
index
:
'platform_name'
,
width
:
80
},
{
label
:
'平台名'
,
name
:
'platformName'
,
index
:
'platform_name'
,
width
:
80
},
{
label
:
'启用状态'
,
name
:
'enableFlag'
,
index
:
'enable_flag'
,
width
:
80
},
{
label
:
'启用状态'
,
name
:
'enableFlag'
,
index
:
'enable_flag'
,
width
:
80
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论