...
|
...
|
@@ -6,14 +6,15 @@ |
|
|
<result column="alias" property="alias" jdbcType="VARCHAR" />
|
|
|
<result column="host_ip" property="hostIp" jdbcType="VARCHAR" />
|
|
|
<result column="group_id" property="groupId" jdbcType="INTEGER" />
|
|
|
<result column="cloud_type" property="cloudType" jdbcType="BIT" />
|
|
|
<result column="cloud_type" property="cloudType" jdbcType="INTEGER" />
|
|
|
<result column="cloud_detail_type" property="cloudDetailType" jdbcType="INTEGER" />
|
|
|
<result column="tags" property="tags" jdbcType="VARCHAR" />
|
|
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
|
|
<result column="group_name" property="groupName" jdbcType="VARCHAR" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List" >
|
|
|
id, alias, host_ip, group_id, cloud_type, tags, create_time, update_time
|
|
|
id, alias, host_ip, group_id, cloud_type, tags, create_time, update_time,cloud_detail_type
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
select
|
...
|
...
|
@@ -28,66 +29,12 @@ |
|
|
<insert id="insert" parameterType="com.model.HostInfo" >
|
|
|
insert into host_info (id, alias, host_ip,
|
|
|
group_id, cloud_type, tags,
|
|
|
create_time, update_time)
|
|
|
create_time, update_time,cloud_detail_type)
|
|
|
values (#{id,jdbcType=INTEGER}, #{alias,jdbcType=VARCHAR}, #{hostIp,jdbcType=VARCHAR},
|
|
|
#{groupId,jdbcType=INTEGER}, #{cloudType,jdbcType=BIT}, #{tags,jdbcType=VARCHAR},
|
|
|
now(), now())
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.model.HostInfo" >
|
|
|
insert into host_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="groupId != null" >
|
|
|
group_id,
|
|
|
</if>
|
|
|
<if test="cloudType != null" >
|
|
|
cloud_type,
|
|
|
</if>
|
|
|
<if test="tags != null" >
|
|
|
tags,
|
|
|
</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="groupId != null" >
|
|
|
#{groupId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="cloudType != null" >
|
|
|
#{cloudType,jdbcType=BIT},
|
|
|
</if>
|
|
|
<if test="tags != null" >
|
|
|
#{tags,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="createTime != null" >
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
<if test="updateTime != null" >
|
|
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
</trim>
|
|
|
#{groupId,jdbcType=INTEGER}, #{cloudType,jdbcType=INTEGER}, #{tags,jdbcType=VARCHAR},
|
|
|
now(), now(), #{cloudDetailType,jdbcType=INTEGER})
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.model.HostInfo" >
|
|
|
update host_info
|
|
|
<set >
|
...
|
...
|
@@ -101,7 +48,10 @@ |
|
|
group_id = #{groupId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="cloudType != null && cloudType != 0" >
|
|
|
cloud_type = #{cloudType,jdbcType=BIT},
|
|
|
cloud_type = #{cloudType,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="cloudDetailType != null && cloudDetailType != 0" >
|
|
|
cloud_detail_type = #{cloudDetailType,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="tags != null" >
|
|
|
tags = #{tags,jdbcType=VARCHAR},
|
...
|
...
|
@@ -120,7 +70,8 @@ |
|
|
set alias = #{alias,jdbcType=VARCHAR},
|
|
|
host_ip = #{hostIp,jdbcType=VARCHAR},
|
|
|
group_id = #{groupId,jdbcType=INTEGER},
|
|
|
cloud_type = #{cloudType,jdbcType=BIT},
|
|
|
cloud_type = #{cloudType,jdbcType=INTEGER},
|
|
|
cloud_detail_type = #{cloudDetailType,jdbcType=INTEGER},
|
|
|
tags = #{tags,jdbcType=VARCHAR},
|
|
|
update_time = now()
|
|
|
where id = #{id,jdbcType=INTEGER}
|
...
|
...
|
@@ -138,6 +89,9 @@ |
|
|
<if test="params.cloudType != null && params.cloudType != 0" >
|
|
|
and a.cloud_type = #{params.cloudType}
|
|
|
</if>
|
|
|
<if test="params.cloudDetailType != null && params.cloudDetailType != 0" >
|
|
|
and a.cloud_detail_type = #{params.cloudDetailType}
|
|
|
</if>
|
|
|
<if test="params.hostIp != null && params.hostIp != ''" >
|
|
|
and a.host_ip like concat(#{params.hostIp},'%')
|
|
|
</if>
|
...
|
...
|
@@ -169,7 +123,7 @@ |
|
|
|
|
|
<select id="selectHostInfosByCodition" resultMap="BaseResultMap">
|
|
|
select
|
|
|
a.id, a.alias, a.host_ip, a.group_id, a.cloud_type, a.tags, a.create_time, a.update_time,b.group_name
|
|
|
a.id, a.alias, a.host_ip, a.group_id, a.cloud_type,a.cloud_detail_type, a.tags, a.create_time, a.update_time,b.group_name
|
|
|
from host_info a left join host_group b on a.group_id=b.id
|
|
|
where
|
|
|
1=1
|
...
|
...
|
@@ -179,6 +133,9 @@ |
|
|
<if test="params.cloudType != null && params.cloudType != 0" >
|
|
|
and a.cloud_type = #{params.cloudType}
|
|
|
</if>
|
|
|
<if test="params.cloudDetailType != null && params.cloudDetailType != 0" >
|
|
|
and a.cloud_detail_type = #{params.cloudDetailType}
|
|
|
</if>
|
|
|
<if test="params.hostIp != null && params.hostIp != ''" >
|
|
|
and a.host_ip like concat(#{params.hostIp},'%')
|
|
|
</if>
|
...
|
...
|
@@ -277,24 +234,15 @@ |
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
<update id="updateTagByIps" >
|
|
|
update host_info
|
|
|
set tags = ""
|
|
|
where host_ip in
|
|
|
<foreach item="hostIp" index="index" collection="hostIps" open="("
|
|
|
separator="," close=")">
|
|
|
#{hostIp}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
|
|
|
|
|
|
<update id="updateHostInfoByIp" parameterType="com.model.HostInfo" >
|
|
|
update host_info
|
|
|
set alias = #{alias,jdbcType=VARCHAR},
|
|
|
cloud_type = #{cloudType,jdbcType=BIT},
|
|
|
cloud_type = #{cloudType,jdbcType=INTEGER},
|
|
|
cloud_detail_type = #{cloudType,jdbcType=INTEGER},
|
|
|
tags = #{tags,jdbcType=VARCHAR},
|
|
|
update_time = now()
|
|
|
where host_ip = #{hostIp,jdbcType=INTEGER}
|
|
|
where host_ip = #{hostIp,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
|
|
|
|
...
|
...
|
|