<?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.cloud.device.dao.ClusterDao">
|
<resultMap id="BaseResultMap" type="com.cloud.device.model.Cluster">
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
<result column="cookie" jdbcType="VARCHAR" property="cookie" />
|
<result column="address" jdbcType="VARCHAR" property="address" />
|
<result column="revJson" jdbcType="CHAR" property="revJson" />
|
<result column="createBy" jdbcType="VARCHAR" property="createBy" />
|
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="updateBy" jdbcType="VARCHAR" property="updateBy" />
|
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
|
<result column="remarks" jdbcType="VARCHAR" property="remarks" />
|
<result column="delFlag" jdbcType="VARCHAR" property="delFlag" />
|
</resultMap>
|
<sql id="Base_Column_List">
|
id, name, cookie, address, revJson, createBy, createTime, updateBy, updateTime, remarks,
|
delFlag
|
</sql>
|
|
<sql id="Base_Column_List2">
|
id, name, cookie, address, revJson remarks, delFlag
|
</sql>
|
|
<select id="selectById" parameterType="java.lang.String" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from cluster
|
where id = #{id,jdbcType=VARCHAR}
|
</select>
|
<delete id="deleteById" parameterType="java.lang.String">
|
update cluster set delFlag = '1'
|
where id = #{id,jdbcType=VARCHAR}
|
</delete>
|
<insert id="save" parameterType="com.cloud.device.model.Cluster">
|
insert into cluster (id,name, cookie, address,
|
revJson, createBy, createTime,
|
updateBy, updateTime, remarks,
|
delFlag)
|
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{cookie,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
|
#{revJson,jdbcType=CHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR},
|
#{delFlag,jdbcType=VARCHAR})
|
</insert>
|
<insert id="saveSelective" parameterType="com.cloud.device.model.Cluster">
|
insert into cluster
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
id,
|
</if>
|
<if test="name != null">
|
name,
|
</if>
|
<if test="cookie != null">
|
cookie,
|
</if>
|
<if test="address != null">
|
address,
|
</if>
|
<if test="revJson != null">
|
revJson,
|
</if>
|
<if test="createBy != null">
|
createBy,
|
</if>
|
<if test="createTime != null">
|
createTime,
|
</if>
|
<if test="updateBy != null">
|
updateBy,
|
</if>
|
<if test="updateTime != null">
|
updateTime,
|
</if>
|
<if test="remarks != null">
|
remarks,
|
</if>
|
<if test="delFlag != null">
|
delFlag,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
#{id,jdbcType=VARCHAR},
|
</if>
|
<if test="name != null">
|
#{name,jdbcType=VARCHAR},
|
</if>
|
<if test="cookie != null">
|
#{cookie,jdbcType=VARCHAR},
|
</if>
|
<if test="address != null">
|
#{address,jdbcType=VARCHAR},
|
</if>
|
<if test="revJson != null">
|
#{revJson,jdbcType=CHAR},
|
</if>
|
<if test="createBy != null">
|
#{createBy,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">
|
#{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateBy != null">
|
#{updateBy,jdbcType=VARCHAR},
|
</if>
|
<if test="updateTime != null">
|
#{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="remarks != null">
|
#{remarks,jdbcType=VARCHAR},
|
</if>
|
<if test="delFlag != null">
|
#{delFlag,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<update id="updateByIdSelective" parameterType="com.cloud.device.model.Cluster">
|
update cluster
|
<set>
|
<if test="name != null">
|
name = #{name,jdbcType=VARCHAR},
|
</if>
|
<if test="cookie != null">
|
cookie = #{cookie,jdbcType=VARCHAR},
|
</if>
|
<if test="address != null">
|
address = #{address,jdbcType=VARCHAR},
|
</if>
|
<if test="revJson != null">
|
revJson = #{revJson,jdbcType=CHAR},
|
</if>
|
<if test="createBy != null">
|
createBy = #{createBy,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">
|
createTime = #{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateBy != null">
|
updateBy = #{updateBy,jdbcType=VARCHAR},
|
</if>
|
<if test="updateTime != null">
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="remarks != null">
|
remarks = #{remarks,jdbcType=VARCHAR},
|
</if>
|
<if test="delFlag != null">
|
delFlag = #{delFlag,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
<update id="updateById" parameterType="com.cloud.device.model.Cluster">
|
update cluster
|
set name = #{name,jdbcType=VARCHAR},
|
cookie = #{cookie,jdbcType=VARCHAR},
|
address = #{address,jdbcType=VARCHAR},
|
revJson = #{revJson,jdbcType=CHAR},
|
createBy = #{createBy,jdbcType=VARCHAR},
|
createTime = #{createTime,jdbcType=TIMESTAMP},
|
updateBy = #{updateBy,jdbcType=VARCHAR},
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
remarks = #{remarks,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
|
<select id="findClusterByParam" resultType="com.cloud.device.model.Cluster">
|
select
|
<include refid="Base_Column_List2" />
|
from cluster t
|
where delFlag = '0'
|
<if test="name != null and name != ''">
|
and name like '%${name}%'
|
</if>
|
<if test="cookie != null and cookie != ''">
|
and cookie like '%${cookie}%'
|
</if>
|
order by t.id desc
|
</select>
|
|
<select id="findClusterByIds" resultType="com.cloud.device.model.Cluster">
|
select <include refid="Base_Column_List2" />
|
from cluster
|
where delFlag = '0'
|
<if test="list !=null">
|
and id IN
|
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
</if>
|
</select>
|
</mapper>
|