<?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="com.ruoyi.web.modules.mall.mapper.BizMallConfigMapper">

    <resultMap id="BizMallConfigResult" type="com.ruoyi.web.modules.mall.domain.BizMallConfig">
        <id property="configId" column="config_id"/>
        <result property="icpNo" column="icp_no"/>
        <result property="icpLink" column="icp_link"/>
        <result property="psbNo" column="psb_no"/>
        <result property="psbLink" column="psb_link"/>
        <result property="currencySymbol" column="currency_symbol"/>
        <result property="currencyNameCn" column="currency_name_cn"/>
        <result property="goodsSnPrefix" column="goods_sn_prefix"/>
        <result property="showSales" column="show_sales"/>
        <result property="autoConfirmDays" column="auto_confirm_days"/>
        <result property="aftersaleLimitDays" column="aftersale_limit_days"/>
        <result property="defaultAvatar" column="default_avatar"/>
        <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>

    <select id="selectById" resultMap="BizMallConfigResult">
        select config_id, icp_no, icp_link, psb_no, psb_link,
               currency_symbol, currency_name_cn, goods_sn_prefix,
               show_sales, auto_confirm_days, aftersale_limit_days, default_avatar,
               create_by, create_time, update_by, update_time
        from biz_mall_config
        where config_id = #{configId}
    </select>

    <insert id="insert">
        insert into biz_mall_config (
            config_id, icp_no, icp_link, psb_no, psb_link,
            currency_symbol, currency_name_cn, goods_sn_prefix,
            show_sales, auto_confirm_days, aftersale_limit_days, default_avatar,
            create_by, create_time
        ) values (
            #{configId}, #{icpNo}, #{icpLink}, #{psbNo}, #{psbLink},
            #{currencySymbol}, #{currencyNameCn}, #{goodsSnPrefix},
            #{showSales}, #{autoConfirmDays}, #{aftersaleLimitDays}, #{defaultAvatar},
            #{createBy}, sysdate()
        )
    </insert>

    <update id="update">
        update biz_mall_config
        set icp_no = #{icpNo},
            icp_link = #{icpLink},
            psb_no = #{psbNo},
            psb_link = #{psbLink},
            show_sales = #{showSales},
            auto_confirm_days = #{autoConfirmDays},
            aftersale_limit_days = #{aftersaleLimitDays},
            default_avatar = #{defaultAvatar},
            update_by = #{updateBy},
            update_time = sysdate()
        where config_id = #{configId}
    </update>

</mapper>
