package com.javaweb.geo.controller; import java.util.List; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.javaweb.common.annotation.Log; import com.javaweb.common.enums.BusinessType; import com.javaweb.geo.domain.HoleBiaoguan; import com.javaweb.geo.service.IHoleBiaoguanService; import com.javaweb.common.core.controller.BaseController; import com.javaweb.common.core.domain.AjaxResult; import com.javaweb.common.utils.poi.ExcelUtil; import com.javaweb.common.core.page.TableDataInfo; /** * 记录-标贯-动探Controller * * @author zmk * @date 2022-10-20 */ @Controller @RequestMapping("/geo/biaoguan") public class HoleBiaoguanController extends BaseController { private String prefix = "geo/biaoguan"; @Autowired private IHoleBiaoguanService holeBiaoguanService; @RequiresPermissions("geo:biaoguan:view") @GetMapping() public String biaoguan(String id, ModelMap mmap) { mmap.put("projectId", id); return prefix + "/biaoguan"; } /** * 查询记录-标贯-动探列表 */ @RequiresPermissions("geo:biaoguan:list") @PostMapping("/list") @ResponseBody public TableDataInfo list(HoleBiaoguan holeBiaoguan) { startPage(); List list = holeBiaoguanService.selectHoleBiaoguanList(holeBiaoguan); return getDataTable(list); } /** * 导出记录-标贯-动探列表 */ @RequiresPermissions("geo:biaoguan:export") @Log(title = "记录-标贯-动探", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody public AjaxResult export(HoleBiaoguan holeBiaoguan) { List list = holeBiaoguanService.selectHoleBiaoguanList(holeBiaoguan); ExcelUtil util = new ExcelUtil(HoleBiaoguan.class); return util.exportExcel(list, "biaoguan"); } /** * 新增记录-标贯-动探 */ @GetMapping("/add") public String add() { return prefix + "/add"; } /** * 新增保存记录-标贯-动探 */ @RequiresPermissions("geo:biaoguan:add") @Log(title = "记录-标贯-动探", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody public AjaxResult addSave(HoleBiaoguan holeBiaoguan) { return toAjax(holeBiaoguanService.insertHoleBiaoguan(holeBiaoguan)); } /** * 修改记录-标贯-动探 */ @GetMapping("/edit/{ids}") public String edit(@PathVariable("ids") String ids, ModelMap mmap) { HoleBiaoguan holeBiaoguan = holeBiaoguanService.selectHoleBiaoguanById(ids); mmap.put("holeBiaoguan", holeBiaoguan); return prefix + "/edit"; } /** * 修改保存记录-标贯-动探 */ @RequiresPermissions("geo:biaoguan:edit") @Log(title = "记录-标贯-动探", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody public AjaxResult editSave(HoleBiaoguan holeBiaoguan) { return toAjax(holeBiaoguanService.updateHoleBiaoguan(holeBiaoguan)); } /** * 删除记录-标贯-动探 */ @RequiresPermissions("geo:biaoguan:remove") @Log(title = "记录-标贯-动探", businessType = BusinessType.DELETE) @PostMapping( "/remove") @ResponseBody public AjaxResult remove(String ids) { return toAjax(holeBiaoguanService.deleteHoleBiaoguanByIds(ids)); } }