Skip to content

Commit

Permalink
Fix the problem that alert records will persistent failed by dao.
Browse files Browse the repository at this point in the history
  • Loading branch information
wushengyeyouya committed Mar 2, 2022
1 parent 2293058 commit 99c761a
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,26 @@

<mapper namespace="com.webank.wedatasphere.streamis.jobmanager.manager.dao.StreamAlertMapper">

<resultMap id="StreamAlertRecordMap" type="com.webank.wedatasphere.streamis.jobmanager.manager.entity.StreamAlertRecord">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="alert_level" property="alertLevel" jdbcType="VARCHAR"/>
<result column="alert_user" property="alertUser" jdbcType="VARCHAR"/>
<result column="alert_msg" property="alertMsg" jdbcType="VARCHAR"/>
<result column="job_id" property="jobId" jdbcType="VARCHAR"/>
<result column="job_version_id" property="jobVersionId" jdbcType="TIMESTAMP"/>
<result column="task_id" property="taskId" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="VARCHAR"/>
<result column="status" property="status" jdbcType="VARCHAR"/>
<result column="error_msg" property="errorMsg" jdbcType="VARCHAR"/>
</resultMap>

<insert id="insert">
insert into linkis_stream_alert_record (alert_level,alert_user,alert_msg,job_id,job_version_id,task_id,create_time,status,error_msg) values
(#{alertLevel},#{alertUser},#{alertMsg},#{jobId},#{jobVersionId},#{taskId},#{createTime},#{status},#{error_msg})
(#{alertLevel},#{alertUser},#{alertMsg},#{jobId},#{jobVersionId},#{taskId},#{createTime},#{status},#{errorMsg})
</insert>

<select id="getAlertByJobIdAndVersion"
resultType="com.webank.wedatasphere.streamis.jobmanager.manager.entity.StreamAlertRecord">
resultMap="StreamAlertRecordMap">
select id, alert_level,alert_user,alert_msg,job_id,job_version_id,task_id,create_time,status,error_msg from linkis_stream_alert_record
where alert_user = #{username} and job_id = #{jobId} and job_version_id = #{versionId}
</select>
Expand Down

0 comments on commit 99c761a

Please sign in to comment.