<?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.qnfhq.modules.c2c.dao.C2cPaymentVoucherDao">

    <resultMap type="com.qnfhq.modules.c2c.entity.C2cPaymentVoucherEntity" id="c2cPaymentVoucherMap">
        <result property="id" column="id"/>
        <result property="orderId" column="order_id"/>
        <result property="orderNo" column="order_no"/>
        <result property="img" column="img"/>
        <result property="userId" column="user_id"/>
        <result property="status" column="status"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
    </resultMap>


    <sql id="selectC2cPaymentVoucherVo">
        select id, order_id, order_no, img, user_id,status, create_time, update_time from c2c_payment_voucher
    </sql>

    <select id="selectC2cPaymentVoucherByIds" parameterType="String" resultMap="c2cPaymentVoucherMap">
        <include refid="selectC2cPaymentVoucherVo"/>
        where status=1 and order_id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
        order by id
    </select>
</mapper>