批量查询增加排序支持
This commit is contained in:
parent
5c2a3ca78f
commit
eb2054b6dc
@ -1,88 +0,0 @@
|
||||
package com.admin.service.impl;
|
||||
|
||||
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import java.util.Date;
|
||||
/**
|
||||
* <p>
|
||||
* 设备与用户绑定Controller类
|
||||
* </p>
|
||||
*
|
||||
* @author wulin
|
||||
* @since 2023-10-07
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/DeviceUserBind")
|
||||
public class DeviceUserBindController{
|
||||
|
||||
|
||||
@Autowired
|
||||
private DeviceUserBindService deviceUserBindService;
|
||||
@PostMapping("/info")
|
||||
public Mono<DeviceUserBindResp> selectDeviceUserBindByRequest(@RequestBody DeviceUserBindRequest request){
|
||||
return deviceUserBindService.selectDeviceUserBindByRequest(request).map(d -> {return new DeviceUserBindResp(d);});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/list")
|
||||
public Mono<PagerResult<DeviceUserBindResp>> selectDeviceUserBindsByRequest(@RequestBody DeviceUserBindRequest request){
|
||||
return deviceUserBindService.selectDeviceInfosByRequest(request).map(d -> {
|
||||
PagerResult<DeviceUserBindResp> result = new PagerResult<>();
|
||||
result.setPageIndex(d.getPageIndex());
|
||||
result.setPageSize(d.getPageSize());
|
||||
result.setTotal(d.getTotal());
|
||||
List<DeviceUserBindResp> ds = d.getData().stream().map(new Function<DeviceUserBindEntity, DeviceUserBindResp>() {
|
||||
@Override
|
||||
public DeviceInfoResp apply(DeviceUserBindEntity entity) {
|
||||
return new DeviceUserBindResp(entity);
|
||||
}
|
||||
}
|
||||
|
||||
).collect(Collectors.toList());
|
||||
result.setData(ds);
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/id")
|
||||
public Mono<DeviceUserBindResp> selectDeviceUserBindById(@RequestParam Long id){
|
||||
return deviceUserBindService.selectDeviceUserBindById(id).map(d -> {return new DeviceUserBindResp(d);});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/save")
|
||||
public Mono<Integer> insertDeviceUserBind(@RequestBody DeviceUserBindEntity entity){
|
||||
return deviceUserBindService.insertDeviceUserBind(entity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/update")
|
||||
public Mono<Integer> updateDeviceUserBindById(@RequestBody DeviceUserBindEntity entity){
|
||||
return deviceUserBindService.updateDeviceUserBindById(entity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/updateCover")
|
||||
public Mono<Integer> updateCoverDeviceUserBindById(@RequestBody DeviceUserBindEntity entity){
|
||||
return deviceUserBindService.updateCoverDeviceUserBindById(entity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/delete")
|
||||
public Mono<Integer> deleteDeviceUserBindById(@RequestParam Long id){
|
||||
return deviceUserBindService.deleteDeviceUserBindById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,92 +0,0 @@
|
||||
package com.qiuguo.iot.data.entity;
|
||||
import org.hswebframework.ezorm.rdb.mapping.annotation.Comment;
|
||||
import org.hswebframework.web.crud.annotation.EnableEntityEvent;
|
||||
import org.hswebframework.web.api.crud.entity.GenericEntity;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Table;import lombok.Data;
|
||||
import java.util.Date;
|
||||
/**
|
||||
* <p>
|
||||
* </p>*设备与用户绑定表
|
||||
* @author wulin
|
||||
* @since 2023-10-07
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Comment("设备与用户绑定表")
|
||||
@Table(name = "device_user_bind")
|
||||
@EnableEntityEvent
|
||||
public class DeviceUserBindEntity extends GenericEntity<Long> {
|
||||
@Comment("id")
|
||||
@Column(name = "id", length = 11, nullable = false, unique = true)
|
||||
private Long id;
|
||||
|
||||
@Comment("是否删除:0 否 1 删除")
|
||||
@Column(name = "is_delete", nullable = false)
|
||||
private Integer isDelete;
|
||||
|
||||
@Comment("创建时间")
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
@Comment("修改时间")
|
||||
@Column(name = "modify_time")
|
||||
private Date modifyTime;
|
||||
|
||||
@Comment("用户Id")
|
||||
@Column(name = "user_id", nullable = false)
|
||||
private Long userId;
|
||||
|
||||
@Comment("设备类型:0 果Box 1 涂鸦设备 2智能大灯 3智能窗帘驱动 4智能窗户关闭 5智能台灯 6智能桌子 7智能椅子 8智能风扇 9智能空调(遥控器) 10智能冰箱 11智能洗碗机 12智能电热水器 13温度传感器 14空气质量传感器 15光线传感器 16雨量传感器 17闭门器")
|
||||
@Column(name = "device_type", nullable = false)
|
||||
private Integer deviceType;
|
||||
|
||||
@Comment("设备id")
|
||||
@Column(name = "device_id", nullable = false)
|
||||
private Long deviceId;
|
||||
|
||||
@Comment("三方设备id")
|
||||
@Column(name = "other_device_id", length = 100)
|
||||
private Long otherDeviceId;
|
||||
|
||||
@Comment("涂鸦空间id")
|
||||
@Column(name = "space_id")
|
||||
private Long spaceId;
|
||||
|
||||
@Comment("是否为主设备 1:是 0:不是")
|
||||
@Column(name = "is_main", nullable = false)
|
||||
private Integer isMain;
|
||||
|
||||
@Comment("绑定设备名称(用户命名)")
|
||||
@Column(name = "bind_name", length = 100)
|
||||
private String bindName;
|
||||
|
||||
@Comment("国家")
|
||||
@Column(name = "country", length = 100)
|
||||
private String country;
|
||||
|
||||
@Comment("省")
|
||||
@Column(name = "province", length = 100)
|
||||
private String province;
|
||||
|
||||
@Comment("市")
|
||||
@Column(name = "city", length = 100)
|
||||
private String city;
|
||||
|
||||
@Comment("县、区")
|
||||
@Column(name = "county", length = 100)
|
||||
private String county;
|
||||
|
||||
@Comment("乡镇")
|
||||
@Column(name = "village", length = 100)
|
||||
private String village;
|
||||
|
||||
@Comment("乡镇以下地址")
|
||||
@Column(name = "address", length = 200)
|
||||
private String address;
|
||||
|
||||
@Comment("第三方分类名称")
|
||||
@Column(name = "category_code", length = 100)
|
||||
private String categoryCode;
|
||||
|
||||
}
|
||||
@ -1,67 +0,0 @@
|
||||
package com.qiuguo.iot.data.entity;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
/**
|
||||
* <p>
|
||||
*设备与用户绑定请求类
|
||||
* @author wulin
|
||||
* @since 2023-10-07
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
public class DeviceUserBindRequest implements java.io.Serializable {
|
||||
|
||||
private int currPage = 1;
|
||||
private int pageSize = 10;
|
||||
private String sort;
|
||||
private String order;
|
||||
//
|
||||
private Long id;
|
||||
//是否删除:0 否 1 删除
|
||||
private Integer isDelete;
|
||||
//创建时间
|
||||
private Date createTime;
|
||||
//创建时间搜索开始
|
||||
|
||||
private Date createTimeStart;
|
||||
|
||||
//创建时间搜索结束
|
||||
private Date createTimeEnd;
|
||||
//修改时间
|
||||
private Date modifyTime;
|
||||
//修改时间搜索开始
|
||||
|
||||
private Date modifyTimeStart;
|
||||
|
||||
//修改时间搜索结束
|
||||
private Date modifyTimeEnd;
|
||||
//用户Id
|
||||
private Long userId;
|
||||
//设备类型:0 果Box 1 涂鸦设备 2智能大灯 3智能窗帘驱动 4智能窗户关闭 5智能台灯 6智能桌子 7智能椅子 8智能风扇 9智能空调(遥控器) 10智能冰箱 11智能洗碗机 12智能电热水器 13温度传感器 14空气质量传感器 15光线传感器 16雨量传感器 17闭门器
|
||||
private Integer deviceType;
|
||||
//设备id
|
||||
private Long deviceId;
|
||||
//三方设备id
|
||||
private Long otherDeviceId;
|
||||
//涂鸦空间id
|
||||
private Long spaceId;
|
||||
//是否为主设备 1:是 0:不是
|
||||
private Integer isMain;
|
||||
//绑定设备名称(用户命名)
|
||||
private String bindName;
|
||||
//国家
|
||||
private String country;
|
||||
//省
|
||||
private String province;
|
||||
//市
|
||||
private String city;
|
||||
//县、区
|
||||
private String county;
|
||||
//乡镇
|
||||
private String village;
|
||||
//乡镇以下地址
|
||||
private String address;
|
||||
//第三方分类名称
|
||||
private String categoryCode;
|
||||
}
|
||||
@ -1,69 +0,0 @@
|
||||
package com.qiuguo.iot.data.entity;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
/**
|
||||
* <p>
|
||||
* </p>*设备与用户绑定返回类
|
||||
* @author wulin
|
||||
* @since 2023-10-07
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class DeviceUserBindResp {
|
||||
public DeviceUserBindResp(){
|
||||
}
|
||||
public DeviceUserBindResp(DeviceUserBindEntity entity){
|
||||
id = entity.getId();
|
||||
createTime = entity.getCreateTime();
|
||||
modifyTime = entity.getModifyTime();
|
||||
userId = entity.getUserId();
|
||||
deviceType = entity.getDeviceType();
|
||||
deviceId = entity.getDeviceId();
|
||||
otherDeviceId = entity.getOtherDeviceId();
|
||||
spaceId = entity.getSpaceId();
|
||||
isMain = entity.getIsMain();
|
||||
bindName = entity.getBindName();
|
||||
country = entity.getCountry();
|
||||
province = entity.getProvince();
|
||||
city = entity.getCity();
|
||||
county = entity.getCounty();
|
||||
village = entity.getVillage();
|
||||
address = entity.getAddress();
|
||||
categoryCode = entity.getCategoryCode();
|
||||
}
|
||||
|
||||
//
|
||||
private Long id;
|
||||
//创建时间
|
||||
private Date createTime;
|
||||
//修改时间
|
||||
private Date modifyTime;
|
||||
//用户Id
|
||||
private Long userId;
|
||||
//设备类型:0 果Box 1 涂鸦设备 2智能大灯 3智能窗帘驱动 4智能窗户关闭 5智能台灯 6智能桌子 7智能椅子 8智能风扇 9智能空调(遥控器) 10智能冰箱 11智能洗碗机 12智能电热水器 13温度传感器 14空气质量传感器 15光线传感器 16雨量传感器 17闭门器
|
||||
private Integer deviceType;
|
||||
//设备id
|
||||
private Long deviceId;
|
||||
//三方设备id
|
||||
private Long otherDeviceId;
|
||||
//涂鸦空间id
|
||||
private Long spaceId;
|
||||
//是否为主设备 1:是 0:不是
|
||||
private Integer isMain;
|
||||
//绑定设备名称(用户命名)
|
||||
private String bindName;
|
||||
//国家
|
||||
private String country;
|
||||
//省
|
||||
private String province;
|
||||
//市
|
||||
private String city;
|
||||
//县、区
|
||||
private String county;
|
||||
//乡镇
|
||||
private String village;
|
||||
//乡镇以下地址
|
||||
private String address;
|
||||
//第三方分类名称
|
||||
private String categoryCode;
|
||||
}
|
||||
@ -1,279 +0,0 @@
|
||||
package com.admin.service.impl;
|
||||
|
||||
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import java.util.Date;
|
||||
/**
|
||||
* <p>
|
||||
* 设备与用户绑定服务类
|
||||
* </p>
|
||||
*
|
||||
* @author wulin
|
||||
* @since 2023-10-07
|
||||
*/
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DeviceUserBindService extends GenericReactiveCrudService<DeviceUserBindEntity, Long> {
|
||||
|
||||
|
||||
public Mono<DeviceUserBindEntity> selectDeviceUserBindByRequest(DeviceUserBindRequest request){
|
||||
ReactiveQuery<DeviceUserBindEntity> reactiveQuery = createQuery();
|
||||
reactiveQuery = reactiveQuery.and("is_delete", 0);
|
||||
if(request.getId() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getId, request.getId());
|
||||
}
|
||||
if(request.getIsDelete() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getIsDelete, request.getIsDelete());
|
||||
}
|
||||
if(request.getCreateTime() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getCreateTime, request.getCreateTime());
|
||||
}
|
||||
if(request.getModifyTime() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getModifyTime, request.getModifyTime());
|
||||
}
|
||||
if(request.getUserId() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getUserId, request.getUserId());
|
||||
}
|
||||
if(request.getDeviceType() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getDeviceType, request.getDeviceType());
|
||||
}
|
||||
if(request.getDeviceId() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getDeviceId, request.getDeviceId());
|
||||
}
|
||||
if(request.getOtherDeviceId() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getOtherDeviceId, request.getOtherDeviceId());
|
||||
}
|
||||
if(request.getSpaceId() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getSpaceId, request.getSpaceId());
|
||||
}
|
||||
if(request.getIsMain() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getIsMain, request.getIsMain());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getBindName())){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getBindName, request.getBindName());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getCountry())){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getCountry, request.getCountry());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getProvince())){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getProvince, request.getProvince());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getCity())){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getCity, request.getCity());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getCounty())){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getCounty, request.getCounty());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getVillage())){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getVillage, request.getVillage());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getAddress())){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getAddress, request.getAddress());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getCategoryCode())){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getCategoryCode, request.getCategoryCode());
|
||||
}
|
||||
SortOrder sortOrder = null;
|
||||
if(StringUtils.isNotEmpty(request.getOrder())){
|
||||
if(StringUtils.isNotEmpty(request.getSort()) && request.getSort().compareTo("0") == 0){
|
||||
sortOrder = SortOrder.desc(request.getOrder());
|
||||
}else{
|
||||
sortOrder = SortOrder.asc(request.getOrder());
|
||||
}
|
||||
reactiveQuery = reactiveQuery.orderBy(sortOrder);
|
||||
}
|
||||
return reactiveQuery.fetchOne();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Mono<PagerResult<DeviceUserBindEntity>> selectDeviceUserBindsByRequest(DeviceUserBindRequest request){
|
||||
ReactiveQuery<DeviceUserBindEntity> reactiveQuery = createQuery();
|
||||
reactiveQuery = reactiveQuery.and("is_delete", 0);
|
||||
if(request.getId() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getId, request.getId());
|
||||
}
|
||||
if(request.getIsDelete() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getIsDelete, request.getIsDelete());
|
||||
}
|
||||
if(request.getCreateTimeStart() != null){
|
||||
reactiveQuery = reactiveQuery.gte(DeviceUserBindRequest::getCreateTime, request.getCreateTimeStart());
|
||||
}
|
||||
if(request.getCreateTimeEnd() != null){
|
||||
reactiveQuery = reactiveQuery.lte(DeviceUserBindRequest::getCreateTime, request.getCreateTimeEnd());
|
||||
}
|
||||
if(request.getModifyTimeStart() != null){
|
||||
reactiveQuery = reactiveQuery.gte(DeviceUserBindRequest::getModifyTime, request.getModifyTimeStart());
|
||||
}
|
||||
if(request.getModifyTimeEnd() != null){
|
||||
reactiveQuery = reactiveQuery.lte(DeviceUserBindRequest::getModifyTime, request.getModifyTimeEnd());
|
||||
}
|
||||
if(request.getUserId() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getUserId, request.getUserId());
|
||||
}
|
||||
if(request.getDeviceType() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getDeviceType, request.getDeviceType());
|
||||
}
|
||||
if(request.getDeviceId() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getDeviceId, request.getDeviceId());
|
||||
}
|
||||
if(request.getOtherDeviceId() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getOtherDeviceId, request.getOtherDeviceId());
|
||||
}
|
||||
if(request.getSpaceId() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getSpaceId, request.getSpaceId());
|
||||
}
|
||||
if(request.getIsMain() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getIsMain, request.getIsMain());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getBindName())){
|
||||
reactiveQuery = reactiveQuery.$like$(DeviceUserBindRequest::getBindName, request.getBindName());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getCountry())){
|
||||
reactiveQuery = reactiveQuery.$like$(DeviceUserBindRequest::getCountry, request.getCountry());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getProvince())){
|
||||
reactiveQuery = reactiveQuery.$like$(DeviceUserBindRequest::getProvince, request.getProvince());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getCity())){
|
||||
reactiveQuery = reactiveQuery.$like$(DeviceUserBindRequest::getCity, request.getCity());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getCounty())){
|
||||
reactiveQuery = reactiveQuery.$like$(DeviceUserBindRequest::getCounty, request.getCounty());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getVillage())){
|
||||
reactiveQuery = reactiveQuery.$like$(DeviceUserBindRequest::getVillage, request.getVillage());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getAddress())){
|
||||
reactiveQuery = reactiveQuery.$like$(DeviceUserBindRequest::getAddress, request.getAddress());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getCategoryCode())){
|
||||
reactiveQuery = reactiveQuery.$like$(DeviceUserBindRequest::getCategoryCode, request.getCategoryCode());
|
||||
}
|
||||
QueryParamEntity param = QueryParamEntity.of(reactiveQuery.getParam());
|
||||
if(StringUtils.isNotEmpty(request.getOrder())){
|
||||
Sort sort = new Sort();
|
||||
sort.setName(request.getOrder());
|
||||
if(StringUtils.isNotEmpty(request.getSort()) && request.getSort().compareTo("0") == 0){
|
||||
sort.desc();
|
||||
}else{
|
||||
sort.asc();
|
||||
}
|
||||
param.setSorts(Arrays.asList(sort));
|
||||
}
|
||||
param.setPageIndex(request.getCurrPage());
|
||||
param.setPageSize(request.getPageSize());
|
||||
param.setPaging(true);
|
||||
param.setFirstPageIndex(1);
|
||||
return queryPager(param);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Mono<DeviceUserBindEntity> selectDeviceUserBindById(Long id){
|
||||
return createQuery()
|
||||
.and("is_delete", 0)
|
||||
.and("id", id)
|
||||
.fetchOne();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Mono<Integer> insertDeviceUserBind(DeviceUserBindEntity entity){
|
||||
entity.setId(null);
|
||||
entity.setCreateTime(null);
|
||||
entity.setModifyTime(null);
|
||||
return insert(entity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Mono<Integer> updateDeviceUserBindById(DeviceUserBindEntity entity){
|
||||
ReactiveUpdate<DeviceUserBindEntity> update = createUpdate()
|
||||
.set(DeviceUserBindEntity::getModifyTime, new Date());
|
||||
if(entity.getIsDelete() != null){
|
||||
update = update.set(DeviceUserBindEntity::getIsDelete, entity.getIsDelete());
|
||||
}
|
||||
if(entity.getUserId() != null){
|
||||
update = update.set(DeviceUserBindEntity::getUserId, entity.getUserId());
|
||||
}
|
||||
if(entity.getDeviceType() != null){
|
||||
update = update.set(DeviceUserBindEntity::getDeviceType, entity.getDeviceType());
|
||||
}
|
||||
if(entity.getDeviceId() != null){
|
||||
update = update.set(DeviceUserBindEntity::getDeviceId, entity.getDeviceId());
|
||||
}
|
||||
if(entity.getOtherDeviceId() != null){
|
||||
update = update.set(DeviceUserBindEntity::getOtherDeviceId, entity.getOtherDeviceId());
|
||||
}
|
||||
if(entity.getSpaceId() != null){
|
||||
update = update.set(DeviceUserBindEntity::getSpaceId, entity.getSpaceId());
|
||||
}
|
||||
if(entity.getIsMain() != null){
|
||||
update = update.set(DeviceUserBindEntity::getIsMain, entity.getIsMain());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(entity.getBindName())){
|
||||
update = update.set(DeviceUserBindEntity::getBindName, entity.getBindName());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(entity.getCountry())){
|
||||
update = update.set(DeviceUserBindEntity::getCountry, entity.getCountry());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(entity.getProvince())){
|
||||
update = update.set(DeviceUserBindEntity::getProvince, entity.getProvince());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(entity.getCity())){
|
||||
update = update.set(DeviceUserBindEntity::getCity, entity.getCity());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(entity.getCounty())){
|
||||
update = update.set(DeviceUserBindEntity::getCounty, entity.getCounty());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(entity.getVillage())){
|
||||
update = update.set(DeviceUserBindEntity::getVillage, entity.getVillage());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(entity.getAddress())){
|
||||
update = update.set(DeviceUserBindEntity::getAddress, entity.getAddress());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(entity.getCategoryCode())){
|
||||
update = update.set(DeviceUserBindEntity::getCategoryCode, entity.getCategoryCode());
|
||||
}
|
||||
return update.where(DeviceUserBindEntity::getId, entity.getId()).and("is_delete", 0).execute();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Mono<Integer> updateCoverDeviceUserBindById(DeviceUserBindEntity entity){
|
||||
ReactiveUpdate<DeviceUserBindEntity> update = createUpdate()
|
||||
.set(DeviceUserBindEntity::getModifyTime, new Date());
|
||||
update = update.set(DeviceUserBindEntity::getIsDelete, entity.getIsDelete());
|
||||
update = update.set(DeviceUserBindEntity::getUserId, entity.getUserId());
|
||||
update = update.set(DeviceUserBindEntity::getDeviceType, entity.getDeviceType());
|
||||
update = update.set(DeviceUserBindEntity::getDeviceId, entity.getDeviceId());
|
||||
update = update.set(DeviceUserBindEntity::getOtherDeviceId, entity.getOtherDeviceId());
|
||||
update = update.set(DeviceUserBindEntity::getSpaceId, entity.getSpaceId());
|
||||
update = update.set(DeviceUserBindEntity::getIsMain, entity.getIsMain());
|
||||
update = update.set(DeviceUserBindEntity::getBindName, entity.getBindName());
|
||||
update = update.set(DeviceUserBindEntity::getCountry, entity.getCountry());
|
||||
update = update.set(DeviceUserBindEntity::getProvince, entity.getProvince());
|
||||
update = update.set(DeviceUserBindEntity::getCity, entity.getCity());
|
||||
update = update.set(DeviceUserBindEntity::getCounty, entity.getCounty());
|
||||
update = update.set(DeviceUserBindEntity::getVillage, entity.getVillage());
|
||||
update = update.set(DeviceUserBindEntity::getAddress, entity.getAddress());
|
||||
update = update.set(DeviceUserBindEntity::getCategoryCode, entity.getCategoryCode());
|
||||
return update.where(DeviceUserBindEntity::getId, entity.getId()).and("is_delete", 0).execute();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Mono<Integer> deleteDeviceUserBindById(Long id){
|
||||
return createUpdate()
|
||||
.set("is_delete", 1)
|
||||
.set("modify_time", new Date())
|
||||
.where("id", id)
|
||||
.execute();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user