<?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.ga.core.mapper.commission.ClawbackInterestMapper">

    <resultMap id="VOMap" type="com.ga.core.vo.commission.ClawbackInterestVO"/>

    <insert id="insertOne">
        INSERT INTO clawback_interest (receivable_id, settle_month, interest_amount)
        VALUES (#{receivableId}, #{settleMonth}, #{interestAmount})
    </insert>

    <select id="selectBySettleMonth" resultMap="VOMap">
        SELECT interest_id, receivable_id, settle_month, interest_amount, created_at
          FROM clawback_interest
         WHERE settle_month = #{settleMonth}
    </select>

    <delete id="deleteBySettleMonth">
        DELETE FROM clawback_interest WHERE settle_month = #{settleMonth}
    </delete>

</mapper>
