<?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="org.jeecg.modules.system.app.mapper.AppIsinMapper">

    <select id="pageAppIsinVerifyRecords" resultType="org.jeecg.modules.app.vo.AppIsinVerifyVO">
        SELECT
        i.id,
        i.use_time,
        i.ticket_no,
        i.isin_status,
        i.remark,
        o.order_type,
        opi.product_image,
        opi.product_name,
        opi.original_price,
        opi.use_date_str,
        opi.frame_time_str
        FROM
            nm_isin i
                LEFT JOIN nm_order o ON i.order_id = o.id
                LEFT JOIN nm_order_pro_info opi ON i.order_pro_info_id = opi.id
        <where>
            i.isin_status = 1 and o.order_type != 0
            <if test="orgCode != null and orgCode != ''">
               and i.org_code = #{orgCode}
            </if>
        </where>
        ORDER BY
            i.use_time DESC
    </select>
</mapper>