潘志宝
2 天以前 0a7d0fda65fc792d4549c266001f890c1a201e16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?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 &gt;= #{startTime}
            </if>
            <if test="params.endTime != null and params.endTime != ''">
                and t.time &lt;= #{endTime}
            </if>
        </where>
        order by t.time desc
 
    </select>
</mapper>