Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
f35bb26a
提交
f35bb26a
authored
9月 28, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
广告投放页管理
上级
5c9a5636
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
1288 行增加
和
0 行删除
+1288
-0
AdvertisementController.java
...java/com/platform/controller/AdvertisementController.java
+110
-0
AdvertisementItemController.java
.../com/platform/controller/AdvertisementItemController.java
+109
-0
AdvertisementDao.java
...dmin/src/main/java/com/platform/dao/AdvertisementDao.java
+13
-0
AdvertisementItemDao.java
.../src/main/java/com/platform/dao/AdvertisementItemDao.java
+13
-0
AdvertisementEntity.java
...rc/main/java/com/platform/entity/AdvertisementEntity.java
+170
-0
AdvertisementItemEntity.java
...ain/java/com/platform/entity/AdvertisementItemEntity.java
+53
-0
AdvertisementItemService.java
...n/java/com/platform/service/AdvertisementItemService.java
+71
-0
AdvertisementService.java
.../main/java/com/platform/service/AdvertisementService.java
+71
-0
AdvertisementItemServiceImpl.java
...m/platform/service/impl/AdvertisementItemServiceImpl.java
+59
-0
AdvertisementServiceImpl.java
...a/com/platform/service/impl/AdvertisementServiceImpl.java
+59
-0
AdvertisementDao.xml
.../src/main/resources/com/platform/dao/AdvertisementDao.xml
+119
-0
AdvertisementItemDao.xml
.../main/resources/com/platform/dao/AdvertisementItemDao.xml
+77
-0
advertisement.html
...admin/src/main/webapp/WEB-INF/page/sys/advertisement.html
+71
-0
advertisementitem.html
...n/src/main/webapp/WEB-INF/page/sys/advertisementitem.html
+50
-0
common.js
platform-admin/src/main/webapp/js/common.js
+14
-0
advertisement.js
platform-admin/src/main/webapp/js/sys/advertisement.js
+118
-0
advertisementitem.js
platform-admin/src/main/webapp/js/sys/advertisementitem.js
+111
-0
没有找到文件。
platform-admin/src/main/java/com/platform/controller/AdvertisementController.java
0 → 100644
浏览文件 @
f35bb26a
package
com
.
platform
.
controller
;
import
com.platform.entity.AdvertisementEntity
;
import
com.platform.service.AdvertisementService
;
import
com.platform.utils.PageUtils
;
import
com.platform.utils.Query
;
import
com.platform.utils.R
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.List
;
import
java.util.Map
;
/**
* Controller
* 状态 0:已删除 1:活动进行中 2:活动已关闭 3:活动已结束
*
* @author lipengjun
* @date 2020-09-25 14:48:21
*/
@Controller
@RequestMapping
(
"advertisement"
)
public
class
AdvertisementController
{
@Autowired
private
AdvertisementService
advertisementService
;
/**
* 查看列表
*/
@RequestMapping
(
"/list"
)
@RequiresPermissions
(
"advertisement:list"
)
@ResponseBody
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
//查询列表数据
Query
query
=
new
Query
(
params
);
List
<
AdvertisementEntity
>
advertisementList
=
advertisementService
.
queryList
(
query
);
int
total
=
advertisementService
.
queryTotal
(
query
);
PageUtils
pageUtil
=
new
PageUtils
(
advertisementList
,
total
,
query
.
getLimit
(),
query
.
getPage
());
return
R
.
ok
().
put
(
"page"
,
pageUtil
);
}
/**
* 查看信息
*/
@RequestMapping
(
"/info/{id}"
)
@RequiresPermissions
(
"advertisement:info"
)
@ResponseBody
public
R
info
(
@PathVariable
(
"id"
)
String
id
)
{
AdvertisementEntity
advertisement
=
advertisementService
.
queryObject
(
id
);
return
R
.
ok
().
put
(
"advertisement"
,
advertisement
);
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
@RequiresPermissions
(
"advertisement:save"
)
@ResponseBody
public
R
save
(
@RequestBody
AdvertisementEntity
advertisement
)
{
advertisementService
.
save
(
advertisement
);
return
R
.
ok
();
}
/**
* 修改
*/
@RequestMapping
(
"/update"
)
@RequiresPermissions
(
"advertisement:update"
)
@ResponseBody
public
R
update
(
@RequestBody
AdvertisementEntity
advertisement
)
{
advertisementService
.
update
(
advertisement
);
return
R
.
ok
();
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
@RequiresPermissions
(
"advertisement:delete"
)
@ResponseBody
public
R
delete
(
@RequestBody
String
[]
ids
)
{
advertisementService
.
deleteBatch
(
ids
);
return
R
.
ok
();
}
/**
* 查看所有列表
*/
@RequestMapping
(
"/queryAll"
)
@ResponseBody
public
R
queryAll
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
List
<
AdvertisementEntity
>
list
=
advertisementService
.
queryList
(
params
);
return
R
.
ok
().
put
(
"list"
,
list
);
}
}
platform-admin/src/main/java/com/platform/controller/AdvertisementItemController.java
0 → 100644
浏览文件 @
f35bb26a
package
com
.
platform
.
controller
;
import
com.platform.entity.AdvertisementItemEntity
;
import
com.platform.service.AdvertisementItemService
;
import
com.platform.utils.PageUtils
;
import
com.platform.utils.Query
;
import
com.platform.utils.R
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.List
;
import
java.util.Map
;
/**
* Controller
*
* @author lipengjun
* @date 2020-09-25 14:48:21
*/
@Controller
@RequestMapping
(
"advertisementitem"
)
public
class
AdvertisementItemController
{
@Autowired
private
AdvertisementItemService
advertisementItemService
;
/**
* 查看列表
*/
@RequestMapping
(
"/list"
)
@RequiresPermissions
(
"advertisementitem:list"
)
@ResponseBody
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
//查询列表数据
Query
query
=
new
Query
(
params
);
List
<
AdvertisementItemEntity
>
advertisementItemList
=
advertisementItemService
.
queryList
(
query
);
int
total
=
advertisementItemService
.
queryTotal
(
query
);
PageUtils
pageUtil
=
new
PageUtils
(
advertisementItemList
,
total
,
query
.
getLimit
(),
query
.
getPage
());
return
R
.
ok
().
put
(
"page"
,
pageUtil
);
}
/**
* 查看信息
*/
@RequestMapping
(
"/info/{adId}"
)
@RequiresPermissions
(
"advertisementitem:info"
)
@ResponseBody
public
R
info
(
@PathVariable
(
"adId"
)
String
adId
)
{
AdvertisementItemEntity
advertisementItem
=
advertisementItemService
.
queryObject
(
adId
);
return
R
.
ok
().
put
(
"advertisementItem"
,
advertisementItem
);
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
@RequiresPermissions
(
"advertisementitem:save"
)
@ResponseBody
public
R
save
(
@RequestBody
AdvertisementItemEntity
advertisementItem
)
{
advertisementItemService
.
save
(
advertisementItem
);
return
R
.
ok
();
}
/**
* 修改
*/
@RequestMapping
(
"/update"
)
@RequiresPermissions
(
"advertisementitem:update"
)
@ResponseBody
public
R
update
(
@RequestBody
AdvertisementItemEntity
advertisementItem
)
{
advertisementItemService
.
update
(
advertisementItem
);
return
R
.
ok
();
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
@RequiresPermissions
(
"advertisementitem:delete"
)
@ResponseBody
public
R
delete
(
@RequestBody
String
[]
adIds
)
{
advertisementItemService
.
deleteBatch
(
adIds
);
return
R
.
ok
();
}
/**
* 查看所有列表
*/
@RequestMapping
(
"/queryAll"
)
@ResponseBody
public
R
queryAll
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
List
<
AdvertisementItemEntity
>
list
=
advertisementItemService
.
queryList
(
params
);
return
R
.
ok
().
put
(
"list"
,
list
);
}
}
platform-admin/src/main/java/com/platform/dao/AdvertisementDao.java
0 → 100644
浏览文件 @
f35bb26a
package
com
.
platform
.
dao
;
import
com.platform.entity.AdvertisementEntity
;
/**
* Dao
*
* @author lipengjun
* @date 2020-09-25 14:48:21
*/
public
interface
AdvertisementDao
extends
BaseDao
<
AdvertisementEntity
>
{
}
platform-admin/src/main/java/com/platform/dao/AdvertisementItemDao.java
0 → 100644
浏览文件 @
f35bb26a
package
com
.
platform
.
dao
;
import
com.platform.entity.AdvertisementItemEntity
;
/**
* Dao
*
* @author lipengjun
* @date 2020-09-25 14:48:21
*/
public
interface
AdvertisementItemDao
extends
BaseDao
<
AdvertisementItemEntity
>
{
}
platform-admin/src/main/java/com/platform/entity/AdvertisementEntity.java
0 → 100644
浏览文件 @
f35bb26a
package
com
.
platform
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 实体
* 表名 advertisement
*
* @author lipengjun
* @date 2020-09-25 16:34:49
*/
public
class
AdvertisementEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 广告投放ID
*/
private
String
id
;
/**
* 广告名
*/
private
String
adName
;
/**
* 广告链接
*/
private
String
adLink
;
/**
* 状态
*/
private
Integer
status
;
/**
* 活动开始时间
*/
private
Date
startTime
;
/**
* 活动结束时间
*/
private
Date
endTime
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 备注
*/
private
String
remark
;
/**
* 设置:广告投放ID
*/
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
/**
* 获取:广告投放ID
*/
public
String
getId
()
{
return
id
;
}
/**
* 设置:广告名
*/
public
void
setAdName
(
String
adName
)
{
this
.
adName
=
adName
;
}
/**
* 获取:广告名
*/
public
String
getAdName
()
{
return
adName
;
}
/**
* 设置:广告链接
*/
public
void
setAdLink
(
String
adLink
)
{
this
.
adLink
=
adLink
;
}
/**
* 获取:广告链接
*/
public
String
getAdLink
()
{
return
adLink
;
}
/**
* 设置:状态
*/
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
/**
* 获取:状态
*/
public
Integer
getStatus
()
{
return
status
;
}
/**
* 设置:活动开始时间
*/
public
void
setStartTime
(
Date
startTime
)
{
this
.
startTime
=
startTime
;
}
/**
* 获取:活动开始时间
*/
public
Date
getStartTime
()
{
return
startTime
;
}
/**
* 设置:活动结束时间
*/
public
void
setEndTime
(
Date
endTime
)
{
this
.
endTime
=
endTime
;
}
/**
* 获取:活动结束时间
*/
public
Date
getEndTime
()
{
return
endTime
;
}
/**
* 设置:创建时间
*/
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
;
}
/**
* 设置:备注
*/
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
/**
* 获取:备注
*/
public
String
getRemark
()
{
return
remark
;
}
}
platform-admin/src/main/java/com/platform/entity/AdvertisementItemEntity.java
0 → 100644
浏览文件 @
f35bb26a
package
com
.
platform
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 实体
* 表名 advertisement_item
*
* @author lipengjun
* @date 2020-09-25 14:48:21
*/
public
class
AdvertisementItemEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 广告投放ID
*/
private
String
adId
;
/**
* 商品ID
*/
private
String
itemId
;
/**
* 设置:广告投放ID
*/
public
void
setAdId
(
String
adId
)
{
this
.
adId
=
adId
;
}
/**
* 获取:广告投放ID
*/
public
String
getAdId
()
{
return
adId
;
}
/**
* 设置:商品ID
*/
public
void
setItemId
(
String
itemId
)
{
this
.
itemId
=
itemId
;
}
/**
* 获取:商品ID
*/
public
String
getItemId
()
{
return
itemId
;
}
}
platform-admin/src/main/java/com/platform/service/AdvertisementItemService.java
0 → 100644
浏览文件 @
f35bb26a
package
com
.
platform
.
service
;
import
com.platform.entity.AdvertisementItemEntity
;
import
java.util.List
;
import
java.util.Map
;
/**
* Service接口
*
* @author lipengjun
* @date 2020-09-25 14:48:21
*/
public
interface
AdvertisementItemService
{
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
AdvertisementItemEntity
queryObject
(
String
adId
);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List
<
AdvertisementItemEntity
>
queryList
(
Map
<
String
,
Object
>
map
);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int
queryTotal
(
Map
<
String
,
Object
>
map
);
/**
* 保存实体
*
* @param advertisementItem 实体
* @return 保存条数
*/
int
save
(
AdvertisementItemEntity
advertisementItem
);
/**
* 根据主键更新实体
*
* @param advertisementItem 实体
* @return 更新条数
*/
int
update
(
AdvertisementItemEntity
advertisementItem
);
/**
* 根据主键删除
*
* @param adId
* @return 删除条数
*/
int
delete
(
String
adId
);
/**
* 根据主键批量删除
*
* @param adIds
* @return 删除条数
*/
int
deleteBatch
(
String
[]
adIds
);
}
platform-admin/src/main/java/com/platform/service/AdvertisementService.java
0 → 100644
浏览文件 @
f35bb26a
package
com
.
platform
.
service
;
import
com.platform.entity.AdvertisementEntity
;
import
java.util.List
;
import
java.util.Map
;
/**
* Service接口
*
* @author lipengjun
* @date 2020-09-25 14:48:21
*/
public
interface
AdvertisementService
{
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
AdvertisementEntity
queryObject
(
String
id
);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List
<
AdvertisementEntity
>
queryList
(
Map
<
String
,
Object
>
map
);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int
queryTotal
(
Map
<
String
,
Object
>
map
);
/**
* 保存实体
*
* @param advertisement 实体
* @return 保存条数
*/
int
save
(
AdvertisementEntity
advertisement
);
/**
* 根据主键更新实体
*
* @param advertisement 实体
* @return 更新条数
*/
int
update
(
AdvertisementEntity
advertisement
);
/**
* 根据主键删除
*
* @param id
* @return 删除条数
*/
int
delete
(
String
id
);
/**
* 根据主键批量删除
*
* @param ids
* @return 删除条数
*/
int
deleteBatch
(
String
[]
ids
);
}
platform-admin/src/main/java/com/platform/service/impl/AdvertisementItemServiceImpl.java
0 → 100644
浏览文件 @
f35bb26a
package
com
.
platform
.
service
.
impl
;
import
com.platform.dao.AdvertisementItemDao
;
import
com.platform.entity.AdvertisementItemEntity
;
import
com.platform.service.AdvertisementItemService
;
import
com.platform.utils.IdUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
/**
* Service实现类
*
* @author lipengjun
* @date 2020-09-25 14:48:21
*/
@Service
(
"advertisementItemService"
)
public
class
AdvertisementItemServiceImpl
implements
AdvertisementItemService
{
@Autowired
private
AdvertisementItemDao
advertisementItemDao
;
@Override
public
AdvertisementItemEntity
queryObject
(
String
adId
)
{
return
advertisementItemDao
.
queryObject
(
adId
);
}
@Override
public
List
<
AdvertisementItemEntity
>
queryList
(
Map
<
String
,
Object
>
map
)
{
return
advertisementItemDao
.
queryList
(
map
);
}
@Override
public
int
queryTotal
(
Map
<
String
,
Object
>
map
)
{
return
advertisementItemDao
.
queryTotal
(
map
);
}
@Override
public
int
save
(
AdvertisementItemEntity
advertisementItem
)
{
advertisementItem
.
setAdId
(
IdUtil
.
createIdbyUUID
());
return
advertisementItemDao
.
save
(
advertisementItem
);
}
@Override
public
int
update
(
AdvertisementItemEntity
advertisementItem
)
{
return
advertisementItemDao
.
update
(
advertisementItem
);
}
@Override
public
int
delete
(
String
adId
)
{
return
advertisementItemDao
.
delete
(
adId
);
}
@Override
public
int
deleteBatch
(
String
[]
adIds
)
{
return
advertisementItemDao
.
deleteBatch
(
adIds
);
}
}
platform-admin/src/main/java/com/platform/service/impl/AdvertisementServiceImpl.java
0 → 100644
浏览文件 @
f35bb26a
package
com
.
platform
.
service
.
impl
;
import
com.platform.dao.AdvertisementDao
;
import
com.platform.entity.AdvertisementEntity
;
import
com.platform.service.AdvertisementService
;
import
com.platform.utils.IdUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
/**
* Service实现类
*
* @author lipengjun
* @date 2020-09-25 14:48:21
*/
@Service
(
"advertisementService"
)
public
class
AdvertisementServiceImpl
implements
AdvertisementService
{
@Autowired
private
AdvertisementDao
advertisementDao
;
@Override
public
AdvertisementEntity
queryObject
(
String
id
)
{
return
advertisementDao
.
queryObject
(
id
);
}
@Override
public
List
<
AdvertisementEntity
>
queryList
(
Map
<
String
,
Object
>
map
)
{
return
advertisementDao
.
queryList
(
map
);
}
@Override
public
int
queryTotal
(
Map
<
String
,
Object
>
map
)
{
return
advertisementDao
.
queryTotal
(
map
);
}
@Override
public
int
save
(
AdvertisementEntity
advertisement
)
{
advertisement
.
setId
(
IdUtil
.
createIdbyUUID
());
return
advertisementDao
.
save
(
advertisement
);
}
@Override
public
int
update
(
AdvertisementEntity
advertisement
)
{
return
advertisementDao
.
update
(
advertisement
);
}
@Override
public
int
delete
(
String
id
)
{
return
advertisementDao
.
delete
(
id
);
}
@Override
public
int
deleteBatch
(
String
[]
ids
)
{
return
advertisementDao
.
deleteBatch
(
ids
);
}
}
platform-admin/src/main/resources/com/platform/dao/AdvertisementDao.xml
0 → 100644
浏览文件 @
f35bb26a
<?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.platform.dao.AdvertisementDao"
>
<resultMap
type=
"com.platform.entity.AdvertisementEntity"
id=
"advertisementMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"adName"
column=
"ad_name"
/>
<result
property=
"adLink"
column=
"ad_link"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"startTime"
column=
"start_time"
/>
<result
property=
"endTime"
column=
"end_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"remark"
column=
"remark"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.platform.entity.AdvertisementEntity"
>
select
`id`,
`ad_name`,
`ad_link`,
`status`,
`start_time`,
`end_time`,
`create_time`,
`update_time`,
`remark`
from advertisement
where id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.platform.entity.AdvertisementEntity"
>
select
`id`,
`ad_name`,
`ad_link`,
`status`,
`start_time`,
`end_time`,
`create_time`,
`update_time`,
`remark`
from advertisement
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 advertisement
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert
id=
"save"
parameterType=
"com.platform.entity.AdvertisementEntity"
>
insert into advertisement(
`id`,
`ad_name`,
`ad_link`,
`status`,
`start_time`,
`end_time`,
`create_time`,
`update_time`,
`remark`)
values(
#{id},
#{adName},
#{adLink},
#{status},
#{startTime},
#{endTime},
#{createTime},
#{updateTime},
#{remark})
</insert>
<update
id=
"update"
parameterType=
"com.platform.entity.AdvertisementEntity"
>
update advertisement
<set>
<if
test=
"adName != null"
>
`ad_name` = #{adName},
</if>
<if
test=
"adLink != null"
>
`ad_link` = #{adLink},
</if>
<if
test=
"status != null"
>
`status` = #{status},
</if>
<if
test=
"startTime != null"
>
`start_time` = #{startTime},
</if>
<if
test=
"endTime != null"
>
`end_time` = #{endTime},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime},
</if>
<if
test=
"remark != null"
>
`remark` = #{remark}
</if>
</set>
where id = #{id}
</update>
<delete
id=
"delete"
>
delete from advertisement where id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from advertisement where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
platform-admin/src/main/resources/com/platform/dao/AdvertisementItemDao.xml
0 → 100644
浏览文件 @
f35bb26a
<?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.platform.dao.AdvertisementItemDao"
>
<resultMap
type=
"com.platform.entity.AdvertisementItemEntity"
id=
"advertisementItemMap"
>
<result
property=
"adId"
column=
"ad_id"
/>
<result
property=
"itemId"
column=
"item_id"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.platform.entity.AdvertisementItemEntity"
>
select
`ad_id`,
`item_id`
from advertisement_item
where ad_id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.platform.entity.AdvertisementItemEntity"
>
select
`ad_id`,
`item_id`
from advertisement_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>
order by ad_id desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from advertisement_item
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert
id=
"save"
parameterType=
"com.platform.entity.AdvertisementItemEntity"
>
insert into advertisement_item(
`ad_id`,
`item_id`)
values(
#{adId},
#{itemId})
</insert>
<update
id=
"update"
parameterType=
"com.platform.entity.AdvertisementItemEntity"
>
update advertisement_item
<set>
<if
test=
"itemId != null"
>
`item_id` = #{itemId}
</if>
</set>
where ad_id = #{adId}
</update>
<delete
id=
"delete"
>
delete from advertisement_item where ad_id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from advertisement_item where ad_id in
<foreach
item=
"adId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{adId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
platform-admin/src/main/webapp/WEB-INF/page/sys/advertisement.html
0 → 100644
浏览文件 @
f35bb26a
<!DOCTYPE html>
<html>
<head>
<title></title>
#parse("sys/header.html")
</head>
<body>
<div
id=
"rrapp"
v-cloak
style=
"height: calc(100% - 15px);"
>
<div
v-show=
"showList"
style=
"height: 100%;"
>
<Row
:gutter=
"16"
>
<div
class=
"search-group"
>
<i-col
span=
"4"
>
<i-input
v-model=
"q.name"
@
on-enter=
"query"
placeholder=
"名称"
/>
</i-col>
<i-button
@
click=
"query"
>
查询
</i-button>
<i-button
@
click=
"reloadSearch"
>
重置
</i-button>
</div>
<div
class=
"buttons-group"
>
#if($shiro.hasPermission("advertisement:save"))
<i-button
type=
"info"
@
click=
"add"
><i
class=
"fa fa-plus"
></i>
新增
</i-button>
#end
#if($shiro.hasPermission("advertisement:update"))
<i-button
type=
"warning"
@
click=
"update"
><i
class=
"fa fa-pencil-square-o"
></i>
修改
</i-button>
#end
#if($shiro.hasPermission("advertisement:delete"))
<i-button
type=
"error"
@
click=
"del"
><i
class=
"fa fa-trash-o"
></i>
删除
</i-button>
#end
</div>
</Row>
<table
id=
"jqGrid"
></table>
</div>
<Card
v-show=
"!showList"
>
<p
slot=
"title"
>
{{title}}
</p>
<i-form
ref=
"formValidate"
:model=
"advertisement"
:rules=
"ruleValidate"
:label-width=
"80"
>
<Form-item
label=
"广告名"
prop=
"adName"
>
<i-input
v-model=
"advertisement.adName"
placeholder=
"广告名"
/>
</Form-item>
<Form-item
label=
"广告链接"
prop=
"adLink"
>
<i-input
v-model=
"advertisement.adLink"
placeholder=
"广告链接"
/>
</Form-item>
<Form-item
label=
"状态"
prop=
"status"
>
<i-input
v-model=
"advertisement.status"
placeholder=
"状态"
/>
</Form-item>
<Form-item
label=
"活动开始时间"
prop=
"startTime"
>
<i-input
v-model=
"advertisement.startTime"
placeholder=
"活动开始时间"
/>
</Form-item>
<Form-item
label=
"活动结束时间"
prop=
"endTime"
>
<i-input
v-model=
"advertisement.endTime"
placeholder=
"活动结束时间"
/>
</Form-item>
<Form-item
label=
"创建时间"
prop=
"createTime"
>
<i-input
v-model=
"advertisement.createTime"
placeholder=
"创建时间"
/>
</Form-item>
<Form-item
label=
"更新时间"
prop=
"updateTime"
>
<i-input
v-model=
"advertisement.updateTime"
placeholder=
"更新时间"
/>
</Form-item>
<Form-item
label=
"备注"
prop=
"remark"
>
<i-input
v-model=
"advertisement.remark"
placeholder=
"备注"
/>
</Form-item>
<Form-item>
<i-button
type=
"primary"
@
click=
"handleSubmit('formValidate')"
>
提交
</i-button>
<i-button
type=
"warning"
@
click=
"reload"
style=
"margin-left: 8px"
/>
返回
</i-button>
<i-button
type=
"ghost"
@
click=
"handleReset('formValidate')"
style=
"margin-left: 8px"
>
重置
</i-button>
</Form-item>
</i-form>
</Card>
</div>
<script
src=
"${rc.contextPath}/js/sys/advertisement.js?_${date.systemTime}"
></script>
</body>
</html>
\ No newline at end of file
platform-admin/src/main/webapp/WEB-INF/page/sys/advertisementitem.html
0 → 100644
浏览文件 @
f35bb26a
<!DOCTYPE html>
<html>
<head>
<title></title>
#parse("sys/header.html")
</head>
<body>
<div
id=
"rrapp"
v-cloak
style=
"height: calc(100% - 15px);"
>
<div
v-show=
"showList"
style=
"height: 100%;"
>
<Row
:gutter=
"16"
>
<div
class=
"search-group"
>
<i-col
span=
"4"
>
<i-input
v-model=
"q.name"
@
on-enter=
"query"
placeholder=
"名称"
/>
</i-col>
<i-button
@
click=
"query"
>
查询
</i-button>
<i-button
@
click=
"reloadSearch"
>
重置
</i-button>
</div>
<div
class=
"buttons-group"
>
#if($shiro.hasPermission("advertisementitem:save"))
<i-button
type=
"info"
@
click=
"add"
><i
class=
"fa fa-plus"
></i>
新增
</i-button>
#end
#if($shiro.hasPermission("advertisementitem:update"))
<i-button
type=
"warning"
@
click=
"update"
><i
class=
"fa fa-pencil-square-o"
></i>
修改
</i-button>
#end
#if($shiro.hasPermission("advertisementitem:delete"))
<i-button
type=
"error"
@
click=
"del"
><i
class=
"fa fa-trash-o"
></i>
删除
</i-button>
#end
</div>
</Row>
<table
id=
"jqGrid"
></table>
</div>
<Card
v-show=
"!showList"
>
<p
slot=
"title"
>
{{title}}
</p>
<i-form
ref=
"formValidate"
:model=
"advertisementItem"
:rules=
"ruleValidate"
:label-width=
"80"
>
<Form-item
label=
"商品ID"
prop=
"itemId"
>
<i-input
v-model=
"advertisementItem.itemId"
placeholder=
"商品ID"
/>
</Form-item>
<Form-item>
<i-button
type=
"primary"
@
click=
"handleSubmit('formValidate')"
>
提交
</i-button>
<i-button
type=
"warning"
@
click=
"reload"
style=
"margin-left: 8px"
/>
返回
</i-button>
<i-button
type=
"ghost"
@
click=
"handleReset('formValidate')"
style=
"margin-left: 8px"
>
重置
</i-button>
</Form-item>
</i-form>
</Card>
</div>
<script
src=
"${rc.contextPath}/js/sys/advertisementitem.js?_${date.systemTime}"
></script>
</body>
</html>
\ No newline at end of file
platform-admin/src/main/webapp/js/common.js
浏览文件 @
f35bb26a
...
...
@@ -603,6 +603,20 @@ statusFormat1 = function (cellvalue) {
return
cellvalue
==
1
?
'正常'
:
'已删除'
;
};
//状态 0:已删除 1:活动进行中 2:活动已关闭 3:活动已结束
adStatus
=
function
(
cellvalue
)
{
let
returnStr
=
"未知"
if
(
cellvalue
==
0
){
returnStr
=
'已删除'
;
}
else
if
(
cellvalue
==
1
){
returnStr
=
'活动进行中'
;
}
else
if
(
cellvalue
==
2
){
returnStr
=
'活动已关闭'
;
}
else
if
(
cellvalue
==
3
){
returnStr
=
'活动已结束'
;
}
return
returnStr
;
};
/**
* 是否为注册就送优惠券
* @param cellvalue
...
...
platform-admin/src/main/webapp/js/sys/advertisement.js
0 → 100644
浏览文件 @
f35bb26a
$
(
function
()
{
$
(
"#jqGrid"
).
Grid
({
url
:
'../advertisement/list'
,
colModel
:
[
{
label
:
'id'
,
name
:
'id'
,
index
:
'id'
,
key
:
true
,
hidden
:
true
},
{
label
:
'广告名'
,
name
:
'adName'
,
index
:
'ad_name'
,
width
:
80
},
{
label
:
'广告链接'
,
name
:
'adLink'
,
index
:
'ad_link'
,
width
:
80
},
{
label
:
'状态'
,
name
:
'status'
,
index
:
'status'
,
width
:
80
,
formatter
:
adStatus
},
{
label
:
'活动开始时间'
,
name
:
'startTime'
,
index
:
'start_time'
,
width
:
80
},
{
label
:
'活动结束时间'
,
name
:
'endTime'
,
index
:
'end_time'
,
width
:
80
},
{
label
:
'创建时间'
,
name
:
'createTime'
,
index
:
'create_time'
,
width
:
80
},
/*{label: '更新时间', name: 'updateTime', index: 'update_time', width: 80},*/
{
label
:
'备注'
,
name
:
'remark'
,
index
:
'remark'
,
width
:
80
}]
});
});
let
vm
=
new
Vue
({
el
:
'#rrapp'
,
data
:
{
showList
:
true
,
title
:
null
,
advertisement
:
{},
ruleValidate
:
{
name
:
[
{
required
:
true
,
message
:
'名称不能为空'
,
trigger
:
'blur'
}
]
},
q
:
{
name
:
''
}
},
methods
:
{
query
:
function
()
{
vm
.
reload
();
},
add
:
function
()
{
vm
.
showList
=
false
;
vm
.
title
=
"新增"
;
vm
.
advertisement
=
{};
},
update
:
function
(
event
)
{
let
id
=
getSelectedRow
(
"#jqGrid"
);
if
(
id
==
null
)
{
return
;
}
vm
.
showList
=
false
;
vm
.
title
=
"修改"
;
vm
.
getInfo
(
id
);
},
saveOrUpdate
:
function
(
event
)
{
let
url
=
vm
.
advertisement
.
id
==
null
?
"../advertisement/save"
:
"../advertisement/update"
;
Ajax
.
request
({
url
:
url
,
params
:
JSON
.
stringify
(
vm
.
advertisement
),
type
:
"POST"
,
contentType
:
"application/json"
,
successCallback
:
function
(
r
)
{
alert
(
'操作成功'
,
function
(
index
)
{
vm
.
reload
();
});
}
});
},
del
:
function
(
event
)
{
let
ids
=
getSelectedRows
(
"#jqGrid"
);
if
(
ids
==
null
){
return
;
}
confirm
(
'确定要删除选中的记录?'
,
function
()
{
Ajax
.
request
({
url
:
"../advertisement/delete"
,
params
:
JSON
.
stringify
(
ids
),
type
:
"POST"
,
contentType
:
"application/json"
,
successCallback
:
function
()
{
alert
(
'操作成功'
,
function
(
index
)
{
vm
.
reload
();
});
}
});
});
},
getInfo
:
function
(
id
){
Ajax
.
request
({
url
:
"../advertisement/info/"
+
id
,
async
:
true
,
successCallback
:
function
(
r
)
{
vm
.
advertisement
=
r
.
advertisement
;
}
});
},
reload
:
function
(
event
)
{
vm
.
showList
=
true
;
let
page
=
$
(
"#jqGrid"
).
jqGrid
(
'getGridParam'
,
'page'
);
$
(
"#jqGrid"
).
jqGrid
(
'setGridParam'
,
{
postData
:
{
'name'
:
vm
.
q
.
name
},
page
:
page
}).
trigger
(
"reloadGrid"
);
vm
.
handleReset
(
'formValidate'
);
},
reloadSearch
:
function
()
{
vm
.
q
=
{
name
:
''
};
vm
.
reload
();
},
handleSubmit
:
function
(
name
)
{
handleSubmitValidate
(
this
,
name
,
function
()
{
vm
.
saveOrUpdate
()
});
},
handleReset
:
function
(
name
)
{
handleResetForm
(
this
,
name
);
}
}
});
platform-admin/src/main/webapp/js/sys/advertisementitem.js
0 → 100644
浏览文件 @
f35bb26a
$
(
function
()
{
$
(
"#jqGrid"
).
Grid
({
url
:
'../advertisementitem/list'
,
colModel
:
[
{
label
:
'adId'
,
name
:
'adId'
,
index
:
'ad_id'
,
key
:
true
,
hidden
:
true
},
{
label
:
'商品ID'
,
name
:
'itemId'
,
index
:
'item_id'
,
width
:
80
}]
});
});
let
vm
=
new
Vue
({
el
:
'#rrapp'
,
data
:
{
showList
:
true
,
title
:
null
,
advertisementItem
:
{},
ruleValidate
:
{
name
:
[
{
required
:
true
,
message
:
'名称不能为空'
,
trigger
:
'blur'
}
]
},
q
:
{
name
:
''
}
},
methods
:
{
query
:
function
()
{
vm
.
reload
();
},
add
:
function
()
{
vm
.
showList
=
false
;
vm
.
title
=
"新增"
;
vm
.
advertisementItem
=
{};
},
update
:
function
(
event
)
{
let
adId
=
getSelectedRow
(
"#jqGrid"
);
if
(
adId
==
null
)
{
return
;
}
vm
.
showList
=
false
;
vm
.
title
=
"修改"
;
vm
.
getInfo
(
adId
);
},
saveOrUpdate
:
function
(
event
)
{
let
url
=
vm
.
advertisementItem
.
adId
==
null
?
"../advertisementitem/save"
:
"../advertisementitem/update"
;
Ajax
.
request
({
url
:
url
,
params
:
JSON
.
stringify
(
vm
.
advertisementItem
),
type
:
"POST"
,
contentType
:
"application/json"
,
successCallback
:
function
(
r
)
{
alert
(
'操作成功'
,
function
(
index
)
{
vm
.
reload
();
});
}
});
},
del
:
function
(
event
)
{
let
adIds
=
getSelectedRows
(
"#jqGrid"
);
if
(
adIds
==
null
){
return
;
}
confirm
(
'确定要删除选中的记录?'
,
function
()
{
Ajax
.
request
({
url
:
"../advertisementitem/delete"
,
params
:
JSON
.
stringify
(
adIds
),
type
:
"POST"
,
contentType
:
"application/json"
,
successCallback
:
function
()
{
alert
(
'操作成功'
,
function
(
index
)
{
vm
.
reload
();
});
}
});
});
},
getInfo
:
function
(
adId
){
Ajax
.
request
({
url
:
"../advertisementitem/info/"
+
adId
,
async
:
true
,
successCallback
:
function
(
r
)
{
vm
.
advertisementItem
=
r
.
advertisementItem
;
}
});
},
reload
:
function
(
event
)
{
vm
.
showList
=
true
;
let
page
=
$
(
"#jqGrid"
).
jqGrid
(
'getGridParam'
,
'page'
);
$
(
"#jqGrid"
).
jqGrid
(
'setGridParam'
,
{
postData
:
{
'name'
:
vm
.
q
.
name
},
page
:
page
}).
trigger
(
"reloadGrid"
);
vm
.
handleReset
(
'formValidate'
);
},
reloadSearch
:
function
()
{
vm
.
q
=
{
name
:
''
};
vm
.
reload
();
},
handleSubmit
:
function
(
name
)
{
handleSubmitValidate
(
this
,
name
,
function
()
{
vm
.
saveOrUpdate
()
});
},
handleReset
:
function
(
name
)
{
handleResetForm
(
this
,
name
);
}
}
});
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论