<?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.yami.shop.dao.UserShopBehaviorMapper">


    <select id="findByUserIdCount" resultType="java.lang.Integer">
        select ifNULL(count(1),0)  from  tz_user_shop_behavior where user_id = #{userId}

    </select>
    <select id="findByUserId" resultType="com.yami.shop.bean.model.UserShopBehavior">
        select * from tz_user_shop_behavior  where user_id = #{userId} and channel_id = #{channelId} and shop_id = #{shopId} order by create_time limit #{num}
    </select>
    <select id="findByUserIdAndProd" resultType="com.yami.shop.bean.model.UserShopBehavior">
        select * from tz_user_shop_behavior  where user_id = #{userId} and prod_id =#{prodId} and channel_id = #{channelId} and shop_id = #{shopId}
    </select>
</mapper>
