<?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.nexo.model.douyin.mapper.NexoDouyinUserInfoMapper">

    <resultMap type="com.nexo.module.api.douyin.domain.NexoDouyinUserInfo" id="NexoDouyinUserInfoResult">
        <result property="userId" column="user_id"/>
        <result property="secUid" column="sec_uid"/>
        <result property="uniqueId" column="unique_id"/>
        <result property="nickname" column="nickname"/>
        <result property="signature" column="signature"/>
        <result property="ipLocation" column="ip_location"/>
        <result property="avatar" column="avatar"/>
        <result property="liveStatus" column="live_status"/>
        <result property="userAge" column="user_age"/>
        <result property="totalFavorited" column="total_favorited"/>
        <result property="followerCount" column="follower_count"/>
        <result property="followingCount" column="following_count"/>
        <result property="awemeCount" column="aweme_count"/>
        <result property="coverUrl" column="cover_url"/>
        <result property="roomId" column="room_id"/>
    </resultMap>

    <select id="getUpdateInfoList" resultType="com.nexo.module.api.douyin.domain.NexoDouyinUserInfo">
        SELECT * FROM `nexo_douyin_user_info` WHERE job_info_status = 1
        <where>
            <if test="secuid != null">
                AND sec_uid = #{secuid}
            </if>
            <if test="secuid == null">
                group by create_by
            </if>
        </where>
    </select>

</mapper>
