[DS-7227][refactor] optimize alert plugin instance list order (#7506)

[DS-7227][refactor] optimize alert plugin instance list order
query all alert plugin instance list order by update time desc
optimize `select *` sql in the AlterPluginInstanceMapper.xml
This commit is contained in:
Tom 2021-12-21 09:22:16 +08:00 committed by GitHub
parent 0d86a48d1c
commit bb140fbc3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 4 deletions

View File

@ -19,15 +19,22 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="org.apache.dolphinscheduler.dao.mapper.AlertPluginInstanceMapper">
<sql id="baseSql">
id, plugin_define_id, plugin_instance_params, create_time, update_time, instance_name
</sql>
<select id="queryAllAlertPluginInstanceList"
resultType="org.apache.dolphinscheduler.dao.entity.AlertPluginInstance">
select *
select
<include refid="baseSql"/>
from t_ds_alert_plugin_instance
where 1 = 1
where 1 = 1 order by update_time desc
</select>
<select id="queryByIds" resultType="org.apache.dolphinscheduler.dao.entity.AlertPluginInstance">
select *
select
<include refid="baseSql"/>
from t_ds_alert_plugin_instance
where id in
<foreach item="item" index="index" collection="ids"
@ -38,7 +45,7 @@
<select id="queryByInstanceNamePage" resultType="org.apache.dolphinscheduler.dao.entity.AlertPluginInstance">
select
*
<include refid="baseSql"/>
from t_ds_alert_plugin_instance
where 1 = 1
<if test="instanceName != null and instanceName != ''">