93 lines
2.9 KiB
XML
93 lines
2.9 KiB
XML
|
|
<?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.zhangy.skyeye.publics.mapper.SysDictDataMapper">
|
||
|
|
<sql id="selectSql">
|
||
|
|
select
|
||
|
|
t.id,
|
||
|
|
t.dict_type,
|
||
|
|
t.dict_label,
|
||
|
|
t.dict_value,
|
||
|
|
t.dict_sort,
|
||
|
|
t.create_time,
|
||
|
|
t.update_time
|
||
|
|
from sys_dict_data t
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectPage" resultType="com.zhangy.skyeye.publics.entity.SysDictData">
|
||
|
|
<include refid="selectSql"/>
|
||
|
|
where 1 = 1
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectList" resultType="com.zhangy.skyeye.publics.entity.SysDictData">
|
||
|
|
<include refid="selectSql"/>
|
||
|
|
where 1 = 1
|
||
|
|
<if test="array != null and array.length > 0">
|
||
|
|
and t.dict_type in
|
||
|
|
<foreach item="item" collection="array" open="(" separator="," close=")">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectById" resultType="com.zhangy.skyeye.publics.entity.SysDictData">
|
||
|
|
<include refid="selectSql"/>
|
||
|
|
where t.id in
|
||
|
|
<foreach item="item" collection="array" open="(" separator="," close=")">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||
|
|
insert into sys_dict_data(
|
||
|
|
dict_type,
|
||
|
|
dict_label,
|
||
|
|
dict_value,
|
||
|
|
dict_sort
|
||
|
|
) values
|
||
|
|
<foreach item="item" index="index" collection="array" separator=",">
|
||
|
|
(
|
||
|
|
#{item.dictType},
|
||
|
|
#{item.dictLabel},
|
||
|
|
#{item.dictValue},
|
||
|
|
#{item.dictSort}
|
||
|
|
)
|
||
|
|
</foreach>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateNotNull">
|
||
|
|
update sys_dict_data
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="dictType != null">dict_type = #{dictType},</if>
|
||
|
|
<if test="dictLabel != null">dict_label = #{dictLabel},</if>
|
||
|
|
<if test="dictValue != null">dict_value = #{dictValue},</if>
|
||
|
|
<if test="dictSort != null">dict_sort = #{dictSort},</if>
|
||
|
|
</trim>
|
||
|
|
where id = #{id}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<update id="update">
|
||
|
|
update sys_dict_data
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
dict_type = #{dictType},
|
||
|
|
dict_label = #{dictLabel},
|
||
|
|
dict_value = #{dictValue},
|
||
|
|
dict_sort = #{dictSort},
|
||
|
|
</trim>
|
||
|
|
where id = #{id}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="delete">
|
||
|
|
delete from sys_dict_data where id in
|
||
|
|
<foreach item="item" collection="array" open="(" separator="," close=")">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteByType">
|
||
|
|
delete from sys_dict_data where dict_type in
|
||
|
|
<foreach item="item" collection="array" open="(" separator="," close=")">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|