| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hnct.system.mapper.SysDictDataMapper"> |
| | | <mapper namespace="com.ycl.system.mapper.SysDictDataMapper"> |
| | | |
| | | <resultMap type="com.hnct.system.domain.SysDictData" id="SysDictDataResult"> |
| | | <resultMap type="SysDictData" id="SysDictDataResult"> |
| | | <id property="dictCode" column="dict_code" /> |
| | | <result property="dictSort" column="dict_sort" /> |
| | | <result property="dictLabel" column="dict_label" /> |
| | |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="parentId" column="parent_id" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectDictDataVo"> |
| | | select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark |
| | | select dict_code, dict_sort,parent_id, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark |
| | | from sys_dict_data |
| | | </sql> |
| | | |
| | | <select id="selectDictDataList" parameterType="com.hnct.system.domain.SysDictData" resultMap="SysDictDataResult"> |
| | | <select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult"> |
| | | <include refid="selectDictDataVo"/> |
| | | <where> |
| | | <if test="dictType != null and dictType != ''"> |
| | |
| | | <if test="dictLabel != null and dictLabel != ''"> |
| | | AND dict_label like concat('%', #{dictLabel}, '%') |
| | | </if> |
| | | <if test="parentId != null"> |
| | | AND parent_id = #{parentId} |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND status = #{status} |
| | | </if> |
| | |
| | | order by dict_sort asc |
| | | </select> |
| | | |
| | | <select id="selectDictDataByType" parameterType="String" resultMap="SysDictDataResult"> |
| | | <select id="selectDictDataByType" parameterType="SysDictData" resultMap="SysDictDataResult"> |
| | | <include refid="selectDictDataVo"/> |
| | | where status = '0' and dict_type = #{dictType} order by dict_sort asc |
| | | </select> |
| | |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="updateDictData" parameterType="com.hnct.system.domain.SysDictData"> |
| | | <update id="updateDictData" parameterType="SysDictData"> |
| | | update sys_dict_data |
| | | <set> |
| | | <if test="dictSort != null">dict_sort = #{dictSort},</if> |
| | | <if test="parentId != null">parent_id = #{parentId},</if> |
| | | <if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if> |
| | | <if test="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if> |
| | | <if test="dictType != null and dictType != ''">dict_type = #{dictType},</if> |
| | |
| | | update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType} |
| | | </update> |
| | | |
| | | <insert id="insertDictData" parameterType="com.hnct.system.domain.SysDictData"> |
| | | <select id="selectDictDataByValue" parameterType="string" resultMap="SysDictDataResult"> |
| | | <include refid="selectDictDataVo"/> |
| | | where dict_value = #{dictValue} AND parent_id = (SELECT dict_code FROM sys_dict_data WHERE dict_value = #{parentValue} AND dict_type = #{dictType}) AND dict_type = #{dictType} |
| | | </select> |
| | | |
| | | <insert id="insertDictData" parameterType="SysDictData"> |
| | | insert into sys_dict_data( |
| | | <if test="dictSort != null">dict_sort,</if> |
| | | <if test="parentId != null">parent_id,</if> |
| | | <if test="dictLabel != null and dictLabel != ''">dict_label,</if> |
| | | <if test="dictValue != null and dictValue != ''">dict_value,</if> |
| | | <if test="dictType != null and dictType != ''">dict_type,</if> |
| | |
| | | create_time |
| | | )values( |
| | | <if test="dictSort != null">#{dictSort},</if> |
| | | <if test="parentId != null">#{parentId},</if> |
| | | <if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if> |
| | | <if test="dictValue != null and dictValue != ''">#{dictValue},</if> |
| | | <if test="dictType != null and dictType != ''">#{dictType},</if> |