亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

mybatis多對多 分頁

mybatis多對多 分頁

暴躁的代碼 2017-07-10 17:31:09
sql語句(拼接條件后):SELECT?DISTINCT?article.id,article.title,article.content,article.summarize,article.publish_time?as?publish_time,article.page_views?as?pageViews?,? topic.id?as?topic_id,?topic.name?as?topic_name,?topic.summarize?as?topic_summarize?,? tag.id?as?tag_id,?tag.name?as?tag_name? FROM?tb_article?article?LEFT?JOIN?tb_topic?topic?ON?article.topic_id?=?topic.id? LEFT?JOIN?tb_article_tag?article_tag?ON?article.id?=?article_tag.article_id ?LEFT?JOIN?tb_tag?tag?ON?tag.id?=?article_tag.tag_id ??ORDER?BY?article.id?limit?0,5xml映射:<resultMap?id="allResult"?type="space.entity.Article"> ????<id?column="id"?property="id"/> ????<result?column="title"?property="title"/> ????<result?column="content"?property="content"/> ????<result?column="summarize"?property="summarize"/> ????<result?column="publish_time"?property="publishTime"/> ????<result?column="page_views"?property="pageViews"/> ????<association?column="topic_id"?property="topic"?resultMap="space.dao.TopicDao.openResultMapper"/> ????<collection?property="tagList"?ofType="Tag"?resultMap="space.dao.TagDao.openResultMapper"/> </resultMap>會出現這種情況mybatis會把兩條記錄合并成一條,就少了一條記錄也出現了這種情況當兩個條記錄不在同一頁,mybatis是看不到他們的,就會出現這種總數+1的情況現在問題來了,sql語句怎么寫,才能把多對多的記錄放在一行,并且配合mybatis的映射呢?
查看完整描述

目前暫無任何回答

  • 0 回答
  • 0 關注
  • 2390 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號