<!-- 查询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 发布