This commit is contained in:
磷叶 2025-04-29 18:08:26 +08:00
parent 578342ec14
commit 4f63af8214
4 changed files with 35 additions and 3 deletions

View File

@ -160,4 +160,12 @@ public interface DeviceMapper
*/ */
List<DeviceMacSnVO> selectMacSnList(@Param("query") DeviceQuery query); List<DeviceMacSnVO> selectMacSnList(@Param("query") DeviceQuery query);
/**
* 条件更新简单版
* @param data
* @param query
* @return
*/
int updateByQuerySimple(@Param("data") Device data, @Param("query") DeviceQuery query);
} }

View File

@ -476,4 +476,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<!-- updateByQuerySimple -->
<update id="updateByQuerySimple">
update bst_device bd
<trim prefix="SET" suffixOverrides=",">
<include refid="updateColumns"/>
</trim>
<where>
<include refid="searchCondition"/>
</where>
</update>
</mapper> </mapper>

View File

@ -300,7 +300,7 @@ public class DeviceIotServiceImpl implements DeviceIotService {
if (device == null) { if (device == null) {
return 0; return 0;
} }
if (StringUtils.isBlank(device.getMac()) || device.getId() == null) { if (StringUtils.isBlank(device.getMac()) && device.getId() == null) {
return 0; return 0;
} }
Device data = new Device(); Device data = new Device();
@ -319,8 +319,8 @@ public class DeviceIotServiceImpl implements DeviceIotService {
data.setSoftwareVersion(device.getSoftwareVersion()); data.setSoftwareVersion(device.getSoftwareVersion());
DeviceQuery query = new DeviceQuery(); DeviceQuery query = new DeviceQuery();
query.setId(device.getId()); query.setId(device.getId());
query.setMac(device.getMac()); query.setEqMac(device.getMac());
return deviceMapper.updateByQuery(data, query); return deviceMapper.updateByQuerySimple(data, query);
} }
@Override @Override

View File

@ -0,0 +1,12 @@
package com.ruoyi.web.app;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
@RestController
@RequestMapping("/app/locationLog")
public class AppLocationLogController extends BaseController {
}