<?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.store.mapper.BizShopGlobalConfigMapper">

    <resultMap id="BizShopGlobalConfigResult" type="com.ruoyi.web.modules.store.domain.BizShopGlobalConfig">
        <id property="configId" column="config_id"/>
        <result property="defaultAuditPass" column="default_audit_pass"/>
        <result property="maxSubAdmin" column="max_sub_admin"/>
        <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="BizShopGlobalConfigResult">
        select config_id, default_audit_pass, max_sub_admin,
               create_by, create_time, update_by, update_time
        from biz_shop_global_config
        where config_id = #{configId}
    </select>

    <insert id="insert">
        insert into biz_shop_global_config (
            config_id, default_audit_pass, max_sub_admin, create_by, create_time
        ) values (
            #{configId}, #{defaultAuditPass}, #{maxSubAdmin}, #{createBy}, sysdate()
        )
    </insert>

    <update id="update">
        update biz_shop_global_config
        set default_audit_pass = #{defaultAuditPass},
            max_sub_admin = #{maxSubAdmin},
            update_by = #{updateBy},
            update_time = sysdate()
        where config_id = #{configId}
    </update>

</mapper>
