更新
This commit is contained in:
parent
578342ec14
commit
4f63af8214
|
@ -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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user