<?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.gree.mall.miniapp.commonmapper.CustomGoodsFavoriteMapper">
    <select id="queryGoodsFavorite" resultType="com.gree.mall.miniapp.bean.goods.GoodsFavoriteBean">
        select gf.goods_favorite_id, gs.*
        from goods_favorite gf
                 left join goods gs
                           on gs.goods_id = gf.goods_id
        where gf.user_id = #{userId}
        order by gf.create_time DESC
            limit #{pageNum},#{pageSize}
    </select>
    <select id="queryGoodsFavoriteCount" resultType="java.lang.Integer">
        select count(*)
        from goods_favorite gf
                 left join goods gs
                           on gs.goods_id = gf.goods_id
        where gf.user_id = #{userId}
    </select>

</mapper>