<?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.cyksj.mapper.OrderDiscountPlusPurchaseSkuRelationMapper">

    <select id="selectPlusRelationByIdAndUserId"
            resultType="com.cyksj.model.entity.OrderDiscountPlusPurchaseSkuRelation">
        select id, relation_ids, order_id
        from order_discount_plus_purchase_sku_relation
        where user_id = #{userId}
          and relation_ids like concat('%', #{relationId}, '%')
        order by order_id desc
    </select>
</mapper>