ibatis 查询部分字段的List的实现方法
可以返回 resultClass 但查询要写上别名
<select id="querypuhuatoutiao" parameterClass="QueryArticleCondition" resultClass="Article">
SELECT
CMS_ARTICLE_TBL.ARTICLE_ID articleId,CMS_ARTICLE_TBL.TITLE as title
FROM CMS_ARTICLE_TBL
WHERE 1=1
AND CMS_ARTICLE_TBL.LABEL= #label# AND CMS_ARTICLE_TBL.TO_EXAMINE=1
ORDER BY CMS_ARTICLE_TBL.CREATE_DATE DESC
</select>
可以返回resultMap 但是要创建ArticleResult2 只查询两个字段
<select id="querypuhuatoutiao" parameterClass="QueryArticleCondition" resultMap="Article_NS.ArticleResult2">
SELECT
CMS_ARTICLE_TBL.ARTICLE_ID,CMS_ARTICLE_TBL.TITLE
FROM CMS_ARTICLE_TBL
WHERE 1=1
AND CMS_ARTICLE_TBL.LABEL= #label# AND CMS_ARTICLE_TBL.TO_EXAMINE=1
ORDER BY CMS_ARTICLE_TBL.CREATE_DATE DESC
</select>