<?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.liquidnet.service.kylin.mapper.KylinOrderRefundBatchesMapper">

    <select id="misRefundBatchList" resultType="com.liquidnet.service.kylin.dao.OrderRefundBatchDao">
        SELECT *
        FROM kylin_order_refund_batches
        <where>
            <if test="targetId!=''">
                AND target_id = #{targetId}
            </if>
            <if test="status!=''">
                AND status IN
                <foreach collection="statusStr" item="status" index="index" open="(" close=")" separator=",">
                    ${status}
                </foreach>
            </if>
        </where>
        ORDER BY mid DESC
    </select>
    <select id="selectLastOne" resultType="com.liquidnet.service.kylin.entity.KylinOrderRefundBatches">
        SELECT *
        FROM kylin_order_refund_batches
        <where>
            target_id = #{targetId}
        </where>
        ORDER BY mid DESC
        LIMIT 1
    </select>
</mapper>
