风险预警提前处置
This commit is contained in:
parent
18d0411e1f
commit
b937ae32dd
|
|
@ -52,4 +52,10 @@ public interface BadWeatherMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int updateStatus(String id);
|
int updateStatus(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取天气预警
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
BadWeatherEntity getBadWeatherData();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,4 +36,10 @@ public interface BadWeatherService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int updateStatus(String id);
|
int updateStatus(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String getBadWeatherData();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,4 +45,14 @@ public class BadWeatherServiceImpl implements BadWeatherService {
|
||||||
public int updateStatus(String id) {
|
public int updateStatus(String id) {
|
||||||
return mapper.updateStatus(id);
|
return mapper.updateStatus(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getBadWeatherData() {
|
||||||
|
BadWeatherEntity bean = mapper.getBadWeatherData();
|
||||||
|
if (bean != null){
|
||||||
|
return "今日天气:"+bean.getWeather()+",最低温度:"+bean.getMinTemperature()+"℃,最高温度:"+bean.getMaxTemperature()+"℃,预警:"+bean.getWarning();
|
||||||
|
}else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,4 +73,15 @@
|
||||||
AND date >= CURDATE()
|
AND date >= CURDATE()
|
||||||
AND date < DATE_ADD(CURDATE(), INTERVAL 7 DAY)
|
AND date < DATE_ADD(CURDATE(), INTERVAL 7 DAY)
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getBadWeatherData" resultType="com.sercurityControl.proteam.dutyTask.domain.BadWeatherEntity">
|
||||||
|
SELECT id, date, weather, min_temperature as minTemperature, max_temperature as maxTemperature, warning
|
||||||
|
FROM
|
||||||
|
t_bad_weather
|
||||||
|
WHERE
|
||||||
|
is_active=1
|
||||||
|
and `status`=1
|
||||||
|
AND DATE (date) = CURDATE()
|
||||||
|
ORDER BY update_time desc
|
||||||
|
LIMIT 1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue