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