From 7e2a6efe8b43b310f9a7a1c52d68c594f8dfe95a Mon Sep 17 00:00:00 2001 From: zhangyanli Date: Wed, 21 Feb 2024 18:11:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=B8=85=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HiddenTermLibraryController.java | 160 ++++++++++++++++++ .../termLibrary/HiddenTermLibraryMapper.java | 58 +++++++ .../termLibrary/HiddenTermLibraryService.java | 59 +++++++ .../impl/HiddenTermLibraryServiceImpl.java | 103 +++++++++++ .../termLibrary/HiddenTermLibraryMapper.xml | 139 +++++++++++++++ 5 files changed, 519 insertions(+) create mode 100644 src/main/java/com/zcloud/controller/termLibrary/HiddenTermLibraryController.java create mode 100644 src/main/java/com/zcloud/mapper/dsno2/termLibrary/HiddenTermLibraryMapper.java create mode 100644 src/main/java/com/zcloud/service/termLibrary/HiddenTermLibraryService.java create mode 100644 src/main/java/com/zcloud/service/termLibrary/impl/HiddenTermLibraryServiceImpl.java create mode 100644 src/main/resources/mybatis/dsno2/termLibrary/HiddenTermLibraryMapper.xml diff --git a/src/main/java/com/zcloud/controller/termLibrary/HiddenTermLibraryController.java b/src/main/java/com/zcloud/controller/termLibrary/HiddenTermLibraryController.java new file mode 100644 index 0000000..948692a --- /dev/null +++ b/src/main/java/com/zcloud/controller/termLibrary/HiddenTermLibraryController.java @@ -0,0 +1,160 @@ +package com.zcloud.controller.termLibrary; + +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.service.termLibrary.HiddenTermLibraryService; +import com.zcloud.util.*; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 说明:隐患排查包保责任人任务清单 + * 作者:zhangyanli + * 时间:2024-02-20 + * 官网:www.zcloudchina.com + */ +@Controller +@RequestMapping("/hiddenTermLibrary") +public class HiddenTermLibraryController extends BaseController { + + @Autowired + private HiddenTermLibraryService hiddenTermLibraryService; + + /** + * 新增 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/add") + @RequiresPermissions("hiddenTermLibrary:add") + @ResponseBody + public Object add() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("TERM_LIBRARY_ID", this.get32UUID()); + pd.put("CREATE_TIME", DateUtil.getTime()); + pd.put("IS_DELETE", '0'); + hiddenTermLibraryService.save(pd); + map.put("result", errInfo); + return map; + } + + /** + * 删除 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/delete") + @RequiresPermissions("hiddenTermLibrary:del") + @ResponseBody + public Object delete() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + hiddenTermLibraryService.delete(pd); + map.put("result", errInfo); //返回结果 + return map; + } + + /** + * 修改 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/edit") + @RequiresPermissions("hiddenTermLibrary:edit") + @ResponseBody + public Object edit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + hiddenTermLibraryService.edit(pd); + map.put("result", errInfo); + return map; + } + + /** + * 列表 + * + * @param page + * @throws Exception + */ + @RequestMapping(value = "/list") + @RequiresPermissions("hiddenTermLibrary:list") + @ResponseBody + public Object list(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + page.setPd(pd); + List varList = hiddenTermLibraryService.list(page); + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + /** + * 去修改页面获取数据 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/goEdit") + @RequiresPermissions("hiddenTermLibrary:edit") + @ResponseBody + public Object goEdit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd = hiddenTermLibraryService.findById(pd); //根据ID读取 + map.put("pd", pd); + map.put("result", errInfo); + return map; + } + + /** + * 批量删除 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/deleteAll") + @RequiresPermissions("hiddenTermLibrary:del") + @ResponseBody + public Object deleteAll() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String DATA_IDS = pd.getString("DATA_IDS"); + if (Tools.notEmpty(DATA_IDS)) { + String ArrayDATA_IDS[] = DATA_IDS.split(","); + PageData del = new PageData(); + del.put("ArrayDATA_IDS", ArrayDATA_IDS); + hiddenTermLibraryService.deleteAll(del); + errInfo = "success"; + } else { + errInfo = "error"; + } + map.put("result", errInfo); //返回结果 + return map; + } +} diff --git a/src/main/java/com/zcloud/mapper/dsno2/termLibrary/HiddenTermLibraryMapper.java b/src/main/java/com/zcloud/mapper/dsno2/termLibrary/HiddenTermLibraryMapper.java new file mode 100644 index 0000000..cdb6175 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/dsno2/termLibrary/HiddenTermLibraryMapper.java @@ -0,0 +1,58 @@ +package com.zcloud.mapper.dsno2.termLibrary; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:隐患排查包保责任人任务清单 + * 作者:zhangyanli + * 时间:2024-02-20 + * 官网:www.zcloudchina.com + */ +public interface HiddenTermLibraryMapper { + + /**新增 + * @param pd + * @throws Exception + */ + void save(PageData pd); + + /**删除 + * @param pd + * @throws Exception + */ + void delete(PageData pd); + + /**修改 + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + /**列表 + * @param page + * @throws Exception + */ + List datalistPage(Page page); + + /**列表(全部) + * @param pd + * @throws Exception + */ + List listAll(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd); + + /**批量删除 + * @param pd + * @throws Exception + */ + void deleteAll(PageData pd); +} + diff --git a/src/main/java/com/zcloud/service/termLibrary/HiddenTermLibraryService.java b/src/main/java/com/zcloud/service/termLibrary/HiddenTermLibraryService.java new file mode 100644 index 0000000..948a7c8 --- /dev/null +++ b/src/main/java/com/zcloud/service/termLibrary/HiddenTermLibraryService.java @@ -0,0 +1,59 @@ +package com.zcloud.service.termLibrary; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:隐患排查包保责任人任务清单 + * 作者:zhangyanli + * 时间:2024-02-20 + * 官网:www.zcloudchina.com + */ +public interface HiddenTermLibraryService { + + /**新增 + * @param pd + * @throws Exception + */ + void save(PageData pd)throws Exception; + + /**删除 + * @param pd + * @throws Exception + */ + void delete(PageData pd)throws Exception; + + /**修改 + * @param pd + * @throws Exception + */ + void edit(PageData pd)throws Exception; + + /**列表 + * @param page + * @throws Exception + */ + List list(Page page)throws Exception; + + /**列表(全部) + * @param pd + * @throws Exception + */ + List listAll(PageData pd)throws Exception; + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd)throws Exception; + + /**批量删除 + * @param pd + * @throws Exception + */ + void deleteAll(PageData pd)throws Exception; + +} + diff --git a/src/main/java/com/zcloud/service/termLibrary/impl/HiddenTermLibraryServiceImpl.java b/src/main/java/com/zcloud/service/termLibrary/impl/HiddenTermLibraryServiceImpl.java new file mode 100644 index 0000000..5843916 --- /dev/null +++ b/src/main/java/com/zcloud/service/termLibrary/impl/HiddenTermLibraryServiceImpl.java @@ -0,0 +1,103 @@ +package com.zcloud.service.termLibrary.impl; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.dsno2.termLibrary.HiddenTermLibraryMapper; +import com.zcloud.service.termLibrary.HiddenTermLibraryService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 说明:隐患排查包保责任人任务清单 + * 作者:zhangyanli + * 时间:2024-02-20 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class HiddenTermLibraryServiceImpl implements HiddenTermLibraryService { + + @Resource + private HiddenTermLibraryMapper hiddenTermLibraryMapper; + + /** + * 新增 + * + * @param pd + * @throws Exception + */ + @Override + public void save(PageData pd) throws Exception { + hiddenTermLibraryMapper.save(pd); + } + + /** + * 删除 + * + * @param pd + * @throws Exception + */ + @Override + public void delete(PageData pd) throws Exception { + hiddenTermLibraryMapper.delete(pd); + } + + /** + * 修改 + * + * @param pd + * @throws Exception + */ + @Override + public void edit(PageData pd) throws Exception { + hiddenTermLibraryMapper.edit(pd); + } + + /** + * 列表 + * + * @param page + * @throws Exception + */ + @Override + public List list(Page page) throws Exception { + return hiddenTermLibraryMapper.datalistPage(page); + } + + /** + * 列表(全部) + * + * @param pd + * @throws Exception + */ + @Override + public List listAll(PageData pd) throws Exception { + return hiddenTermLibraryMapper.listAll(pd); + } + + /** + * 通过id获取数据 + * + * @param pd + * @throws Exception + */ + @Override + public PageData findById(PageData pd) throws Exception { + return hiddenTermLibraryMapper.findById(pd); + } + + /** + * 批量删除 + * + * @param pd + * @throws Exception + */ + @Override + public void deleteAll(PageData pd) throws Exception { + hiddenTermLibraryMapper.deleteAll(pd); + } +} + diff --git a/src/main/resources/mybatis/dsno2/termLibrary/HiddenTermLibraryMapper.xml b/src/main/resources/mybatis/dsno2/termLibrary/HiddenTermLibraryMapper.xml new file mode 100644 index 0000000..d3ae2ac --- /dev/null +++ b/src/main/resources/mybatis/dsno2/termLibrary/HiddenTermLibraryMapper.xml @@ -0,0 +1,139 @@ + + + + + + + BUS_HIDDENDANGERCHECKSTANDARD_TERM_LIBRARY + + + + + SYS_DICTIONARIES + + + + + f.TERM_LIBRARY_ID, + f.TASK_NUM, + f.TERM_DESCRIBE, + f.WORK_TYPE, + f.IS_DELETE, + f.CREATE_TIME, + f.SORT + + + + + TERM_LIBRARY_ID, + TASK_NUM, + TERM_DESCRIBE, + WORK_TYPE, + IS_DELETE, + CREATE_TIME, + SORT + + + + + #{TERM_LIBRARY_ID}, + #{TASK_NUM}, + #{TERM_DESCRIBE}, + #{WORK_TYPE}, + #{IS_DELETE}, + #{CREATE_TIME}, + #{SORT} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + IS_DELETE = '1' + where + TERM_LIBRARY_ID = #{TERM_LIBRARY_ID} + + + + + update + + set + + TASK_NUM = #{TASK_NUM}, + + + TERM_DESCRIBE = #{TERM_DESCRIBE}, + + + WORK_TYPE = #{WORK_TYPE}, + + + SORT = #{SORT}, + + TERM_LIBRARY_ID = TERM_LIBRARY_ID + where + TERM_LIBRARY_ID = #{TERM_LIBRARY_ID} + + + + + + + + + + + + + + update + + set + IS_DELETE = '1', + where + TERM_LIBRARY_ID in + + #{item} + + + +