<?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.crm.pay.dao.mapper.GoldenOrderMapper">

    <select id="getByCustomIdAndGoodsIdIn" resultType="com.crm.rely.backend.model.pojo.table.GoldenOrderDetailsTable">
        SELECT *
        FROM golden_order_details der
        left join golden_order gor on der.serial = gor.serial
        where gor.`status` in (1,2) and der.custom_id = #{customId}
        and der.goods_id in
        <foreach collection="goodIds" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        limit 1
    </select>

</mapper>