feat(预警计划发布内容的模版名称替换):

This commit is contained in:
fuhao 2024-09-06 17:20:24 +08:00
parent a120716c7e
commit 79997243f5
No known key found for this signature in database
3 changed files with 12 additions and 4 deletions

View File

@ -50,6 +50,6 @@ public class AlertPlan extends BaseEntity {
/**
* 显示内容
*/
@TableField(value = "display_content")
private String displayContent;
@TableField(value = "preset_content_id")
private Long presetContentId;
}

View File

@ -35,7 +35,12 @@ public class AlertPlanAndPlanTypeDTO {
private BigDecimal minValue;
/**
* 显示内容
* 显示内容 ID
*/
private String displayContent;
private Long presetContentId;
/**
* 显示内容名称
*/
private String presetContentName;
}

View File

@ -5,6 +5,7 @@ import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.ruoyi.board.domain.AlertPlan;
import com.ruoyi.board.domain.PlanType;
import com.ruoyi.board.domain.PresetContent;
import com.ruoyi.board.domain.dto.AlertPlanAndPlanTypeDTO;
import com.ruoyi.board.mapper.AlertPlanMapper;
import com.ruoyi.board.service.IAlertPlanService;
@ -25,7 +26,9 @@ public class AlertPlanServiceImpl extends MPJBaseServiceImpl<AlertPlanMapper, Al
MPJLambdaWrapper<AlertPlan> eq = new MPJLambdaWrapper<AlertPlan>()
.selectAll(AlertPlan.class)
.select(PlanType::getTypeName)
.selectAs(PresetContent::getName, "preset_content_name")
.leftJoin(PlanType.class, PlanType::getId, AlertPlan::getType)
.leftJoin(PresetContent.class, PresetContent::getId, AlertPlan::getPresetContentId)
.eq(ObjectUtils.isNotEmpty(alertPlan.getType()), AlertPlan::getType, alertPlan.getType());
return selectJoinList(AlertPlanAndPlanTypeDTO.class, eq);
}