|
@@ -11,10 +11,44 @@
|
|
<result column="descrip" property="descrip" />
|
|
<result column="descrip" property="descrip" />
|
|
<result column="read_cnt" property="readCnt" />
|
|
<result column="read_cnt" property="readCnt" />
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
+ <resultMap id="BaseResultMapVO" type="com.hssx.bms.entity.vo.BookVO">
|
|
|
|
+ <result column="id" property="id" />
|
|
|
|
+ <result column="name" property="name" />
|
|
|
|
+ <result column="cover" property="cover" />
|
|
|
|
+ <result column="author" property="author" />
|
|
|
|
+ <result column="descrip" property="descrip" />
|
|
|
|
+ <result column="read_cnt" property="readCnt" />
|
|
|
|
+ <collection property="bookPages" ofType="com.hssx.bms.entity.BookPage">
|
|
|
|
+ <result column="bpid" property="id" />
|
|
|
|
+ <result column="book_id" property="bookId" />
|
|
|
|
+ <result column="bppagenum" property="pageNum" />
|
|
|
|
+ <result column="file" property="file" />
|
|
|
|
+ </collection>
|
|
|
|
+ <collection property="categories" ofType="com.hssx.bms.entity.BookCategory">
|
|
|
|
+ <result column="bcid" property="id" />
|
|
|
|
+ <result column="book_id" property="bookId" />
|
|
|
|
+ <result column="rank" property="rank" />
|
|
|
|
+ <result column="bcname" property="name" />
|
|
|
|
+ <result column="page_num" property="pageNum" />
|
|
|
|
+ </collection>
|
|
|
|
+ </resultMap>
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
<!-- 通用查询结果列 -->
|
|
<sql id="Base_Column_List">
|
|
<sql id="Base_Column_List">
|
|
id, name, cover, author, descrip, read_cnt
|
|
id, name, cover, author, descrip, read_cnt
|
|
</sql>
|
|
</sql>
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ <select id="selectDetailById" resultMap="BaseResultMapVO">
|
|
|
|
+ select
|
|
|
|
+ b.id, b.name, b.cover, b.author, b.descrip, b.read_cnt,
|
|
|
|
+ bp.id bpid,bp.page_num bppagenum, bp.file,
|
|
|
|
+ bc.id bcid, bc.rank, bc.name bcname, bc.page_num
|
|
|
|
+ from book b
|
|
|
|
+ left join book_category bc
|
|
|
|
+ on bc.book_id = b.id
|
|
|
|
+ left join book_page bp
|
|
|
|
+ on bp.book_id = b.id
|
|
|
|
+ where
|
|
|
|
+ b.id = #{id}
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|