<sql id="Base_Column_List">
id_, uuid_, resourcePrimKey, groupId, companyId, userId, userName, createDate, modifiedDate,
folderId, classNameId, classPK, treePath, articleId, version, title, urlTitle, description,
content, type_, structureId, templateId, layoutUuid, displayDate, expirationDate,
reviewDate, indexable, smallImage, smallImageId, smallImageURL, status, statusByUserId,
statusByUserName, statusDate
</sql>
<select id="selectCMSList" resultMap="BaseResultMap">
SELECT
j.title,j.content,j.userName,
j.createDate, cm.url
FROM journalarticle j inner join cmspublishedarticle cm
on j.resourcePrimKey=cm.resourcePrimKey
limit 0,10000
</select>
List<Journalarticle> selectCMSList();
<resultMap id="BaseResultMap" type="com.sn.pojo.Journalarticle">
<id column="id_" jdbcType="BIGINT" property="id" />
<result column="uuid_" jdbcType="VARCHAR" property="uuid" />
<result column="resourcePrimKey" jdbcType="BIGINT" property="resourceprimkey" />
<result column="userName" jdbcType="VARCHAR" property="username" />
<result column="createDate" jdbcType="TIMESTAMP" property="createdate" />
<result column="modifiedDate" jdbcType="TIMESTAMP" property="modifieddate" />
<result column="folderId" jdbcType="BIGINT" property="folderid" />
<result column="classNameId" jdbcType="BIGINT" property="classnameid" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="urlTitle" jdbcType="VARCHAR" property="urltitle" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="type_" jdbcType="VARCHAR" property="type" />
<result column="indexable" jdbcType="TINYINT" property="indexable" />
<result column="statusDate" jdbcType="TIMESTAMP" property="statusdate" />
<association property="cmspublishedarticle" javaType="com.sn.pojo.Cmspublishedarticle">
<id column="resourcePrimKey" jdbcType="BIGINT" property="resourceprimkey" />
<result column="url" jdbcType="VARCHAR" property="url" />
</association>
</resultMap>

mysql 查询两张表 只显示了一个表的 一条数据 这是什么原因 望各位大神帮助一下
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- 土灵猪 2019-05-15 12:10关注
结果类型BaseResultMap与 j.title,j.content,j.userName,j.createDate, cm.url这个不匹配
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报