|  |  |  | 
|---|
|  |  |  | if(Objects.isNull(ywDeviceRecord) | 
|---|
|  |  |  | || Objects.isNull(ywDeviceRecord.getDeviceId()) | 
|---|
|  |  |  | || Objects.isNull(ywDeviceRecord.getStatus()) | 
|---|
|  |  |  | || StringUtils.isBlank(ywDeviceRecord.getContent()) | 
|---|
|  |  |  | ){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.BAD_REQUEST); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | .selectAs(SystemUser::getMobile,YwDeviceRecord::getMobile) | 
|---|
|  |  |  | .selectAs(Company::getName,YwDeviceRecord::getCompanyName) | 
|---|
|  |  |  | .selectAs(YwDevice::getName,YwDeviceRecord::getDeviceName) | 
|---|
|  |  |  | .selectAs(YwDevice::getCode,YwDeviceRecord::getDeviceCode) | 
|---|
|  |  |  | .leftJoin(SystemUser.class,SystemUser::getId,YwDeviceRecord::getUserId) | 
|---|
|  |  |  | .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) | 
|---|
|  |  |  | .leftJoin(YwDevice.class,YwDevice::getId,YwDeviceRecord::getDeviceId) | 
|---|
|  |  |  | 
|---|
|  |  |  | .last(" limit  1 ") | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | List<Multifile> multifiles = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda() | 
|---|
|  |  |  | .eq(Multifile::getObjId,id).eq(Multifile::getObjType,Constants.MultiFile.FN_DEVICE_RECORD_FILE)); | 
|---|
|  |  |  | .eq(Multifile::getObjId,id).eq(Multifile::getObjType,Constants.MultiFile.FN_DEVICE_RECORD_FILE.getKey())); | 
|---|
|  |  |  | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifiles)) { | 
|---|
|  |  |  | String path = systemDictDataBiz.queryByCode(Constants.FTP, Constants.FTP_RESOURCE_PATH).getCode() | 
|---|
|  |  |  | + systemDictDataBiz.queryByCode(Constants.FTP, Constants.YW_DEVICE).getCode(); | 
|---|
|  |  |  | 
|---|
|  |  |  | .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) | 
|---|
|  |  |  | .leftJoin(YwDevice.class,YwDevice::getId,YwDeviceRecord::getDeviceId) | 
|---|
|  |  |  | .eq(YwDeviceRecord::getIsdeleted,Constants.ZERO) | 
|---|
|  |  |  | .eq(Objects.nonNull(model.getUserId()),YwDeviceRecord::getUserId,model.getUserId()) | 
|---|
|  |  |  | .and(Objects.nonNull(model)&&StringUtils.isNotBlank(model.getDeviceName()),i->i.like(YwDevice::getName,model.getDeviceName()).or().like(YwDevice::getCode,model.getDeviceName())) | 
|---|
|  |  |  | .ge(Objects.nonNull(model.getStartDate()),YwDeviceRecord::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getStartDate())) | 
|---|
|  |  |  | .le(Objects.nonNull(model.getEndDate()),YwDeviceRecord::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getEndDate())) | 
|---|
|  |  |  | .eq(Objects.nonNull(model.getDeviceId()),YwDeviceRecord::getDeviceId,model.getDeviceId()) | 
|---|
|  |  |  | .eq(YwDeviceRecord::getIsdeleted,Constants.ZERO) | 
|---|
|  |  |  | .orderByDesc(YwDeviceRecord::getCreateDate) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | return PageData.from(iPage); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | QueryWrapper<YwDeviceRecord> wrapper = new QueryWrapper<>(ywDeviceRecord); | 
|---|
|  |  |  | return ywDeviceRecordMapper.selectCount(wrapper); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|