<?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.mzl.flower.mapper.customer.FollowMapper">
|
|
<select id="myFollow" resultType="com.mzl.flower.dto.response.customer.FollowDTO"
|
parameterType="java.lang.String">
|
SELECT
|
f.id,
|
f.supplier_id,
|
f.user_id,
|
f.create_time,
|
s.`name` AS supplierName,
|
s.cover AS cover
|
FROM
|
t_follow_supplier f
|
LEFT JOIN t_supplier_info s ON f.supplier_id = s.id
|
WHERE
|
f.deleted = 0
|
<if test="userId != null and userId != ''">
|
AND f.user_id = #{userId}
|
</if>
|
ORDER BY f.create_time DESC
|
</select>
|
|
<select id="getStatisFansCount" resultType="java.lang.Integer">
|
SELECT IFNULL(COUNT(DISTINCT f.user_id), 0)
|
FROM t_follow_supplier f
|
WHERE f.deleted = 0
|
AND f.supplier_id = #{supplierId};
|
</select>
|
</mapper>
|