<!-- 查询group_id 下的 所有 kpi的数据 -->
<select id="getAll" resultMap="realtimeMap">
select * from db_table_data_realtime_t_#{groupId} where group_id = #{groupId}
</select>
<!-- 查询group_id 下的 指定 kpi数据 -->
<select id="getInfoByKpi" resultMap="realtimeMap">
select * from db_table_data_realtime_t_#{groupId} where group_id = #{groupId} and kpi = #{kpi}
</select>
<!-- 查询 group_id 下的 某些 kpi数据-->
<select id="getIndfoByKpis" resultMap="realtimeMap">
select * from db_table_data_realtime_t_#{groupId} where group_id = #{groupId}
<if test=" kpi != null and kpi.size() > 0 ">
and kpi in
<foreach collection="kpi" item="item" open="(" close=")" separator="," index="">
#{item}
</foreach>
</if>
</select>
MySQL 分表,mybatis后台查询
最新推荐文章于 2023-09-16 16:03:34 发布
本文介绍了如何使用SQL查询特定和多个KPI的数据,包括获取group_id下的所有KPI、指定KPI和多个KPI的实例。
1224

被折叠的 条评论
为什么被折叠?



