| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?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.yonge.cooleshow.bbs.dao.BbsCollectDao">
- <resultMap id="BaseResultMap" type="com.yonge.cooleshow.bbs.entity.BbsCollect">
- <result column="id_" property="id" />
- <result column="article_id_" property="articleId" />
- <result column="collect_user_id_" property="collectUserId" />
- <result column="created_time_" property="createdTime" />
- </resultMap>
-
- <!-- 表字段 -->
- <sql id="baseColumns">
- t.id_ as id
- , t.article_id_ as articleId
- , t.collect_user_id_ as collectUserId
- , t.created_time_ as createdTime
- </sql>
-
- <select id="detail" resultType="com.yonge.cooleshow.bbs.vo.BbsCollectVo">
- SELECT
- <include refid="baseColumns"/>
- FROM bbs_collect t
- where t.id_ = #{id}
- </select>
-
- <select id="selectPage" resultType="com.yonge.cooleshow.bbs.vo.BbsCollectVo">
- SELECT
- <include refid="baseColumns" />
- ,ba.title_ as title
- ,ba.label_name_ as labelName
- ,ba.label_id_ as labelId
- FROM bbs_collect t
- left join bbs_article ba on t.article_id_ = ba.id_
- <where>
- <if test="param.userId != null">
- and #{param.userId,jdbcType=BIGINT} = t.collect_user_id_
- </if>
- </where>
- order by t.created_time_ desc
- </select>
- </mapper>
|