<?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.gkhy.exam.system.mapper.SysDictDataMapper">
|
<resultMap type="com.gkhy.exam.common.domain.entity.SysDictData" id="SysDictDataResult">
|
<id property="id" column="id" />
|
<result property="sort" column="sort" />
|
<result property="label" column="label" />
|
<result property="value" column="value" />
|
<result property="dictType" column="dict_type" />
|
<result property="cssClass" column="css_class" />
|
<result property="listClass" column="list_class" />
|
<result property="isDefault" column="is_default" />
|
<result property="status" column="status" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateTime" column="update_time" />
|
<result property="remark" column="remark" />
|
</resultMap>
|
|
<sql id="selectDictDataVo">
|
select id, sort, label, value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
|
from sys_dict_data
|
</sql>
|
|
|
<select id="selectDictDataList" resultMap="SysDictDataResult">
|
<include refid="selectDictDataVo"/>
|
<where>
|
<if test="dictType != null and dictType != ''">
|
AND dict_type = #{dictType}
|
</if>
|
<if test="label != null and label != ''">
|
AND label like concat('%', #{label}, '%')
|
</if>
|
<if test="status != null and status != ''">
|
AND status = #{status}
|
</if>
|
</where>
|
order by sort asc
|
</select>
|
|
<select id="selectDictDataByType" resultMap="SysDictDataResult">
|
<include refid="selectDictDataVo"/>
|
where status = 0 and dict_type = #{dictType} order by sort asc
|
</select>
|
|
<select id="countDictDataByType" resultType="Integer">
|
select count(1) from sys_dict_data where dict_type=#{dictType}
|
</select>
|
|
<update id="updateDictDataType" parameterType="String">
|
update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
|
</update>
|
|
<select id="selectDictLabel" resultType="String">
|
select label from sys_dict_data
|
where dict_type = #{dictType} and value = #{dictValue}
|
</select>
|
</mapper>
|