7 changed files with 1020 additions and 10 deletions
-
18chenhai-admin/src/main/java/com/chenhai/ChenHaiApplication.java
-
98chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/CarouselAdsController.java
-
494chenhai-system/src/main/java/com/chenhai/muhu/domain/CarouselAds.java
-
62chenhai-system/src/main/java/com/chenhai/muhu/mapper/CarouselAdsMapper.java
-
62chenhai-system/src/main/java/com/chenhai/muhu/service/ICarouselAdsService.java
-
95chenhai-system/src/main/java/com/chenhai/muhu/service/impl/CarouselAdsServiceImpl.java
-
201chenhai-system/src/main/resources/mapper/muhu/CarouselAdsMapper.xml
@ -0,0 +1,98 @@ |
|||
package com.chenhai.web.controller.muhu; |
|||
|
|||
import com.chenhai.common.annotation.Log; |
|||
import com.chenhai.common.core.controller.BaseController; |
|||
import com.chenhai.common.core.domain.AjaxResult; |
|||
import com.chenhai.common.core.page.TableDataInfo; |
|||
import com.chenhai.common.enums.BusinessType; |
|||
import com.chenhai.common.utils.poi.ExcelUtil; |
|||
import com.chenhai.muhu.domain.CarouselAds; |
|||
import com.chenhai.muhu.service.ICarouselAdsService; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 轮播广告Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-12-26 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/system/ads") |
|||
public class CarouselAdsController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private ICarouselAdsService carouselAdsService; |
|||
|
|||
/** |
|||
* 查询轮播广告列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:ads:list')") |
|||
@GetMapping("/list") |
|||
public TableDataInfo list(CarouselAds carouselAds) |
|||
{ |
|||
startPage(); |
|||
List<CarouselAds> list = carouselAdsService.selectCarouselAdsList(carouselAds); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出轮播广告列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:ads:export')") |
|||
@Log(title = "轮播广告", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(HttpServletResponse response, CarouselAds carouselAds) |
|||
{ |
|||
List<CarouselAds> list = carouselAdsService.selectCarouselAdsList(carouselAds); |
|||
ExcelUtil<CarouselAds> util = new ExcelUtil<CarouselAds>(CarouselAds.class); |
|||
util.exportExcel(response, list, "轮播广告数据"); |
|||
} |
|||
|
|||
/** |
|||
* 获取轮播广告详细信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:ads:query')") |
|||
@GetMapping(value = "/{carouselId}") |
|||
public AjaxResult getInfo(@PathVariable("carouselId") Long carouselId) |
|||
{ |
|||
return success(carouselAdsService.selectCarouselAdsByCarouselId(carouselId)); |
|||
} |
|||
|
|||
/** |
|||
* 新增轮播广告 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:ads:add')") |
|||
@Log(title = "轮播广告", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody CarouselAds carouselAds) |
|||
{ |
|||
return toAjax(carouselAdsService.insertCarouselAds(carouselAds)); |
|||
} |
|||
|
|||
/** |
|||
* 修改轮播广告 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:ads:edit')") |
|||
@Log(title = "轮播广告", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody CarouselAds carouselAds) |
|||
{ |
|||
return toAjax(carouselAdsService.updateCarouselAds(carouselAds)); |
|||
} |
|||
|
|||
/** |
|||
* 删除轮播广告 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:ads:remove')") |
|||
@Log(title = "轮播广告", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{carouselIds}") |
|||
public AjaxResult remove(@PathVariable Long[] carouselIds) |
|||
{ |
|||
return toAjax(carouselAdsService.deleteCarouselAdsByCarouselIds(carouselIds)); |
|||
} |
|||
} |
|||
@ -0,0 +1,494 @@ |
|||
package com.chenhai.muhu.domain; |
|||
|
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.chenhai.common.annotation.Excel; |
|||
import com.chenhai.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 轮播广告对象 carousel_ads |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-12-26 |
|||
*/ |
|||
public class CarouselAds extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 轮播ID */ |
|||
private Long carouselId; |
|||
|
|||
/** 广告标题 */ |
|||
@Excel(name = "广告标题") |
|||
private String title; |
|||
|
|||
/** 广告副标题 */ |
|||
@Excel(name = "广告副标题") |
|||
private String subtitle; |
|||
|
|||
/** 图片URL */ |
|||
@Excel(name = "图片URL") |
|||
private String imageUrl; |
|||
|
|||
/** 图片替代文本 */ |
|||
@Excel(name = "图片替代文本") |
|||
private String altText; |
|||
|
|||
/** 图片尺寸 */ |
|||
@Excel(name = "图片尺寸") |
|||
private String imageSize; |
|||
|
|||
/** 背景色 */ |
|||
@Excel(name = "背景色") |
|||
private String bgColor; |
|||
|
|||
/** 文字颜色 */ |
|||
@Excel(name = "文字颜色") |
|||
private String textColor; |
|||
|
|||
/** 按钮文字 */ |
|||
@Excel(name = "按钮文字") |
|||
private String buttonText; |
|||
|
|||
/** 按钮CSS类 */ |
|||
@Excel(name = "按钮CSS类") |
|||
private String buttonClass; |
|||
|
|||
/** 链接类型 */ |
|||
@Excel(name = "链接类型") |
|||
private String linkType; |
|||
|
|||
/** 跳转链接 */ |
|||
@Excel(name = "跳转链接") |
|||
private String linkUrl; |
|||
|
|||
/** 链接参数 */ |
|||
@Excel(name = "链接参数") |
|||
private String linkParams; |
|||
|
|||
/** 排序权重(越大越靠前) */ |
|||
@Excel(name = "排序权重", readConverterExp = "越=大越靠前") |
|||
private Long sortOrder; |
|||
|
|||
/** 展示位置 */ |
|||
@Excel(name = "展示位置") |
|||
private String displayType; |
|||
|
|||
/** 是否启用 */ |
|||
@Excel(name = "是否启用") |
|||
private Integer isActive; |
|||
|
|||
/** 开始时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date startTime; |
|||
|
|||
/** 结束时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date endTime; |
|||
|
|||
/** 是否永久有效 */ |
|||
@Excel(name = "是否永久有效") |
|||
private Integer isAlwaysValid; |
|||
|
|||
/** 文字位置 */ |
|||
@Excel(name = "文字位置") |
|||
private String captionPosition; |
|||
|
|||
/** 标题样式配置 */ |
|||
@Excel(name = "标题样式配置") |
|||
private String captionStyle; |
|||
|
|||
/** 按钮样式配置 */ |
|||
@Excel(name = "按钮样式配置") |
|||
private String buttonStyle; |
|||
|
|||
/** 展示次数 */ |
|||
@Excel(name = "展示次数") |
|||
private Long displayCount; |
|||
|
|||
/** 点击次数 */ |
|||
@Excel(name = "点击次数") |
|||
private Long clickCount; |
|||
|
|||
/** 状态 */ |
|||
@Excel(name = "状态") |
|||
private String status; |
|||
|
|||
/** 审核备注 */ |
|||
@Excel(name = "审核备注") |
|||
private String reviewNotes; |
|||
|
|||
/** 审核人 */ |
|||
@Excel(name = "审核人") |
|||
private Long reviewedBy; |
|||
|
|||
/** 审核时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date reviewedAt; |
|||
|
|||
/** 创建人 */ |
|||
@Excel(name = "创建人") |
|||
private Long createdBy; |
|||
|
|||
/** 创建时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date createdAt; |
|||
|
|||
/** 更新时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date updatedAt; |
|||
|
|||
public void setCarouselId(Long carouselId) |
|||
{ |
|||
this.carouselId = carouselId; |
|||
} |
|||
|
|||
public Long getCarouselId() |
|||
{ |
|||
return carouselId; |
|||
} |
|||
|
|||
public void setTitle(String title) |
|||
{ |
|||
this.title = title; |
|||
} |
|||
|
|||
public String getTitle() |
|||
{ |
|||
return title; |
|||
} |
|||
|
|||
public void setSubtitle(String subtitle) |
|||
{ |
|||
this.subtitle = subtitle; |
|||
} |
|||
|
|||
public String getSubtitle() |
|||
{ |
|||
return subtitle; |
|||
} |
|||
|
|||
public void setImageUrl(String imageUrl) |
|||
{ |
|||
this.imageUrl = imageUrl; |
|||
} |
|||
|
|||
public String getImageUrl() |
|||
{ |
|||
return imageUrl; |
|||
} |
|||
|
|||
public void setAltText(String altText) |
|||
{ |
|||
this.altText = altText; |
|||
} |
|||
|
|||
public String getAltText() |
|||
{ |
|||
return altText; |
|||
} |
|||
|
|||
public void setImageSize(String imageSize) |
|||
{ |
|||
this.imageSize = imageSize; |
|||
} |
|||
|
|||
public String getImageSize() |
|||
{ |
|||
return imageSize; |
|||
} |
|||
|
|||
public void setBgColor(String bgColor) |
|||
{ |
|||
this.bgColor = bgColor; |
|||
} |
|||
|
|||
public String getBgColor() |
|||
{ |
|||
return bgColor; |
|||
} |
|||
|
|||
public void setTextColor(String textColor) |
|||
{ |
|||
this.textColor = textColor; |
|||
} |
|||
|
|||
public String getTextColor() |
|||
{ |
|||
return textColor; |
|||
} |
|||
|
|||
public void setButtonText(String buttonText) |
|||
{ |
|||
this.buttonText = buttonText; |
|||
} |
|||
|
|||
public String getButtonText() |
|||
{ |
|||
return buttonText; |
|||
} |
|||
|
|||
public void setButtonClass(String buttonClass) |
|||
{ |
|||
this.buttonClass = buttonClass; |
|||
} |
|||
|
|||
public String getButtonClass() |
|||
{ |
|||
return buttonClass; |
|||
} |
|||
|
|||
public void setLinkType(String linkType) |
|||
{ |
|||
this.linkType = linkType; |
|||
} |
|||
|
|||
public String getLinkType() |
|||
{ |
|||
return linkType; |
|||
} |
|||
|
|||
public void setLinkUrl(String linkUrl) |
|||
{ |
|||
this.linkUrl = linkUrl; |
|||
} |
|||
|
|||
public String getLinkUrl() |
|||
{ |
|||
return linkUrl; |
|||
} |
|||
|
|||
public void setLinkParams(String linkParams) |
|||
{ |
|||
this.linkParams = linkParams; |
|||
} |
|||
|
|||
public String getLinkParams() |
|||
{ |
|||
return linkParams; |
|||
} |
|||
|
|||
public void setSortOrder(Long sortOrder) |
|||
{ |
|||
this.sortOrder = sortOrder; |
|||
} |
|||
|
|||
public Long getSortOrder() |
|||
{ |
|||
return sortOrder; |
|||
} |
|||
|
|||
public void setDisplayType(String displayType) |
|||
{ |
|||
this.displayType = displayType; |
|||
} |
|||
|
|||
public String getDisplayType() |
|||
{ |
|||
return displayType; |
|||
} |
|||
|
|||
public void setIsActive(Integer isActive) |
|||
{ |
|||
this.isActive = isActive; |
|||
} |
|||
|
|||
public Integer getIsActive() |
|||
{ |
|||
return isActive; |
|||
} |
|||
|
|||
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 setIsAlwaysValid(Integer isAlwaysValid) |
|||
{ |
|||
this.isAlwaysValid = isAlwaysValid; |
|||
} |
|||
|
|||
public Integer getIsAlwaysValid() |
|||
{ |
|||
return isAlwaysValid; |
|||
} |
|||
|
|||
public void setCaptionPosition(String captionPosition) |
|||
{ |
|||
this.captionPosition = captionPosition; |
|||
} |
|||
|
|||
public String getCaptionPosition() |
|||
{ |
|||
return captionPosition; |
|||
} |
|||
|
|||
public void setCaptionStyle(String captionStyle) |
|||
{ |
|||
this.captionStyle = captionStyle; |
|||
} |
|||
|
|||
public String getCaptionStyle() |
|||
{ |
|||
return captionStyle; |
|||
} |
|||
|
|||
public void setButtonStyle(String buttonStyle) |
|||
{ |
|||
this.buttonStyle = buttonStyle; |
|||
} |
|||
|
|||
public String getButtonStyle() |
|||
{ |
|||
return buttonStyle; |
|||
} |
|||
|
|||
public void setDisplayCount(Long displayCount) |
|||
{ |
|||
this.displayCount = displayCount; |
|||
} |
|||
|
|||
public Long getDisplayCount() |
|||
{ |
|||
return displayCount; |
|||
} |
|||
|
|||
public void setClickCount(Long clickCount) |
|||
{ |
|||
this.clickCount = clickCount; |
|||
} |
|||
|
|||
public Long getClickCount() |
|||
{ |
|||
return clickCount; |
|||
} |
|||
|
|||
public void setStatus(String status) |
|||
{ |
|||
this.status = status; |
|||
} |
|||
|
|||
public String getStatus() |
|||
{ |
|||
return status; |
|||
} |
|||
|
|||
public void setReviewNotes(String reviewNotes) |
|||
{ |
|||
this.reviewNotes = reviewNotes; |
|||
} |
|||
|
|||
public String getReviewNotes() |
|||
{ |
|||
return reviewNotes; |
|||
} |
|||
|
|||
public void setReviewedBy(Long reviewedBy) |
|||
{ |
|||
this.reviewedBy = reviewedBy; |
|||
} |
|||
|
|||
public Long getReviewedBy() |
|||
{ |
|||
return reviewedBy; |
|||
} |
|||
|
|||
public void setReviewedAt(Date reviewedAt) |
|||
{ |
|||
this.reviewedAt = reviewedAt; |
|||
} |
|||
|
|||
public Date getReviewedAt() |
|||
{ |
|||
return reviewedAt; |
|||
} |
|||
|
|||
public void setCreatedBy(Long createdBy) |
|||
{ |
|||
this.createdBy = createdBy; |
|||
} |
|||
|
|||
public Long getCreatedBy() |
|||
{ |
|||
return createdBy; |
|||
} |
|||
|
|||
public void setCreatedAt(Date createdAt) |
|||
{ |
|||
this.createdAt = createdAt; |
|||
} |
|||
|
|||
public Date getCreatedAt() |
|||
{ |
|||
return createdAt; |
|||
} |
|||
|
|||
public void setUpdatedAt(Date updatedAt) |
|||
{ |
|||
this.updatedAt = updatedAt; |
|||
} |
|||
|
|||
public Date getUpdatedAt() |
|||
{ |
|||
return updatedAt; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("carouselId", getCarouselId()) |
|||
.append("title", getTitle()) |
|||
.append("subtitle", getSubtitle()) |
|||
.append("imageUrl", getImageUrl()) |
|||
.append("altText", getAltText()) |
|||
.append("imageSize", getImageSize()) |
|||
.append("bgColor", getBgColor()) |
|||
.append("textColor", getTextColor()) |
|||
.append("buttonText", getButtonText()) |
|||
.append("buttonClass", getButtonClass()) |
|||
.append("linkType", getLinkType()) |
|||
.append("linkUrl", getLinkUrl()) |
|||
.append("linkParams", getLinkParams()) |
|||
.append("sortOrder", getSortOrder()) |
|||
.append("displayType", getDisplayType()) |
|||
.append("isActive", getIsActive()) |
|||
.append("startTime", getStartTime()) |
|||
.append("endTime", getEndTime()) |
|||
.append("isAlwaysValid", getIsAlwaysValid()) |
|||
.append("captionPosition", getCaptionPosition()) |
|||
.append("captionStyle", getCaptionStyle()) |
|||
.append("buttonStyle", getButtonStyle()) |
|||
.append("displayCount", getDisplayCount()) |
|||
.append("clickCount", getClickCount()) |
|||
.append("status", getStatus()) |
|||
.append("reviewNotes", getReviewNotes()) |
|||
.append("reviewedBy", getReviewedBy()) |
|||
.append("reviewedAt", getReviewedAt()) |
|||
.append("createdBy", getCreatedBy()) |
|||
.append("createdAt", getCreatedAt()) |
|||
.append("updatedAt", getUpdatedAt()) |
|||
.toString(); |
|||
} |
|||
} |
|||
@ -0,0 +1,62 @@ |
|||
package com.chenhai.muhu.mapper; |
|||
|
|||
import com.chenhai.muhu.domain.CarouselAds; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 轮播广告Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-12-26 |
|||
*/ |
|||
public interface CarouselAdsMapper |
|||
{ |
|||
/** |
|||
* 查询轮播广告 |
|||
* |
|||
* @param carouselId 轮播广告主键 |
|||
* @return 轮播广告 |
|||
*/ |
|||
public CarouselAds selectCarouselAdsByCarouselId(Long carouselId); |
|||
|
|||
/** |
|||
* 查询轮播广告列表 |
|||
* |
|||
* @param carouselAds 轮播广告 |
|||
* @return 轮播广告集合 |
|||
*/ |
|||
public List<CarouselAds> selectCarouselAdsList(CarouselAds carouselAds); |
|||
|
|||
/** |
|||
* 新增轮播广告 |
|||
* |
|||
* @param carouselAds 轮播广告 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertCarouselAds(CarouselAds carouselAds); |
|||
|
|||
/** |
|||
* 修改轮播广告 |
|||
* |
|||
* @param carouselAds 轮播广告 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateCarouselAds(CarouselAds carouselAds); |
|||
|
|||
/** |
|||
* 删除轮播广告 |
|||
* |
|||
* @param carouselId 轮播广告主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteCarouselAdsByCarouselId(Long carouselId); |
|||
|
|||
/** |
|||
* 批量删除轮播广告 |
|||
* |
|||
* @param carouselIds 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteCarouselAdsByCarouselIds(Long[] carouselIds); |
|||
} |
|||
@ -0,0 +1,62 @@ |
|||
package com.chenhai.muhu.service; |
|||
|
|||
import com.chenhai.muhu.domain.CarouselAds; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 轮播广告Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-12-26 |
|||
*/ |
|||
public interface ICarouselAdsService |
|||
{ |
|||
/** |
|||
* 查询轮播广告 |
|||
* |
|||
* @param carouselId 轮播广告主键 |
|||
* @return 轮播广告 |
|||
*/ |
|||
public CarouselAds selectCarouselAdsByCarouselId(Long carouselId); |
|||
|
|||
/** |
|||
* 查询轮播广告列表 |
|||
* |
|||
* @param carouselAds 轮播广告 |
|||
* @return 轮播广告集合 |
|||
*/ |
|||
public List<CarouselAds> selectCarouselAdsList(CarouselAds carouselAds); |
|||
|
|||
/** |
|||
* 新增轮播广告 |
|||
* |
|||
* @param carouselAds 轮播广告 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertCarouselAds(CarouselAds carouselAds); |
|||
|
|||
/** |
|||
* 修改轮播广告 |
|||
* |
|||
* @param carouselAds 轮播广告 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateCarouselAds(CarouselAds carouselAds); |
|||
|
|||
/** |
|||
* 批量删除轮播广告 |
|||
* |
|||
* @param carouselIds 需要删除的轮播广告主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteCarouselAdsByCarouselIds(Long[] carouselIds); |
|||
|
|||
/** |
|||
* 删除轮播广告信息 |
|||
* |
|||
* @param carouselId 轮播广告主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteCarouselAdsByCarouselId(Long carouselId); |
|||
} |
|||
@ -0,0 +1,95 @@ |
|||
package com.chenhai.muhu.service.impl; |
|||
|
|||
|
|||
import com.chenhai.muhu.domain.CarouselAds; |
|||
import com.chenhai.muhu.mapper.CarouselAdsMapper; |
|||
import com.chenhai.muhu.service.ICarouselAdsService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 轮播广告Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-12-26 |
|||
*/ |
|||
@Service |
|||
public class CarouselAdsServiceImpl implements ICarouselAdsService |
|||
{ |
|||
@Autowired |
|||
private CarouselAdsMapper carouselAdsMapper; |
|||
|
|||
/** |
|||
* 查询轮播广告 |
|||
* |
|||
* @param carouselId 轮播广告主键 |
|||
* @return 轮播广告 |
|||
*/ |
|||
@Override |
|||
public CarouselAds selectCarouselAdsByCarouselId(Long carouselId) |
|||
{ |
|||
return carouselAdsMapper.selectCarouselAdsByCarouselId(carouselId); |
|||
} |
|||
|
|||
/** |
|||
* 查询轮播广告列表 |
|||
* |
|||
* @param carouselAds 轮播广告 |
|||
* @return 轮播广告 |
|||
*/ |
|||
@Override |
|||
public List<CarouselAds> selectCarouselAdsList(CarouselAds carouselAds) |
|||
{ |
|||
return carouselAdsMapper.selectCarouselAdsList(carouselAds); |
|||
} |
|||
|
|||
/** |
|||
* 新增轮播广告 |
|||
* |
|||
* @param carouselAds 轮播广告 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertCarouselAds(CarouselAds carouselAds) |
|||
{ |
|||
return carouselAdsMapper.insertCarouselAds(carouselAds); |
|||
} |
|||
|
|||
/** |
|||
* 修改轮播广告 |
|||
* |
|||
* @param carouselAds 轮播广告 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateCarouselAds(CarouselAds carouselAds) |
|||
{ |
|||
return carouselAdsMapper.updateCarouselAds(carouselAds); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除轮播广告 |
|||
* |
|||
* @param carouselIds 需要删除的轮播广告主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteCarouselAdsByCarouselIds(Long[] carouselIds) |
|||
{ |
|||
return carouselAdsMapper.deleteCarouselAdsByCarouselIds(carouselIds); |
|||
} |
|||
|
|||
/** |
|||
* 删除轮播广告信息 |
|||
* |
|||
* @param carouselId 轮播广告主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteCarouselAdsByCarouselId(Long carouselId) |
|||
{ |
|||
return carouselAdsMapper.deleteCarouselAdsByCarouselId(carouselId); |
|||
} |
|||
} |
|||
@ -0,0 +1,201 @@ |
|||
<?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.chenhai.muhu.mapper.CarouselAdsMapper"> |
|||
|
|||
<resultMap type="CarouselAds" id="CarouselAdsResult"> |
|||
<result property="carouselId" column="carousel_id" /> |
|||
<result property="title" column="title" /> |
|||
<result property="subtitle" column="subtitle" /> |
|||
<result property="imageUrl" column="image_url" /> |
|||
<result property="altText" column="alt_text" /> |
|||
<result property="imageSize" column="image_size" /> |
|||
<result property="bgColor" column="bg_color" /> |
|||
<result property="textColor" column="text_color" /> |
|||
<result property="buttonText" column="button_text" /> |
|||
<result property="buttonClass" column="button_class" /> |
|||
<result property="linkType" column="link_type" /> |
|||
<result property="linkUrl" column="link_url" /> |
|||
<result property="linkParams" column="link_params" /> |
|||
<result property="sortOrder" column="sort_order" /> |
|||
<result property="displayType" column="display_type" /> |
|||
<result property="isActive" column="is_active" /> |
|||
<result property="startTime" column="start_time" /> |
|||
<result property="endTime" column="end_time" /> |
|||
<result property="isAlwaysValid" column="is_always_valid" /> |
|||
<result property="captionPosition" column="caption_position" /> |
|||
<result property="captionStyle" column="caption_style" /> |
|||
<result property="buttonStyle" column="button_style" /> |
|||
<result property="displayCount" column="display_count" /> |
|||
<result property="clickCount" column="click_count" /> |
|||
<result property="status" column="status" /> |
|||
<result property="reviewNotes" column="review_notes" /> |
|||
<result property="reviewedBy" column="reviewed_by" /> |
|||
<result property="reviewedAt" column="reviewed_at" /> |
|||
<result property="createdBy" column="created_by" /> |
|||
<result property="createdAt" column="created_at" /> |
|||
<result property="updatedAt" column="updated_at" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectCarouselAdsVo"> |
|||
select carousel_id, title, subtitle, image_url, alt_text, image_size, bg_color, text_color, button_text, button_class, link_type, link_url, link_params, sort_order, display_type, is_active, start_time, end_time, is_always_valid, caption_position, caption_style, button_style, display_count, click_count, status, review_notes, reviewed_by, reviewed_at, created_by, created_at, updated_at from carousel_ads |
|||
</sql> |
|||
|
|||
<select id="selectCarouselAdsList" parameterType="CarouselAds" resultMap="CarouselAdsResult"> |
|||
<include refid="selectCarouselAdsVo"/> |
|||
<where> |
|||
<if test="title != null and title != ''"> and title = #{title}</if> |
|||
<if test="subtitle != null and subtitle != ''"> and subtitle = #{subtitle}</if> |
|||
<if test="imageUrl != null and imageUrl != ''"> and image_url = #{imageUrl}</if> |
|||
<if test="altText != null and altText != ''"> and alt_text = #{altText}</if> |
|||
<if test="imageSize != null and imageSize != ''"> and image_size = #{imageSize}</if> |
|||
<if test="bgColor != null and bgColor != ''"> and bg_color = #{bgColor}</if> |
|||
<if test="textColor != null and textColor != ''"> and text_color = #{textColor}</if> |
|||
<if test="buttonText != null and buttonText != ''"> and button_text = #{buttonText}</if> |
|||
<if test="buttonClass != null and buttonClass != ''"> and button_class = #{buttonClass}</if> |
|||
<if test="linkType != null and linkType != ''"> and link_type = #{linkType}</if> |
|||
<if test="linkUrl != null and linkUrl != ''"> and link_url = #{linkUrl}</if> |
|||
<if test="linkParams != null and linkParams != ''"> and link_params = #{linkParams}</if> |
|||
<if test="sortOrder != null "> and sort_order = #{sortOrder}</if> |
|||
<if test="displayType != null and displayType != ''"> and display_type = #{displayType}</if> |
|||
<if test="isActive != null "> and is_active = #{isActive}</if> |
|||
<if test="startTime != null "> and start_time = #{startTime}</if> |
|||
<if test="endTime != null "> and end_time = #{endTime}</if> |
|||
<if test="isAlwaysValid != null "> and is_always_valid = #{isAlwaysValid}</if> |
|||
<if test="captionPosition != null and captionPosition != ''"> and caption_position = #{captionPosition}</if> |
|||
<if test="captionStyle != null and captionStyle != ''"> and caption_style = #{captionStyle}</if> |
|||
<if test="buttonStyle != null and buttonStyle != ''"> and button_style = #{buttonStyle}</if> |
|||
<if test="displayCount != null "> and display_count = #{displayCount}</if> |
|||
<if test="clickCount != null "> and click_count = #{clickCount}</if> |
|||
<if test="status != null and status != ''"> and status = #{status}</if> |
|||
<if test="reviewNotes != null and reviewNotes != ''"> and review_notes = #{reviewNotes}</if> |
|||
<if test="reviewedBy != null "> and reviewed_by = #{reviewedBy}</if> |
|||
<if test="reviewedAt != null "> and reviewed_at = #{reviewedAt}</if> |
|||
<if test="createdBy != null "> and created_by = #{createdBy}</if> |
|||
<if test="createdAt != null "> and created_at = #{createdAt}</if> |
|||
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectCarouselAdsByCarouselId" parameterType="Long" resultMap="CarouselAdsResult"> |
|||
<include refid="selectCarouselAdsVo"/> |
|||
where carousel_id = #{carouselId} |
|||
</select> |
|||
|
|||
<insert id="insertCarouselAds" parameterType="CarouselAds" useGeneratedKeys="true" keyProperty="carouselId"> |
|||
insert into carousel_ads |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="title != null and title != ''">title,</if> |
|||
<if test="subtitle != null">subtitle,</if> |
|||
<if test="imageUrl != null and imageUrl != ''">image_url,</if> |
|||
<if test="altText != null">alt_text,</if> |
|||
<if test="imageSize != null">image_size,</if> |
|||
<if test="bgColor != null">bg_color,</if> |
|||
<if test="textColor != null">text_color,</if> |
|||
<if test="buttonText != null">button_text,</if> |
|||
<if test="buttonClass != null">button_class,</if> |
|||
<if test="linkType != null">link_type,</if> |
|||
<if test="linkUrl != null">link_url,</if> |
|||
<if test="linkParams != null">link_params,</if> |
|||
<if test="sortOrder != null">sort_order,</if> |
|||
<if test="displayType != null">display_type,</if> |
|||
<if test="isActive != null">is_active,</if> |
|||
<if test="startTime != null">start_time,</if> |
|||
<if test="endTime != null">end_time,</if> |
|||
<if test="isAlwaysValid != null">is_always_valid,</if> |
|||
<if test="captionPosition != null">caption_position,</if> |
|||
<if test="captionStyle != null">caption_style,</if> |
|||
<if test="buttonStyle != null">button_style,</if> |
|||
<if test="displayCount != null">display_count,</if> |
|||
<if test="clickCount != null">click_count,</if> |
|||
<if test="status != null">status,</if> |
|||
<if test="reviewNotes != null">review_notes,</if> |
|||
<if test="reviewedBy != null">reviewed_by,</if> |
|||
<if test="reviewedAt != null">reviewed_at,</if> |
|||
<if test="createdBy != null">created_by,</if> |
|||
<if test="createdAt != null">created_at,</if> |
|||
<if test="updatedAt != null">updated_at,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="title != null and title != ''">#{title},</if> |
|||
<if test="subtitle != null">#{subtitle},</if> |
|||
<if test="imageUrl != null and imageUrl != ''">#{imageUrl},</if> |
|||
<if test="altText != null">#{altText},</if> |
|||
<if test="imageSize != null">#{imageSize},</if> |
|||
<if test="bgColor != null">#{bgColor},</if> |
|||
<if test="textColor != null">#{textColor},</if> |
|||
<if test="buttonText != null">#{buttonText},</if> |
|||
<if test="buttonClass != null">#{buttonClass},</if> |
|||
<if test="linkType != null">#{linkType},</if> |
|||
<if test="linkUrl != null">#{linkUrl},</if> |
|||
<if test="linkParams != null">#{linkParams},</if> |
|||
<if test="sortOrder != null">#{sortOrder},</if> |
|||
<if test="displayType != null">#{displayType},</if> |
|||
<if test="isActive != null">#{isActive},</if> |
|||
<if test="startTime != null">#{startTime},</if> |
|||
<if test="endTime != null">#{endTime},</if> |
|||
<if test="isAlwaysValid != null">#{isAlwaysValid},</if> |
|||
<if test="captionPosition != null">#{captionPosition},</if> |
|||
<if test="captionStyle != null">#{captionStyle},</if> |
|||
<if test="buttonStyle != null">#{buttonStyle},</if> |
|||
<if test="displayCount != null">#{displayCount},</if> |
|||
<if test="clickCount != null">#{clickCount},</if> |
|||
<if test="status != null">#{status},</if> |
|||
<if test="reviewNotes != null">#{reviewNotes},</if> |
|||
<if test="reviewedBy != null">#{reviewedBy},</if> |
|||
<if test="reviewedAt != null">#{reviewedAt},</if> |
|||
<if test="createdBy != null">#{createdBy},</if> |
|||
<if test="createdAt != null">#{createdAt},</if> |
|||
<if test="updatedAt != null">#{updatedAt},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateCarouselAds" parameterType="CarouselAds"> |
|||
update carousel_ads |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="title != null and title != ''">title = #{title},</if> |
|||
<if test="subtitle != null">subtitle = #{subtitle},</if> |
|||
<if test="imageUrl != null and imageUrl != ''">image_url = #{imageUrl},</if> |
|||
<if test="altText != null">alt_text = #{altText},</if> |
|||
<if test="imageSize != null">image_size = #{imageSize},</if> |
|||
<if test="bgColor != null">bg_color = #{bgColor},</if> |
|||
<if test="textColor != null">text_color = #{textColor},</if> |
|||
<if test="buttonText != null">button_text = #{buttonText},</if> |
|||
<if test="buttonClass != null">button_class = #{buttonClass},</if> |
|||
<if test="linkType != null">link_type = #{linkType},</if> |
|||
<if test="linkUrl != null">link_url = #{linkUrl},</if> |
|||
<if test="linkParams != null">link_params = #{linkParams},</if> |
|||
<if test="sortOrder != null">sort_order = #{sortOrder},</if> |
|||
<if test="displayType != null">display_type = #{displayType},</if> |
|||
<if test="isActive != null">is_active = #{isActive},</if> |
|||
<if test="startTime != null">start_time = #{startTime},</if> |
|||
<if test="endTime != null">end_time = #{endTime},</if> |
|||
<if test="isAlwaysValid != null">is_always_valid = #{isAlwaysValid},</if> |
|||
<if test="captionPosition != null">caption_position = #{captionPosition},</if> |
|||
<if test="captionStyle != null">caption_style = #{captionStyle},</if> |
|||
<if test="buttonStyle != null">button_style = #{buttonStyle},</if> |
|||
<if test="displayCount != null">display_count = #{displayCount},</if> |
|||
<if test="clickCount != null">click_count = #{clickCount},</if> |
|||
<if test="status != null">status = #{status},</if> |
|||
<if test="reviewNotes != null">review_notes = #{reviewNotes},</if> |
|||
<if test="reviewedBy != null">reviewed_by = #{reviewedBy},</if> |
|||
<if test="reviewedAt != null">reviewed_at = #{reviewedAt},</if> |
|||
<if test="createdBy != null">created_by = #{createdBy},</if> |
|||
<if test="createdAt != null">created_at = #{createdAt},</if> |
|||
<if test="updatedAt != null">updated_at = #{updatedAt},</if> |
|||
</trim> |
|||
where carousel_id = #{carouselId} |
|||
</update> |
|||
|
|||
<delete id="deleteCarouselAdsByCarouselId" parameterType="Long"> |
|||
delete from carousel_ads where carousel_id = #{carouselId} |
|||
</delete> |
|||
|
|||
<delete id="deleteCarouselAdsByCarouselIds" parameterType="String"> |
|||
delete from carousel_ads where carousel_id in |
|||
<foreach item="carouselId" collection="array" open="(" separator="," close=")"> |
|||
#{carouselId} |
|||
</foreach> |
|||
</delete> |
|||
</mapper> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue