| | |
| | | public class AlarmGetVO extends AlarmGet { |
| | | private String cdName; |
| | | |
| | | private String cdWyName; |
| | | |
| | | private String startTime; |
| | | private String endTime; |
| | | |
| | |
| | | </if> |
| | | AND dam_id = #{vo.damId} |
| | | </select> |
| | | |
| | | <select id="getAlarmDetailPage" resultType="cn.gistack.nky.vo.AlarmGetVO"> |
| | | SELECT temp.*,awcb."cd_nm" as cdWyName FROM |
| | | ( |
| | | SELECT |
| | | NAG.ID, |
| | | NAG.DAM_ID, |
| | | NAG.POINT_ID, |
| | | acb."cd_nm" as cdName, |
| | | NAG.TYPE, |
| | | ( |
| | | CASE |
| | | WHEN NAG.TYPE=1 THEN '渗压' |
| | | WHEN NAG.TYPE=2 THEN '渗流' |
| | | WHEN (NAG.TYPE=3 OR NAG.TYPE=4 OR NAG.TYPE=5) THEN '位移' |
| | | END) AS typeName, |
| | | NAG."TIME",NAG."VALUE",NAG."DESC",NAG.CREATE_TIME,NAG.TASK_CATEGORY,NAG."LEVEL",NAG.BAOJINGZHI,NAG.ORIGIN_ID, |
| | | NAG.ID, |
| | | NAG.DAM_ID, |
| | | NAG.POINT_ID, |
| | | acb."cd_nm" as cdName, |
| | | NAG.TYPE, |
| | | ( |
| | | CASE |
| | | WHEN NAG.TYPE=1 THEN '渗压' |
| | | WHEN NAG.TYPE=2 THEN '渗流' |
| | | WHEN (NAG.TYPE=3 OR NAG.TYPE=4 OR NAG.TYPE=5) THEN '位移' |
| | | END) AS typeName, |
| | | NAG."TIME",NAG."VALUE",NAG."DESC",NAG.CREATE_TIME,NAG.TASK_CATEGORY,NAG."LEVEL",NAG.BAOJINGZHI,NAG.ORIGIN_ID, |
| | | NAG.FORWARD,NAG."REVERSE",NAG.RATIO,NAG.STATUS |
| | | |
| | | FROM YWXT.NKY_ALARM_GET NAG |
| | |
| | | AND NAG.type = #{vo.type} |
| | | </if> |
| | | <if test="vo.type != null and vo.type !='' and vo.type == 3"> |
| | | AND (NAG.type = '3' or NAG.type = '4' orNAG. type = '5') |
| | | AND (NAG.type = '3' or NAG.type = '4' or NAG. type = '5') |
| | | </if> |
| | | <if test="vo.pointId != null and vo.pointId !='' "> |
| | | AND NAG.POINT_id = #{vo.pointId} |
| | |
| | | AND acb."cd_nm" LIKE CONCAT('%',#{vo.cdName},'%') |
| | | </if> |
| | | AND NAG.dam_id = #{vo.damId} |
| | | ORDER BY NAG."time" DESC |
| | | )temp |
| | | LEFT JOIN SJZT_MD."att_wy_cd_base" awcb ON awcb."res_cd" = temp.DAM_ID AND temp.POINT_ID = awcb."cd" |
| | | |
| | | |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | @Override |
| | | public IPage<AlarmGetVO> getAlarmDetailPage(IPage<AlarmGetVO> page, AlarmGetVO alarmGet) { |
| | | return page.setRecords(baseMapper.getAlarmDetailPage(page,alarmGet)); |
| | | |
| | | |
| | | return page.setRecords(baseMapper.getAlarmDetailPage(page,alarmGet)); |
| | | } |
| | | |
| | | /** |
| | |
| | | List<LevelPo> getLevelList(@Param("dam") DamMonitor damMonitor); |
| | | |
| | | List<AlarmGetVO> pageMonitor(@Param("page") IPage<AlarmGetVO> page, @Param("vo") AlarmGetVO alarmGet); |
| | | |
| | | List<AlarmGetVO> pageMonitorWy(IPage<AlarmGetVO> page, @Param("vo") AlarmGetVO alarmGet); |
| | | } |
| | |
| | | ORDER BY NAG.TIME DESC |
| | | |
| | | </select> |
| | | <select id="pageMonitorWy" resultType="cn.gistack.nky.vo.AlarmGetVO"> |
| | | |
| | | SELECT |
| | | NAG.ID, |
| | | NAG.DAM_ID, |
| | | NAG.POINT_ID, |
| | | NAG.TYPE, |
| | | ( |
| | | CASE |
| | | WHEN NAG.TYPE=1 THEN '渗压' |
| | | WHEN NAG.TYPE=2 THEN '渗流' |
| | | WHEN (NAG.TYPE=3 OR NAG.TYPE=4 OR NAG.TYPE=5) THEN '位移' |
| | | END) AS typeName, |
| | | NAG.TIME, |
| | | NAG.VALUE, |
| | | NAG."DESC", |
| | | NAG.CREATE_TIME, |
| | | NAG.TASK_CATEGORY, |
| | | NAG.LEVEL, |
| | | NAG.BAOJINGZHI, |
| | | NAG.ORIGIN_ID, |
| | | NAG.FORWARD, |
| | | NAG."REVERSE", |
| | | NAG.RATIO, |
| | | NAG.STATUS, |
| | | province."guid" as provinceCode, |
| | | province."ad_name" as provinceName, |
| | | city."guid" as cityCode, |
| | | city."ad_name" as cityName, |
| | | county."guid" as countyCode, |
| | | county."ad_name" as countyName, |
| | | |
| | | arb."name" as reservoirName, |
| | | awcb."cd_nm" as cdName |
| | | |
| | | FROM NKY_ALARM_GET NAG |
| | | |
| | | LEFT JOIN SJZT_MD."att_res_base" arb ON arb."guid" = NAG.DAM_ID |
| | | LEFT JOIN SJZT_MD."att_ad_base" town ON town."guid" = arb."interior_ad_guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" county ON county."guid" = town."p_ad_code" |
| | | LEFT JOIN SJZT_MD."att_ad_base" city ON city."guid" = county."p_ad_code" |
| | | LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code" |
| | | |
| | | |
| | | LEFT JOIN SJZT_MD."rel_res_bas_loc" rrbl ON rrbl."res_guid" = NAG.DAM_ID |
| | | |
| | | LEFT JOIN SJZT_MD."att_bas_base" abb ON abb."code" = rrbl."bas_guid" |
| | | LEFT JOIN SJZT_MD."att_bas_base" pabb ON abb."p_code" = pabb."code" |
| | | LEFT JOIN SJZT_MD."att_wy_cd_base" awcb ON awcb."res_cd" = NAG.DAM_ID AND NAG.POINT_ID = awcb."cd" |
| | | WHERE 1=1 |
| | | <if test=" vo.adCode != null and vo.adCode !='' "> |
| | | AND (province."ad_code" =#{vo.adCode} or city."ad_code" = #{vo.adCode} or county."ad_code" = #{vo.adCode}) |
| | | </if> |
| | | |
| | | <if test="vo.startTime != null and vo.startTime != ''"> |
| | | AND DATE_FORMAT(NAG.time,'%Y-%m-%d') >= #{vo.startTime} |
| | | </if> |
| | | |
| | | <if test="vo.endTime != null and vo.endTime !='' "> |
| | | AND DATE_FORMAT(NAG.time,'%Y-%m-%d') <= #{vo.endTime} |
| | | </if> |
| | | |
| | | <if test="vo.level != null and vo.level !='' "> |
| | | AND NAG.level = #{vo.level} |
| | | </if> |
| | | |
| | | <if test="vo.status != null and vo.status !='' "> |
| | | AND NAG.status = #{vo.status} |
| | | </if> |
| | | <if test="vo.type != null and vo.type !='' and vo.type == 3"> |
| | | AND (NAG.type = '3' or NAG.type = '4' or NAG.type = '5') |
| | | </if> |
| | | |
| | | <if test="vo.pointId != null and vo.pointId !='' "> |
| | | AND NAG.POINT_id = #{vo.pointId} |
| | | </if> |
| | | |
| | | <if test="vo.basGuids != null and vo.basGuids !='' "> |
| | | AND( |
| | | abb."code" in |
| | | <foreach collection="vo.basGuids.split(',')" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | or pabb."code" in |
| | | <foreach collection="vo.basGuids.split(',')" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | |
| | | <if test="vo.labels != null and vo.labels != '' "> |
| | | AND( 1!=1 |
| | | <foreach collection="vo.labels.split(',')" item="item" open="" separator="" close="" index="index"> |
| | | OR #{item} in (arb."label") |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | |
| | | <if test="vo.engScal != null and vo.engScal !='' "> |
| | | AND arb."eng_scal" = #{vo.engScal} |
| | | </if> |
| | | ORDER BY NAG.TIME DESC |
| | | |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | |
| | | @Override |
| | | public IPage<AlarmGetVO> pageMonitor(AlarmGetVO alarmGet, IPage<AlarmGetVO> page) { |
| | | List<AlarmGetVO> list = damSecurityMapper.pageMonitor(page,alarmGet); |
| | | return page.setRecords(list); |
| | | |
| | | //位移 |
| | | if (alarmGet.getType().equals("3")){ |
| | | List<AlarmGetVO> list = damSecurityMapper.pageMonitorWy(page,alarmGet); |
| | | return page.setRecords(list); |
| | | }else{ |
| | | List<AlarmGetVO> list = damSecurityMapper.pageMonitor(page,alarmGet); |
| | | return page.setRecords(list); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { |
| | | return R.data(dbReportService.removeBatchByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | //获取最新上报数据 |
| | | @GetMapping("/getLatestList") |
| | | public R getLatestList(DbReportVO dbReport){ |
| | | return R.data(dbReportService.getLatestList(dbReport)); |
| | | } |
| | | } |
| | |
| | | //监测值 |
| | | private String val; |
| | | |
| | | //水平监测值 |
| | | private String deVal; |
| | | |
| | | //上下监测值 |
| | | private String dnVal; |
| | | |
| | | //位移垂直监测值 |
| | | private String duVal; |
| | | |
| | | //描述 |
| | | private String description; |
| | | } |
| | |
| | | |
| | | public interface DbReportMapper extends BaseMapper<DbReport> { |
| | | List<DbReportVO> getPage(@Param("page") IPage<DbReportVO> page, @Param("db") DbReportVO dbReport); |
| | | |
| | | List<DbReportVO> getDayList(@Param("vo") DbReportVO dbReport); |
| | | |
| | | DbReport getRecordTimeData(@Param("entity") DbReport entity); |
| | | } |
| | |
| | | </if> |
| | | ORDER BY sdr.create_time DESC |
| | | </select> |
| | | <select id="getDayList" resultType="cn.gistack.sm.jcsb.vo.DbReportVO"> |
| | | |
| | | SELECT |
| | | SDR.ID,SDR.RESERVOIR_NAME, |
| | | SDR.RESERVOIR_ID, |
| | | SDR.TYPE, |
| | | SDR.STATION_ID,acb.stationName, |
| | | DATE_FORMAT(sdr.record_time,'%Y-%m-%d') AS record_time, |
| | | SDR.VAL,SDR.DE_VAL,SDR.DN_VAL,SDR.DU_VAL |
| | | FROM SM_DB_REPORT SDR |
| | | LEFT JOIN SJZT_MD."att_cd_base" acb ON acb."res_cd" = sdr.reservoir_id and acb."cd" = SDR.station_id |
| | | WHERE SDR.IS_DELETED = 0 |
| | | <if test="vo.type != null and vo.type != ''"> |
| | | AND SDR.TYPE = #{vo.type} |
| | | </if> |
| | | <if test="db.startTime !=null and db.startTime !=''"> |
| | | AND DATE_FORMAT(sdr.record_time,'%Y-%m-%d') >= #{db.startTime} |
| | | </if> |
| | | <if test="db.endTime !=null and db.endTime !=''"> |
| | | AND DATE_FORMAT(sdr.record_time,'%Y-%m-%d') <= #{db.endTime} |
| | | </if> |
| | | <if test="vo.ch != null and vo.ch != ''"> |
| | | AND acb."ch" = #{vo.ch} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | <select id="getRecordTimeData" resultType="cn.gistack.sm.jcsb.entity.DbReport"> |
| | | |
| | | SELECT * FROM SM_DB_REPORT |
| | | WHERE |
| | | is_deleted = 0 |
| | | AND RESERVOIR_ID = #{entity.reservoirId} |
| | | AND type = #{entity.type} |
| | | AND station_id = #{entity.stationId} |
| | | AND DATE_FORMAT(record_time,'%Y-%m-%d') = DATE_FORMAT(#{entity.recordTime},'%Y-%m-%d') |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IDbReportService extends BaseService<DbReport> { |
| | | IPage<DbReportVO> selectPage(IPage<DbReportVO> page, DbReportVO dbReport); |
| | | |
| | | List<DbReportVO> getLatestList(DbReportVO dbReport); |
| | | } |
| | |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class DbReportServiceImpl extends BaseServiceImpl<DbReportMapper, DbReport> implements IDbReportService { |
| | | @Override |
| | | public IPage<DbReportVO> selectPage(IPage<DbReportVO> page, DbReportVO dbReport) { |
| | | return page.setRecords(baseMapper.getPage(page,dbReport)); |
| | | } |
| | | |
| | | @Override |
| | | public List<DbReportVO> getLatestList(DbReportVO dbReport) { |
| | | |
| | | List<DbReportVO> list = new ArrayList<>(); |
| | | if (dbReport.getTimeFlag().equals("day")){ |
| | | if (dbReport.getType().equals("3")){ |
| | | //位移 |
| | | }else{ |
| | | list = baseMapper.getDayList(dbReport); |
| | | } |
| | | |
| | | }else if (dbReport.getTimeFlag().equals("year")){ |
| | | |
| | | } |
| | | return list; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public boolean save(DbReport entity) { |
| | | |
| | | //先判断上报时间当天是否有 |
| | | DbReport dbReport = baseMapper.getRecordTimeData(entity); |
| | | |
| | | return super.save(entity); |
| | | } |
| | | } |
| | |
| | | |
| | | //测站名称 |
| | | private String stationName; |
| | | |
| | | private String timeFlag; |
| | | |
| | | //断面 |
| | | private String ch; |
| | | } |