TopicFollowRelEntityMapper.xml 1.77 KB
Newer Older
刘基明's avatar
刘基明 committed
1 2 3
<?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.tanpu.community.dao.mapper.community.TopicFollowRelMapper">
王亚雷's avatar
王亚雷 committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
  <resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.TopicFollowRelEntity">
    <!--@mbg.generated-->
    <!--@Table topic_follow_rel-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="topic_id" jdbcType="VARCHAR" property="topicId" />
    <result column="user_id" jdbcType="VARCHAR" property="userId" />
    <result column="follow_time" jdbcType="TIMESTAMP" property="followTime" />
    <result column="unfollow_time" jdbcType="TIMESTAMP" property="unfollowTime" />
    <result column="manager" jdbcType="INTEGER" property="manager" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="delete_tag" jdbcType="INTEGER" property="deleteTag" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, topic_id, user_id, follow_time, unfollow_time, manager, create_time, update_time,
    delete_tag
  </sql>
刘基明's avatar
刘基明 committed
22 23 24 25 26 27 28 29 30 31 32 33

<!--auto generated by MybatisCodeHelper on 2022-02-17-->
    <select id="selectTopicIdByUserId" resultType="java.lang.String">
        select topic_id
        from topic_follow_rel
        where user_id=#{userId}
        and delete_tag = 0
    </select>

<!--auto generated by MybatisCodeHelper on 2022-02-17-->
    <select id="queryOneByTopicIdAndUserId" resultMap="BaseResultMap">
        select
王亚雷's avatar
王亚雷 committed
34
        <include refid="Base_Column_List" />
刘基明's avatar
刘基明 committed
35
        from topic_follow_rel
刘基明's avatar
刘基明 committed
36
        where topic_id=#{topicId} and user_id=#{userId} and delete_tag = 0
刘基明's avatar
刘基明 committed
37 38
    </select>
</mapper>