mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
修复指令消费
This commit is contained in:
parent
99e403f89e
commit
d228e84415
3 changed files with 3 additions and 3 deletions
|
|
@ -13,5 +13,5 @@ public interface DeviceCommandDao extends BaseMapper<DeviceCommandEntity> {
|
||||||
|
|
||||||
int updateExecuted(@Param("id") String id, @Param("isExecuted") Integer isExecuted);
|
int updateExecuted(@Param("id") String id, @Param("isExecuted") Integer isExecuted);
|
||||||
|
|
||||||
DeviceCommandEntity consumeCommand(@Param("id") String id);
|
DeviceCommandEntity consumeCommand(@Param("deviceId") String deviceId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ spring:
|
||||||
druid:
|
druid:
|
||||||
#MySQL
|
#MySQL
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://106.75.77.213:3306/zy_esp32_server?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://106.75.77.213:3306/zy_esp32_server_dev?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||||
username: root
|
username: root
|
||||||
password: zy123456
|
password: zy123456
|
||||||
initial-size: 10
|
initial-size: 10
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
SELECT * FROM zy_ai_device_command WHERE device_id = #{deviceId} AND is_executed = 0 ORDER BY create_date DESC
|
SELECT * FROM zy_ai_device_command WHERE device_id = #{deviceId} AND is_executed = 0 ORDER BY create_date DESC
|
||||||
</select>
|
</select>
|
||||||
<select id="consumeCommand" resultType="xiaozhi.modules.device.entity.DeviceCommandEntity">
|
<select id="consumeCommand" resultType="xiaozhi.modules.device.entity.DeviceCommandEntity">
|
||||||
SELECT * FROM zy_ai_device_command WHERE is_executed = 0 ORDER BY create_date ASC LIMIT 1 FOR UPDATE
|
SELECT * FROM zy_ai_device_command WHERE device_id = #{deviceId} AND is_executed = 0 ORDER BY create_date ASC LIMIT 1 FOR UPDATE
|
||||||
</select>
|
</select>
|
||||||
<update id="updateExecuted">
|
<update id="updateExecuted">
|
||||||
UPDATE zy_ai_device_command SET is_executed = #{isExecuted}, update_date = NOW() WHERE id = #{id}
|
UPDATE zy_ai_device_command SET is_executed = #{isExecuted}, update_date = NOW() WHERE id = #{id}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue