From ca39aeadb7b19b2e854d5e2694e52b63ef9e8afe Mon Sep 17 00:00:00 2001 From: ‘liusuyi’ <1951119284@qq.com> Date: 星期二, 21 十一月 2023 14:35:00 +0800 Subject: [PATCH] 菜单/字典/系统配置增加双语 --- ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml | 200 +++++++++++++++++++++++++------------------------ 1 files changed, 103 insertions(+), 97 deletions(-) diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml index 6297966..d8b18db 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml @@ -1,105 +1,111 @@ <?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"> + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ruoyi.system.mapper.SysDictTypeMapper"> - <resultMap type="SysDictType" id="SysDictTypeResult"> - <id property="dictId" column="dict_id" /> - <result property="dictName" column="dict_name" /> - <result property="dictType" column="dict_type" /> - <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" /> - </resultMap> - - <sql id="selectDictTypeVo"> - select dict_id, dict_name, dict_type, status, create_by, create_time, remark - from sys_dict_type + <resultMap type="SysDictType" id="SysDictTypeResult"> + <id property="dictId" column="dict_id"/> + <result property="dictName" column="dict_name"/> + <result property="dictNameI18n" column="dict_name_i18n"/> + <result property="dictType" column="dict_type"/> + <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"/> + </resultMap> + + <sql id="selectDictTypeVo"> + select dict_id, dict_name,dict_name_i18n, dict_type, status, create_by, create_time, remark + from sys_dict_type </sql> - <select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult"> - <include refid="selectDictTypeVo"/> - <where> - <if test="dictName != null and dictName != ''"> - AND dict_name like ('%${dictName}%') - </if> - <if test="status != null and status != ''"> - AND status = #{status} - </if> - <if test="dictType != null and dictType != ''"> - AND dict_type like ('%${dictType}%') - </if> - <if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� --> - and create_time >= to_timestamp(#{params.beginTime},'yyyy-MM-DD') - </if> - <if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� --> - and create_time <= to_timestamp(#{params.endTime},'yyyy-MM-DD') - </if> - </where> - </select> - - <select id="selectDictTypeAll" resultMap="SysDictTypeResult"> - <include refid="selectDictTypeVo"/> - </select> - - <select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult"> - <include refid="selectDictTypeVo"/> - where dict_id = #{dictId} - </select> - - <select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult"> - <include refid="selectDictTypeVo"/> - where dict_type = #{dictType} - </select> - - <select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult"> - <include refid="selectDictTypeVo"/> - where dict_type = #{dictType} limit 1 OFFSET 0 - </select> - - <delete id="deleteDictTypeById" parameterType="Long"> - delete from sys_dict_type where dict_id = #{dictId} - </delete> - - <delete id="deleteDictTypeByIds" parameterType="Long"> - delete from sys_dict_type where dict_id in - <foreach collection="array" item="dictId" open="(" separator="," close=")"> - #{dictId} - </foreach> - </delete> + <select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult"> + <include refid="selectDictTypeVo"/> + <where> + <if test="dictName != null and dictName != ''"> + AND dict_name like ('%${dictName}%') + </if> + <if test="status != null and status != ''"> + AND status = #{status} + </if> + <if test="dictType != null and dictType != ''"> + AND dict_type like ('%${dictType}%') + </if> + <if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� --> + and create_time >= to_timestamp(#{params.beginTime},'yyyy-MM-DD') + </if> + <if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� --> + and create_time <= to_timestamp(#{params.endTime},'yyyy-MM-DD') + </if> + </where> + </select> - <update id="updateDictType" parameterType="SysDictType"> - update sys_dict_type - <set> - <if test="dictName != null and dictName != ''">dict_name = #{dictName},</if> - <if test="dictType != null and dictType != ''">dict_type = #{dictType},</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 = now() - </set> - where dict_id = #{dictId} - </update> - - <insert id="insertDictType" parameterType="SysDictType"> - insert into sys_dict_type( - <if test="dictName != null and dictName != ''">dict_name,</if> - <if test="dictType != null and dictType != ''">dict_type,</if> - <if test="status != null">status,</if> - <if test="remark != null and remark != ''">remark,</if> - <if test="createBy != null and createBy != ''">create_by,</if> - create_time - )values( - <if test="dictName != null and dictName != ''">#{dictName},</if> - <if test="dictType != null and dictType != ''">#{dictType},</if> - <if test="status != null">#{status},</if> - <if test="remark != null and remark != ''">#{remark},</if> - <if test="createBy != null and createBy != ''">#{createBy},</if> - now() - ) - </insert> - + <select id="selectDictTypeAll" resultMap="SysDictTypeResult"> + <include refid="selectDictTypeVo"/> + </select> + + <select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult"> + <include refid="selectDictTypeVo"/> + where dict_id = #{dictId} + </select> + + <select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult"> + <include refid="selectDictTypeVo"/> + where dict_type = #{dictType} + </select> + + <select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult"> + <include refid="selectDictTypeVo"/> + where dict_type = #{dictType} limit 1 OFFSET 0 + </select> + + <delete id="deleteDictTypeById" parameterType="Long"> + delete + from sys_dict_type + where dict_id = #{dictId} + </delete> + + <delete id="deleteDictTypeByIds" parameterType="Long"> + delete from sys_dict_type where dict_id in + <foreach collection="array" item="dictId" open="(" separator="," close=")"> + #{dictId} + </foreach> + </delete> + + <update id="updateDictType" parameterType="SysDictType"> + update sys_dict_type + <set> + <if test="dictName != null and dictName != ''">dict_name = #{dictName},</if> + <if test="dictNameI18n != null and dictNameI18n != ''">dict_name_i18n = #{dictNameI18n},</if> + <if test="dictType != null and dictType != ''">dict_type = #{dictType},</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 = now() + </set> + where dict_id = #{dictId} + </update> + + <insert id="insertDictType" parameterType="SysDictType"> + insert into sys_dict_type( + <if test="dictName != null and dictName != ''">dict_name,</if> + <if test="dictNameI18n != null and dictNameI18n != ''">dict_name_i18n,</if> + <if test="dictType != null and dictType != ''">dict_type,</if> + <if test="status != null">status,</if> + <if test="remark != null and remark != ''">remark,</if> + <if test="createBy != null and createBy != ''">create_by,</if> + create_time + )values( + <if test="dictName != null and dictName != ''">#{dictName},</if> + <if test="dictNameI18n != null and dictNameI18n != ''">#{dictNameI18n},</if> + <if test="dictType != null and dictType != ''">#{dictType},</if> + <if test="status != null">#{status},</if> + <if test="remark != null and remark != ''">#{remark},</if> + <if test="createBy != null and createBy != ''">#{createBy},</if> + now() + ) + </insert> + </mapper> \ No newline at end of file -- Gitblit v1.9.3