| | |
| | | delete from t_st_schedule_suggest |
| | | where schedule_time between #{startdate} and #{enddate} |
| | | </delete> |
| | | <select id="getLastSuggest" resultType="com.iailab.module.model.api.mcs.dto.ScheduleSuggestRespDTO"> |
| | | WITH t_st_schedule_suggest AS (SELECT *, |
| | | ROW_NUMBER() OVER ( PARTITION BY schedule_obj ORDER BY schedule_time DESC ) AS rn |
| | | FROM t_st_schedule_suggest |
| | | WHERE schedule_obj in |
| | | ('BFG_ALARM', 'COG_ALARM', 'LDG1_ALARM', 'LDG2_ALARM', 'LDGt_ALARM') |
| | | and schedule_time >= DATE_SUB(NOW(), INTERVAL 15 MINUTE )) |
| | | SELECT * |
| | | FROM t_st_schedule_suggest |
| | | WHERE rn = 1; |
| | | </select> |
| | | </mapper> |