EOS Low-Code Platform 8 EOS Low-Code Platform 8
产品简介
安装部署
应用开发
专题场景实战案例
低代码(Low-Code)开发参考手册
高开开发参考手册
流程开发参考手册
AFCenter 使用指南
Governor 使用指南
FAQ
  • 基本类型的result

# 基本类型的Result

# 概述

Result Map还可以给基本类型包装类(如String、Integer、Boolean等)赋值。

注意:要记住一个限制,基本类型只能有一个属性,名字必须用"value"。

# 使用场景

例如,如果用户要获得所有产品描述的一个列表而不是整个Product,Result Map如下:

<resultMap id="get-product-result" class="java.lang.String" >
  <result property="value" column="PRD_DESCRIPTION"/>
</resultMap>

更简单方法是,在Mapped Statement中使用resultClass属性(使用"as"关键字给字段取别名"value")。

<statement id="getProductCount" resultClass="java.lang.Integer">
  select count(1) as value from PRODUCT
</statement>