feat(内容模版中情报板信息类型连表查询):
This commit is contained in:
parent
f6fca9e2f6
commit
fb9a66a663
|
@ -1,6 +1,7 @@
|
||||||
package com.ruoyi.web.controller.board;
|
package com.ruoyi.web.controller.board;
|
||||||
|
|
||||||
import com.ruoyi.board.domain.PresetContent;
|
import com.ruoyi.board.domain.PresetContent;
|
||||||
|
import com.ruoyi.board.domain.dto.PresetContentDTO;
|
||||||
import com.ruoyi.board.service.IPresetContentService;
|
import com.ruoyi.board.service.IPresetContentService;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
@ -37,7 +38,7 @@ public class PresetContentController extends BaseController
|
||||||
public TableDataInfo list(PresetContent presetContent)
|
public TableDataInfo list(PresetContent presetContent)
|
||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
List<PresetContent> list = presetContentService.listPage(presetContent);
|
List<PresetContentDTO> list = presetContentService.listDTO(presetContent);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,130 @@
|
||||||
|
package com.ruoyi.board.domain.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PresetContentDTO {
|
||||||
|
/**
|
||||||
|
* 主键自增
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预置信息名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "`name`")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 情报板尺寸
|
||||||
|
*/
|
||||||
|
@TableField(value = "board_size")
|
||||||
|
private String boardSize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 信息类型
|
||||||
|
*/
|
||||||
|
@TableField(value = "info_type")
|
||||||
|
private Integer infoType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型名称
|
||||||
|
*/
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预置内容
|
||||||
|
*/
|
||||||
|
@TableField(value = "content")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预览路径
|
||||||
|
*/
|
||||||
|
@TableField(value = "preview_path")
|
||||||
|
private String previewPath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字体样式
|
||||||
|
*/
|
||||||
|
@TableField(value = "font_style")
|
||||||
|
private String fontStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字体大小
|
||||||
|
*/
|
||||||
|
@TableField(value = "font_size")
|
||||||
|
private Integer fontSize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字体间距
|
||||||
|
*/
|
||||||
|
@TableField(value = "letter_spacing")
|
||||||
|
private Integer letterSpacing;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字体颜色
|
||||||
|
*/
|
||||||
|
@TableField(value = "font_color")
|
||||||
|
private String fontColor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字体坐标X
|
||||||
|
*/
|
||||||
|
@TableField(value = "font_position_x")
|
||||||
|
private Integer fontPositionX;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字体坐标Y
|
||||||
|
*/
|
||||||
|
@TableField(value = "font_position_y")
|
||||||
|
private Integer fontPositionY;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 播放时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "play_time")
|
||||||
|
private Integer playTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前预置类型 1:内置模版 0:预发布信息
|
||||||
|
*/
|
||||||
|
@TableField(value = "preset_type")
|
||||||
|
private Integer presetType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField(value = "remark")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "create_time")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "update_time")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人id
|
||||||
|
*/
|
||||||
|
@TableField(value = "create_by")
|
||||||
|
private Integer createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人id
|
||||||
|
*/
|
||||||
|
@TableField(value = "update_by")
|
||||||
|
private Integer updateBy;
|
||||||
|
}
|
|
@ -2,6 +2,7 @@ package com.ruoyi.board.service;
|
||||||
|
|
||||||
import com.github.yulichang.base.MPJBaseService;
|
import com.github.yulichang.base.MPJBaseService;
|
||||||
import com.ruoyi.board.domain.PresetContent;
|
import com.ruoyi.board.domain.PresetContent;
|
||||||
|
import com.ruoyi.board.domain.dto.PresetContentDTO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -9,5 +10,5 @@ public interface IPresetContentService extends MPJBaseService<PresetContent> {
|
||||||
|
|
||||||
PresetContent getOneByContentAndBoardSize(String content, String boardSize, Integer type);
|
PresetContent getOneByContentAndBoardSize(String content, String boardSize, Integer type);
|
||||||
|
|
||||||
List<PresetContent> listPage(PresetContent presetContent);
|
List<PresetContentDTO> listDTO(PresetContent presetContent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,12 +2,13 @@ package com.ruoyi.board.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import com.ruoyi.board.domain.PlanType;
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.ruoyi.board.mapper.PresetContentMapper;
|
|
||||||
import com.ruoyi.board.domain.PresetContent;
|
import com.ruoyi.board.domain.PresetContent;
|
||||||
|
import com.ruoyi.board.domain.dto.PresetContentDTO;
|
||||||
|
import com.ruoyi.board.mapper.PresetContentMapper;
|
||||||
import com.ruoyi.board.service.IPresetContentService;
|
import com.ruoyi.board.service.IPresetContentService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -24,11 +25,12 @@ public class PresetContentServiceImpl extends MPJBaseServiceImpl<PresetContentMa
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PresetContent> listPage(PresetContent presetContent) {
|
public List<PresetContentDTO> listDTO(PresetContent presetContent) {
|
||||||
LambdaQueryWrapper<PresetContent> queryWrapper = new LambdaQueryWrapper<>();
|
MPJLambdaWrapper<PresetContent> eq = new MPJLambdaWrapper<PresetContent>()
|
||||||
queryWrapper.likeRight(StringUtils.isNotEmpty(presetContent.getName()), PresetContent::getName, presetContent.getName());
|
.selectAll(PresetContent.class)
|
||||||
queryWrapper.eq(StringUtils.isNotEmpty(presetContent.getBoardSize()), PresetContent::getBoardSize, presetContent.getBoardSize());
|
.selectAs(PlanType::getTypeName, "type_name")
|
||||||
queryWrapper.eq(ObjectUtils.isNotEmpty(presetContent.getInfoType()), PresetContent::getInfoType, presetContent.getInfoType());
|
.leftJoin(PlanType.class, PlanType::getId, PresetContent::getInfoType)
|
||||||
return list(queryWrapper);
|
.eq(presetContent.getInfoType() != null && presetContent.getInfoType() > 0, PresetContent::getInfoType, presetContent.getInfoType());
|
||||||
|
return selectJoinList(PresetContentDTO.class, eq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue