Appearance
数据集管理-主子表参数
点击观看本节视频
主子表参数用于将本数据集中查询出来的数据传递到其他数据集。在数据集参数配置时可以添加子表参数,如下图所示: 例如: 数据集ds001:查询语句为 select id,name,value from order
数据集ds002:需要用【数据集ds001】的id作为参数来查询数据,则就可以在配置【数据集ds001】的参数时添加子表参数
【数据ds002】的参数使用如下写法接收【数据集ds001】的参数,如下:
select
id,
order_code,
name,
value
from
order_detail
<where>
<if test="id!=null and id.size() > 0">
and id in
<foreach collection="id" open="(" separator="," close=")" item="item" index="index">
#{item}
</foreach>
</if>
</where>
因为主数据集可能查询一条,也可能查询出多条数据,所以传递给子数据集的数据格式统一采用数组的格式传递