<?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="cn.reghao.tnb.content.app.chat.db.mapper.HongbaoReceiverMapper">
    <insert id="save" useGeneratedKeys="true" keyProperty="id">
        insert into chat_hongbao_receiver
        (`hongbao_id`,`receiver_id`,`amount`,`remark`,`create_at`)
        values
        (#{hongbaoId},#{receiverId},#{amount},#{remark},#{createAt})
    </insert>

    <select id="findById" resultType="cn.reghao.tnb.content.app.chat.model.po.HongbaoReceiver">
        select *
        from chat_hongbao_receiver
        where hongbao_id=#{hongbaoId} and reciever_id=#{receiverId}
    </select>
    <select id="findByHongbaoId" resultType="cn.reghao.tnb.content.app.chat.model.po.HongbaoReceiver">
        select *
        from chat_hongbao_receiver
        where hongbao_id=#{hongbaoId}
    </select>
</mapper>
