更新
This commit is contained in:
parent
578342ec14
commit
4f63af8214
|
@ -160,4 +160,12 @@ public interface DeviceMapper
|
|||
*/
|
||||
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>
|
||||
</select>
|
||||
|
||||
<!-- updateByQuerySimple -->
|
||||
|
||||
<update id="updateByQuerySimple">
|
||||
update bst_device bd
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<include refid="updateColumns"/>
|
||||
</trim>
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -300,7 +300,7 @@ public class DeviceIotServiceImpl implements DeviceIotService {
|
|||
if (device == null) {
|
||||
return 0;
|
||||
}
|
||||
if (StringUtils.isBlank(device.getMac()) || device.getId() == null) {
|
||||
if (StringUtils.isBlank(device.getMac()) && device.getId() == null) {
|
||||
return 0;
|
||||
}
|
||||
Device data = new Device();
|
||||
|
@ -319,8 +319,8 @@ public class DeviceIotServiceImpl implements DeviceIotService {
|
|||
data.setSoftwareVersion(device.getSoftwareVersion());
|
||||
DeviceQuery query = new DeviceQuery();
|
||||
query.setId(device.getId());
|
||||
query.setMac(device.getMac());
|
||||
return deviceMapper.updateByQuery(data, query);
|
||||
query.setEqMac(device.getMac());
|
||||
return deviceMapper.updateByQuerySimple(data, query);
|
||||
}
|
||||
|
||||
@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