| New file |
| | |
| | | package cn.gistack.sm.sjztmd.controller; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.AttResBase; |
| | | import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigation; |
| | | import cn.gistack.sm.sjztmd.service.IAttResBaseService; |
| | | import cn.gistack.sm.sjztmd.service.ITbResGeneralInvestigationService; |
| | | import cn.gistack.sm.sjztmd.vo.AttResBaseGeneralInvestigationVO; |
| | | import cn.gistack.sm.sjztmd.wrapper.AttResBaseWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | | * @DESCRIPTION: |
| | | * @USER: aix |
| | | * @DATE: 2024/1/3 14:39 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "白蚁普查") |
| | | @RestController |
| | | @RequestMapping("/sjztmd/tbresgeneralinvestigation") |
| | | @AllArgsConstructor |
| | | public class TbResGeneralInvestigationController { |
| | | |
| | | private ITbResGeneralInvestigationService tbResGeneralInvestigationService; |
| | | private IAttResBaseService attResBaseService; |
| | | |
| | | @ApiOperation(value = "中台水库-分页列表查询", notes = "中台水库-分页列表查询") |
| | | @GetMapping(value = "/queryPageResList") |
| | | public R queryPageResList(AttResBaseGeneralInvestigationVO attResBase, Query query) { |
| | | IPage<AttResBaseGeneralInvestigationVO> pageList = attResBaseService.selectAttResBaseGeneralInvestigation(Condition.getPage(query), attResBase); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "分页", notes = "白蚁普查分页") |
| | | public R list(@ApiIgnore TbResGeneralInvestigation param, Query query) { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | if (null != param.getCheckState()) |
| | | queryWrapper.eq("\"check_state\"", param.getCheckState()); |
| | | if (!StringUtil.isBlank(param.getResName())) |
| | | queryWrapper.like("\"res_name\"", param.getResName()); |
| | | if (!StringUtil.isBlank(param.getResGuid())) |
| | | queryWrapper.like("\"res_guid\"", param.getResGuid()); |
| | | return R.data(tbResGeneralInvestigationService.page(Condition.getPage(query), queryWrapper)); |
| | | } |
| | | |
| | | @ApiOperation(value = "白蚁普查-添加或者修改", notes = "白蚁普查-添加或者修改") |
| | | @PostMapping(value = "/submit") |
| | | public R submit(@RequestBody TbResGeneralInvestigation tbResGeneralInvestigation) { |
| | | if (tbResGeneralInvestigation.getGuid() == null) { |
| | | tbResGeneralInvestigation.setCreateTime(new Date()); |
| | | } |
| | | return R.status(tbResGeneralInvestigationService.saveOrUpdate(tbResGeneralInvestigation)); |
| | | } |
| | | |
| | | @PostMapping("/remove") |
| | | @ApiOperation(value = "物理删除", notes = "传入id") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String id) { |
| | | return R.status(tbResGeneralInvestigationService.removeById(id)); |
| | | |
| | | } |
| | | |
| | | } |