This commit is contained in:
hezi66677 2024-12-17 21:13:04 +08:00
parent a2dccc7614
commit b3b901df82
6 changed files with 483 additions and 0 deletions

View File

@ -0,0 +1,104 @@
package com.ruoyi.system.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.Myinform;
import com.ruoyi.system.service.IMyinformService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 通知管理Controller
*
* @author 徐天乐
* @date 2024-12-16
*/
@RestController
@RequestMapping("/system/myinform")
public class MyinformController extends BaseController
{
@Autowired
private IMyinformService myinformService;
/**
* 查询通知管理列表
*/
@PreAuthorize("@ss.hasPermi('system:myinform:list')")
@GetMapping("/list")
public TableDataInfo list(Myinform myinform)
{
startPage();
List<Myinform> list = myinformService.selectMyinformList(myinform);
return getDataTable(list);
}
/**
* 导出通知管理列表
*/
@PreAuthorize("@ss.hasPermi('system:myinform:export')")
@Log(title = "通知管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Myinform myinform)
{
List<Myinform> list = myinformService.selectMyinformList(myinform);
ExcelUtil<Myinform> util = new ExcelUtil<Myinform>(Myinform.class);
util.exportExcel(response, list, "通知管理数据");
}
/**
* 获取通知管理详细信息
*/
@PreAuthorize("@ss.hasPermi('system:myinform:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(myinformService.selectMyinformById(id));
}
/**
* 新增通知管理
*/
@PreAuthorize("@ss.hasPermi('system:myinform:add')")
@Log(title = "通知管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Myinform myinform)
{
return toAjax(myinformService.insertMyinform(myinform));
}
/**
* 修改通知管理
*/
@PreAuthorize("@ss.hasPermi('system:myinform:edit')")
@Log(title = "通知管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Myinform myinform)
{
return toAjax(myinformService.updateMyinform(myinform));
}
/**
* 删除通知管理
*/
@PreAuthorize("@ss.hasPermi('system:myinform:remove')")
@Log(title = "通知管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(myinformService.deleteMyinformByIds(ids));
}
}

View File

@ -0,0 +1,93 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 通知管理对象 myinform
*
* @author 徐天乐
* @date 2024-12-16
*/
public class Myinform extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 发布部门 */
@Excel(name = "发布部门")
private String inform;
/** 日期 */
@Excel(name = "日期")
private String date;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 标题 */
@Excel(name = "标题")
private String title;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setInform(String inform)
{
this.inform = inform;
}
public String getInform()
{
return inform;
}
public void setDate(String date)
{
this.date = date;
}
public String getDate()
{
return date;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setTitle(String title)
{
this.title = title;
}
public String getTitle()
{
return title;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("inform", getInform())
.append("date", getDate())
.append("status", getStatus())
.append("title", getTitle())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.Myinform;
/**
* 通知管理Mapper接口
*
* @author 徐天乐
* @date 2024-12-16
*/
public interface MyinformMapper
{
/**
* 查询通知管理
*
* @param id 通知管理主键
* @return 通知管理
*/
public Myinform selectMyinformById(Long id);
/**
* 查询通知管理列表
*
* @param myinform 通知管理
* @return 通知管理集合
*/
public List<Myinform> selectMyinformList(Myinform myinform);
/**
* 新增通知管理
*
* @param myinform 通知管理
* @return 结果
*/
public int insertMyinform(Myinform myinform);
/**
* 修改通知管理
*
* @param myinform 通知管理
* @return 结果
*/
public int updateMyinform(Myinform myinform);
/**
* 删除通知管理
*
* @param id 通知管理主键
* @return 结果
*/
public int deleteMyinformById(Long id);
/**
* 批量删除通知管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMyinformByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.Myinform;
/**
* 通知管理Service接口
*
* @author 徐天乐
* @date 2024-12-16
*/
public interface IMyinformService
{
/**
* 查询通知管理
*
* @param id 通知管理主键
* @return 通知管理
*/
public Myinform selectMyinformById(Long id);
/**
* 查询通知管理列表
*
* @param myinform 通知管理
* @return 通知管理集合
*/
public List<Myinform> selectMyinformList(Myinform myinform);
/**
* 新增通知管理
*
* @param myinform 通知管理
* @return 结果
*/
public int insertMyinform(Myinform myinform);
/**
* 修改通知管理
*
* @param myinform 通知管理
* @return 结果
*/
public int updateMyinform(Myinform myinform);
/**
* 批量删除通知管理
*
* @param ids 需要删除的通知管理主键集合
* @return 结果
*/
public int deleteMyinformByIds(Long[] ids);
/**
* 删除通知管理信息
*
* @param id 通知管理主键
* @return 结果
*/
public int deleteMyinformById(Long id);
}

View File

@ -0,0 +1,93 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MyinformMapper;
import com.ruoyi.system.domain.Myinform;
import com.ruoyi.system.service.IMyinformService;
/**
* 通知管理Service业务层处理
*
* @author 徐天乐
* @date 2024-12-16
*/
@Service
public class MyinformServiceImpl implements IMyinformService
{
@Autowired
private MyinformMapper myinformMapper;
/**
* 查询通知管理
*
* @param id 通知管理主键
* @return 通知管理
*/
@Override
public Myinform selectMyinformById(Long id)
{
return myinformMapper.selectMyinformById(id);
}
/**
* 查询通知管理列表
*
* @param myinform 通知管理
* @return 通知管理
*/
@Override
public List<Myinform> selectMyinformList(Myinform myinform)
{
return myinformMapper.selectMyinformList(myinform);
}
/**
* 新增通知管理
*
* @param myinform 通知管理
* @return 结果
*/
@Override
public int insertMyinform(Myinform myinform)
{
return myinformMapper.insertMyinform(myinform);
}
/**
* 修改通知管理
*
* @param myinform 通知管理
* @return 结果
*/
@Override
public int updateMyinform(Myinform myinform)
{
return myinformMapper.updateMyinform(myinform);
}
/**
* 批量删除通知管理
*
* @param ids 需要删除的通知管理主键
* @return 结果
*/
@Override
public int deleteMyinformByIds(Long[] ids)
{
return myinformMapper.deleteMyinformByIds(ids);
}
/**
* 删除通知管理信息
*
* @param id 通知管理主键
* @return 结果
*/
@Override
public int deleteMyinformById(Long id)
{
return myinformMapper.deleteMyinformById(id);
}
}

View File

@ -0,0 +1,71 @@
<?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.ruoyi.system.mapper.MyinformMapper">
<resultMap type="Myinform" id="MyinformResult">
<result property="id" column="id" />
<result property="inform" column="inform" />
<result property="date" column="date" />
<result property="status" column="status" />
<result property="title" column="title" />
</resultMap>
<sql id="selectMyinformVo">
select id, inform, date, status, title from myinform
</sql>
<select id="selectMyinformList" parameterType="Myinform" resultMap="MyinformResult">
<include refid="selectMyinformVo"/>
<where>
<if test="inform != null and inform != ''"> and inform = #{inform}</if>
<if test="date != null and date != ''"> and date = #{date}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="title != null and title != ''"> and title = #{title}</if>
</where>
</select>
<select id="selectMyinformById" parameterType="Long" resultMap="MyinformResult">
<include refid="selectMyinformVo"/>
where id = #{id}
</select>
<insert id="insertMyinform" parameterType="Myinform" useGeneratedKeys="true" keyProperty="id">
insert into myinform
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="inform != null">inform,</if>
<if test="date != null">date,</if>
<if test="status != null">status,</if>
<if test="title != null">title,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="inform != null">#{inform},</if>
<if test="date != null">#{date},</if>
<if test="status != null">#{status},</if>
<if test="title != null">#{title},</if>
</trim>
</insert>
<update id="updateMyinform" parameterType="Myinform">
update myinform
<trim prefix="SET" suffixOverrides=",">
<if test="inform != null">inform = #{inform},</if>
<if test="date != null">date = #{date},</if>
<if test="status != null">status = #{status},</if>
<if test="title != null">title = #{title},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMyinformById" parameterType="Long">
delete from myinform where id = #{id}
</delete>
<delete id="deleteMyinformByIds" parameterType="String">
delete from myinform where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>