<?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">
<mapper namespace="org.springblade.system.mapper.ISystemConfigMapper">
    <insert id="add">
        insert into da_ky_system_config(config_name, config_code, use_status)
        values(#{configName}, #{configCode}, #{useStatus})
    </insert>

    <update id="update">
        update da_ky_system_config
        <set>
            <if test="configName != null and configName !=''">
                config_name = #{configName},
            </if>
            <if test="configCode != null and configCode !=''">
                config_code = #{configCode},
            </if>
            <if test="useStatus != null and useStatus !=''">
                use_status = #{useStatus},
            </if>
        </set>
        where id = #{id}
    </update>
    <delete id="del">
        delete from da_ky_system_config where id = #{id}
    </delete>

    <select id="list" resultType="org.springblade.common.core.domain.entity.SystemConfig">
        select id,
               config_name as configName,
               config_code as configCode,
               use_status as useStatus
        from da_ky_system_config
    </select>
    <select id="listConfig" resultType="org.springblade.common.core.domain.entity.SystemConfigVo">
        select
               config_code as configCode,
               use_status as useStatus
        from da_ky_system_config
    </select>
</mapper>
