<?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.DicDao">
|
<resultMap id="BaseResultMap" type="com.cloud.device.model.Dic">
|
<id column="id" jdbcType="INTEGER" property="id" />
|
<result column="value" jdbcType="VARCHAR" property="value" />
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
<result column="parentId" jdbcType="INTEGER" property="parentId" />
|
<result column="path" jdbcType="VARCHAR" property="path" />
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
<result column="sort" jdbcType="INTEGER" property="sort" />
|
<result column="delFlag" jdbcType="VARCHAR" property="delFlag" />
|
<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="orgId" jdbcType="INTEGER" property="orgId" />
|
<result column="icon" jdbcType="VARCHAR" property="icon" />
|
<result column="urlTemplate" jdbcType="VARCHAR" property="urlTemplate" />
|
</resultMap>
|
<sql id="Base_Column_List">
|
id, value, name, parentId, path, type, sort, delFlag, createBy, createTime, updateBy, updateTime, orgId, icon, urlTemplate
|
</sql>
|
<select id="selectById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from dic
|
where id = #{id,jdbcType=INTEGER}
|
</select>
|
<delete id="deleteById" parameterType="java.lang.Integer">
|
update dic set delFlag = '1'
|
where id = #{id,jdbcType=INTEGER}
|
</delete>
|
<insert id="insert" parameterType="com.cloud.device.model.Dic">
|
insert into dic ( value, name, parentId,
|
path, type, sort, delFlag,
|
createBy, createTime, updateBy, updateTime, orgId, icon, urlTemplate)
|
values (#{value,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER},
|
#{path,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},#{sort,jdbcType=INTEGER}, #{delFlag,jdbcType=VARCHAR},
|
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
|
#{updateTime,jdbcType=TIMESTAMP}, #{orgId,jdbcType=INTEGER}, #{icon,jdbcType=VARCHAR}, #{urlTemplate,jdbcType=VARCHAR})
|
</insert>
|
<insert id="insertSelective" parameterType="com.cloud.device.model.Dic">
|
insert into dic
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="value != null">
|
value,
|
</if>
|
<if test="name != null">
|
name,
|
</if>
|
<if test="parentId != null">
|
parentId,
|
</if>
|
<if test="path != null">
|
path,
|
</if>
|
<if test="type != null">
|
type,
|
</if>
|
<if test="sort != null">
|
sort,
|
</if>
|
<if test="delFlag != null">
|
delFlag,
|
</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="orgId != null">
|
orgId,
|
</if>
|
<if test="icon != null">
|
icon,
|
</if>
|
<if test="urlTemplate !=null">
|
urlTemplate,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="value != null">
|
#{value,jdbcType=VARCHAR},
|
</if>
|
<if test="name != null">
|
#{name,jdbcType=VARCHAR},
|
</if>
|
<if test="parentId != null">
|
#{parentId,jdbcType=INTEGER},
|
</if>
|
<if test="path != null">
|
#{path,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null">
|
#{type,jdbcType=VARCHAR},
|
</if>
|
<if test="sort != null">
|
#{sort,jdbcType=INTEGER},
|
</if>
|
<if test="delFlag != null">
|
#{delFlag,jdbcType=VARCHAR},
|
</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="orgId != null">
|
#{orgId,jdbcType=INTEGER},
|
</if>
|
<if test="icon != null">
|
#{icon,jdbcType=VARCHAR},
|
</if>
|
<if test="urlTemplate !=null">
|
#{urlTemplate,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<update id="updateByIdSelective" parameterType="com.cloud.device.model.Dic">
|
update dic
|
<set>
|
<if test="value != null">
|
value = #{value,jdbcType=VARCHAR},
|
</if>
|
<if test="name != null">
|
name = #{name,jdbcType=VARCHAR},
|
</if>
|
<if test="parentId != null">
|
parentId = #{parentId,jdbcType=INTEGER},
|
</if>
|
<if test="path != null">
|
path = #{path,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null">
|
type = #{type,jdbcType=VARCHAR},
|
</if>
|
<if test="sort != null">
|
sort = #{sort,jdbcType=INTEGER},
|
</if>
|
<if test="delFlag != null">
|
delFlag = #{delFlag,jdbcType=VARCHAR},
|
</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="orgId != null">
|
orgId = #{orgId,jdbcType=INTEGER},
|
</if>
|
<if test="icon != null">
|
icon = #{icon,jdbcType=VARCHAR},
|
</if>
|
<if test="urlTemplate !=null">
|
urlTemplate = #{urlTemplate,jdbcType=VARCHAR}
|
</if>
|
</set>
|
where id = #{id,jdbcType=INTEGER}
|
</update>
|
<update id="updateById" parameterType="com.cloud.device.model.Dic">
|
update dic
|
set
|
value = #{value,jdbcType=VARCHAR},
|
name = #{name,jdbcType=VARCHAR},
|
parentId = #{parentId,jdbcType=INTEGER},
|
path = #{path,jdbcType=VARCHAR},
|
type = #{type,jdbcType=VARCHAR},
|
sort = #{sort,jdbcType=INTEGER},
|
delFlag = #{delFlag,jdbcType=VARCHAR},
|
createBy = #{createBy,jdbcType=VARCHAR},
|
createTime = #{createTime,jdbcType=TIMESTAMP},
|
updateBy = #{updateBy,jdbcType=VARCHAR},
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
orgId = #{orgId,jdbcType=INTEGER},
|
icon = #{icon,jdbcType=VARCHAR},
|
urlTemplate = #{urlTemplate,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=INTEGER}
|
</update>
|
|
<select id="getByType" parameterType="java.util.Map" resultMap="BaseResultMap">
|
select <include refid="Base_Column_List" />
|
from dic
|
where delFlag='0'
|
<if test="type != null and type !=''">
|
and type=#{type,jdbcType=VARCHAR}
|
</if>
|
<if test="name !=null and name !=''">
|
and name like '%${name}%'
|
</if>
|
</select>
|
</mapper>
|