package com.fzzy.igds.repository; import com.fzzy.igds.domain.DeviceIot; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; /** * @Description * @Author CZT * @Date 2025/11/28 14:42 */ @Service public interface DeviceIotRepository extends JpaRepository, JpaSpecificationExecutor { /** * 根据组织编码获取仓库货位信息 * * @param companyId * @return */ @Query("from DeviceIot where companyId =:companyId order by id") List getDeviceIotByCompanyId(@Param("companyId") String companyId); /** * 更新设备位置 * @param deviceId * @param posX * @param posY */ @Transactional @Modifying @Query("update DeviceIot set posX =:posX,posY =:posY where id =:deviceId") void updatePos(@Param("deviceId") String deviceId, @Param("posX") Double posX, @Param("posY") Double posY); }