<?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.trading.mapper.BizIsolationSettingMapper">

    <resultMap type="com.ruoyi.web.modules.trading.domain.BizIsolationSetting" id="BizIsolationSettingResult">
        <id     property="id"           column="id"/>
        <result property="defaultDays"  column="default_days"/>
        <result property="remark"       column="remark"/>
        <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>

    <sql id="selectVo">
        select id, default_days, remark, create_by, create_time, update_by, update_time
        from biz_isolation_setting
    </sql>

    <select id="selectBizIsolationSettingById" parameterType="long" resultMap="BizIsolationSettingResult">
        <include refid="selectVo"/>
        where id = #{id}
    </select>

    <insert id="insertBizIsolationSetting" parameterType="com.ruoyi.web.modules.trading.domain.BizIsolationSetting">
        insert into biz_isolation_setting (
            id, default_days, remark, create_by, create_time
        ) values (
            #{id}, #{defaultDays}, #{remark}, #{createBy}, sysdate()
        )
    </insert>

    <update id="updateBizIsolationSetting" parameterType="com.ruoyi.web.modules.trading.domain.BizIsolationSetting">
        update biz_isolation_setting set
            default_days = #{defaultDays},
            remark = #{remark},
            update_by = #{updateBy},
            update_time = sysdate()
        where id = #{id}
    </update>
</mapper>
