潘志宝
3 天以前 10edab49cfd859ea4928c969da658b4a548f5b71
提交 | 用户 | 时间
0a7d0f 1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.iailab.module.model.mcs.sche.dao.StScheduleSchemeDao">
4
5     <select id="getAlarmAndSuggestPage" resultType="com.iailab.module.model.api.mcs.dto.StAlarmAndSuggestRespVO">
6         select
7         t.type,
8         t.title,
9         t.content,
10         t.time,
11         t.obj
12         from (
13                  select 'alarm' type, t1.title, t1.content, t1.alarm_time `time`, t1.alarm_obj obj
14                  from t_mm_predict_alarm_message t1
15                  UNION
16                  select 'suggest' type, t2.title, t2.content, t2.schedule_time `time`, t2.schedule_obj obj
17                  from t_st_schedule_suggest t2
18         ) t
19         <where>
20             <if test="params.obj != null and params.obj != ''">
10edab 21                 and t.obj = #{params.obj}
0a7d0f 22             </if>
10edab 23             <if test="params.startTime != null">
24                 and t.time &gt;= #{params.startTime}
0a7d0f 25             </if>
10edab 26             <if test="params.endTime != null">
27                 and t.time &lt;= #{params.endTime}
0a7d0f 28             </if>
29         </where>
30         order by t.time desc
31
32     </select>
33 </mapper>