refactor(iot): 优化 OTA 升级记录查询方法
- 重写 getOtaUpgradeRecordCount 和 getOtaUpgradeRecordStatistics 方法,使用 MyBatis-Plus 的 LambdaQueryWrapperX -移除 XML 中对应的 SQL 查询语句 - 提高代码可维护性和数据库兼容性
This commit is contained in:
@@ -4,21 +4,4 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.iot.dal.mysql.ota.IotOtaUpgradeRecordMapper">
|
||||
|
||||
<!-- TODO @li:看看是不是可以通过 mybatis plus 写哈,更好适配多 db -->
|
||||
<select id="getOtaUpgradeRecordCount" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from iot_ota_upgrade_record
|
||||
where task_id = #{taskId}
|
||||
and device_name like concat('%', #{deviceName}, '%')
|
||||
and status = #{status}
|
||||
</select>
|
||||
|
||||
<!-- TODO @li:看看是不是可以通过 mybatis plus 写哈,更好适配多 db -->
|
||||
<select id="getOtaUpgradeRecordStatistics" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from iot_ota_upgrade_record
|
||||
where firmware_id = #{firmwareId}
|
||||
and status = #{status}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user