提交 14f27fdd 编写于 作者: F fengyw

轮播功能

上级 5bd9670c
package com.roncoo.education.system.dao; package com.roncoo.education.system.dao;
import com.roncoo.education.common.core.base.Page; import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteAdv; import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarousel;
import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteAdvExample; import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarouselExample;
import java.util.List; import java.util.List;
...@@ -10,9 +10,9 @@ import java.util.List; ...@@ -10,9 +10,9 @@ import java.util.List;
* 广告信息 服务类 * 广告信息 服务类
* *
* @author wujing * @author wujing
* @date 2022-08-25 * @date 2022-09-16
*/ */
public interface WebsiteAdvDao { public interface WebsiteCarouselDao {
/** /**
* 保存广告信息 * 保存广告信息
...@@ -20,7 +20,7 @@ public interface WebsiteAdvDao { ...@@ -20,7 +20,7 @@ public interface WebsiteAdvDao {
* @param record 广告信息 * @param record 广告信息
* @return 影响记录数 * @return 影响记录数
*/ */
int save(WebsiteAdv record); int save(WebsiteCarousel record);
/** /**
* 根据ID删除广告信息 * 根据ID删除广告信息
...@@ -36,7 +36,7 @@ public interface WebsiteAdvDao { ...@@ -36,7 +36,7 @@ public interface WebsiteAdvDao {
* @param record 广告信息 * @param record 广告信息
* @return 影响记录数 * @return 影响记录数
*/ */
int updateById(WebsiteAdv record); int updateById(WebsiteCarousel record);
/** /**
* 根据ID获取广告信息 * 根据ID获取广告信息
...@@ -44,7 +44,7 @@ public interface WebsiteAdvDao { ...@@ -44,7 +44,7 @@ public interface WebsiteAdvDao {
* @param id 主键ID * @param id 主键ID
* @return 广告信息 * @return 广告信息
*/ */
WebsiteAdv getById(Long id); WebsiteCarousel getById(Long id);
/** /**
* 广告信息--分页查询 * 广告信息--分页查询
...@@ -54,21 +54,21 @@ public interface WebsiteAdvDao { ...@@ -54,21 +54,21 @@ public interface WebsiteAdvDao {
* @param example 查询条件 * @param example 查询条件
* @return 分页结果 * @return 分页结果
*/ */
Page<WebsiteAdv> page(int pageCurrent, int pageSize, WebsiteAdvExample example); Page<WebsiteCarousel> page(int pageCurrent, int pageSize, WebsiteCarouselExample example);
/** /**
* 广告信息--条件列出 * 广告信息--条件列出
* *
* @param example 查询条件 * @param example 查询条件
* @return 广告信息列表 * @return 广告信息列表
*/ */
List<WebsiteAdv> listByExample(WebsiteAdvExample example); List<WebsiteCarousel> listByExample(WebsiteCarouselExample example);
/** /**
* 广告信息--条件统计 * 广告信息--条件统计
* *
* @param example 统计条件 * @param example 统计条件
* @return 广告信息数量 * @return 广告信息数量
*/ */
int countByExample(WebsiteAdvExample example); int countByExample(WebsiteCarouselExample example);
} }
...@@ -3,10 +3,10 @@ package com.roncoo.education.system.dao.impl; ...@@ -3,10 +3,10 @@ package com.roncoo.education.system.dao.impl;
import com.roncoo.education.common.core.base.Page; import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.common.core.base.PageUtil; import com.roncoo.education.common.core.base.PageUtil;
import com.roncoo.education.common.core.tools.IdWorker; import com.roncoo.education.common.core.tools.IdWorker;
import com.roncoo.education.system.dao.WebsiteAdvDao; import com.roncoo.education.system.dao.WebsiteCarouselDao;
import com.roncoo.education.system.dao.impl.mapper.WebsiteAdvMapper; import com.roncoo.education.system.dao.impl.mapper.WebsiteCarouselMapper;
import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteAdv; import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarousel;
import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteAdvExample; import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarouselExample;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -17,17 +17,17 @@ import java.util.List; ...@@ -17,17 +17,17 @@ import java.util.List;
* 广告信息 服务实现类 * 广告信息 服务实现类
* *
* @author wujing * @author wujing
* @date 2022-08-25 * @date 2022-09-16
*/ */
@Repository @Repository
@RequiredArgsConstructor @RequiredArgsConstructor
public class WebsiteAdvDaoImpl implements WebsiteAdvDao { public class WebsiteCarouselDaoImpl implements WebsiteCarouselDao {
@NotNull @NotNull
private final WebsiteAdvMapper mapper; private final WebsiteCarouselMapper mapper;
@Override @Override
public int save(WebsiteAdv record) { public int save(WebsiteCarousel record) {
if (record.getId() == null) { if (record.getId() == null) {
record.setId(IdWorker.getId()); record.setId(IdWorker.getId());
} }
...@@ -40,19 +40,19 @@ public class WebsiteAdvDaoImpl implements WebsiteAdvDao { ...@@ -40,19 +40,19 @@ public class WebsiteAdvDaoImpl implements WebsiteAdvDao {
} }
@Override @Override
public int updateById(WebsiteAdv record) { public int updateById(WebsiteCarousel record) {
record.setGmtCreate(null); record.setGmtCreate(null);
record.setGmtModified(null); record.setGmtModified(null);
return this.mapper.updateByPrimaryKeySelective(record); return this.mapper.updateByPrimaryKeySelective(record);
} }
@Override @Override
public WebsiteAdv getById(Long id) { public WebsiteCarousel getById(Long id) {
return this.mapper.selectByPrimaryKey(id); return this.mapper.selectByPrimaryKey(id);
} }
@Override @Override
public Page<WebsiteAdv> page(int pageCurrent, int pageSize, WebsiteAdvExample example) { public Page<WebsiteCarousel> page(int pageCurrent, int pageSize, WebsiteCarouselExample example) {
int count = this.mapper.countByExample(example); int count = this.mapper.countByExample(example);
pageSize = PageUtil.checkPageSize(pageSize); pageSize = PageUtil.checkPageSize(pageSize);
pageCurrent = PageUtil.checkPageCurrent(count, pageSize, pageCurrent); pageCurrent = PageUtil.checkPageCurrent(count, pageSize, pageCurrent);
...@@ -63,12 +63,12 @@ public class WebsiteAdvDaoImpl implements WebsiteAdvDao { ...@@ -63,12 +63,12 @@ public class WebsiteAdvDaoImpl implements WebsiteAdvDao {
} }
@Override @Override
public List<WebsiteAdv> listByExample(WebsiteAdvExample example) { public List<WebsiteCarousel> listByExample(WebsiteCarouselExample example) {
return this.mapper.selectByExample(example); return this.mapper.selectByExample(example);
} }
@Override @Override
public int countByExample(WebsiteAdvExample example) { public int countByExample(WebsiteCarouselExample example){
return this.mapper.countByExample(example); return this.mapper.countByExample(example);
} }
} }
package com.roncoo.education.system.dao.impl.mapper; package com.roncoo.education.system.dao.impl.mapper;
import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteAdv; import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarousel;
import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteAdvExample; import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarouselExample;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
public interface WebsiteAdvMapper { public interface WebsiteCarouselMapper {
int countByExample(WebsiteAdvExample example); int countByExample(WebsiteCarouselExample example);
int deleteByExample(WebsiteAdvExample example); int deleteByExample(WebsiteCarouselExample example);
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
int insert(WebsiteAdv record); int insert(WebsiteCarousel record);
int insertSelective(WebsiteAdv record); int insertSelective(WebsiteCarousel record);
List<WebsiteAdv> selectByExample(WebsiteAdvExample example); List<WebsiteCarousel> selectByExample(WebsiteCarouselExample example);
WebsiteAdv selectByPrimaryKey(Long id); WebsiteCarousel selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") WebsiteAdv record, @Param("example") WebsiteAdvExample example); int updateByExampleSelective(@Param("record") WebsiteCarousel record, @Param("example") WebsiteCarouselExample example);
int updateByExample(@Param("record") WebsiteAdv record, @Param("example") WebsiteAdvExample example); int updateByExample(@Param("record") WebsiteCarousel record, @Param("example") WebsiteCarouselExample example);
int updateByPrimaryKeySelective(WebsiteAdv record); int updateByPrimaryKeySelective(WebsiteCarousel record);
int updateByPrimaryKey(WebsiteAdv record); int updateByPrimaryKey(WebsiteCarousel record);
} }
\ No newline at end of file
...@@ -3,7 +3,7 @@ package com.roncoo.education.system.dao.impl.mapper.entity; ...@@ -3,7 +3,7 @@ package com.roncoo.education.system.dao.impl.mapper.entity;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
public class WebsiteAdv implements Serializable { public class WebsiteCarousel implements Serializable {
private Long id; private Long id;
private Date gmtCreate; private Date gmtCreate;
...@@ -14,22 +14,18 @@ public class WebsiteAdv implements Serializable { ...@@ -14,22 +14,18 @@ public class WebsiteAdv implements Serializable {
private Integer sort; private Integer sort;
private String advTitle; private String carouselTitle;
private String advImg; private String carouselImg;
private String advUrl; private String carouselUrl;
private String advTarget; private String carouselTarget;
private Integer advLocation;
private Date beginTime; private Date beginTime;
private Date endTime; private Date endTime;
private Integer platShow;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getId() { public Long getId() {
...@@ -72,44 +68,36 @@ public class WebsiteAdv implements Serializable { ...@@ -72,44 +68,36 @@ public class WebsiteAdv implements Serializable {
this.sort = sort; this.sort = sort;
} }
public String getAdvTitle() { public String getCarouselTitle() {
return advTitle; return carouselTitle;
}
public void setAdvTitle(String advTitle) {
this.advTitle = advTitle == null ? null : advTitle.trim();
}
public String getAdvImg() {
return advImg;
} }
public void setAdvImg(String advImg) { public void setCarouselTitle(String carouselTitle) {
this.advImg = advImg == null ? null : advImg.trim(); this.carouselTitle = carouselTitle == null ? null : carouselTitle.trim();
} }
public String getAdvUrl() { public String getCarouselImg() {
return advUrl; return carouselImg;
} }
public void setAdvUrl(String advUrl) { public void setCarouselImg(String carouselImg) {
this.advUrl = advUrl == null ? null : advUrl.trim(); this.carouselImg = carouselImg == null ? null : carouselImg.trim();
} }
public String getAdvTarget() { public String getCarouselUrl() {
return advTarget; return carouselUrl;
} }
public void setAdvTarget(String advTarget) { public void setCarouselUrl(String carouselUrl) {
this.advTarget = advTarget == null ? null : advTarget.trim(); this.carouselUrl = carouselUrl == null ? null : carouselUrl.trim();
} }
public Integer getAdvLocation() { public String getCarouselTarget() {
return advLocation; return carouselTarget;
} }
public void setAdvLocation(Integer advLocation) { public void setCarouselTarget(String carouselTarget) {
this.advLocation = advLocation; this.carouselTarget = carouselTarget == null ? null : carouselTarget.trim();
} }
public Date getBeginTime() { public Date getBeginTime() {
...@@ -128,14 +116,6 @@ public class WebsiteAdv implements Serializable { ...@@ -128,14 +116,6 @@ public class WebsiteAdv implements Serializable {
this.endTime = endTime; this.endTime = endTime;
} }
public Integer getPlatShow() {
return platShow;
}
public void setPlatShow(Integer platShow) {
this.platShow = platShow;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
...@@ -147,14 +127,12 @@ public class WebsiteAdv implements Serializable { ...@@ -147,14 +127,12 @@ public class WebsiteAdv implements Serializable {
sb.append(", gmtModified=").append(gmtModified); sb.append(", gmtModified=").append(gmtModified);
sb.append(", statusId=").append(statusId); sb.append(", statusId=").append(statusId);
sb.append(", sort=").append(sort); sb.append(", sort=").append(sort);
sb.append(", advTitle=").append(advTitle); sb.append(", carouselTitle=").append(carouselTitle);
sb.append(", advImg=").append(advImg); sb.append(", carouselImg=").append(carouselImg);
sb.append(", advUrl=").append(advUrl); sb.append(", carouselUrl=").append(carouselUrl);
sb.append(", advTarget=").append(advTarget); sb.append(", carouselTarget=").append(carouselTarget);
sb.append(", advLocation=").append(advLocation);
sb.append(", beginTime=").append(beginTime); sb.append(", beginTime=").append(beginTime);
sb.append(", endTime=").append(endTime); sb.append(", endTime=").append(endTime);
sb.append(", platShow=").append(platShow);
sb.append(", serialVersionUID=").append(serialVersionUID); sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
......
...@@ -2,12 +2,12 @@ package com.roncoo.education.system.service.admin; ...@@ -2,12 +2,12 @@ package com.roncoo.education.system.service.admin;
import com.roncoo.education.common.core.base.Page; import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.common.core.base.Result; import com.roncoo.education.common.core.base.Result;
import com.roncoo.education.system.service.admin.biz.AdminWebsiteAdvBiz; import com.roncoo.education.system.service.admin.biz.AdminWebsiteCarouselBiz;
import com.roncoo.education.system.service.admin.req.AdminWebsiteAdvEditReq; import com.roncoo.education.system.service.admin.req.AdminWebsiteCarouselEditReq;
import com.roncoo.education.system.service.admin.req.AdminWebsiteAdvPageReq; import com.roncoo.education.system.service.admin.req.AdminWebsiteCarouselPageReq;
import com.roncoo.education.system.service.admin.req.AdminWebsiteAdvSaveReq; import com.roncoo.education.system.service.admin.req.AdminWebsiteCarouselSaveReq;
import com.roncoo.education.system.service.admin.resp.AdminWebsiteAdvPageResp; import com.roncoo.education.system.service.admin.resp.AdminWebsiteCarouselPageResp;
import com.roncoo.education.system.service.admin.resp.AdminWebsiteAdvViewResp; import com.roncoo.education.system.service.admin.resp.AdminWebsiteCarouselViewResp;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -25,34 +25,34 @@ import javax.validation.constraints.NotNull; ...@@ -25,34 +25,34 @@ import javax.validation.constraints.NotNull;
@Api(tags = "ADMIN-广告信息") @Api(tags = "ADMIN-广告信息")
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/system/admin/website/adv") @RequestMapping("/system/admin/website/carousel")
public class AdminWebsiteAdvController { public class AdminWebsiteCarouselController {
@NotNull @NotNull
private final AdminWebsiteAdvBiz biz; private final AdminWebsiteCarouselBiz biz;
@ApiOperation(value = "广告信息分页", notes = "广告信息分页") @ApiOperation(value = "广告信息分页", notes = "广告信息分页")
@PostMapping(value = "/page") @PostMapping(value = "/page")
public Result<Page<AdminWebsiteAdvPageResp>> page(@RequestBody AdminWebsiteAdvPageReq req) { public Result<Page<AdminWebsiteCarouselPageResp>> page(@RequestBody AdminWebsiteCarouselPageReq req) {
return biz.page(req); return biz.page(req);
} }
@ApiOperation(value = "广告信息添加", notes = "广告信息添加") @ApiOperation(value = "广告信息添加", notes = "广告信息添加")
@PostMapping(value = "/save") @PostMapping(value = "/save")
public Result<String> save(@RequestBody @Valid AdminWebsiteAdvSaveReq req) { public Result<String> save(@RequestBody @Valid AdminWebsiteCarouselSaveReq req) {
return biz.save(req); return biz.save(req);
} }
@ApiOperation(value = "广告信息查看", notes = "广告信息查看") @ApiOperation(value = "广告信息查看", notes = "广告信息查看")
@ApiImplicitParam(name = "id", value = "主键ID", dataTypeClass = Long.class, paramType = "query", required = true) @ApiImplicitParam(name = "id", value = "主键ID", dataTypeClass = Long.class, paramType = "query", required = true)
@GetMapping(value = "/view") @GetMapping(value = "/view")
public Result<AdminWebsiteAdvViewResp> view(@RequestParam Long id) { public Result<AdminWebsiteCarouselViewResp> view(@RequestParam Long id) {
return biz.view(id); return biz.view(id);
} }
@ApiOperation(value = "广告信息修改", notes = "广告信息修改") @ApiOperation(value = "广告信息修改", notes = "广告信息修改")
@PutMapping(value = "/edit") @PutMapping(value = "/edit")
public Result<String> edit(@RequestBody @Valid AdminWebsiteAdvEditReq req) { public Result<String> edit(@RequestBody @Valid AdminWebsiteCarouselEditReq req) {
return biz.edit(req); return biz.edit(req);
} }
......
package com.roncoo.education.system.service.admin.biz; package com.roncoo.education.system.service.admin.biz;
import com.roncoo.education.common.service.BaseBiz;
import com.roncoo.education.common.core.base.Page; import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.common.core.base.PageUtil; import com.roncoo.education.common.core.base.PageUtil;
import com.roncoo.education.common.core.base.Result; import com.roncoo.education.common.core.base.Result;
import com.roncoo.education.common.core.tools.BeanUtil; import com.roncoo.education.common.core.tools.BeanUtil;
import com.roncoo.education.common.service.BaseBiz; import com.roncoo.education.system.service.admin.req.AdminWebsiteCarouselEditReq;
import com.roncoo.education.system.dao.WebsiteAdvDao; import com.roncoo.education.system.service.admin.req.AdminWebsiteCarouselPageReq;
import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteAdv; import com.roncoo.education.system.service.admin.req.AdminWebsiteCarouselSaveReq;
import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteAdvExample; import com.roncoo.education.system.service.admin.resp.AdminWebsiteCarouselPageResp;
import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteAdvExample.Criteria; import com.roncoo.education.system.service.admin.resp.AdminWebsiteCarouselViewResp;
import com.roncoo.education.system.service.admin.req.AdminWebsiteAdvEditReq; import com.roncoo.education.system.dao.WebsiteCarouselDao;
import com.roncoo.education.system.service.admin.req.AdminWebsiteAdvPageReq; import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarousel;
import com.roncoo.education.system.service.admin.req.AdminWebsiteAdvSaveReq; import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarouselExample;
import com.roncoo.education.system.service.admin.resp.AdminWebsiteAdvPageResp; import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarouselExample.Criteria;
import com.roncoo.education.system.service.admin.resp.AdminWebsiteAdvViewResp;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -26,10 +26,10 @@ import javax.validation.constraints.NotNull; ...@@ -26,10 +26,10 @@ import javax.validation.constraints.NotNull;
*/ */
@Component @Component
@RequiredArgsConstructor @RequiredArgsConstructor
public class AdminWebsiteAdvBiz extends BaseBiz { public class AdminWebsiteCarouselBiz extends BaseBiz {
@NotNull @NotNull
private final WebsiteAdvDao dao; private final WebsiteCarouselDao dao;
/** /**
* 广告信息分页 * 广告信息分页
...@@ -37,12 +37,12 @@ public class AdminWebsiteAdvBiz extends BaseBiz { ...@@ -37,12 +37,12 @@ public class AdminWebsiteAdvBiz extends BaseBiz {
* @param req 广告信息分页查询参数 * @param req 广告信息分页查询参数
* @return 广告信息分页查询结果 * @return 广告信息分页查询结果
*/ */
public Result<Page<AdminWebsiteAdvPageResp>> page(AdminWebsiteAdvPageReq req) { public Result<Page<AdminWebsiteCarouselPageResp>> page(AdminWebsiteCarouselPageReq req) {
WebsiteAdvExample example = new WebsiteAdvExample(); WebsiteCarouselExample example = new WebsiteCarouselExample();
Criteria c = example.createCriteria(); Criteria c = example.createCriteria();
example.setOrderByClause("sort asc, id desc"); example.setOrderByClause("sort asc, id desc");
Page<WebsiteAdv> page = dao.page(req.getPageCurrent(), req.getPageSize(), example); Page<WebsiteCarousel> page = dao.page(req.getPageCurrent(), req.getPageSize(), example);
Page<AdminWebsiteAdvPageResp> respPage = PageUtil.transform(page, AdminWebsiteAdvPageResp.class); Page<AdminWebsiteCarouselPageResp> respPage = PageUtil.transform(page, AdminWebsiteCarouselPageResp.class);
return Result.success(respPage); return Result.success(respPage);
} }
...@@ -52,8 +52,8 @@ public class AdminWebsiteAdvBiz extends BaseBiz { ...@@ -52,8 +52,8 @@ public class AdminWebsiteAdvBiz extends BaseBiz {
* @param req 广告信息 * @param req 广告信息
* @return 添加结果 * @return 添加结果
*/ */
public Result<String> save(AdminWebsiteAdvSaveReq req) { public Result<String> save(AdminWebsiteCarouselSaveReq req) {
WebsiteAdv record = BeanUtil.copyProperties(req, WebsiteAdv.class); WebsiteCarousel record = BeanUtil.copyProperties(req, WebsiteCarousel.class);
if (dao.save(record) > 0) { if (dao.save(record) > 0) {
return Result.success("操作成功"); return Result.success("操作成功");
} }
...@@ -66,8 +66,8 @@ public class AdminWebsiteAdvBiz extends BaseBiz { ...@@ -66,8 +66,8 @@ public class AdminWebsiteAdvBiz extends BaseBiz {
* @param id 主键ID * @param id 主键ID
* @return 广告信息 * @return 广告信息
*/ */
public Result<AdminWebsiteAdvViewResp> view(Long id) { public Result<AdminWebsiteCarouselViewResp> view(Long id) {
return Result.success(BeanUtil.copyProperties(dao.getById(id), AdminWebsiteAdvViewResp.class)); return Result.success(BeanUtil.copyProperties(dao.getById(id), AdminWebsiteCarouselViewResp.class));
} }
/** /**
...@@ -76,8 +76,8 @@ public class AdminWebsiteAdvBiz extends BaseBiz { ...@@ -76,8 +76,8 @@ public class AdminWebsiteAdvBiz extends BaseBiz {
* @param req 广告信息修改对象 * @param req 广告信息修改对象
* @return 修改结果 * @return 修改结果
*/ */
public Result<String> edit(AdminWebsiteAdvEditReq req) { public Result<String> edit(AdminWebsiteCarouselEditReq req) {
WebsiteAdv record = BeanUtil.copyProperties(req, WebsiteAdv.class); WebsiteCarousel record = BeanUtil.copyProperties(req, WebsiteCarousel.class);
if (dao.updateById(record) > 0) { if (dao.updateById(record) > 0) {
return Result.success("操作成功"); return Result.success("操作成功");
} }
......
package com.roncoo.education.system.service.admin.req; package com.roncoo.education.system.service.admin.req;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* <p> * <p>
* ADMIN-广告信息 * ADMIN-广告信息
...@@ -18,8 +17,8 @@ import java.time.LocalDateTime; ...@@ -18,8 +17,8 @@ import java.time.LocalDateTime;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value = "AdminWebsiteAdvEditReq", description = "ADMIN-广告信息修改") @ApiModel(value = "AdminWebsiteCarouselEditReq", description = "ADMIN-广告信息修改")
public class AdminWebsiteAdvEditReq implements Serializable { public class AdminWebsiteCarouselEditReq implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -41,19 +40,16 @@ public class AdminWebsiteAdvEditReq implements Serializable { ...@@ -41,19 +40,16 @@ public class AdminWebsiteAdvEditReq implements Serializable {
private Integer sort; private Integer sort;
@ApiModelProperty(value = "广告标题") @ApiModelProperty(value = "广告标题")
private String advTitle; private String carouselTitle;
@ApiModelProperty(value = "广告图片") @ApiModelProperty(value = "广告图片")
private String advImg; private String carouselImg;
@ApiModelProperty(value = "广告链接") @ApiModelProperty(value = "广告链接")
private String advUrl; private String carouselUrl;
@ApiModelProperty(value = "广告跳转方式") @ApiModelProperty(value = "广告跳转方式")
private String advTarget; private String carouselTarget;
@ApiModelProperty(value = "广告位置(1首页轮播)")
private Integer advLocation;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "开始时间") @ApiModelProperty(value = "开始时间")
...@@ -62,7 +58,4 @@ public class AdminWebsiteAdvEditReq implements Serializable { ...@@ -62,7 +58,4 @@ public class AdminWebsiteAdvEditReq implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "结束时间") @ApiModelProperty(value = "结束时间")
private LocalDateTime endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "位置(0电脑端,1微信端)")
private Integer platShow;
} }
package com.roncoo.education.system.service.admin.req; package com.roncoo.education.system.service.admin.req;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* <p> * <p>
* ADMIN-广告信息 * ADMIN-广告信息
...@@ -18,8 +17,8 @@ import java.time.LocalDateTime; ...@@ -18,8 +17,8 @@ import java.time.LocalDateTime;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value = "AdminWebsiteAdvPageReq", description = "ADMIN-广告信息分页") @ApiModel(value = "AdminWebsiteCarouselPageReq", description = "ADMIN-广告信息分页")
public class AdminWebsiteAdvPageReq implements Serializable { public class AdminWebsiteCarouselPageReq implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -41,19 +40,16 @@ public class AdminWebsiteAdvPageReq implements Serializable { ...@@ -41,19 +40,16 @@ public class AdminWebsiteAdvPageReq implements Serializable {
private Integer sort; private Integer sort;
@ApiModelProperty(value = "广告标题") @ApiModelProperty(value = "广告标题")
private String advTitle; private String carouselTitle;
@ApiModelProperty(value = "广告图片") @ApiModelProperty(value = "广告图片")
private String advImg; private String carouselImg;
@ApiModelProperty(value = "广告链接") @ApiModelProperty(value = "广告链接")
private String advUrl; private String carouselUrl;
@ApiModelProperty(value = "广告跳转方式") @ApiModelProperty(value = "广告跳转方式")
private String advTarget; private String carouselTarget;
@ApiModelProperty(value = "广告位置(1首页轮播)")
private Integer advLocation;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "开始时间") @ApiModelProperty(value = "开始时间")
...@@ -63,9 +59,6 @@ public class AdminWebsiteAdvPageReq implements Serializable { ...@@ -63,9 +59,6 @@ public class AdminWebsiteAdvPageReq implements Serializable {
@ApiModelProperty(value = "结束时间") @ApiModelProperty(value = "结束时间")
private LocalDateTime endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "位置(0电脑端,1微信端)")
private Integer platShow;
@ApiModelProperty(value = "当前页") @ApiModelProperty(value = "当前页")
private int pageCurrent = 1; private int pageCurrent = 1;
......
package com.roncoo.education.system.service.admin.req; package com.roncoo.education.system.service.admin.req;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* <p> * <p>
* ADMIN-广告信息 * ADMIN-广告信息
...@@ -18,8 +17,8 @@ import java.time.LocalDateTime; ...@@ -18,8 +17,8 @@ import java.time.LocalDateTime;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value = "AdminWebsiteAdvSaveReq", description = "ADMIN-广告信息添加") @ApiModel(value = "AdminWebsiteCarouselSaveReq", description = "ADMIN-广告信息添加")
public class AdminWebsiteAdvSaveReq implements Serializable { public class AdminWebsiteCarouselSaveReq implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -41,19 +40,16 @@ public class AdminWebsiteAdvSaveReq implements Serializable { ...@@ -41,19 +40,16 @@ public class AdminWebsiteAdvSaveReq implements Serializable {
private Integer sort; private Integer sort;
@ApiModelProperty(value = "广告标题") @ApiModelProperty(value = "广告标题")
private String advTitle; private String carouselTitle;
@ApiModelProperty(value = "广告图片") @ApiModelProperty(value = "广告图片")
private String advImg; private String carouselImg;
@ApiModelProperty(value = "广告链接") @ApiModelProperty(value = "广告链接")
private String advUrl; private String carouselUrl;
@ApiModelProperty(value = "广告跳转方式") @ApiModelProperty(value = "广告跳转方式")
private String advTarget; private String carouselTarget;
@ApiModelProperty(value = "广告位置(1首页轮播)")
private Integer advLocation;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "开始时间") @ApiModelProperty(value = "开始时间")
...@@ -62,7 +58,4 @@ public class AdminWebsiteAdvSaveReq implements Serializable { ...@@ -62,7 +58,4 @@ public class AdminWebsiteAdvSaveReq implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "结束时间") @ApiModelProperty(value = "结束时间")
private LocalDateTime endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "位置(0电脑端,1微信端)")
private Integer platShow;
} }
package com.roncoo.education.system.service.admin.resp; package com.roncoo.education.system.service.admin.resp;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* <p> * <p>
* ADMIN-广告信息 * ADMIN-广告信息
...@@ -18,8 +17,8 @@ import java.time.LocalDateTime; ...@@ -18,8 +17,8 @@ import java.time.LocalDateTime;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value = "AdminWebsiteAdvViewResp", description = "ADMIN-广告信息查看") @ApiModel(value = "AdminWebsiteCarouselPageResp", description = "ADMIN-广告信息分页")
public class AdminWebsiteAdvViewResp implements Serializable { public class AdminWebsiteCarouselPageResp implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -41,19 +40,16 @@ public class AdminWebsiteAdvViewResp implements Serializable { ...@@ -41,19 +40,16 @@ public class AdminWebsiteAdvViewResp implements Serializable {
private Integer sort; private Integer sort;
@ApiModelProperty(value = "广告标题") @ApiModelProperty(value = "广告标题")
private String advTitle; private String carouselTitle;
@ApiModelProperty(value = "广告图片") @ApiModelProperty(value = "广告图片")
private String advImg; private String carouselImg;
@ApiModelProperty(value = "广告链接") @ApiModelProperty(value = "广告链接")
private String advUrl; private String carouselUrl;
@ApiModelProperty(value = "广告跳转方式") @ApiModelProperty(value = "广告跳转方式")
private String advTarget; private String carouselTarget;
@ApiModelProperty(value = "广告位置(1首页轮播)")
private Integer advLocation;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "开始时间") @ApiModelProperty(value = "开始时间")
...@@ -62,7 +58,4 @@ public class AdminWebsiteAdvViewResp implements Serializable { ...@@ -62,7 +58,4 @@ public class AdminWebsiteAdvViewResp implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "结束时间") @ApiModelProperty(value = "结束时间")
private LocalDateTime endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "位置(0电脑端,1微信端)")
private Integer platShow;
} }
package com.roncoo.education.system.service.admin.resp; package com.roncoo.education.system.service.admin.resp;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* <p> * <p>
* ADMIN-广告信息 * ADMIN-广告信息
...@@ -18,8 +17,8 @@ import java.time.LocalDateTime; ...@@ -18,8 +17,8 @@ import java.time.LocalDateTime;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value = "AdminWebsiteAdvPageResp", description = "ADMIN-广告信息分页") @ApiModel(value = "AdminWebsiteCarouselViewResp", description = "ADMIN-广告信息查看")
public class AdminWebsiteAdvPageResp implements Serializable { public class AdminWebsiteCarouselViewResp implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -41,19 +40,16 @@ public class AdminWebsiteAdvPageResp implements Serializable { ...@@ -41,19 +40,16 @@ public class AdminWebsiteAdvPageResp implements Serializable {
private Integer sort; private Integer sort;
@ApiModelProperty(value = "广告标题") @ApiModelProperty(value = "广告标题")
private String advTitle; private String carouselTitle;
@ApiModelProperty(value = "广告图片") @ApiModelProperty(value = "广告图片")
private String advImg; private String carouselImg;
@ApiModelProperty(value = "广告链接") @ApiModelProperty(value = "广告链接")
private String advUrl; private String carouselUrl;
@ApiModelProperty(value = "广告跳转方式") @ApiModelProperty(value = "广告跳转方式")
private String advTarget; private String carouselTarget;
@ApiModelProperty(value = "广告位置(1首页轮播)")
private Integer advLocation;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "开始时间") @ApiModelProperty(value = "开始时间")
...@@ -62,7 +58,4 @@ public class AdminWebsiteAdvPageResp implements Serializable { ...@@ -62,7 +58,4 @@ public class AdminWebsiteAdvPageResp implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "结束时间") @ApiModelProperty(value = "结束时间")
private LocalDateTime endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "位置(0电脑端,1微信端)")
private Integer platShow;
} }
package com.roncoo.education.system.service.api; package com.roncoo.education.system.service.api;
import com.roncoo.education.common.core.base.Result; import com.roncoo.education.common.core.base.Result;
import com.roncoo.education.system.service.api.biz.ApiWebsiteAdvBiz; import com.roncoo.education.system.service.api.biz.ApiWebsiteCarouselBiz;
import com.roncoo.education.system.service.api.resp.ApiWebsiteAdvResp; import com.roncoo.education.system.service.api.resp.ApiWebsiteAdvResp;
import com.roncoo.education.system.service.api.resp.ApiWebsiteCarouselResp;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -17,20 +18,21 @@ import java.util.List; ...@@ -17,20 +18,21 @@ import java.util.List;
* API-广告信息 * API-广告信息
* *
* @author wujing * @author wujing
* @date 2022-08-25 * @date 2022-09-16
*/ */
@Api(tags = "API-广告信息") @Api(tags = "API-广告信息")
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/system/api/website/adv") @RequestMapping("/system/api/website/carousel")
public class ApiWebsiteAdvController { public class ApiWebsiteCarouselController {
@NotNull @NotNull
private final ApiWebsiteAdvBiz biz; private final ApiWebsiteCarouselBiz biz;
@ApiOperation(value = "广告列表接口", notes = "首页轮播广告列出") @ApiOperation(value = "广告列表接口", notes = "首页轮播广告列出")
@RequestMapping(value = "/list", method = RequestMethod.GET) @RequestMapping(value = "/list", method = RequestMethod.GET)
public Result<List<ApiWebsiteAdvResp>> list() { public Result<List<ApiWebsiteCarouselResp>> list() {
return biz.list(); return biz.list();
} }
} }
...@@ -4,12 +4,11 @@ import com.roncoo.education.common.core.base.PageUtil; ...@@ -4,12 +4,11 @@ import com.roncoo.education.common.core.base.PageUtil;
import com.roncoo.education.common.core.base.Result; import com.roncoo.education.common.core.base.Result;
import com.roncoo.education.common.core.enums.StatusIdEnum; import com.roncoo.education.common.core.enums.StatusIdEnum;
import com.roncoo.education.common.service.BaseBiz; import com.roncoo.education.common.service.BaseBiz;
import com.roncoo.education.system.dao.WebsiteAdvDao; import com.roncoo.education.system.dao.WebsiteCarouselDao;
import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteAdv; import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarousel;
import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteAdvExample; import com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarouselExample;
import com.roncoo.education.system.service.api.resp.ApiWebsiteAdvResp; import com.roncoo.education.system.service.api.resp.ApiWebsiteCarouselResp;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -22,18 +21,18 @@ import java.util.List; ...@@ -22,18 +21,18 @@ import java.util.List;
* @author wujing * @author wujing
*/ */
@Component @Component
@CacheConfig(cacheNames = {"system"})
@RequiredArgsConstructor @RequiredArgsConstructor
public class ApiWebsiteAdvBiz extends BaseBiz { public class ApiWebsiteCarouselBiz extends BaseBiz {
@NotNull @NotNull
private final WebsiteAdvDao dao; private final WebsiteCarouselDao dao;
@Cacheable @Cacheable
public Result<List<ApiWebsiteAdvResp>> list() { public Result<List<ApiWebsiteCarouselResp>> list() {
WebsiteAdvExample example = new WebsiteAdvExample(); WebsiteCarouselExample example = new WebsiteCarouselExample();
example.createCriteria().andStatusIdEqualTo(StatusIdEnum.YES.getCode()); example.createCriteria().andStatusIdEqualTo(StatusIdEnum.YES.getCode());
List<WebsiteAdv> advList = dao.listByExample(example); example.setOrderByClause("sort asc, id desc");
return Result.success(PageUtil.copyList(advList, ApiWebsiteAdvResp.class)); List<WebsiteCarousel> CarouselList = dao.listByExample(example);
return Result.success(PageUtil.copyList(CarouselList, ApiWebsiteCarouselResp.class));
} }
} }
package com.roncoo.education.system.service.api.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* <p>
* API-广告信息
* </p>
*
* @author wujing
* @date 2022-09-16
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "ApiWebsiteCarouselReq", description = "API-广告信息")
public class ApiWebsiteCarouselReq implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private Long id;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private LocalDateTime gmtCreate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "修改时间")
private LocalDateTime gmtModified;
@ApiModelProperty(value = "状态(1:正常,0:禁用)")
private Integer statusId;
@ApiModelProperty(value = "排序")
private Integer sort;
@ApiModelProperty(value = "广告标题")
private String carouselTitle;
@ApiModelProperty(value = "广告图片")
private String carouselImg;
@ApiModelProperty(value = "广告链接")
private String carouselUrl;
@ApiModelProperty(value = "广告跳转方式")
private String carouselTarget;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "开始时间")
private LocalDateTime beginTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "结束时间")
private LocalDateTime endTime;
}
package com.roncoo.education.system.service.api.resp;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* <p>
* API-广告信息
* </p>
*
* @author wujing
* @date 2022-09-16
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "ApiWebsiteCarouselResp", description = "API-广告信息")
public class ApiWebsiteCarouselResp implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private Long id;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private LocalDateTime gmtCreate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "修改时间")
private LocalDateTime gmtModified;
@ApiModelProperty(value = "状态(1:正常,0:禁用)")
private Integer statusId;
@ApiModelProperty(value = "排序")
private Integer sort;
@ApiModelProperty(value = "广告标题")
private String carouselTitle;
@ApiModelProperty(value = "广告图片")
private String carouselImg;
@ApiModelProperty(value = "广告链接")
private String carouselUrl;
@ApiModelProperty(value = "广告跳转方式")
private String carouselTarget;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "开始时间")
private LocalDateTime beginTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "结束时间")
private LocalDateTime endTime;
}
<?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.roncoo.education.system.dao.impl.mapper.WebsiteCarouselMapper">
<resultMap id="BaseResultMap" type="com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarousel">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
<result column="status_id" jdbcType="TINYINT" property="statusId" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="carousel_title" jdbcType="VARCHAR" property="carouselTitle" />
<result column="carousel_img" jdbcType="VARCHAR" property="carouselImg" />
<result column="carousel_url" jdbcType="VARCHAR" property="carouselUrl" />
<result column="carousel_target" jdbcType="VARCHAR" property="carouselTarget" />
<result column="begin_time" jdbcType="TIMESTAMP" property="beginTime" />
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, gmt_create, gmt_modified, status_id, sort, carousel_title, carousel_img, carousel_url,
carousel_target, begin_time, end_time
</sql>
<select id="selectByExample" parameterType="com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarouselExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from website_carousel
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limitStart >= 0">
limit ${limitStart} , ${pageSize}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from website_carousel
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from website_carousel
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarouselExample">
delete from website_carousel
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarousel">
insert into website_carousel (id, gmt_create, gmt_modified,
status_id, sort, carousel_title,
carousel_img, carousel_url, carousel_target,
begin_time, end_time)
values (#{id,jdbcType=BIGINT}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP},
#{statusId,jdbcType=TINYINT}, #{sort,jdbcType=INTEGER}, #{carouselTitle,jdbcType=VARCHAR},
#{carouselImg,jdbcType=VARCHAR}, #{carouselUrl,jdbcType=VARCHAR}, #{carouselTarget,jdbcType=VARCHAR},
#{beginTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarousel">
insert into website_carousel
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="gmtCreate != null">
gmt_create,
</if>
<if test="gmtModified != null">
gmt_modified,
</if>
<if test="statusId != null">
status_id,
</if>
<if test="sort != null">
sort,
</if>
<if test="carouselTitle != null">
carousel_title,
</if>
<if test="carouselImg != null">
carousel_img,
</if>
<if test="carouselUrl != null">
carousel_url,
</if>
<if test="carouselTarget != null">
carousel_target,
</if>
<if test="beginTime != null">
begin_time,
</if>
<if test="endTime != null">
end_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="gmtCreate != null">
#{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null">
#{gmtModified,jdbcType=TIMESTAMP},
</if>
<if test="statusId != null">
#{statusId,jdbcType=TINYINT},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="carouselTitle != null">
#{carouselTitle,jdbcType=VARCHAR},
</if>
<if test="carouselImg != null">
#{carouselImg,jdbcType=VARCHAR},
</if>
<if test="carouselUrl != null">
#{carouselUrl,jdbcType=VARCHAR},
</if>
<if test="carouselTarget != null">
#{carouselTarget,jdbcType=VARCHAR},
</if>
<if test="beginTime != null">
#{beginTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
#{endTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarouselExample" resultType="java.lang.Integer">
select count(*) from website_carousel
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update website_carousel
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.gmtCreate != null">
gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="record.gmtModified != null">
gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP},
</if>
<if test="record.statusId != null">
status_id = #{record.statusId,jdbcType=TINYINT},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
<if test="record.carouselTitle != null">
carousel_title = #{record.carouselTitle,jdbcType=VARCHAR},
</if>
<if test="record.carouselImg != null">
carousel_img = #{record.carouselImg,jdbcType=VARCHAR},
</if>
<if test="record.carouselUrl != null">
carousel_url = #{record.carouselUrl,jdbcType=VARCHAR},
</if>
<if test="record.carouselTarget != null">
carousel_target = #{record.carouselTarget,jdbcType=VARCHAR},
</if>
<if test="record.beginTime != null">
begin_time = #{record.beginTime,jdbcType=TIMESTAMP},
</if>
<if test="record.endTime != null">
end_time = #{record.endTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update website_carousel
set id = #{record.id,jdbcType=BIGINT},
gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP},
status_id = #{record.statusId,jdbcType=TINYINT},
sort = #{record.sort,jdbcType=INTEGER},
carousel_title = #{record.carouselTitle,jdbcType=VARCHAR},
carousel_img = #{record.carouselImg,jdbcType=VARCHAR},
carousel_url = #{record.carouselUrl,jdbcType=VARCHAR},
carousel_target = #{record.carouselTarget,jdbcType=VARCHAR},
begin_time = #{record.beginTime,jdbcType=TIMESTAMP},
end_time = #{record.endTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarousel">
update website_carousel
<set>
<if test="gmtCreate != null">
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null">
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
</if>
<if test="statusId != null">
status_id = #{statusId,jdbcType=TINYINT},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="carouselTitle != null">
carousel_title = #{carouselTitle,jdbcType=VARCHAR},
</if>
<if test="carouselImg != null">
carousel_img = #{carouselImg,jdbcType=VARCHAR},
</if>
<if test="carouselUrl != null">
carousel_url = #{carouselUrl,jdbcType=VARCHAR},
</if>
<if test="carouselTarget != null">
carousel_target = #{carouselTarget,jdbcType=VARCHAR},
</if>
<if test="beginTime != null">
begin_time = #{beginTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.roncoo.education.system.dao.impl.mapper.entity.WebsiteCarousel">
update website_carousel
set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
status_id = #{statusId,jdbcType=TINYINT},
sort = #{sort,jdbcType=INTEGER},
carousel_title = #{carouselTitle,jdbcType=VARCHAR},
carousel_img = #{carouselImg,jdbcType=VARCHAR},
carousel_url = #{carouselUrl,jdbcType=VARCHAR},
carousel_target = #{carouselTarget,jdbcType=VARCHAR},
begin_time = #{beginTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册