Compare commits
2 Commits
95a1b587e1
...
9d57c5d13f
Author | SHA1 | Date |
---|---|---|
yx | 9d57c5d13f | 2 years ago |
yx | d40782ca21 | 2 years ago |
12 changed files with 479 additions and 0 deletions
@ -0,0 +1,109 @@
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.code.camera.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.common.core.page.R; |
||||
import com.ruoyi.common.core.page.TableDataInfo; |
||||
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.code.camera.domain.ScStationInfo; |
||||
import com.ruoyi.code.camera.service.IScStationInfoService; |
||||
import com.ruoyi.common.utils.poi.ExcelUtil; |
||||
/** |
||||
* 水尺-测站信息Controller |
||||
* |
||||
* @author ruoyi |
||||
* @date 2022-06-29 |
||||
*/ |
||||
@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,40 @@
@@ -0,0 +1,40 @@
|
||||
package com.ruoyi.code.camera.controller; |
||||
|
||||
import com.ruoyi.code.camera.service.IWaterPhotoInfoService; |
||||
import com.ruoyi.common.annotation.Log; |
||||
import com.ruoyi.common.core.controller.BaseController; |
||||
import com.ruoyi.common.core.page.R; |
||||
import com.ruoyi.common.core.page.TableDataInfo; |
||||
import com.ruoyi.common.enums.BusinessType; |
||||
import com.ruoyi.common.utils.poi.ExcelUtil; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
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 |
||||
* |
||||
* @author ruoyi |
||||
* @date 2022-06-29 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/system/photoinfo") |
||||
public class WaterPhotoInfoController extends BaseController |
||||
{ |
||||
@Autowired |
||||
private IWaterPhotoInfoService waterPhotoInfoService; |
||||
/** |
||||
* 查询列表 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:photo:list')") |
||||
@RequestMapping("/list") |
||||
public R list(@RequestParam Map<String, Object> params){ |
||||
return waterPhotoInfoService.queryPage(params); |
||||
} |
||||
} |
@ -0,0 +1,70 @@
@@ -0,0 +1,70 @@
|
||||
package com.ruoyi.code.camera.domain; |
||||
|
||||
import java.math.BigDecimal; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
import org.apache.commons.lang3.builder.ToStringStyle; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.ruoyi.common.annotation.Excel; |
||||
import java.io.Serializable; |
||||
import lombok.Data; |
||||
|
||||
|
||||
/** |
||||
* 水尺-测站信息对象 sc_station_info |
||||
* |
||||
* @author ruoyi |
||||
* @date 2022-06-29 |
||||
*/ |
||||
@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; |
||||
|
||||
/** 摄像头编号 */ |
||||
private String cameraSn; |
||||
|
||||
/** 删除标识0未删除,1已删除 */ |
||||
private String delFlag; |
||||
|
||||
|
||||
} |
@ -0,0 +1,55 @@
@@ -0,0 +1,55 @@
|
||||
package com.ruoyi.code.camera.domain; |
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
|
||||
|
||||
/** |
||||
* 水尺-图片信息map |
||||
* |
||||
* @author ruoyi |
||||
* @date 2022-06-29 |
||||
*/ |
||||
@Data |
||||
|
||||
public class WaterPhotoInfo implements Serializable |
||||
{ |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** 测站id */ |
||||
@TableId(type = IdType.INPUT) |
||||
private Long id; |
||||
|
||||
/** 测站名称 */ |
||||
private String stnm; |
||||
|
||||
/** 地址*/ |
||||
private String ip; |
||||
|
||||
/** 水位 */ |
||||
private String value; |
||||
|
||||
/** 时间*/ |
||||
private String tm; |
||||
|
||||
/** 图片地址 */ |
||||
@JSONField(name = "img_name") |
||||
private String imgName; |
||||
|
||||
/** 水位计名称*/ |
||||
private String name; |
||||
|
||||
/** 起始时间*/ |
||||
private String startTime; |
||||
|
||||
/** 结束时间*/ |
||||
|
||||
private String endTime; |
||||
|
||||
} |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
package com.ruoyi.code.camera.mapper; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import com.ruoyi.code.camera.domain.ScStationInfo; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
/** |
||||
* Mapper接口 |
||||
* |
||||
* @author ruoyi |
||||
* @date 2022-06-29 |
||||
*/ |
||||
@Mapper |
||||
public interface ScStationInfoMapper extends BaseMapper<ScStationInfo> |
||||
{ |
||||
|
||||
} |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
package com.ruoyi.code.camera.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.ruoyi.code.camera.domain.ScStationInfo; |
||||
import com.ruoyi.code.camera.domain.WaterPhotoInfo; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* Mapper接口 |
||||
* |
||||
* @author ruoyi |
||||
* @date 2022-06-29 |
||||
*/ |
||||
@Mapper |
||||
public interface WaterPhotoInfoMapper extends BaseMapper<WaterPhotoInfo> |
||||
{ |
||||
IPage<WaterPhotoInfo> queryPhotoList(Page page, @Param("params") Map<String, Object> params); |
||||
} |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
package com.ruoyi.code.camera.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ruoyi.common.core.page.R; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import com.ruoyi.code.camera.domain.ScStationInfo; |
||||
|
||||
/** |
||||
* Service接口 |
||||
* |
||||
* @author ruoyi |
||||
* @date 2022-06-29 |
||||
*/ |
||||
public interface IScStationInfoService extends IService<ScStationInfo> |
||||
{ |
||||
/** |
||||
* 查询 |
||||
*/ |
||||
R queryPage(Map<String, Object> params); |
||||
|
||||
} |
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.code.camera.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
import com.ruoyi.code.camera.domain.WaterPhotoInfo; |
||||
import com.ruoyi.common.core.page.R; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* Service接口 |
||||
* |
||||
* @author ruoyi |
||||
* @date 2022-06-29 |
||||
*/ |
||||
public interface IWaterPhotoInfoService extends IService<WaterPhotoInfo> |
||||
{ |
||||
|
||||
R queryPage(Map<String, Object> params); |
||||
|
||||
} |
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
package com.ruoyi.code.camera.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.common.core.page.R; |
||||
import com.ruoyi.common.utils.Query; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
import com.ruoyi.code.camera.mapper.ScStationInfoMapper; |
||||
import com.ruoyi.code.camera.domain.ScStationInfo; |
||||
import com.ruoyi.code.camera.service.IScStationInfoService; |
||||
|
||||
/** |
||||
* Service业务层处理 |
||||
* |
||||
* @author ruoyi |
||||
* @date 2022-06-29 |
||||
*/ |
||||
@Service("scStationInfoService") |
||||
public class ScStationInfoServiceImpl extends ServiceImpl<ScStationInfoMapper, ScStationInfo> implements IScStationInfoService |
||||
{ |
||||
@Autowired |
||||
private ScStationInfoMapper scStationInfoMapper; |
||||
@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,42 @@
@@ -0,0 +1,42 @@
|
||||
package com.ruoyi.code.camera.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.ruoyi.code.camera.domain.WaterPhotoInfo; |
||||
import com.ruoyi.code.camera.mapper.WaterPhotoInfoMapper; |
||||
import com.ruoyi.code.camera.service.IWaterPhotoInfoService; |
||||
import com.ruoyi.common.core.page.R; |
||||
import com.ruoyi.common.utils.Query; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.Collection; |
||||
import java.util.Map; |
||||
import java.util.function.Function; |
||||
|
||||
/** |
||||
* Service业务层处理 |
||||
* |
||||
* @author ruoyi |
||||
* @date 2022-06-29 |
||||
*/ |
||||
@Service("waterPhotoInfoService") |
||||
public class WaterPhotoInfoServiceImpl extends ServiceImpl<WaterPhotoInfoMapper, WaterPhotoInfo> implements IWaterPhotoInfoService |
||||
{ |
||||
|
||||
|
||||
@Override |
||||
public R queryPage(Map<String, Object> params) { |
||||
|
||||
IPage<WaterPhotoInfo> page = baseMapper.queryPhotoList( |
||||
new Query<WaterPhotoInfo>().getPage(params), |
||||
params |
||||
); |
||||
|
||||
return R.ok().put("count", page.getTotal()).put("data", page.getRecords()); |
||||
|
||||
} |
||||
} |
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
<?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.camera.mapper.ScStationInfoMapper"> |
||||
|
||||
|
||||
</mapper> |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
<?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.camera.mapper.WaterPhotoInfoMapper"> |
||||
|
||||
|
||||
<select id="queryPhotoList" resultType="com.ruoyi.code.camera.domain.WaterPhotoInfo" > |
||||
|
||||
select w.stnm_id,s.stnm,c.ip,w.value,w.tm,w.img_name |
||||
from sc_station_info s |
||||
left join camera c on s.camera_sn = c.devsn |
||||
left join sc_water_data w on s.id = w.stnm_id |
||||
|
||||
<if test="params.stnm !=null and params.stnm !=''">and s.stnm like concat('%',#{params.stnm},'%')</if> |
||||
<if test="params.name !=null and params.name !=''">and c.name like concat('%',#{params.name},'%')</if> |
||||
<if test="params.startTime != null and params.startTime !=''"> and w.tm >= #{params.startTime }</if> |
||||
<if test="params.endTime != null and params.endTime !=''"> and w.tm <= #{params.endTime}</if> |
||||
|
||||
</select> |
||||
|
||||
</mapper> |
Loading…
Reference in new issue