|
|
<?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.MechineInfoMapper" >
|
|
|
<resultMap id="BaseResultMap" type="com.model.MechineInfo" >
|
|
|
<id column="id" property="id" jdbcType="INTEGER" />
|
|
|
<result column="alias" property="alias" jdbcType="VARCHAR" />
|
|
|
<result column="host_ip" property="hostIp" jdbcType="VARCHAR" />
|
|
|
<result column="redis" property="redis" jdbcType="TINYINT" />
|
|
|
<result column="database" property="database" jdbcType="TINYINT" />
|
|
|
<result column="rabbitmq" property="rabbitmq" jdbcType="TINYINT" />
|
|
|
<result column="nginx" property="nginx" jdbcType="TINYINT" />
|
|
|
<result column="java_server" property="javaServer" jdbcType="TINYINT" />
|
|
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List" >
|
|
|
id, alias, host_ip, redis, database, rabbitmq, nginx, java_server, create_time, update_time
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from mechine_info
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
|
delete from mechine_info
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.model.MechineInfo" >
|
|
|
insert into mechine_info (id, alias, host_ip,
|
|
|
redis, database, rabbitmq,
|
|
|
nginx, java_server, create_time,
|
|
|
update_time)
|
|
|
values (#{id,jdbcType=INTEGER}, #{alias,jdbcType=VARCHAR}, #{hostIp,jdbcType=VARCHAR},
|
|
|
#{redis,jdbcType=TINYINT}, #{database,jdbcType=TINYINT}, #{rabbitmq,jdbcType=TINYINT},
|
|
|
#{nginx,jdbcType=TINYINT}, #{javaServer,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP},
|
|
|
#{updateTime,jdbcType=TIMESTAMP})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.model.MechineInfo" >
|
|
|
insert into mechine_info
|
|
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
<if test="id != null" >
|
|
|
id,
|
|
|
</if>
|
|
|
<if test="alias != null" >
|
|
|
alias,
|
|
|
</if>
|
|
|
<if test="hostIp != null" >
|
|
|
host_ip,
|
|
|
</if>
|
|
|
<if test="redis != null" >
|
|
|
redis,
|
|
|
</if>
|
|
|
<if test="database != null" >
|
|
|
database,
|
|
|
</if>
|
|
|
<if test="rabbitmq != null" >
|
|
|
rabbitmq,
|
|
|
</if>
|
|
|
<if test="nginx != null" >
|
|
|
nginx,
|
|
|
</if>
|
|
|
<if test="javaServer != null" >
|
|
|
java_server,
|
|
|
</if>
|
|
|
<if test="createTime != null" >
|
|
|
create_time,
|
|
|
</if>
|
|
|
<if test="updateTime != null" >
|
|
|
update_time,
|
|
|
</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
<if test="id != null" >
|
|
|
#{id,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="alias != null" >
|
|
|
#{alias,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="hostIp != null" >
|
|
|
#{hostIp,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="redis != null" >
|
|
|
#{redis,jdbcType=TINYINT},
|
|
|
</if>
|
|
|
<if test="database != null" >
|
|
|
#{database,jdbcType=TINYINT},
|
|
|
</if>
|
|
|
<if test="rabbitmq != null" >
|
|
|
#{rabbitmq,jdbcType=TINYINT},
|
|
|
</if>
|
|
|
<if test="nginx != null" >
|
|
|
#{nginx,jdbcType=TINYINT},
|
|
|
</if>
|
|
|
<if test="javaServer != null" >
|
|
|
#{javaServer,jdbcType=TINYINT},
|
|
|
</if>
|
|
|
<if test="createTime != null" >
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
<if test="updateTime != null" >
|
|
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.model.MechineInfo" >
|
|
|
update mechine_info
|
|
|
<set >
|
|
|
<if test="alias != null" >
|
|
|
alias = #{alias,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="hostIp != null" >
|
|
|
host_ip = #{hostIp,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="redis != null" >
|
|
|
redis = #{redis,jdbcType=TINYINT},
|
|
|
</if>
|
|
|
<if test="database != null" >
|
|
|
database = #{database,jdbcType=TINYINT},
|
|
|
</if>
|
|
|
<if test="rabbitmq != null" >
|
|
|
rabbitmq = #{rabbitmq,jdbcType=TINYINT},
|
|
|
</if>
|
|
|
<if test="nginx != null" >
|
|
|
nginx = #{nginx,jdbcType=TINYINT},
|
|
|
</if>
|
|
|
<if test="javaServer != null" >
|
|
|
java_server = #{javaServer,jdbcType=TINYINT},
|
|
|
</if>
|
|
|
<if test="createTime != null" >
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
<if test="updateTime != null" >
|
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.model.MechineInfo" >
|
|
|
update mechine_info
|
|
|
set alias = #{alias,jdbcType=VARCHAR},
|
|
|
host_ip = #{hostIp,jdbcType=VARCHAR},
|
|
|
redis = #{redis,jdbcType=TINYINT},
|
|
|
database = #{database,jdbcType=TINYINT},
|
|
|
rabbitmq = #{rabbitmq,jdbcType=TINYINT},
|
|
|
nginx = #{nginx,jdbcType=TINYINT},
|
|
|
java_server = #{javaServer,jdbcType=TINYINT},
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
<select id="selectCountByCodition" parameterType="java.util.Map" resultType="java.lang.Integer">
|
|
|
select
|
|
|
IFNULL(count(1),0)
|
|
|
from mechine_info
|
|
|
where
|
|
|
1=1
|
|
|
<if test="alias != null" >
|
|
|
and alias = #{alias}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectMechineInfosByCodition" parameterType="java.util.Map" resultMap="BaseResultMap">
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from mechine_info
|
|
|
where
|
|
|
1=1
|
|
|
<if test="alias != null" >
|
|
|
and alias = #{alias}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
</mapper> |
|
|
\ No newline at end of file |
...
|
...
|
|