图片广告
This commit is contained in:
parent
9ed04fce2a
commit
4027bafbac
|
|
@ -0,0 +1,108 @@
|
|||
package com.ruoyi.content.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.content.domain.CmsPicAdInfo;
|
||||
import com.ruoyi.content.service.ICmsPicAdInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 图片广告Controller
|
||||
*
|
||||
* @author liushenlu
|
||||
* @date 2021-03-25
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/content/picAdverts")
|
||||
public class CmsPicAdInfoController extends BaseController {
|
||||
|
||||
private String prefix = "content/picAdverts";
|
||||
|
||||
@Autowired
|
||||
private ICmsPicAdInfoService cmsPicAdInfoService;
|
||||
|
||||
@GetMapping()
|
||||
public String picAdverts() {
|
||||
return prefix + "/picAdverts";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询图片广告列表
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(CmsPicAdInfo cmsPicAdInfo) {
|
||||
startPage();
|
||||
List<CmsPicAdInfo> list = cmsPicAdInfoService.selectCmsPicAdInfoList(cmsPicAdInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出图片广告列表
|
||||
*/
|
||||
@Log(title = "图片广告", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(CmsPicAdInfo cmsPicAdInfo) {
|
||||
List<CmsPicAdInfo> list = cmsPicAdInfoService.selectCmsPicAdInfoList(cmsPicAdInfo);
|
||||
ExcelUtil<CmsPicAdInfo> util = new ExcelUtil<CmsPicAdInfo>(CmsPicAdInfo.class);
|
||||
return util.exportExcel(list, "picAdverts");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增图片广告
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add() {
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存图片广告
|
||||
*/
|
||||
@Log(title = "图片广告", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(CmsPicAdInfo cmsPicAdInfo) {
|
||||
return toAjax(cmsPicAdInfoService.insertCmsPicAdInfo(cmsPicAdInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改图片广告
|
||||
*/
|
||||
@GetMapping("/edit/{picAdId}")
|
||||
public String edit(@PathVariable("picAdId") Long picAdId, ModelMap mmap) {
|
||||
CmsPicAdInfo cmsPicAdInfo = cmsPicAdInfoService.selectCmsPicAdInfoById(picAdId);
|
||||
mmap.put("cmsPicAdInfo", cmsPicAdInfo);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存图片广告
|
||||
*/
|
||||
@Log(title = "图片广告", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(CmsPicAdInfo cmsPicAdInfo) {
|
||||
return toAjax(cmsPicAdInfoService.updateCmsPicAdInfo(cmsPicAdInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除图片广告
|
||||
*/
|
||||
@Log(title = "图片广告", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids) {
|
||||
return toAjax(cmsPicAdInfoService.deleteCmsPicAdInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,216 @@
|
|||
package com.ruoyi.content.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 图片广告对象 cms_pic_ad_info
|
||||
*
|
||||
* @author liushenlu
|
||||
* @date 2021-03-25
|
||||
*/
|
||||
public class CmsPicAdInfo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 广告编号
|
||||
*/
|
||||
private Long picAdId;
|
||||
|
||||
/**
|
||||
* 广告类型
|
||||
*/
|
||||
@Excel(name = "广告类型")
|
||||
private String picAdType;
|
||||
|
||||
/**
|
||||
* 产品标题
|
||||
*/
|
||||
@Excel(name = "产品标题")
|
||||
private String picAdTitle;
|
||||
|
||||
/**
|
||||
* 广告特有名称
|
||||
*/
|
||||
@Excel(name = "广告特有名称")
|
||||
private String picAdName;
|
||||
|
||||
/**
|
||||
* 广告链接
|
||||
*/
|
||||
@Excel(name = "广告链接")
|
||||
private String picAdUrl;
|
||||
|
||||
/**
|
||||
* 广告状态,0:可展示,1:不可展示
|
||||
*/
|
||||
@Excel(name = "广告状态,0:可展示,1:不可展示")
|
||||
private String picAdState;
|
||||
|
||||
/**
|
||||
* 公司id
|
||||
*/
|
||||
@Excel(name = "公司id")
|
||||
private String companyId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Excel(name = "")
|
||||
private String createDate;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Excel(name = "")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Excel(name = "")
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Excel(name = "")
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Excel(name = "")
|
||||
private String updateDate;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Excel(name = "")
|
||||
private String updateTime;
|
||||
|
||||
public void setPicAdId(Long picAdId) {
|
||||
this.picAdId = picAdId;
|
||||
}
|
||||
|
||||
public Long getPicAdId() {
|
||||
return picAdId;
|
||||
}
|
||||
|
||||
public void setPicAdType(String picAdType) {
|
||||
this.picAdType = picAdType;
|
||||
}
|
||||
|
||||
public String getPicAdType() {
|
||||
return picAdType;
|
||||
}
|
||||
|
||||
public void setPicAdTitle(String picAdTitle) {
|
||||
this.picAdTitle = picAdTitle;
|
||||
}
|
||||
|
||||
public String getPicAdTitle() {
|
||||
return picAdTitle;
|
||||
}
|
||||
|
||||
public void setPicAdName(String picAdName) {
|
||||
this.picAdName = picAdName;
|
||||
}
|
||||
|
||||
public String getPicAdName() {
|
||||
return picAdName;
|
||||
}
|
||||
|
||||
public void setPicAdUrl(String picAdUrl) {
|
||||
this.picAdUrl = picAdUrl;
|
||||
}
|
||||
|
||||
public String getPicAdUrl() {
|
||||
return picAdUrl;
|
||||
}
|
||||
|
||||
public void setPicAdState(String picAdState) {
|
||||
this.picAdState = picAdState;
|
||||
}
|
||||
|
||||
public String getPicAdState() {
|
||||
return picAdState;
|
||||
}
|
||||
|
||||
public void setCompanyId(String companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public String getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCreateDate(String createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
public String getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateUser(String createUser) {
|
||||
this.createUser = createUser;
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
return createUser;
|
||||
}
|
||||
|
||||
public void setUpdateUser(String updateUser) {
|
||||
this.updateUser = updateUser;
|
||||
}
|
||||
|
||||
public String getUpdateUser() {
|
||||
return updateUser;
|
||||
}
|
||||
|
||||
public void setUpdateDate(String updateDate) {
|
||||
this.updateDate = updateDate;
|
||||
}
|
||||
|
||||
public String getUpdateDate() {
|
||||
return updateDate;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(String updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("picAdId", getPicAdId())
|
||||
.append("picAdType", getPicAdType())
|
||||
.append("picAdTitle", getPicAdTitle())
|
||||
.append("picAdName", getPicAdName())
|
||||
.append("picAdUrl", getPicAdUrl())
|
||||
.append("picAdState", getPicAdState())
|
||||
.append("companyId", getCompanyId())
|
||||
.append("createDate", getCreateDate())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createUser", getCreateUser())
|
||||
.append("updateUser", getUpdateUser())
|
||||
.append("updateDate", getUpdateDate())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.ruoyi.content.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.content.domain.CmsPicAdInfo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 图片广告Mapper接口
|
||||
*
|
||||
* @author liushenlu
|
||||
* @date 2021-03-25
|
||||
*/
|
||||
@Repository
|
||||
public interface CmsPicAdInfoMapper {
|
||||
/**
|
||||
* 查询图片广告
|
||||
*
|
||||
* @param picAdId 图片广告ID
|
||||
* @return 图片广告
|
||||
*/
|
||||
public CmsPicAdInfo selectCmsPicAdInfoById(Long picAdId);
|
||||
|
||||
/**
|
||||
* 查询图片广告列表
|
||||
*
|
||||
* @param cmsPicAdInfo 图片广告
|
||||
* @return 图片广告集合
|
||||
*/
|
||||
public List<CmsPicAdInfo> selectCmsPicAdInfoList(CmsPicAdInfo cmsPicAdInfo);
|
||||
|
||||
/**
|
||||
* 新增图片广告
|
||||
*
|
||||
* @param cmsPicAdInfo 图片广告
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCmsPicAdInfo(CmsPicAdInfo cmsPicAdInfo);
|
||||
|
||||
/**
|
||||
* 修改图片广告
|
||||
*
|
||||
* @param cmsPicAdInfo 图片广告
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCmsPicAdInfo(CmsPicAdInfo cmsPicAdInfo);
|
||||
|
||||
/**
|
||||
* 删除图片广告
|
||||
*
|
||||
* @param picAdId 图片广告ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCmsPicAdInfoById(Long picAdId);
|
||||
|
||||
/**
|
||||
* 批量删除图片广告
|
||||
*
|
||||
* @param picAdIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCmsPicAdInfoByIds(String[] picAdIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.ruoyi.content.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.content.domain.CmsPicAdInfo;
|
||||
|
||||
/**
|
||||
* 图片广告Service接口
|
||||
*
|
||||
* @author liushenlu
|
||||
* @date 2021-03-25
|
||||
*/
|
||||
public interface ICmsPicAdInfoService {
|
||||
|
||||
/**
|
||||
* 查询图片广告
|
||||
*
|
||||
* @param picAdId 图片广告ID
|
||||
* @return 图片广告
|
||||
*/
|
||||
public CmsPicAdInfo selectCmsPicAdInfoById(Long picAdId);
|
||||
|
||||
/**
|
||||
* 查询图片广告列表
|
||||
*
|
||||
* @param cmsPicAdInfo 图片广告
|
||||
* @return 图片广告集合
|
||||
*/
|
||||
public List<CmsPicAdInfo> selectCmsPicAdInfoList(CmsPicAdInfo cmsPicAdInfo);
|
||||
|
||||
/**
|
||||
* 新增图片广告
|
||||
*
|
||||
* @param cmsPicAdInfo 图片广告
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCmsPicAdInfo(CmsPicAdInfo cmsPicAdInfo);
|
||||
|
||||
/**
|
||||
* 修改图片广告
|
||||
*
|
||||
* @param cmsPicAdInfo 图片广告
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCmsPicAdInfo(CmsPicAdInfo cmsPicAdInfo);
|
||||
|
||||
/**
|
||||
* 批量删除图片广告
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCmsPicAdInfoByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除图片广告信息
|
||||
*
|
||||
* @param picAdId 图片广告ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCmsPicAdInfoById(Long picAdId);
|
||||
}
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
package com.ruoyi.content.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.content.domain.CmsArticleAdInfo;
|
||||
import com.ruoyi.content.domain.CmsPicAdInfo;
|
||||
import com.ruoyi.content.mapper.CmsPicAdInfoMapper;
|
||||
import com.ruoyi.content.redis.RedisManager;
|
||||
import com.ruoyi.content.service.ICmsPicAdInfoService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 图片广告Service业务层处理
|
||||
*
|
||||
* @author liushenlu
|
||||
* @date 2021-03-25
|
||||
*/
|
||||
@Service
|
||||
public class CmsPicAdInfoServiceImpl implements ICmsPicAdInfoService {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(CmsPicAdInfoServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private CmsPicAdInfoMapper cmsPicAdInfoMapper;
|
||||
@Autowired
|
||||
private RedisManager redisManager;
|
||||
|
||||
/**
|
||||
* 查询图片广告
|
||||
*
|
||||
* @param picAdId 图片广告ID
|
||||
* @return 图片广告
|
||||
*/
|
||||
@Override
|
||||
public CmsPicAdInfo selectCmsPicAdInfoById(Long picAdId) {
|
||||
return cmsPicAdInfoMapper.selectCmsPicAdInfoById(picAdId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询图片广告列表
|
||||
*
|
||||
* @param cmsPicAdInfo 图片广告
|
||||
* @return 图片广告
|
||||
*/
|
||||
@Override
|
||||
public List<CmsPicAdInfo> selectCmsPicAdInfoList(CmsPicAdInfo cmsPicAdInfo) {
|
||||
cmsPicAdInfo.setCompanyId("1");
|
||||
return cmsPicAdInfoMapper.selectCmsPicAdInfoList(cmsPicAdInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增图片广告
|
||||
*
|
||||
* @param cmsPicAdInfo 图片广告
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCmsPicAdInfo(CmsPicAdInfo cmsPicAdInfo) {
|
||||
String date = DateUtils.getDate();
|
||||
String time = DateUtils.getTimeNow();
|
||||
cmsPicAdInfo.setCompanyId("1");
|
||||
cmsPicAdInfo.setPicAdUrl(cmsPicAdInfo.getPicAdUrl() + "(");
|
||||
cmsPicAdInfo.setCreateDate(date);
|
||||
cmsPicAdInfo.setCreateTime(time);
|
||||
cmsPicAdInfo.setCreateUser("company");
|
||||
cmsPicAdInfo.setUpdateUser("company");
|
||||
cmsPicAdInfo.setUpdateDate(date);
|
||||
cmsPicAdInfo.setUpdateTime(time);
|
||||
cmsPicAdInfo.setPicAdState("0");
|
||||
return cmsPicAdInfoMapper.insertCmsPicAdInfo(cmsPicAdInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改图片广告
|
||||
*
|
||||
* @param cmsPicAdInfo 图片广告
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCmsPicAdInfo(CmsPicAdInfo cmsPicAdInfo) {
|
||||
if (StringUtils.isNotBlank(cmsPicAdInfo.getPicAdUrl()) && cmsPicAdInfo.getPicAdUrl().indexOf("(") == -1) {
|
||||
cmsPicAdInfo.setPicAdUrl(cmsPicAdInfo.getPicAdUrl() + "(");
|
||||
}
|
||||
cmsPicAdInfo.setUpdateDate(DateUtils.getDate());
|
||||
cmsPicAdInfo.setUpdateTime(DateUtils.getTimeNow());
|
||||
if (cmsPicAdInfoMapper.updateCmsPicAdInfo(cmsPicAdInfo) > 0) {
|
||||
redisManager.delete("picAdInfo_1");
|
||||
} else {
|
||||
LOGGER.info("编辑广告失败");
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除图片广告对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCmsPicAdInfoByIds(String ids) {
|
||||
String[] arrId = ids.split(",");
|
||||
for (String id : arrId) {
|
||||
CmsPicAdInfo delType = cmsPicAdInfoMapper.selectCmsPicAdInfoById(Long.valueOf(id));
|
||||
if (delType != null) {
|
||||
redisManager.delete("picAdInfo_1");
|
||||
cmsPicAdInfoMapper.deleteCmsPicAdInfoById(Long.valueOf(id));
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除图片广告信息
|
||||
*
|
||||
* @param picAdId 图片广告ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCmsPicAdInfoById(Long picAdId) {
|
||||
return cmsPicAdInfoMapper.deleteCmsPicAdInfoById(picAdId);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
<?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.ruoyi.content.mapper.CmsPicAdInfoMapper">
|
||||
|
||||
<resultMap type="CmsPicAdInfo" id="CmsPicAdInfoResult">
|
||||
<result property="picAdId" column="PIC_AD_ID" />
|
||||
<result property="picAdType" column="PIC_AD_TYPE" />
|
||||
<result property="picAdTitle" column="PIC_AD_TITLE" />
|
||||
<result property="picAdName" column="PIC_AD_NAME" />
|
||||
<result property="picAdUrl" column="PIC_AD_URL" />
|
||||
<result property="picAdState" column="PIC_AD_STATE" />
|
||||
<result property="companyId" column="COMPANY_ID" />
|
||||
<result property="createDate" column="CREATE_DATE" />
|
||||
<result property="createTime" column="CREATE_TIME" />
|
||||
<result property="createUser" column="CREATE_USER" />
|
||||
<result property="updateUser" column="UPDATE_USER" />
|
||||
<result property="updateDate" column="UPDATE_DATE" />
|
||||
<result property="updateTime" column="UPDATE_TIME" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCmsPicAdInfoVo">
|
||||
select PIC_AD_ID, PIC_AD_TYPE, PIC_AD_TITLE, PIC_AD_NAME, PIC_AD_URL, PIC_AD_STATE, COMPANY_ID, CREATE_DATE, CREATE_TIME, CREATE_USER, UPDATE_USER, UPDATE_DATE, UPDATE_TIME from cms_pic_ad_info
|
||||
</sql>
|
||||
|
||||
<select id="selectCmsPicAdInfoList" parameterType="CmsPicAdInfo" resultMap="CmsPicAdInfoResult">
|
||||
<include refid="selectCmsPicAdInfoVo"/>
|
||||
<where>
|
||||
PIC_AD_STATE = '0'
|
||||
<if test="picAdType != null and picAdType != ''"> and PIC_AD_TYPE = #{picAdType}</if>
|
||||
<if test="picAdTitle != null and picAdTitle != ''"> and PIC_AD_TITLE like concat('%', #{picAdTitle}, '%')</if>
|
||||
<if test="picAdName != null and picAdName != ''"> and PIC_AD_NAME like concat('%', #{picAdName}, '%')</if>
|
||||
<if test="picAdUrl != null and picAdUrl != ''"> and PIC_AD_URL = #{picAdUrl}</if>
|
||||
<if test="companyId != null and companyId != ''"> and COMPANY_ID = #{companyId}</if>
|
||||
<if test="createDate != null and createDate != ''"> and CREATE_DATE = #{createDate}</if>
|
||||
<if test="createTime != null and createTime != ''"> and CREATE_TIME = #{createTime}</if>
|
||||
and CREATE_USER = 'company'
|
||||
<if test="updateUser != null and updateUser != ''"> and UPDATE_USER = #{updateUser}</if>
|
||||
<if test="updateDate != null and updateDate != ''"> and UPDATE_DATE = #{updateDate}</if>
|
||||
<if test="updateTime != null and updateTime != ''"> and UPDATE_TIME = #{updateTime}</if>
|
||||
</where>
|
||||
order by CREATE_DATE DESC,CREATE_TIME DESC, UPDATE_DATE DESC,UPDATE_TIME DESC
|
||||
</select>
|
||||
|
||||
<select id="selectCmsPicAdInfoById" parameterType="Long" resultMap="CmsPicAdInfoResult">
|
||||
<include refid="selectCmsPicAdInfoVo"/>
|
||||
where PIC_AD_ID = #{picAdId}
|
||||
</select>
|
||||
|
||||
<insert id="insertCmsPicAdInfo" parameterType="CmsPicAdInfo" useGeneratedKeys="true" keyProperty="picAdId">
|
||||
insert into cms_pic_ad_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="picAdType != null">PIC_AD_TYPE,</if>
|
||||
<if test="picAdTitle != null">PIC_AD_TITLE,</if>
|
||||
<if test="picAdName != null">PIC_AD_NAME,</if>
|
||||
<if test="picAdUrl != null">PIC_AD_URL,</if>
|
||||
<if test="picAdState != null">PIC_AD_STATE,</if>
|
||||
<if test="companyId != null">COMPANY_ID,</if>
|
||||
<if test="createDate != null">CREATE_DATE,</if>
|
||||
<if test="createTime != null">CREATE_TIME,</if>
|
||||
<if test="createUser != null">CREATE_USER,</if>
|
||||
<if test="updateUser != null">UPDATE_USER,</if>
|
||||
<if test="updateDate != null">UPDATE_DATE,</if>
|
||||
<if test="updateTime != null">UPDATE_TIME,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="picAdType != null">#{picAdType},</if>
|
||||
<if test="picAdTitle != null">#{picAdTitle},</if>
|
||||
<if test="picAdName != null">#{picAdName},</if>
|
||||
<if test="picAdUrl != null">#{picAdUrl},</if>
|
||||
<if test="picAdState != null">#{picAdState},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="createDate != null">#{createDate},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createUser != null">#{createUser},</if>
|
||||
<if test="updateUser != null">#{updateUser},</if>
|
||||
<if test="updateDate != null">#{updateDate},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCmsPicAdInfo" parameterType="CmsPicAdInfo">
|
||||
update cms_pic_ad_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="picAdType != null">PIC_AD_TYPE = #{picAdType},</if>
|
||||
<if test="picAdTitle != null">PIC_AD_TITLE = #{picAdTitle},</if>
|
||||
<if test="picAdName != null">PIC_AD_NAME = #{picAdName},</if>
|
||||
<if test="picAdUrl != null">PIC_AD_URL = #{picAdUrl},</if>
|
||||
<if test="picAdState != null">PIC_AD_STATE = #{picAdState},</if>
|
||||
<if test="companyId != null">COMPANY_ID = #{companyId},</if>
|
||||
<if test="createDate != null">CREATE_DATE = #{createDate},</if>
|
||||
<if test="createTime != null">CREATE_TIME = #{createTime},</if>
|
||||
<if test="createUser != null">CREATE_USER = #{createUser},</if>
|
||||
<if test="updateUser != null">UPDATE_USER = #{updateUser},</if>
|
||||
<if test="updateDate != null">UPDATE_DATE = #{updateDate},</if>
|
||||
<if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
|
||||
</trim>
|
||||
where PIC_AD_ID = #{picAdId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCmsPicAdInfoById" parameterType="Long">
|
||||
delete from cms_pic_ad_info where PIC_AD_ID = #{picAdId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCmsPicAdInfoByIds" parameterType="String">
|
||||
delete from cms_pic_ad_info where PIC_AD_ID in
|
||||
<foreach item="picAdId" collection="array" open="(" separator="," close=")">
|
||||
#{picAdId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增图片广告')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-picAdverts-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">广告标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="picAdTitle" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">广告特有名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="picAdName" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">广告类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="picAdType" class="form-control" required>
|
||||
<option selected value="1">名片</option>
|
||||
<option value="2">招募</option>
|
||||
<option value="3">增员</option>
|
||||
<option value="4">产品</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">广告链接:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="picAdUrl" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "content/picAdverts"
|
||||
$("#form-picAdverts-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
// 打开遮罩层
|
||||
$.modal.loading("请稍后...");
|
||||
$.operate.save(prefix + "/add", $('#form-picAdverts-add').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改图片广告')"/>
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-picAdverts-edit" th:object="${cmsPicAdInfo}">
|
||||
<input name="picAdId" th:field="*{picAdId}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">广告标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="picAdTitle" th:field="*{picAdTitle}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">广告特有名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="picAdName" th:field="*{picAdName}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">广告类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="picAdType" th:field="*{picAdType}" class="form-control" required>
|
||||
<option value="1">名片</option>
|
||||
<option value="2">招募</option>
|
||||
<option value="3">增员</option>
|
||||
<option value="4">产品</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">广告链接:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="picAdUrl" th:field="*{picAdUrl}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer"/>
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "content/picAdverts";
|
||||
$("#form-picAdverts-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
// 打开遮罩层
|
||||
$.modal.loading("请稍后...");
|
||||
$.operate.save(prefix + "/edit", $('#form-picAdverts-edit').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('图片广告列表')"/>
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>产品名称:</label>
|
||||
<input type="text" name="picAdTitle"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
|
||||
class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
|
||||
class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer"/>
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "content/picAdverts";
|
||||
|
||||
$(function () {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "图片广告",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'picAdId',
|
||||
title: '广告编号',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'picAdTitle',
|
||||
title: '广告标题'
|
||||
},
|
||||
{
|
||||
field: 'picAdName',
|
||||
title: '广告特有名称'
|
||||
},
|
||||
{
|
||||
field: 'picAdUrl',
|
||||
title: '广告链接',
|
||||
formatter: function (value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-xs" href="javascript:void(0)" onclick="$.modal.msg(\'' + row.picAdUrl + '\');" ><i class="fa"></i>展示</a> ');
|
||||
return actions.join('');
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function (value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.picAdId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.picAdId + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue