<?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.freemud.manager.db2.dao.RefundOverOrderDao">

    <resultMap id="BaseResultMap" type="cn.freemud.entities.db.db2.RefundOverOrder" >
        <!--
          WARNING - @mbg.generated
        -->
        <id column="refund_id" property="refundId" jdbcType="INTEGER" />
        <result column="refund_order_code" property="refundOrderCode" jdbcType="VARCHAR" />
        <result column="refund_coupon_code" property="refundCouponCode" jdbcType="VARCHAR" />
        <result column="refund_time" property="refundTime" jdbcType="TIMESTAMP" />
        <result column="refund_status" property="refundStatus" jdbcType="INTEGER" />
        <result column="refund_fail" property="refundFail" jdbcType="INTEGER" />
        <result column="refund_desc" property="refundDesc" jdbcType="VARCHAR" />
        <result column="refund_create_time" property="refundCreateTime" jdbcType="TIMESTAMP" />
        <result column="refund_update_time" property="refundUpdateTime" jdbcType="TIMESTAMP" />
    </resultMap>

    <sql id="all_column">
         refund_id as refundId,
         refund_order_code as refundOrderCode,
         refund_coupon_code as refundCouponCode,
         refund_time as refundTime,
         refund_status as refundStatus,
         refund_fail as refundFail,
         refund_desc as refundDesc,
         refund_create_time as refundCreateTime,
         refund_update_time as refundUpdateTime
    </sql>

    <select id="selectBatch" resultType="cn.freemud.entities.db.db2.RefundOverOrder">
        SELECT
        <include refid="all_column"/>
        FROM refund_over_order
        WHERE refund_status = 1
        order by refund_id
        limit #{num}
    </select>

    <update id="update" parameterType="cn.freemud.entities.db.db2.RefundOverOrder">
        update refund_over_order
        set refund_status = #{refundOverOrder.refundStatus},
        refund_fail = #{refundOverOrder.refundFail},
        refund_desc = #{refundOverOrder.refundDesc}
        where refund_id = #{refundOverOrder.refundId}
    </update>

</mapper>