From b3b901df82d74adb615c8627c9f7e98e9720d7aa Mon Sep 17 00:00:00 2001 From: hezi66677 <847517741@qq.com> Date: Tue, 17 Dec 2024 21:13:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/MyinformController.java | 104 ++++++++++++++++++ .../com/ruoyi/system/domain/Myinform.java | 93 ++++++++++++++++ .../ruoyi/system/mapper/MyinformMapper.java | 61 ++++++++++ .../system/service/IMyinformService.java | 61 ++++++++++ .../service/impl/MyinformServiceImpl.java | 93 ++++++++++++++++ .../mapper/system/MyinformMapper.xml | 71 ++++++++++++ 6 files changed, 483 insertions(+) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/controller/MyinformController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/Myinform.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/MyinformMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/IMyinformService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MyinformServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/system/MyinformMapper.xml diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/MyinformController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/MyinformController.java new file mode 100644 index 0000000..2528129 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/MyinformController.java @@ -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 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 list = myinformService.selectMyinformList(myinform); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Myinform.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Myinform.java new file mode 100644 index 0000000..92476b1 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Myinform.java @@ -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(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/MyinformMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/MyinformMapper.java new file mode 100644 index 0000000..a5b73d7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/MyinformMapper.java @@ -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 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); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IMyinformService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IMyinformService.java new file mode 100644 index 0000000..f5b30ff --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IMyinformService.java @@ -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 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); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MyinformServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MyinformServiceImpl.java new file mode 100644 index 0000000..f9022b8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MyinformServiceImpl.java @@ -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 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); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/MyinformMapper.xml b/ruoyi-system/src/main/resources/mapper/system/MyinformMapper.xml new file mode 100644 index 0000000..18cb32f --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/MyinformMapper.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + select id, inform, date, status, title from myinform + + + + + + + + insert into myinform + + inform, + date, + status, + title, + + + #{inform}, + #{date}, + #{status}, + #{title}, + + + + + update myinform + + inform = #{inform}, + date = #{date}, + status = #{status}, + title = #{title}, + + where id = #{id} + + + + delete from myinform where id = #{id} + + + + delete from myinform where id in + + #{id} + + + \ No newline at end of file