| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.system.mapper.SysDictDataMapper"> |
| | | |
| | | <resultMap type="SysDictData" id="SysDictDataResult"> |
| | | <resultMap type="com.aps.system.api.domain.SysDictData" id="SysDictDataResult"> |
| | | <id property="dictCode" column="dict_code" /> |
| | | <result property="dictSort" column="dict_sort" /> |
| | | <result property="dictLabel" column="dict_label" /> |
| | |
| | | from sys_dict_data |
| | | </sql> |
| | | |
| | | <select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult"> |
| | | <select id="selectDictDataList" parameterType="com.aps.system.api.domain.SysDictData" resultMap="SysDictDataResult"> |
| | | <include refid="selectDictDataVo"/> |
| | | <where> |
| | | <if test="dictType != null and dictType != ''"> |
| | | AND dict_type = #{dictType} |
| | | </if> |
| | | <if test="dictLabel != null and dictLabel != ''"> |
| | | AND dict_label like concat('%', #{dictLabel}, '%') |
| | | AND dict_label like '%' || #{dictLabel} || '%' |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND status = #{status} |
| | |
| | | </where> |
| | | order by dict_sort asc |
| | | </select> |
| | | |
| | | |
| | | <select id="selectByValue" resultMap="SysDictDataResult"> |
| | | <include refid="selectDictDataVo"/> |
| | | <where> |
| | | <if test="dictTypeApsArea != null and dictTypeApsArea != ''"> |
| | | AND dict_type = #{dictTypeApsArea} |
| | | </if> |
| | | <if test="dictValue != null and dictValue != ''"> |
| | | AND dict_value = #{dictValue} |
| | | </if> |
| | | </where> |
| | | order by dict_sort asc |
| | | </select> |
| | | |
| | | <select id="selectDictValueList" resultMap="SysDictDataResult"> |
| | | select distinct dict_value from sys_dict_data where dict_type = #{dictType} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectDictDataByType" parameterType="String" resultMap="SysDictDataResult"> |
| | | <include refid="selectDictDataVo"/> |
| | | where status = '0' and dict_type = #{dictType} order by dict_sort asc |
| | |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="updateDictData" parameterType="SysDictData"> |
| | | <update id="updateDictData" parameterType="com.aps.system.api.domain.SysDictData"> |
| | | update sys_dict_data |
| | | <set> |
| | | <if test="dictSort != null">dict_sort = #{dictSort},</if> |
| | |
| | | <if test="status != null">status = #{status},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | update_time = sysdate() |
| | | update_time = now() |
| | | </set> |
| | | where dict_code = #{dictCode} |
| | | </update> |
| | |
| | | update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType} |
| | | </update> |
| | | |
| | | <insert id="insertDictData" parameterType="SysDictData"> |
| | | <insert id="insertDictData" parameterType="com.aps.system.api.domain.SysDictData"> |
| | | insert into sys_dict_data( |
| | | <if test="dictSort != null">dict_sort,</if> |
| | | <if test="dictLabel != null and dictLabel != ''">dict_label,</if> |
| | |
| | | <if test="status != null">#{status},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | sysdate() |
| | | now() |
| | | ) |
| | | </insert> |
| | | |