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/hiddenDangerCheckStandard/DictionaryMapper.xml b/src/main/resources/mybatis/dsno2/hiddenDangerCheckStandard/DictionaryMapper.xml index eb2263d..000c23c 100644 --- a/src/main/resources/mybatis/dsno2/hiddenDangerCheckStandard/DictionaryMapper.xml +++ b/src/main/resources/mybatis/dsno2/hiddenDangerCheckStandard/DictionaryMapper.xml @@ -207,10 +207,10 @@ from f - left join bus_hiddendangercheckstandard_common_item cca on cca.CHECK_CATEGORY = f.DICTIONARY_ID - left join bus_hiddendangercheckstandard_common_item cci on cci.CHECK_ITEM = f.DICTIONARY_ID - left join bus_hiddendangercheckstandard_custom_item cua on cua.CHECK_CATEGORY = f.DICTIONARY_ID - left join bus_hiddendangercheckstandard_custom_item cui on cui.CHECK_ITEM = f.DICTIONARY_ID + left join bus_hiddendangercheckstandard_common_item cca on cca.CHECK_CATEGORY = f.DICTIONARY_ID and cca.ISDELETE = '0' + left join bus_hiddendangercheckstandard_common_item cci on cci.CHECK_ITEM = f.DICTIONARY_ID and cci.ISDELETE = '0' + left join bus_hiddendangercheckstandard_custom_item cua on cua.CHECK_CATEGORY = f.DICTIONARY_ID and cua.ISDELETE = '0' + left join bus_hiddendangercheckstandard_custom_item cui on cui.CHECK_ITEM = f.DICTIONARY_ID and cui.ISDELETE = '0' where f.ISDELETE = '0' group by f.DICTIONARY_ID order by f.DICTIONARY_LEVEL asc, f.DICTIONARY_SORT asc 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} + + + +