diff --git a/smart-switch-ruoyi/smart-switch-system/src/main/java/com/ruoyi/system/domain/SysNotice.java b/smart-switch-ruoyi/smart-switch-system/src/main/java/com/ruoyi/system/domain/SysNotice.java index 8c07a54a..77445385 100644 --- a/smart-switch-ruoyi/smart-switch-system/src/main/java/com/ruoyi/system/domain/SysNotice.java +++ b/smart-switch-ruoyi/smart-switch-system/src/main/java/com/ruoyi/system/domain/SysNotice.java @@ -1,17 +1,20 @@ package com.ruoyi.system.domain; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.common.xss.Xss; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.core.domain.BaseEntity; -import com.ruoyi.common.xss.Xss; /** * 通知公告表 sys_notice - * + * * @author ruoyi */ +@Data public class SysNotice extends BaseEntity { private static final long serialVersionUID = 1L; @@ -20,6 +23,9 @@ public class SysNotice extends BaseEntity private Long noticeId; /** 公告标题 */ + @Xss(message = "公告标题不能包含脚本字符") + @NotBlank(message = "公告标题不能为空") + @Size(min = 0, max = 50, message = "公告标题不能超过50个字符") private String noticeTitle; /** 公告类型(1通知 2公告) */ @@ -31,72 +37,20 @@ public class SysNotice extends BaseEntity /** 公告状态(0正常 1关闭) */ private String status; - public Long getNoticeId() - { - return noticeId; - } + @Excel(name = "接收方式", readConverterExp = "1=全体用户,2=指定用户") + @ApiModelProperty("接收方式") + private String receiveType; - public void setNoticeId(Long noticeId) - { - this.noticeId = noticeId; - } + @Excel(name = "跳转URL") + @ApiModelProperty("跳转URL") + private String url; - public void setNoticeTitle(String noticeTitle) - { - this.noticeTitle = noticeTitle; - } + @Excel(name = "URL类型", readConverterExp = "1=公告详情,2=小程序内部URL,3=外部URL") + @ApiModelProperty("URL类型") + private String urlType; - @Xss(message = "公告标题不能包含脚本字符") - @NotBlank(message = "公告标题不能为空") - @Size(min = 0, max = 50, message = "公告标题不能超过50个字符") - public String getNoticeTitle() - { - return noticeTitle; - } + @Excel(name = "发送方式", readConverterExp = "1=小程序内部展示,2=短信,3=公众号") + @ApiModelProperty("发送方式") + private String sendType; - public void setNoticeType(String noticeType) - { - this.noticeType = noticeType; - } - - public String getNoticeType() - { - return noticeType; - } - - public void setNoticeContent(String noticeContent) - { - this.noticeContent = noticeContent; - } - - public String getNoticeContent() - { - return noticeContent; - } - - public void setStatus(String status) - { - this.status = status; - } - - public String getStatus() - { - return status; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("noticeId", getNoticeId()) - .append("noticeTitle", getNoticeTitle()) - .append("noticeType", getNoticeType()) - .append("noticeContent", getNoticeContent()) - .append("status", getStatus()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); - } } diff --git a/smart-switch-ruoyi/smart-switch-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/smart-switch-ruoyi/smart-switch-system/src/main/resources/mapper/system/SysNoticeMapper.xml index f909f685..39fba75c 100644 --- a/smart-switch-ruoyi/smart-switch-system/src/main/resources/mapper/system/SysNoticeMapper.xml +++ b/smart-switch-ruoyi/smart-switch-system/src/main/resources/mapper/system/SysNoticeMapper.xml @@ -17,7 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_time, update_by, update_time, - remark + remark, + receive_type, + url, + url_type, + send_type from sys_notice </sql> @@ -41,6 +45,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <if test="status != null and status != ''"> AND `status` = #{status} </if> + <if test="receiveType != null and receiveType != ''"> and receive_type = #{receiveType}</if> + <if test="url != null and url != ''"> and url like concat('%', #{url},'%')</if> + <if test="urlType != null and urlType != ''"> and url_type = #{urlType}</if> + <if test="sendType != null and sendType != ''"> and send_type = #{sendType}</if> </where> </select> @@ -52,6 +60,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <if test="status != null and status != '' ">status, </if> <if test="remark != null and remark != ''">remark,</if> <if test="createBy != null and createBy != ''">create_by,</if> + <if test="receiveType != null">receive_type,</if> + <if test="url != null">url,</if> + <if test="urlType != null">url_type,</if> + <if test="sendType != null">send_type,</if> create_time )values( <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if> @@ -60,6 +72,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <if test="status != null and status != ''">#{status}, </if> <if test="remark != null and remark != ''">#{remark},</if> <if test="createBy != null and createBy != ''">#{createBy},</if> + <if test="receiveType != null">#{receiveType},</if> + <if test="url != null">#{url},</if> + <if test="urlType != null">#{urlType},</if> + <if test="sendType != null">#{sendType},</if> sysdate() ) </insert> @@ -70,8 +86,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if> <if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if> <if test="noticeContent != null">notice_content = #{noticeContent}, </if> - <if test="status != null and status != ''">status = #{status}, </if> + <if test="status != null and status != ''">`status` = #{status}, </if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> + <if test="receiveType != null">receive_type = #{receiveType},</if> + <if test="url != null">url = #{url},</if> + <if test="urlType != null">url_type = #{urlType},</if> + <if test="sendType != null">send_type = #{sendType},</if> update_time = sysdate() </set> where notice_id = #{noticeId}