blankk
2 years ago
11 changed files with 292 additions and 0 deletions
@ -0,0 +1,108 @@
@@ -0,0 +1,108 @@
|
||||
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.enums.BusinessType; |
||||
import com.ruoyi.common.utils.poi.ExcelUtil; |
||||
/** |
||||
* 水尺-测站信息Controller |
||||
* |
||||
* @author ruoyi |
||||
* @date 2022-06-28 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/system/info") |
||||
public class ScStationInfoController extends BaseController |
||||
{ |
||||
@Resource |
||||
private IScStationInfoService scStationInfoService; |
||||
|
||||
/** |
||||
* 查询列表 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:info:list')") |
||||
@RequestMapping("/list") |
||||
public R list(@RequestParam Map<String, Object> params){ |
||||
return scStationInfoService.queryPage(params); |
||||
} |
||||
|
||||
/** |
||||
* 获取详细信息 |
||||
*/ |
||||
@RequestMapping("/info/{id}") |
||||
@PreAuthorize("@ss.hasPermi('system:info:query')") |
||||
public R info(@PathVariable("id") Long id){ |
||||
ScStationInfo scStationInfo = scStationInfoService.getById(id); |
||||
|
||||
return R.ok().put("data", scStationInfo); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 导出列表 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:info:export')") |
||||
@Log(title = "列表", businessType = BusinessType.EXPORT) |
||||
@PostMapping("/export") |
||||
public void export(HttpServletResponse response, ScStationInfo scStationInfo) |
||||
{ |
||||
List<ScStationInfo> list = scStationInfoService.list(); |
||||
ExcelUtil<ScStationInfo> util = new ExcelUtil<ScStationInfo>(ScStationInfo.class); |
||||
util.exportExcel(response, list, "列表数据"); |
||||
} |
||||
|
||||
/** |
||||
* 新增 |
||||
*/ |
||||
@RequestMapping("/add") |
||||
@Log(title = "ScStationInfo", businessType = BusinessType.INSERT) |
||||
@PreAuthorize("@ss.hasPermi('system:info:add')") |
||||
public R add(@RequestBody ScStationInfo scStationInfo){ |
||||
scStationInfoService.save(scStationInfo); |
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 修改 |
||||
*/ |
||||
@RequestMapping("/edit") |
||||
@PreAuthorize("@ss.hasPermi('system:info:edit')") |
||||
@Log(title = "ScStationInfo", businessType = BusinessType.UPDATE) |
||||
public R edit(@RequestBody ScStationInfo scStationInfo){ |
||||
scStationInfoService.updateById(scStationInfo); |
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
*/ |
||||
@RequestMapping("/delete/{ids}") |
||||
@PreAuthorize("@ss.hasPermi('system:info:remove')") |
||||
@Log(title = "ScStationInfo", businessType = BusinessType.DELETE) |
||||
public R delete(@PathVariable Long[] ids){ |
||||
scStationInfoService.removeByIds(Arrays.asList(ids)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,70 @@
@@ -0,0 +1,70 @@
|
||||
package com.ruoyi.code.sctaationinfo.domain; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.*; |
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
import org.apache.commons.lang3.builder.ToStringStyle; |
||||
import com.ruoyi.common.annotation.Excel; |
||||
import java.io.Serializable; |
||||
import lombok.Data; |
||||
|
||||
|
||||
/** |
||||
* 水尺-测站信息对象 sc_station_info |
||||
* |
||||
* @author ruoyi |
||||
* @date 2022-06-28 |
||||
*/ |
||||
@Data |
||||
@TableName("sc_station_info") |
||||
public class ScStationInfo implements Serializable |
||||
{ |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** 测站id */ |
||||
@TableId(type = IdType.INPUT) |
||||
private Long id; |
||||
|
||||
/** 测站名称 */ |
||||
private String stnm; |
||||
|
||||
/** 经度 */ |
||||
private BigDecimal longitude; |
||||
|
||||
/** 纬度 */ |
||||
private BigDecimal latitude; |
||||
|
||||
/** 测站状态: 0正常,1信道故障,5站点关闭 */ |
||||
private String status; |
||||
|
||||
/** 测站编码 */ |
||||
private String staid; |
||||
|
||||
/** 河流 */ |
||||
private String rvnm; |
||||
|
||||
/** 水系 */ |
||||
private String hnnm; |
||||
|
||||
/** 流域 */ |
||||
private String bsnm; |
||||
|
||||
/** 站址 */ |
||||
private String stlc; |
||||
|
||||
/** 测站编码 */ |
||||
private String isState; |
||||
|
||||
/** 保证水位 */ |
||||
private BigDecimal bzsw; |
||||
|
||||
/** 摄像头编号 */ |
||||
@TableField(updateStrategy = FieldStrategy.IGNORED) |
||||
private String cameraSn; |
||||
|
||||
/** 删除标识0未删除,1已删除 */ |
||||
private String delFlag; |
||||
|
||||
|
||||
} |
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
package com.ruoyi.code.sctaationinfo.mapper; |
||||
|
||||
import java.util.List; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ruoyi.code.camera.domain.Camera; |
||||
import com.ruoyi.code.sctaationinfo.domain.ScStationInfo; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
|
||||
/** |
||||
* Mapper接口 |
||||
* |
||||
* @author ruoyi |
||||
* @date 2022-06-28 |
||||
*/ |
||||
@Mapper |
||||
public interface ScStationInfoMapper extends BaseMapper<ScStationInfo> |
||||
{ |
||||
} |
@ -0,0 +1,24 @@
@@ -0,0 +1,24 @@
|
||||
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; |
||||
|
||||
/** |
||||
* Service接口 |
||||
* |
||||
* @author ruoyi |
||||
* @date 2022-06-28 |
||||
*/ |
||||
public interface IScStationInfoService extends IService<ScStationInfo> |
||||
{ |
||||
/** |
||||
* 查询 |
||||
*/ |
||||
R queryPage(Map<String, Object> params); |
||||
|
||||
} |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
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.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; |
||||
import com.ruoyi.common.core.page.R; |
||||
import com.ruoyi.common.utils.Query; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
|
||||
/** |
||||
* Service业务层处理 |
||||
* |
||||
* @author ruoyi |
||||
* @date 2022-06-28 |
||||
*/ |
||||
@Service("scStationInfoService") |
||||
public class ScStationInfoServiceImpl extends ServiceImpl<ScStationInfoMapper, ScStationInfo> implements IScStationInfoService |
||||
{ |
||||
@Override |
||||
public R queryPage(Map<String, Object> params) { |
||||
IPage<ScStationInfo> page = this.page( |
||||
new Query<ScStationInfo>().getPage(params), |
||||
new QueryWrapper<ScStationInfo>() |
||||
); |
||||
|
||||
return R.ok().put("count", page.getTotal()).put("data", page.getRecords()); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
<!DOCTYPE mapper |
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.ruoyi.code.sctaationinfo.mapper.ScStationInfoMapper"> |
||||
|
||||
</mapper> |
Loading…
Reference in new issue