<?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.iailab.module.model.mcs.sche.dao.StScheduleSchemeDao">
|
|
<select id="getAlarmAndSuggestPage" resultType="com.iailab.module.model.api.mcs.dto.StAlarmAndSuggestRespVO">
|
select
|
t.type,
|
t.title,
|
t.content,
|
t.time,
|
t.obj
|
from (
|
select 'alarm' type, t1.title, t1.content, t1.alarm_time `time`, t1.alarm_obj obj
|
from t_mm_predict_alarm_message t1
|
UNION
|
select 'suggest' type, t2.title, t2.content, t2.schedule_time `time`, t2.schedule_obj obj
|
from t_st_schedule_suggest t2
|
) t
|
<where>
|
<if test="params.obj != null and params.obj != ''">
|
and t.obj = #{obj}
|
</if>
|
<if test="params.startTime != null and params.startTime != ''">
|
and t.time >= #{startTime}
|
</if>
|
<if test="params.endTime != null and params.endTime != ''">
|
and t.time <= #{endTime}
|
</if>
|
</where>
|
order by t.time desc
|
|
</select>
|
</mapper>
|