<?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.ruoyi.xq.mapper.DynamicStarMapper">

    <resultMap type="com.ruoyi.xq.domain.DynamicStar" id="DynamicStarResult">
        <result property="id" column="id"/>
        <result property="starUserId" column="star_user_id"/>
        <result property="starUsercode" column="star_usercode"/>
        <result property="dynamicId" column="dynamic_id"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
    </resultMap>
    <select id="myStarDynamic" resultType="com.ruoyi.xq.dto.app.dynamic.MyStarDynamicListVO">
        select
            t3.id as star_user_id, t3.usercode as star_usercode,
            t3.nickname as star_nickname, t3.avatar as star_avatar,
            t1.dynamic_id, t1.create_time
        from xq_dynamic_star t1
        join xq_dynamic t2 on t1.dynamic_id = t2.id
        join xq_user t3 on t1.star_user_id = t3.id
        where t2.audit_status = 2 and t2.user_id = #{query.userId}
        order by t1.create_time desc
    </select>


</mapper>
