潘志宝
3 天以前 af7bd200a95b9fc6b8b3f3fc603d612221e21fc7
提交 | 用户 | 时间
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 != ''">
21                 and t.obj = #{obj}
22             </if>
23             <if test="params.startTime != null and params.startTime != ''">
24                 and t.time &gt;= #{startTime}
25             </if>
26             <if test="params.endTime != null and params.endTime != ''">
27                 and t.time &lt;= #{endTime}
28             </if>
29         </where>
30         order by t.time desc
31
32     </select>
33 </mapper>