Browse Source

优化

master
blankk 2 years ago
parent
commit
51fa1451a7
  1. 33
      ruoyi-code/src/main/java/com/ruoyi/code/sctaationinfo/controller/ScStationInfoController.java
  2. 3
      ruoyi-code/src/main/java/com/ruoyi/code/sctaationinfo/service/IScStationInfoService.java
  3. 14
      ruoyi-code/src/main/java/com/ruoyi/code/sctaationinfo/service/impl/ScStationInfoServiceImpl.java

33
ruoyi-code/src/main/java/com/ruoyi/code/sctaationinfo/controller/ScStationInfoController.java

@ -1,30 +1,20 @@ @@ -1,30 +1,20 @@
package com.ruoyi.code.sctaationinfo.controller;
import java.util.List;
import java.util.Arrays;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import javax.annotation.Resource;
import com.ruoyi.code.camera.domain.Camera;
import com.ruoyi.code.sctaationinfo.domain.ScStationInfo;
import com.ruoyi.code.sctaationinfo.service.IScStationInfoService;
import com.ruoyi.common.core.page.R;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.R;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 水尺-测站信息Controller
*
@ -47,6 +37,11 @@ public class ScStationInfoController extends BaseController @@ -47,6 +37,11 @@ public class ScStationInfoController extends BaseController
return scStationInfoService.queryPage(params);
}
@RequestMapping("/listAll")
public R listAll(){
return scStationInfoService.listAll();
}
/**
* 获取详细信息
*/

3
ruoyi-code/src/main/java/com/ruoyi/code/sctaationinfo/service/IScStationInfoService.java

@ -1,11 +1,9 @@ @@ -1,11 +1,9 @@
package com.ruoyi.code.sctaationinfo.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.code.camera.domain.Camera;
import com.ruoyi.code.sctaationinfo.domain.ScStationInfo;
import com.ruoyi.common.core.page.R;
import java.util.List;
import java.util.Map;
/**
@ -21,4 +19,5 @@ public interface IScStationInfoService extends IService<ScStationInfo> @@ -21,4 +19,5 @@ public interface IScStationInfoService extends IService<ScStationInfo>
*/
R queryPage(Map<String, Object> params);
R listAll();
}

14
ruoyi-code/src/main/java/com/ruoyi/code/sctaationinfo/service/impl/ScStationInfoServiceImpl.java

@ -1,11 +1,8 @@ @@ -1,11 +1,8 @@
package com.ruoyi.code.sctaationinfo.service.impl;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.code.camera.domain.Camera;
import com.ruoyi.code.sctaationinfo.domain.ScStationInfo;
import com.ruoyi.code.sctaationinfo.mapper.ScStationInfoMapper;
import com.ruoyi.code.sctaationinfo.service.IScStationInfoService;
@ -13,6 +10,8 @@ import com.ruoyi.common.core.page.R; @@ -13,6 +10,8 @@ import com.ruoyi.common.core.page.R;
import com.ruoyi.common.utils.Query;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* Service业务层处理
@ -33,5 +32,12 @@ public class ScStationInfoServiceImpl extends ServiceImpl<ScStationInfoMapper, S @@ -33,5 +32,12 @@ public class ScStationInfoServiceImpl extends ServiceImpl<ScStationInfoMapper, S
return R.ok().put("count", page.getTotal()).put("data", page.getRecords());
}
@Override
public R listAll() {
LambdaQueryWrapper<ScStationInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.select(ScStationInfo::getStnm,ScStationInfo::getId);
return R.ok().put("data",baseMapper.selectList(wrapper));
}
}

Loading…
Cancel
Save