<?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.dd.admin.business.starNotes.mapper.StarNotesMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.dd.admin.business.starNotes.entity.StarNotes">
        <id column="STAR_NOTE_ID" property="starNoteId" />
        <result column="NOTE_ID" property="noteId" />
        <result column="NOTE_TITLE" property="noteTitle" />
        <result column="AUTHOR_ID" property="authorId" />
        <result column="AUTHOR_NAME" property="authorName" />
        <result column="FOLLOW_ID" property="followId" />
        <result column="FOLLOW_NAME" property="followName" />
        <result column="CREATE_TIME" property="createTime" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        STAR_NOTE_ID, NOTE_ID, NOTE_TITLE, AUTHOR_ID, AUTHOR_NAME, FOLLOW_ID, FOLLOW_NAME, CREATE_TIME
    </sql>

    <select id="selectStarNotesPage" resultType="com.dd.admin.business.starNotes.domain.StarNotesVo">
        select
        *
        from business_star_notes where 1 = 1
    </select>

    <select id="selectStarNotesList" resultType="com.dd.admin.business.starNotes.domain.StarNotesVo">
        select
        *
        from business_star_notes where 1 = 1
        <if test="starNotesDto.followId != null and starNotesDto.followId != ''">
            and FOLLOW_ID = #{starNotesDto.followId}
        </if>
    </select>
</mapper>
