|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
<mapper namespace="com.monitor.mysql.mapper.TaskSheduleMapper">
|
|
|
<resultMap id="BaseResultMap" type="com.model.TaskModel">
|
|
|
<id column="id" property="id" jdbcType="INTEGER"/>
|
|
|
<result column="alarm_interval" property="interval" jdbcType="INTEGER"/>
|
|
|
<result column="relax_start_time" property="relaxStartTime" jdbcType="INTEGER"/>
|
|
|
<result column="relax_end_time" property="relaxEndTime" jdbcType="INTEGER"/>
|
|
|
<result column="time_flag" property="timeFlag" jdbcType="INTEGER"/>
|
|
|
<result column="alarm_type" property="alarmType" jdbcType="INTEGER"/>
|
|
|
<result column="alarm_num_flag" property="alarmNumFlag" jdbcType="INTEGER"/>
|
|
|
<result column="is_run" property="isRun" jdbcType="INTEGER"/>
|
|
|
<result column="is_on" property="isOn" jdbcType="INTEGER"/>
|
|
|
<result column="continuous_alarm_times" property="alarmTimes" jdbcType="INTEGER"/>
|
|
|
<result column="fields" property="fields" jdbcType="VARCHAR"/>
|
|
|
<result column="tags" property="tags" jdbcType="VARCHAR"/>
|
|
|
<result column="influxdbs" property="influxdbs" jdbcType="VARCHAR"/>
|
|
|
<result column="influx_sql" property="influxSql" jdbcType="VARCHAR"/>
|
|
|
<result column="mobile" property="mobile" jdbcType="VARCHAR"/>
|
|
|
<result column="sms" property="sms" jdbcType="VARCHAR"/>
|
|
|
<result column="type" property="type" jdbcType="VARCHAR"/>
|
|
|
<result column="inf_database" property="database" jdbcType="VARCHAR"/>
|
|
|
<result column="description" property="description" jdbcType="VARCHAR"/>
|
|
|
<result column="last_time" property="lastTime"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="selectById" resultMap="BaseResultMap" parameterType="java.lang.Integer">
|
|
|
select
|
|
|
*
|
|
|
from task_shedule
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectAll" resultMap="BaseResultMap">
|
|
|
select
|
|
|
*
|
|
|
from task_shedule
|
|
|
</select>
|
|
|
|
|
|
<select id="selectByPage" resultMap="BaseResultMap">
|
|
|
select
|
|
|
*
|
|
|
from task_shedule
|
|
|
order by id
|
|
|
limit #{startIndex},#{pageSize}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCount" resultType="java.lang.Integer">
|
|
|
select
|
|
|
count(1)
|
|
|
from task_shedule
|
|
|
</select>
|
|
|
|
|
|
<delete id="deleteById" parameterType="java.lang.Integer">
|
|
|
delete from task_shedule
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
|
|
|
<update id="updateByid" parameterType="com.model.TaskModel">
|
|
|
update task_shedule
|
|
|
set alarm_interval = #{interval,jdbcType=INTEGER},
|
|
|
relax_start_time = #{relaxStartTime,jdbcType=INTEGER},
|
|
|
time_flag = #{timeFlag,jdbcType=INTEGER},
|
|
|
relax_end_time = #{relaxEndTime,jdbcType=INTEGER},
|
|
|
alarm_type = #{alarmType,jdbcType=INTEGER},
|
|
|
alarm_num_flag = #{alarmNumFlag,jdbcType=INTEGER},
|
|
|
is_on = #{isOn,jdbcType=INTEGER},
|
|
|
fields = #{fields,jdbcType=VARCHAR},
|
|
|
tags = #{tags,jdbcType=VARCHAR},
|
|
|
influxdbs = #{influxdbs,jdbcType=VARCHAR},
|
|
|
influx_sql = #{influxSql,jdbcType=VARCHAR},
|
|
|
mobile = #{mobile,jdbcType=VARCHAR},
|
|
|
sms = #{sms,jdbcType=VARCHAR},
|
|
|
type = #{type,jdbcType=VARCHAR},
|
|
|
description = #{description,jdbcType=VARCHAR},
|
|
|
inf_database = #{database,jdbcType=VARCHAR}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
<insert id="insert" parameterType="com.model.TaskModel">
|
|
|
insert into task_shedule
|
|
|
(alarm_interval,
|
|
|
relax_start_time,
|
|
|
time_flag,
|
|
|
relax_end_time,
|
|
|
alarm_num_flag,
|
|
|
alarm_type,
|
|
|
is_on,
|
|
|
fields,
|
|
|
tags,
|
|
|
influxdbs,
|
|
|
influx_sql,
|
|
|
mobile,
|
|
|
sms,
|
|
|
type ,
|
|
|
inf_database,
|
|
|
description)
|
|
|
values
|
|
|
(#{interval,jdbcType=INTEGER},
|
|
|
#{relaxStartTime,jdbcType=INTEGER},
|
|
|
#{timeFlag,jdbcType=INTEGER},
|
|
|
#{relaxEndTime,jdbcType=INTEGER},
|
|
|
#{alarmNumFlag,jdbcType=INTEGER},
|
|
|
#{alarmType,jdbcType=INTEGER},
|
|
|
#{isOn,jdbcType=INTEGER},
|
|
|
#{fields,jdbcType=VARCHAR},
|
|
|
#{tags,jdbcType=VARCHAR},
|
|
|
#{influxdbs,jdbcType=VARCHAR},
|
|
|
#{influxSql,jdbcType=VARCHAR},
|
|
|
#{mobile,jdbcType=VARCHAR},
|
|
|
#{sms,jdbcType=VARCHAR},
|
|
|
#{type,jdbcType=VARCHAR},
|
|
|
#{database,jdbcType=VARCHAR},
|
|
|
#{description,jdbcType=VARCHAR}
|
|
|
)
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateLastTime" parameterType="java.lang.Integer">
|
|
|
update task_shedule
|
|
|
set last_time = now()
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
</mapper> |
|
|
\ No newline at end of file |
...
|
...
|
|