dongyukun
2025-01-24 ae3258f8191e911c697249476747d016a75922c5
提交 | 用户 | 时间
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>
e03772 23             <if test="params.type != null and params.type != ''">
24                 and t.type = #{params.type}
25             </if>
ae3258 26             <if test="params.objs != null and !params.objs.isEmpty()">
D 27                 and t.obj in
28                 <foreach item="obj" collection="params.objs" open="(" separator="," close=")">
29                     #{obj}
30                 </foreach>
31             </if>
10edab 32             <if test="params.startTime != null">
33                 and t.time &gt;= #{params.startTime}
0a7d0f 34             </if>
10edab 35             <if test="params.endTime != null">
36                 and t.time &lt;= #{params.endTime}
0a7d0f 37             </if>
ecb7d3 38             <if test="params.objList != null">
L 39                 and t.obj in
40                 <foreach collection="params.objList" item="item" open="(" close=")" separator=",">
41                     #{item}
42                 </foreach>
43             </if>
0a7d0f 44         </where>
45         order by t.time desc
46
47     </select>
48 </mapper>