feat:配置修改

law-v2025-01
wangxy 3 months ago
parent 6e6477e1a7
commit 187de58335

@ -9,6 +9,7 @@ import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.domain.SysColumn; import com.ruoyi.system.domain.SysColumn;
import com.ruoyi.system.domain.SysColumnVO; import com.ruoyi.system.domain.SysColumnVO;
import com.ruoyi.system.domain.SysSpecial; import com.ruoyi.system.domain.SysSpecial;
import com.ruoyi.system.domain.SysSpecialDTO;
import com.ruoyi.system.service.ISysColumnService; import com.ruoyi.system.service.ISysColumnService;
import com.ruoyi.system.service.ISysSpecialService; import com.ruoyi.system.service.ISysSpecialService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -75,17 +76,10 @@ public class LawController extends BaseController {
@ApiOperation("专题活动") @ApiOperation("专题活动")
@GetMapping("/special") @GetMapping("/special")
public R<PageInfo<SysSpecial>> special(@RequestParam(required = false, defaultValue = "1", value = "p") Integer pageNum, public R<PageInfo<SysSpecial>> special(SysSpecialDTO sysSpecialDTO) {
@RequestParam(required = false, defaultValue = PAGE_SIZE, value = "ps") Integer pageSize, PageMethod.startPage(sysSpecialDTO.getPageNum(), sysSpecialDTO.getPageSize());
@RequestParam(required = false) String columnId, List<SysSpecial> specialList = specialService.selectSysSpecialDTOList(sysSpecialDTO);
@RequestParam(required = false) String specialTitle) { PageInfo<SysSpecial> page = PageInfo.of(specialList);
PageMethod.startPage(pageNum, pageSize);
SysSpecial sysSpecial = new SysSpecial();
sysSpecial.setStatus(STATUS);
sysSpecial.setColumnId(columnId);
sysSpecial.setSpecialTitle(specialTitle);
List<SysSpecial> specialList = specialService.selectSysSpecialList(sysSpecial);
PageInfo<SysSpecial> page = new PageInfo<>(specialList, pageSize);
return R.ok(page); return R.ok(page);
} }

@ -0,0 +1,52 @@
package com.ruoyi.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* ClassName: SysSpecialDTO
* Package: com.ruoyi.system.domain
* Description:
*
* @Author wangxy
* @Create 2025/1/10 14:18
* @Version 1.0
*/
@Data
public class SysSpecialDTO {
/** 公告ID */
private String specialId;
/** 公告标题 */
private String specialTitle;
/** 公告内容 */
private String specialContent;
/** 公告状态0正常 1关闭 */
private String status = "0";
private String columnId;
/** 名称 */
private String columnName;
/** 创建者 */
private String createBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private Integer pageNum = 1;
private Integer pageSize = 15;
}

@ -1,6 +1,7 @@
package com.ruoyi.system.mapper; package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.SysSpecial; import com.ruoyi.system.domain.SysSpecial;
import com.ruoyi.system.domain.SysSpecialDTO;
import java.util.List; import java.util.List;
@ -26,6 +27,11 @@ public interface SysSpecialMapper {
*/ */
public List<SysSpecial> selectSysSpecialList(SysSpecial special); public List<SysSpecial> selectSysSpecialList(SysSpecial special);
public List<SysSpecial> selectSysSpecialDTOList(SysSpecialDTO sysSpecialDTO);
/** /**
* *
* *

@ -1,6 +1,7 @@
package com.ruoyi.system.service; package com.ruoyi.system.service;
import com.ruoyi.system.domain.SysSpecial; import com.ruoyi.system.domain.SysSpecial;
import com.ruoyi.system.domain.SysSpecialDTO;
import java.util.List; import java.util.List;
@ -26,6 +27,11 @@ public interface ISysSpecialService {
*/ */
public List<SysSpecial> selectSysSpecialList(SysSpecial special); public List<SysSpecial> selectSysSpecialList(SysSpecial special);
public List<SysSpecial> selectSysSpecialDTOList(SysSpecialDTO sysSpecialDTO);
/** /**
* *
* *

@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import com.ruoyi.system.domain.SysSpecial; import com.ruoyi.system.domain.SysSpecial;
import com.ruoyi.system.domain.SysSpecialDTO;
import com.ruoyi.system.mapper.SysSpecialMapper; import com.ruoyi.system.mapper.SysSpecialMapper;
import com.ruoyi.system.service.ISysSpecialService; import com.ruoyi.system.service.ISysSpecialService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -44,6 +45,11 @@ public class SysSpecialServiceImpl implements ISysSpecialService {
return specialMapper.selectSysSpecialList(special); return specialMapper.selectSysSpecialList(special);
} }
@Override
public List<SysSpecial> selectSysSpecialDTOList(SysSpecialDTO sysSpecialDTO) {
return specialMapper.selectSysSpecialDTOList(sysSpecialDTO);
}
/** /**
* *
* *

@ -52,6 +52,28 @@
order by create_time desc order by create_time desc
</select> </select>
<select id="selectSysSpecialDTOList" parameterType="SysSpecialDTO" resultMap="SysSpecialResult">
<include refid="selectSysSpecialVo"/>
<where>
<if test="specialTitle != null and specialTitle != ''">
AND special_title like concat('%', #{specialTitle}, '%')
</if>
<if test="specialContent != null and specialContent != ''">
AND special_content like concat('%', #{specialContent}, '%')
</if>
<if test="createBy != null and createBy != ''">
AND create_by like concat('%', #{createBy}, '%')
</if>
<if test="status != null">
AND status = #{status}
</if>
<if test="columnId != null and columnId != ''">
AND column_id = #{columnId}
</if>
</where>
order by create_time desc
</select>
<insert id="insertSysSpecial" parameterType="SysSpecial"> <insert id="insertSysSpecial" parameterType="SysSpecial">
insert into sys_special ( insert into sys_special (
<if test="specialId != null and specialId != ''">special_id, </if> <if test="specialId != null and specialId != ''">special_id, </if>

Loading…
Cancel
Save