<?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.user.dao.SysDictDao">
|
<resultMap id="BaseResultMap" type="com.cloud.model.sys.SysDict">
|
<id column="id" jdbcType="INTEGER" property="id" />
|
<result column="orgId" jdbcType="INTEGER" property="orgId" />
|
<result column="parentId" jdbcType="INTEGER" property="parentId" />
|
<result column="value" jdbcType="VARCHAR" property="value" />
|
<result column="lable" jdbcType="VARCHAR" property="lable" />
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
<result column="module" jdbcType="VARCHAR" property="module" />
|
<result column="description" jdbcType="VARCHAR" property="description" />
|
<result column="sort" jdbcType="INTEGER" property="sort" />
|
<result column="scope" jdbcType="VARCHAR" property="scope" />
|
<result column="enabled" jdbcType="VARCHAR" property="enabled" />
|
<result column="delFlag" jdbcType="VARCHAR" property="delFlag" />
|
<result column="revJson" jdbcType="VARCHAR" property="revJson" />
|
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
|
</resultMap>
|
<sql id="Base_Column_List">
|
id, orgId, parentId, value, lable, type, module, description, sort, scope, enabled,
|
delFlag, revJson, createTime, updateTime
|
</sql>
|
|
<select id="getSysDictsCount" resultType="Integer">
|
select count(id) from sys_dict
|
where delFlag = '0'
|
<if test="type != null and type != ''">
|
and type = #{type}
|
</if>
|
<if test="module != null and module != ''">
|
and module = #{module}
|
</if>
|
<if test="id != null and id !=''">
|
and id = #{id}
|
</if>
|
<if test="orgId != null and orgId != ''">
|
and orgId = #{orgId}
|
</if>
|
<if test="name != null and name != ''">
|
and lable like '%${name}%'
|
</if>
|
</select>
|
|
<select id="getSysDicts" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from sys_dict
|
where delFlag = '0'
|
<if test="type != null and type != ''">
|
and type = #{type}
|
</if>
|
<if test="module != null and module != ''">
|
and module = #{module}
|
</if>
|
<if test="id != null and id !=''">
|
and id = #{id}
|
</if>
|
<if test="orgId != null and orgId != ''">
|
and orgId = #{orgId}
|
</if>
|
<if test="name != null and name != ''">
|
and lable like '%${name}%'
|
</if>
|
ORDER BY type
|
<if test="start != null and length != null and length != '' ">
|
LIMIT #{start}, #{length}
|
</if>
|
</select>
|
|
<!--系统字典逻辑删除-->
|
<update id="deleteSysDicts" parameterType="Integer" >
|
UPDATE sys_dict set delFlag = '1' WHERE id = #{id}
|
</update>
|
|
<!--* 系统字典展示查询-->
|
<select id="getSysDictByType" resultType="map">
|
SELECT id,value,lable,revJson from sys_dict WHERE delFlag = 0
|
<if test="orgId != null and orgId != '' and orgId != 1 and orgId != '1'">
|
and orgId = #{orgId}
|
</if>
|
<if test="type != null and type != ''">
|
and type = #{type}
|
</if>
|
<if test="module != null and type != ''">
|
and module = #{module}
|
</if>
|
GROUP BY value
|
ORDER BY sort
|
</select>
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from sys_dict
|
where delFlag = 0 and id = #{id,jdbcType=INTEGER}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
delete from sys_dict
|
where id = #{id,jdbcType=INTEGER}
|
</delete>
|
<insert id="insert" parameterType="com.cloud.model.sys.SysDict">
|
insert into sys_dict (id, orgId, parentId,
|
value, lable, type,
|
module, description, sort,
|
scope, enabled, delFlag,
|
revJson, createTime, updateTime
|
)
|
values (#{id,jdbcType=INTEGER}, #{orgId,jdbcType=INTEGER}, #{parentId,jdbcType=INTEGER},
|
#{value,jdbcType=VARCHAR}, #{lable,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
#{module,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER},
|
#{scope,jdbcType=VARCHAR}, #{enabled,jdbcType=VARCHAR}, #{delFlag,jdbcType=VARCHAR},
|
#{revJson,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
|
)
|
</insert>
|
<insert id="insertSelective" parameterType="com.cloud.model.sys.SysDict">
|
insert into sys_dict
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
id,
|
</if>
|
<if test="orgId != null">
|
orgId,
|
</if>
|
<if test="parentId != null">
|
parentId,
|
</if>
|
<if test="value != null">
|
value,
|
</if>
|
<if test="lable != null">
|
lable,
|
</if>
|
<if test="type != null">
|
type,
|
</if>
|
<if test="module != null">
|
module,
|
</if>
|
<if test="description != null">
|
description,
|
</if>
|
<if test="sort != null">
|
sort,
|
</if>
|
<if test="scope != null">
|
scope,
|
</if>
|
<if test="enabled != null">
|
enabled,
|
</if>
|
<if test="delFlag != null">
|
delFlag,
|
</if>
|
<if test="revJson != null">
|
revJson,
|
</if>
|
<if test="createTime != null">
|
createTime,
|
</if>
|
<if test="updateTime != null">
|
updateTime,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
#{id,jdbcType=INTEGER},
|
</if>
|
<if test="orgId != null">
|
#{orgId,jdbcType=INTEGER},
|
</if>
|
<if test="parentId != null">
|
#{parentId,jdbcType=INTEGER},
|
</if>
|
<if test="value != null">
|
#{value,jdbcType=VARCHAR},
|
</if>
|
<if test="lable != null">
|
#{lable,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null">
|
#{type,jdbcType=VARCHAR},
|
</if>
|
<if test="module != null">
|
#{module,jdbcType=VARCHAR},
|
</if>
|
<if test="description != null">
|
#{description,jdbcType=VARCHAR},
|
</if>
|
<if test="sort != null">
|
#{sort,jdbcType=INTEGER},
|
</if>
|
<if test="scope != null">
|
#{scope,jdbcType=VARCHAR},
|
</if>
|
<if test="enabled != null">
|
#{enabled,jdbcType=VARCHAR},
|
</if>
|
<if test="delFlag != null">
|
#{delFlag,jdbcType=VARCHAR},
|
</if>
|
<if test="revJson != null">
|
#{revJson,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">
|
#{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateTime != null">
|
#{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKeySelective" parameterType="com.cloud.model.sys.SysDict">
|
update sys_dict
|
<set>
|
<if test="orgId != null">
|
orgId = #{orgId,jdbcType=INTEGER},
|
</if>
|
<if test="parentId != null">
|
parentId = #{parentId,jdbcType=INTEGER},
|
</if>
|
<if test="value != null">
|
value = #{value,jdbcType=VARCHAR},
|
</if>
|
<if test="lable != null">
|
lable = #{lable,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null">
|
type = #{type,jdbcType=VARCHAR},
|
</if>
|
<if test="module != null">
|
module = #{module,jdbcType=VARCHAR},
|
</if>
|
<if test="description != null">
|
description = #{description,jdbcType=VARCHAR},
|
</if>
|
<if test="sort != null">
|
sort = #{sort,jdbcType=INTEGER},
|
</if>
|
<if test="scope != null">
|
scope = #{scope,jdbcType=VARCHAR},
|
</if>
|
<if test="enabled != null">
|
enabled = #{enabled,jdbcType=VARCHAR},
|
</if>
|
<if test="delFlag != null">
|
delFlag = #{delFlag,jdbcType=VARCHAR},
|
</if>
|
<if test="revJson != null">
|
revJson = #{revJson,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">
|
createTime = #{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateTime != null">
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
</set>
|
where id = #{id,jdbcType=INTEGER}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="com.cloud.model.sys.SysDict">
|
update sys_dict
|
set orgId = #{orgId,jdbcType=INTEGER},
|
parentId = #{parentId,jdbcType=INTEGER},
|
value = #{value,jdbcType=VARCHAR},
|
lable = #{lable,jdbcType=VARCHAR},
|
type = #{type,jdbcType=VARCHAR},
|
module = #{module,jdbcType=VARCHAR},
|
description = #{description,jdbcType=VARCHAR},
|
sort = #{sort,jdbcType=INTEGER},
|
scope = #{scope,jdbcType=VARCHAR},
|
enabled = #{enabled,jdbcType=VARCHAR},
|
delFlag = #{delFlag,jdbcType=VARCHAR},
|
revJson = #{revJson,jdbcType=VARCHAR},
|
createTime = #{createTime,jdbcType=TIMESTAMP},
|
updateTime = #{updateTime,jdbcType=TIMESTAMP}
|
where id = #{id,jdbcType=INTEGER}
|
</update>
|
</mapper>
|