| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.yssh.entity.WarningDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yssh.entity.vo.WarningVo; |
| | | |
| | | @Mapper |
| | | public interface WarningDetailMapper extends BaseMapper{ |
| | | public interface WarningDetailMapper extends BaseMapper { |
| | | |
| | | //List<WarningVo> getRunTimeAlarmAnalyse(); |
| | | |
| | | |
| | | //@Param("startTime") Date startTime, |
| | | List<WarningVo> selectWarningDetailByType(@Param("type") Integer type); |
| | | |
| | | |
| | | List<WarningVo> selectWarningDetailByMap(Map<String, Object> param); |
| | | |
| | | List<Map<String, Object>> selectWarningDayCountByMap(Map<String, Object> param); |
| | | |
| | | List<WarningDetail> selectByTime(@Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public List<WarningVo> getAlarmAndWarnByTime(Date begin, Date end) { |
| | | String startTime = ymdhms.format(begin); |
| | | String endTime = ymdhms.format(end); |
| | | |
| | | List<WarningDetail> rs = warningDetailMapper.selectByTime(startTime, endTime); |
| | | if (null == rs || rs.isEmpty()) { |
| | | return null; |
| | | } |
| | | |
| | | List<WarningVo> list = new ArrayList<>(); |
| | | for (WarningDetail wd : rs) { |
| | | String time = ymdh.format(wd.getCreateTime()); |
| | | list.add(new WarningVo(wd.getLocationName(), wd.getSuYuanId(), 0.0, 0.0, wd.getValue(), time)); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | public List<WarningVo> getAlarmAndWarnByTime_old(Date begin, Date end) { |
| | | List<WarningVo> list = new ArrayList<>(); |
| | | List<String> ids = CalculateUtils.assembleId(commonService.getCheckPoints3d()); |
| | | if (ids.size() == 0) { |
| | |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yssh.dao.WarningDetailMapper"> |
| | | |
| | | <resultMap id="WarningDetailResult" type="com.yssh.entity.WarningDetail"> |
| | | <id property="id" column="id" /> |
| | | <result property="tableName" column="table_name" /> |
| | |
| | | group by ct |
| | | order by ct asc; |
| | | </select> |
| | | |
| | | <select id="selectByTime" resultMap="WarningDetailResult"> |
| | | select * from warning_detail |
| | | where create_time between #{startTime} and #{endTime} |
| | | order by create_time; |
| | | </select> |
| | | |
| | | <insert id="batchInsert"> |
| | | INSERT INTO warning_detail (table_name, su_yuan_id, location_name, type, create_time, value)VALUES |
| | |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | |
| | | </mapper> |