INSERT INTO ten_person_sync_${tenantId}
(device_id,
device_sn,
person_id,
state,
last_update_time,
tenant_id)
VALUES
#{item.deviceId},
#{item.deviceSn},
#{item.personId},
#{item.state},
#{item.lastUpdateTime},
#{item.tenantId}
insert into ten_person_sync_${tenantId}
person_sync_id,
device_id,
device_sn,
person_id,
state,
last_update_time,
tenant_id
#{personSyncId,jdbcType=BIGINT},
#{deviceId,jdbcType=BIGINT},
#{deviceSn},
#{personId,jdbcType=BIGINT},
#{state,jdbcType=TINYINT},
#{lastUpdateTime,jdbcType=TIMESTAMP},
#{tenantId,jdbcType=BIGINT},
update ten_person_sync_${tenantId}
person_sync_id = #{personSyncId,jdbcType=BIGINT},
device_id = #{deviceId,jdbcType=BIGINT},
device_sn = #{deviceSn},
person_id = #{personId,jdbcType=BIGINT},
state = #{state,jdbcType=TINYINT},
last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP},
tenant_id = #{tenantId,jdbcType=TIMESTAMP},
where person_sync_id = #{personSyncId,jdbcType=BIGINT}
delete from ten_person_sync_${tenantId}
where device_id = #{deviceId}
and state = 3
delete from ten_person_sync_${tenantId}
where device_id = #{deviceId}
delete from ten_person_sync_${tenantId}
where person_sync_id = #{personSyncId}