帮忙看下mybatis查出的数据为什么是一条
答案:1 悬赏:50 手机版
解决时间 2021-04-05 07:33
- 提问者网友:不要迷恋哥
- 2021-04-04 06:39
帮忙看下mybatis查出的数据为什么是一条
最佳答案
- 五星知识达人网友:轻熟杀无赦
- 2021-04-04 07:13
<resultMap id="articleResultMap" type="Article">
<id property="id" column="id" />
<result property="title" column="title" />
<result property="content" column="content" />
</resultMap>
<resultMap id="articleResultMap" type="Article">
<id property="id" column="id" />
<result property="username" column="userName" />
<result property="useraddress" column="userAddress" />
<collection property="articles" column="ID" javaType="ArrayList" ofType="java.lang.Object" select="select-articles-user" />
</resultMap>
<select id="getUserArticles" parameterType="int" resultMap="resultUserArticleList">
select u.id,u.username,u.useraddress from test_user u where u.id=#{id}
</select>
<select id="select-articles-user" parameterType="int" resultMap="articleResultMap">
select id,title,content from test_article where id = #{ID}
</select>
<id property="id" column="id" />
<result property="title" column="title" />
<result property="content" column="content" />
</resultMap>
<resultMap id="articleResultMap" type="Article">
<id property="id" column="id" />
<result property="username" column="userName" />
<result property="useraddress" column="userAddress" />
<collection property="articles" column="ID" javaType="ArrayList" ofType="java.lang.Object" select="select-articles-user" />
</resultMap>
<select id="getUserArticles" parameterType="int" resultMap="resultUserArticleList">
select u.id,u.username,u.useraddress from test_user u where u.id=#{id}
</select>
<select id="select-articles-user" parameterType="int" resultMap="articleResultMap">
select id,title,content from test_article where id = #{ID}
</select>
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯