<?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.ssm.manage.mapper.RechargeAccountGiveMapper">
    <resultMap id="RechargeAccountGive" type="com.ssm.manage.entity.RechargeAccountGive">
        <result property="rechargeStoreNum" column="recharge_store_num"/>
    </resultMap>
    <select id="getDocNum" parameterType="com.ssm.manage.entity.RechargeAccountGive"  resultMap="RechargeAccountGive">
        select recharge_store_num from recharge_account_give
        where recharge_store_num like concat(#{rechargeStoreNum,jdbcType = VARCHAR},'%')
        order by recharge_store_num desc
    </select>
    <update id="updateByGifMoney" parameterType="com.ssm.manage.entity.RechargeAccountGive">
        update recharge_account_give set gift_consume_money=#{giftConsumeMoney,jdbcType=DECIMAL}
        where account_id=#{accountId,jdbcType=BIGINT} and member_id = #{memberId,jdbcType=BIGINT}
                and store_id=#{storeId,jdbcType=BIGINT}
    </update>
    <update id="updateByMemberId">
        update recharge_account_give set member_name = #{memberName} where member_id = #{memberId}
    </update>
</mapper>