jiangqs
2023-06-12 924242a73d62d247f7055ffd0dd86a2700757f5b
ruoyi-modules/ruoyi-system/src/main/resources/mapper/config/CustomConfigMapper.xml
@@ -2,86 +2,12 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.config.CustomConfigMapper">
    <resultMap type="CustomConfig" id="CustomConfigResult">
        <result property="id"    column="id"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="type"    column="type"    />
        <result property="key"    column="key"    />
        <result property="name"    column="name"    />
        <result property="value"    column="value"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>
    <sql id="selectCustomConfigVo">
        select id, del_flag, type, key, name, value, create_time, update_time from t_custom_config
    </sql>
    <select id="selectCustomConfigList" parameterType="CustomConfig" resultMap="CustomConfigResult">
        <include refid="selectCustomConfigVo"/>
        <where>
            <if test="type != null "> and type = #{type}</if>
            <if test="key != null  and key != ''"> and key = #{key}</if>
            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
            <if test="value != null  and value != ''"> and value = #{value}</if>
        </where>
    </select>
    <select id="selectCustomConfigById" parameterType="Long" resultMap="CustomConfigResult">
        <include refid="selectCustomConfigVo"/>
        where id = #{id}
    </select>
    <insert id="insertCustomConfig" parameterType="CustomConfig" useGeneratedKeys="true" keyProperty="id">
        insert into t_custom_config
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="delFlag != null">del_flag,</if>
            <if test="type != null">type,</if>
            <if test="key != null">key,</if>
            <if test="name != null">name,</if>
            <if test="value != null">value,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="delFlag != null">#{delFlag},</if>
            <if test="type != null">#{type},</if>
            <if test="key != null">#{key},</if>
            <if test="name != null">#{name},</if>
            <if test="value != null">#{value},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
        </trim>
    </insert>
    <update id="updateCustomConfig" parameterType="CustomConfig">
        update t_custom_config
        <trim prefix="SET" suffixOverrides=",">
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="type != null">type = #{type},</if>
            <if test="key != null">key = #{key},</if>
            <if test="name != null">name = #{name},</if>
            <if test="value != null">value = #{value},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteCustomConfigById" parameterType="Long">
        delete from t_custom_config where id = #{id}
    </delete>
    <delete id="deleteCustomConfigByIds" parameterType="String">
        delete from t_custom_config where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    <select id="getByKey" resultMap="CustomConfigResult">
        <include refid="selectCustomConfigVo"/>
        WHERE del_flag = 0 AND key = #{key}
    <select id="getByKey" resultType="CustomConfig">
        SELECT
            *
        FROM t_custom_config
        WHERE del_flag = 0 AND config_key = #{key}
    </select>
    <select id="pageOperLog" resultType="com.ruoyi.system.domain.vo.MgtOperLogPageVo">