mybatis 集合in的用法
<!-- 查询 设备List 的 某天,并且小于当前小时的,耗电 记录 -->
<select id="findByDeviceIdInAndBetweenRecordTime" resultType="cn.com.platform.entity.RecordElectricityEntity">
select * from
<!-- power_record_electricity_${tableYear} c -->
power_record_electricity c
where c.deviceId in
<foreach collection="deviceList" index="index" item="item" open="(" separator="," close=")">
#{item.id}
</foreach>
and c.recordTime
>=#{startTime}
and c.recordTime <= #{endTime}
</select>
梅花香自古寒来