<?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.xxfc.platform.order.mapper.OrderInvoiceMapper" >
    <select id="selectByUserIdAndOrderId" parameterType="com.xxfc.platform.order.entity.OrderInvoice" resultType="com.xxfc.platform.order.entity.OrderInvoice">
        select * from order_e_invoice where user_id = #{userId} and order_ids like concat("%", #{orderIds}, "%")
    </select>

    <select id="getByParam" parameterType="Map" resultType="com.xxfc.platform.order.entity.OrderInvoice">
        select * from order_e_invoice
        <where>
            <if test="type != null">
                and type = #{type}
            </if>
            <if test="userId != null">
                and user_id = #{userId}
            </if>
            <if test="orderIds != null and orderIds != ''">
                and order_ids like concat("%", #{orderIds}, "%")
            </if>
        </where>
        order by crt_time DESC
    </select>
</mapper>