guoshilong
2024-03-18 2b9cd5d7c0cf41bb1996079eb62bd4c390a27e12
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/controller/TbResGeneralInvestigationController.java
@@ -5,6 +5,7 @@
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.vo.TbResGeneralInvestigationParam;
import cn.gistack.sm.sjztmd.wrapper.AttResBaseWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -20,6 +21,7 @@
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -44,7 +46,7 @@
   @ApiOperation(value = "中台水库-分页列表查询", notes = "中台水库-分页列表查询")
   @GetMapping(value = "/queryPageResList")
   public R queryPageResList(AttResBaseGeneralInvestigationVO attResBase, Query query) {
      IPage<AttResBaseGeneralInvestigationVO> pageList = attResBaseService.selectAttResBaseGeneralInvestigation(Condition.getPage(query), attResBase);
      Object pageList = attResBaseService.selectAttResBaseGeneralInvestigation(Condition.getPage(query), attResBase);
      return R.data(pageList);
   }
@@ -60,6 +62,10 @@
         queryWrapper.like("\"res_guid\"", param.getResGuid());
      if (!StringUtil.isBlank(param.getCreateUser()))
         queryWrapper.like("\"create_user\"", param.getCreateUser());
      if (null != param.getTbYear())
         queryWrapper.like("\"tb_year\"", param.getTbYear());
      if (!StringUtil.isBlank(param.getTbQuarter()))
         queryWrapper.like("\"tb_quarter\"", param.getTbQuarter());
      return R.data(tbResGeneralInvestigationService.page(Condition.getPage(query), queryWrapper));
   }
@@ -88,14 +94,31 @@
      if (tbResGeneralInvestigation.getGuid() == null) {
         tbResGeneralInvestigation.setCreateTime(new Date());
      }
      return R.status(tbResGeneralInvestigationService.saveOrUpdate(tbResGeneralInvestigation));
      return tbResGeneralInvestigationService.saveOrUpdateBy(tbResGeneralInvestigation);
   }
   @ApiOperation(value = "白蚁普查-添加或者修改", notes = "白蚁普查-添加或者修改")
   @PostMapping(value = "/submitBatch")
   public R submit(@RequestBody TbResGeneralInvestigationParam tbResGeneralInvestigationParam) {
      return tbResGeneralInvestigationService.saveOrUpdateByBatch(tbResGeneralInvestigationParam);
   }
   @PostMapping("/remove")
   @ApiOperation(value = "物理删除", notes = "传入id")
   public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String id) {
      return R.status(tbResGeneralInvestigationService.removeById(id));
   public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
//      return R.status(tbResGeneralInvestigationService.removeBatchByIds(Arrays.asList(ids.split(","))));
      return R.status(tbResGeneralInvestigationService.removeByIds(Arrays.asList(ids.split(","))));
   }
   @PostMapping("/getInvestigationListByStateId")
   @ApiOperation(value = "根据状态id获取普查集合", notes = "传入id")
   public R getInvestigationListByStateId(String stateId){
      QueryWrapper queryWrapper = new QueryWrapper();
      queryWrapper.eq("\"tb_state_id\"",stateId);
      List<TbResGeneralInvestigation> list = tbResGeneralInvestigationService.list(queryWrapper);
      return R.data(list);
   }
}