‘liusuyi’
2023-11-21 ca39aeadb7b19b2e854d5e2694e52b63ef9e8afe
ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml
@@ -7,6 +7,7 @@
    <resultMap type="SysConfig" id="SysConfigResult">
       <id     property="configId"      column="config_id"      />
        <result property="configName"    column="config_name"    />
        <result property="configNameI18n" column="config_name_i18n"/>
        <result property="configKey"     column="config_key"     />
        <result property="configValue"   column="config_value"   />
        <result property="configType"    column="config_type"    />
@@ -17,7 +18,17 @@
    </resultMap>
    
    <sql id="selectConfigVo">
        select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark
        select config_id,
               config_name,
               config_name_i18n,
               config_key,
               config_value,
               config_type,
               create_by,
               create_time,
               update_by,
               update_time,
               remark
      from sys_config
    </sql>
    
@@ -72,6 +83,7 @@
    <insert id="insertConfig" parameterType="SysConfig">
        insert into sys_config (
         <if test="configName != null and configName != '' ">config_name,</if>
        <if test="configNameI18n != null and configNameI18n != '' ">config_name_i18n,</if>
         <if test="configKey != null and configKey != '' ">config_key,</if>
         <if test="configValue != null and configValue != '' ">config_value,</if>
         <if test="configType != null and configType != '' ">config_type,</if>
@@ -80,6 +92,7 @@
          create_time
        )values(
         <if test="configName != null and configName != ''">#{configName},</if>
        <if test="configNameI18n != null and configNameI18n != ''">#{configNameI18n},</if>
         <if test="configKey != null and configKey != ''">#{configKey},</if>
         <if test="configValue != null and configValue != ''">#{configValue},</if>
         <if test="configType != null and configType != ''">#{configType},</if>
@@ -93,6 +106,7 @@
        update sys_config 
        <set>
            <if test="configName != null and configName != ''">config_name = #{configName},</if>
            <if test="configNameI18n != null and configNameI18n != ''">config_name_i18n = #{configNameI18n},</if>
            <if test="configKey != null and configKey != ''">config_key = #{configKey},</if>
            <if test="configValue != null and configValue != ''">config_value = #{configValue},</if>
            <if test="configType != null and configType != ''">config_type = #{configType},</if>
@@ -104,7 +118,9 @@
    </update>
   
    <delete id="deleteConfigById" parameterType="Long">
        delete from sys_config where config_id = #{configId}
        delete
        from sys_config
        where config_id = #{configId}
    </delete>
    
    <delete id="deleteConfigByIds" parameterType="Long">
@@ -115,7 +131,9 @@
    </delete>
    <select id="selectByType" parameterType="String" resultMap="SysConfigResult">
        select * from sys_config where config_key = #{sysType}
        select *
        from sys_config
        where config_key = #{sysType}
    </select>
    
</mapper>