1.添加数据更新接口代码

zhairh
x_z 2 years ago
parent bd874cbd64
commit a0c9a75cda

@ -45,4 +45,15 @@ public interface Constant {
*/
Integer TASK_TYPE_UPDATE = 1;
/**
* -
*/
String JOB_TASK_TYPE_DOWNLOAD = "download";
/**
* -
*/
String JOB_TASK_TYPE_UPDATE = "update";
}

@ -1,12 +1,13 @@
package com.glxp.udidl.admin.controller.device;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.StrUtil;
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
import com.glxp.udidl.admin.entity.udid.Contactlist;
import com.glxp.udidl.admin.enums.ResultEnum;
import com.glxp.udidl.admin.req.UpdateUdiRequest;
import com.glxp.udidl.admin.res.BaseResponse;
import com.glxp.udidl.admin.service.dataSync.DeviceUpdateService;
import com.glxp.udidl.admin.service.dataUpdate.DeviceUpdateService;
import com.glxp.udidl.admin.util.ResultVOUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
@ -27,10 +28,19 @@ public class UdiUpdateController {
@AuthRuleAnnotation("udi/update/updateUdiData")
@GetMapping("udi/update/updateUdiData")
public BaseResponse updateData(UpdateUdiRequest updateUdiRequest) {
if (StrUtil.isBlank(updateUdiRequest.getStartDate()) || StrUtil.isBlank(updateUdiRequest.getEndDate())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "未指定更新时间");
if (updateUdiRequest.getType() == 0) {
if (StrUtil.isBlank(updateUdiRequest.getStartDate()) || StrUtil.isBlank(updateUdiRequest.getEndDate())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "未指定更新时间");
}
} else if (updateUdiRequest.getType() == 1) {
if (StrUtil.isBlank(updateUdiRequest.getNameCode())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "未指定更新DI");
}
}
deviceUpdateService.updateUdiData(updateUdiRequest);
ThreadUtil.execAsync(() -> {
deviceUpdateService.updateUdiData(updateUdiRequest);
});
return ResultVOUtils.success();
}

@ -12,7 +12,6 @@ import com.glxp.udidl.admin.req.udid.JobRequest;
import com.glxp.udidl.admin.res.BaseResponse;
import com.glxp.udidl.admin.res.udid.DataSetSingleHistoryResult;
import com.glxp.udidl.admin.service.dataSync.DeviceDownloadService;
import com.glxp.udidl.admin.service.dataSync.DeviceSaveService;
import com.glxp.udidl.admin.service.dataSync.DeviceSyncService;
import com.glxp.udidl.admin.service.inout.ProductInfoService;
import com.glxp.udidl.admin.service.udi.JobLogService;
@ -25,7 +24,10 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
@ -89,6 +91,7 @@ public class UdidlDeviceController {
jobLog.setCreateTime(new Date());
jobLog.setType(Constant.LOG_TYPE_INFO);
jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL);
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD);
jobLogService.update(jobLog);
if (StrUtil.isNotEmpty(jobLog.getLastUploadRequest())) {
DeviceRequest deviceRequest = JSONUtil.toBean(jobLog.getLastUploadRequest(), DeviceRequest.class);

@ -3,9 +3,11 @@ package com.glxp.udidl.admin.dao.auth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.auth.AuthAdmin;
import com.glxp.udidl.admin.req.auth.AuthAdminQueryRequest;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface AuthAdminMapper extends BaseMapper<AuthAdmin> {
/**

@ -2,9 +2,11 @@ package com.glxp.udidl.admin.dao.auth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.auth.AuthPermission;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface AuthPermissionMapper extends BaseMapper<AuthPermission> {
/**

@ -2,10 +2,12 @@ package com.glxp.udidl.admin.dao.auth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.auth.AuthPermissionRule;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface AuthPermissionRuleMapper extends BaseMapper<AuthPermissionRule> {
/**

@ -2,10 +2,12 @@ package com.glxp.udidl.admin.dao.auth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.auth.AuthRoleAdmin;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface AuthRoleAdminMapper extends BaseMapper<AuthRoleAdmin> {
/**

@ -3,9 +3,11 @@ package com.glxp.udidl.admin.dao.auth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.auth.AuthRole;
import com.glxp.udidl.admin.req.auth.AuthRoleQueryRequest;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface AuthRoleMapper extends BaseMapper<AuthRole> {
/**

@ -2,7 +2,9 @@ package com.glxp.udidl.admin.dao.info;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.info.CompanyEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface CompanyMapper extends BaseMapper<CompanyEntity> {
CompanyEntity findCompany();

@ -2,9 +2,11 @@ package com.glxp.udidl.admin.dao.info;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.info.FileInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface FileInfoMapper extends BaseMapper<FileInfoEntity> {
List<FileInfoEntity> list();

@ -3,7 +3,9 @@ package com.glxp.udidl.admin.dao.info;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.info.ScheduledEntity;
import com.glxp.udidl.admin.req.info.ScheduledRequest;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ScheduledMapper extends BaseMapper<ScheduledEntity> {
ScheduledEntity findScheduled(ScheduledRequest scheduledRequest);

@ -2,9 +2,11 @@ package com.glxp.udidl.admin.dao.sys;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.sys.SysMenu;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface SysMenuMapper extends BaseMapper<SysMenu> {
int getChildCount(Integer parentId);

@ -3,9 +3,11 @@ package com.glxp.udidl.admin.dao.sys;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.dto.sys.SysRoleParam;
import com.glxp.udidl.admin.entity.sys.SysRole;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface SysRoleMapper extends BaseMapper<SysRole> {
int deleteByPrimaryKey(Integer id);

@ -2,10 +2,12 @@ package com.glxp.udidl.admin.dao.sys;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.sys.SysRoleMenu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> {
int insert(SysRoleMenu record);

@ -2,8 +2,10 @@ package com.glxp.udidl.admin.dao.sys;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.sys.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {
int deleteByPrimaryKey(Integer id);

@ -2,6 +2,8 @@ package com.glxp.udidl.admin.dao.udi;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.udi.ProductClassify;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ProductClassifyMapper extends BaseMapper<ProductClassify> {
}

@ -5,10 +5,12 @@ import com.glxp.udidl.admin.dto.device.ProductDetailModel;
import com.glxp.udidl.admin.entity.udi.ProductInfoEntity;
import com.glxp.udidl.admin.req.ListPageRequest;
import com.glxp.udidl.admin.req.ProductInfoFilterRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface ProductInfoMapper extends BaseMapper<ProductInfoEntity> {
List<ProductInfoEntity> filterProductInfo(ProductInfoFilterRequest productInfoFilterRequest);

@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.udi.UdiCompanyEntity;
import com.glxp.udidl.admin.entity.udid.Contactlist;
import com.glxp.udidl.admin.req.UdiCompanyRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface UdiCompanyMapper extends BaseMapper<UdiCompanyEntity> {
List<UdiCompanyEntity> selectAllTyshxyh();

@ -5,10 +5,12 @@ import com.glxp.udidl.admin.entity.udid.Contactlist;
import com.glxp.udidl.admin.entity.udid.ContactlistExample;
import com.glxp.udidl.admin.req.DlConnactRequest;
import com.glxp.udidl.admin.req.DownloadUdiRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface ContactlistMapper extends BaseMapper<Contactlist> {
long countByExample(ContactlistExample example);
@ -37,4 +39,5 @@ public interface ContactlistMapper extends BaseMapper<Contactlist> {
List<Contactlist> dlConnacts(DlConnactRequest dlConnactRequest);
void update(Contactlist contactlist);
}

@ -7,10 +7,12 @@ import com.glxp.udidl.admin.req.DownloadUdiRequest;
import com.glxp.udidl.admin.req.ListPageRequest;
import com.glxp.udidl.admin.req.udid.DeviceListRequest;
import com.glxp.udidl.admin.req.udid.DeviceSearchRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface DeviceMapper extends BaseMapper<Device> {
long countByExample(DeviceExample example);
@ -64,4 +66,7 @@ public interface DeviceMapper extends BaseMapper<Device> {
List<String> findAllByZxxscpbsPage(ListPageRequest listPageRequest);
boolean updateCplx(Device device);
void updateDevice(Device device);
}

@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.udid.Deviceclinical;
import com.glxp.udidl.admin.entity.udid.DeviceclinicalExample;
import com.glxp.udidl.admin.req.DownloadUdiRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface DeviceclinicalMapper extends BaseMapper<Deviceclinical> {
long countByExample(DeviceclinicalExample example);
@ -34,4 +36,5 @@ public interface DeviceclinicalMapper extends BaseMapper<Deviceclinical> {
List<Deviceclinical> downloadDeviceclinical(DownloadUdiRequest downloadUdiRequest);
void update(Deviceclinical deviceclinical);
}

@ -3,10 +3,12 @@ package com.glxp.udidl.admin.dao.udid;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.udid.Devicedownload;
import com.glxp.udidl.admin.entity.udid.DevicedownloadExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface DevicedownloadMapper extends BaseMapper<Devicedownload> {
long countByExample(DevicedownloadExample example);

@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.udid.Devicepackage;
import com.glxp.udidl.admin.entity.udid.DevicepackageExample;
import com.glxp.udidl.admin.req.DownloadUdiRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface DevicepackageMapper extends BaseMapper<Devicepackage> {
long countByExample(DevicepackageExample example);
@ -34,4 +36,5 @@ public interface DevicepackageMapper extends BaseMapper<Devicepackage> {
List<Devicepackage> downloadDevicepackage(DownloadUdiRequest downloadUdiRequest);
void update(Devicepackage devicepackage);
}

@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.udid.Devicestorage;
import com.glxp.udidl.admin.entity.udid.DevicestorageExample;
import com.glxp.udidl.admin.req.DownloadUdiRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface DevicestorageMapper extends BaseMapper<Devicestorage> {
long countByExample(DevicestorageExample example);
@ -34,4 +36,5 @@ public interface DevicestorageMapper extends BaseMapper<Devicestorage> {
List<Devicestorage> downloadDevicestorage(DownloadUdiRequest downloadUdiRequest);
void update(Devicestorage devicestorage);
}

@ -3,9 +3,11 @@ package com.glxp.udidl.admin.dao.udid;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.udid.JobLog;
import com.glxp.udidl.admin.req.udid.JobLogFilterRequest;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface JobLogMapper extends BaseMapper<JobLog> {
/**

@ -5,10 +5,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.dto.udplat.BaseParam;
import com.glxp.udidl.admin.dto.udplat.UnitsListModel;
import com.glxp.udidl.admin.entity.udplat.UdplatDistributor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface UdplatDistributorMapper extends BaseMapper<UdplatDistributor> {
int deleteByPrimaryKey(Integer id);

@ -5,9 +5,11 @@ import com.glxp.udidl.admin.dto.udplat.ProductListModel;
import com.glxp.udidl.admin.dto.udplat.ProductParam;
import com.glxp.udidl.admin.dto.udplat.UdplatGoodsParam;
import com.glxp.udidl.admin.entity.udplat.UdplatGoods;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface UdplatGoodsMapper extends BaseMapper<UdplatGoods> {
int deleteByPrimaryKey(Long id);

@ -5,9 +5,11 @@ import com.glxp.udidl.admin.dto.device.ProductGoodsMatchModel;
import com.glxp.udidl.admin.dto.udplat.UdplatGoodsMatchListModel;
import com.glxp.udidl.admin.dto.udplat.UdplatGoodsMatchParam;
import com.glxp.udidl.admin.entity.udplat.UdplatGoodsMatch;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface UdplatGoodsMatchMapper extends BaseMapper<UdplatGoodsMatch> {
int deleteByPrimaryKey(Integer id);

@ -3,9 +3,11 @@ package com.glxp.udidl.admin.dao.udplat;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.dto.udplat.BaseParam;
import com.glxp.udidl.admin.entity.udplat.UdplatHospital;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface UdplatHospitalMapper extends BaseMapper<UdplatHospital> {
int deleteByPrimaryKey(Integer id);

@ -3,9 +3,11 @@ package com.glxp.udidl.admin.dao.udplat;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.udplat.UdplatLog;
import com.glxp.udidl.admin.req.udid.JobLogFilterRequest;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface UdplatLogMapper extends BaseMapper<UdplatLog> {
int deleteByPrimaryKey(Integer id);

@ -3,9 +3,11 @@ package com.glxp.udidl.admin.dao.udplat;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.dto.udplat.BaseParam;
import com.glxp.udidl.admin.entity.udplat.UdplatManufacture;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface UdplatManufactureMapper extends BaseMapper<UdplatManufacture> {
int deleteByPrimaryKey(Integer id);

@ -1,9 +1,10 @@
package com.glxp.udidl.admin.entity.info;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
@Data
@ -13,6 +14,7 @@ public class CompanyEntity {
@ApiModelProperty(value = "ID主键")
@TableId(type = IdType.AUTO)
private Integer id; //自增长ID
@ApiModelProperty(value = "企业名称")
@ -44,4 +46,7 @@ public class CompanyEntity {
@ApiModelProperty(value = "账号数据来源1.UDIMS2.UDI自助平台")
private String dataSource;
@ApiModelProperty(value = "任务类型: 0下载任务 1更新任务")
private Integer taskType;
}

@ -61,6 +61,11 @@ public class JobLog {
private String lastUploadRequest;
/**
* download: update:
*/
private String taskType;
public Integer getInsertCount() {
if (insertCount == null)
return 0;

@ -18,4 +18,15 @@ public class UpdateUdiRequest {
*/
private String endDate;
/**
* DI
*/
private String nameCode;
/**
* 0 1DI
*/
private Integer type;
}

@ -519,6 +519,7 @@ public class DeviceDownloadService {
//发生错误,存储日志
JobLog jobLog = new JobLog();
jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL);
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD);
jobLog.setType(Constant.LOG_TYPE_ERROR);
jobLog.setMsg(msg);
jobLog.setContent(dataSetResult.getReturnMsg());
@ -538,6 +539,7 @@ public class DeviceDownloadService {
JobLog jobLog = new JobLog();
jobLog.setType(Constant.LOG_TYPE_INFO);
jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL);
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD);
jobLog.setMsg("月份:" + month + ",执行成功!");
jobLog.setCreateTime(new Date());
jobLogService.insert(jobLog);
@ -545,6 +547,7 @@ public class DeviceDownloadService {
log.error(e.getMessage(), e);
JobLog jobLog = new JobLog();
jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL);
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD);
jobLog.setType(Constant.LOG_TYPE_ERROR);
jobLog.setMsg("月份:" + month + ",执行失败:" + e.getMessage());
jobLog.setContent(JSON.toJSONString(e.getStackTrace()));
@ -567,6 +570,7 @@ public class DeviceDownloadService {
//发生错误,存储日志
JobLog jobLog = new JobLog();
jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL);
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD);
jobLog.setType(Constant.LOG_TYPE_ERROR);
jobLog.setMsg(msg);
jobLog.setContent(dataSetResult.getReturnMsg());
@ -601,6 +605,7 @@ public class DeviceDownloadService {
JobLog jobLog = new JobLog();
jobLog.setType(Constant.LOG_TYPE_INFO);
jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL);
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD);
jobLog.setMsg("月份:" + month + ",执行成功!");
jobLog.setCreateTime(new Date());
jobLogService.insert(jobLog);
@ -608,6 +613,7 @@ public class DeviceDownloadService {
log.error(e.getMessage(), e);
JobLog jobLog = new JobLog();
jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL);
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD);
jobLog.setType(Constant.LOG_TYPE_ERROR);
jobLog.setMsg("月份:" + month + ",执行失败:" + e.getMessage());
jobLog.setContent(JSON.toJSONString(e.getStackTrace()));

@ -17,7 +17,6 @@ import com.glxp.udidl.admin.res.udid.DataSetTotalResult;
import com.glxp.udidl.admin.service.inout.ProductInfoService;
import com.glxp.udidl.admin.service.udi.JobLogService;
import com.glxp.udidl.admin.util.DateUtil;
import com.glxp.udidl.admin.util.RedisUtil;
import com.glxp.udidl.admin.util.ResultVOUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
@ -44,9 +43,6 @@ public class DeviceSyncService {
@Resource
private ProductInfoService productInfoService;
@Resource
private RedisUtil redisUtil;
public void downloadAndSave(String day, String downloadType) {
//1.下载唯一标识数据
DataSetTotalResult result;
@ -59,6 +55,7 @@ public class DeviceSyncService {
if (result.getCode() != 1) {
JobLog jobLog = new JobLog();
jobLog.setDownloadType(downloadType);
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD);
jobLog.setDownloadDate(DateUtil.parseDate(rangeValue));
jobLog.setType(Constant.LOG_TYPE_ERROR);
jobLog.setMsg(result.getMsg());
@ -92,6 +89,7 @@ public class DeviceSyncService {
} else {
JobLog jobLog = new JobLog();
jobLog.setDownloadType(downloadType);
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD);
jobLog.setDownloadDate(DateUtil.parseDate(rangeValue));
jobLog.setType(Constant.LOG_TYPE_ERROR);
jobLog.setMsg("下载历史记录出错:" + res.getMsg());
@ -103,6 +101,7 @@ public class DeviceSyncService {
JobLog jobLog = new JobLog();
jobLog.setDownloadType(downloadType);
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD);
jobLog.setDownloadDate(DateUtil.parseDate(day));
jobLog.setTotalCount(result.getTotalRecordCount());
jobLog.setRealCount(result.realRecordCount());
@ -222,6 +221,7 @@ public class DeviceSyncService {
//插入日志
JobLog jobLog = new JobLog();
jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL);
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD);
jobLog.setDownloadDate(new Date());
jobLog.setType(Constant.LOG_TYPE_INFO);
jobLog.setMsg("下载中");
@ -420,6 +420,7 @@ public class DeviceSyncService {
//插入日志
JobLog jobLog = new JobLog();
jobLog.setDownloadType(deviceRequest.getDownloadType());
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD);
jobLog.setDownloadDate(DateUtil.parseDate(date));
jobLog.setType(Constant.LOG_TYPE_INFO);
jobLog.setMsg("下载中");

@ -1,92 +0,0 @@
package com.glxp.udidl.admin.service.dataSync;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.glxp.udidl.admin.constant.Constant;
import com.glxp.udidl.admin.entity.info.CompanyEntity;
import com.glxp.udidl.admin.entity.udid.JobLog;
import com.glxp.udidl.admin.entity.udid.TokenEntity;
import com.glxp.udidl.admin.req.UpdateUdiRequest;
import com.glxp.udidl.admin.req.udid.TokenRequest;
import com.glxp.udidl.admin.service.info.CompanyService;
import com.glxp.udidl.admin.service.inout.DeviceService;
import com.glxp.udidl.admin.service.inout.ProductInfoService;
import com.glxp.udidl.admin.service.udi.JobLogService;
import com.glxp.udidl.admin.util.HttpClient;
import com.glxp.udidl.admin.util.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class DeviceUpdateService {
private String token;
private String url = "sharing/get";
@Resource
private RedisUtil redisUtil;
@Resource
private CompanyService companyService;
@Resource
private JobLogService jobLogService; //日志
@Resource
private DeviceSaveService deviceSaveService;
@Resource
private DeviceService deviceService;
@Resource
private ProductInfoService productInfoService;
@Async
public void updateUdiData(UpdateUdiRequest updateUdiRequest) {
log.info("开始更新数据,更新时间段为: {} - {}", updateUdiRequest.getStartDate(), updateUdiRequest.getEndDate());
//解析更新参数
DateTime startDate = DateUtil.parse(updateUdiRequest.getStartDate(), DatePattern.SIMPLE_MONTH_PATTERN);
DateTime endDate = DateUtil.parse(updateUdiRequest.getEndDate(), DatePattern.SIMPLE_MONTH_PATTERN);
List<DateTime> dateRanges = DateUtil.rangeToList(startDate, endDate, DateField.MONTH);
JobLog jobLog = new JobLog();
jobLog.setCreateTime(new Date());
jobLog.setStatus(0);
jobLog.setType(Constant.LOG_TYPE_INFO);
jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL);
jobLogService.insert(jobLog);
}
/**
* token
*
* @return
*/
public String getToken() {
token = redisUtil.get("UDI_UPDATE_TOKEN");
if (StrUtil.isEmpty(token)) {
//查询下载数据使用的appid
CompanyEntity companyEntity = companyService.findByTaskType(Constant.TASK_TYPE_UPDATE);
TokenRequest tokenRequest = new TokenRequest();
tokenRequest.setAppId(companyEntity.getAppId());
tokenRequest.setAppSecret(companyEntity.getAppSecret());
tokenRequest.setTyshxydm(companyEntity.getTyshxydm());
String response = HttpClient.post("token/get", tokenRequest);
TokenEntity tokenEntity = JSONObject.parseObject(response, TokenEntity.class);
token = tokenEntity.getAccessToken();
redisUtil.setEx("UDI_UPDATE_TOKEN", token, 1 * 60 * 60 * 6);
}
return token;
}
}

@ -0,0 +1,540 @@
package com.glxp.udidl.admin.service.dataUpdate;
import cn.hutool.core.util.StrUtil;
import com.glxp.udidl.admin.entity.udi.CountProductEntity;
import com.glxp.udidl.admin.entity.udi.ProductClassify;
import com.glxp.udidl.admin.entity.udi.ProductInfoEntity;
import com.glxp.udidl.admin.entity.udi.UdiCompanyEntity;
import com.glxp.udidl.admin.entity.udid.*;
import com.glxp.udidl.admin.req.ProductInfoFilterRequest;
import com.glxp.udidl.admin.req.UdiCompanyRequest;
import com.glxp.udidl.admin.res.udid.DataSetResult;
import com.glxp.udidl.admin.service.inout.DeviceService;
import com.glxp.udidl.admin.service.inout.ProductInfoService;
import com.glxp.udidl.admin.service.udi.ProductClassifyService;
import com.glxp.udidl.admin.service.udi.UdiCompanyService;
import com.glxp.udidl.admin.util.BeanUtils;
import com.glxp.udidl.admin.util.DateUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
*
*/
@Service
public class DeviceParseService {
@Resource
private DeviceService deviceService;
@Resource
ProductClassifyService productClassifyService;
@Resource
ProductInfoService productInfoService;
@Resource
UdiCompanyService udiCompanyService;
/**
*
*
* @param dataSets
* @return
*/
public int DeviceSave(List<DataSetResult.DataSet> dataSets, Date requestDate) {
int result = 0;
for (DataSetResult.DataSet ds : dataSets) {
List<DataSetResult.ClinicalInfo> ClinicalInfoAll = ds.getClinicalInfo();
List<DataSetResult.StorageInfo> storageInfoAll = ds.getStorageInfo();
List<DataSetResult.PackingInfo> packingInfoAll = ds.getPackingInfo();
for (DataSetResult.DeviceInfo item : ds.getDeviceInfo()) {
//1:判断数据是否存在
if (StrUtil.isNotEmpty(deviceService.selectDiIsSame(item.getZxxsdycpbs(), item.getVersionNumber() + "")))
continue;
Device device = responseToDevice(item);
String uuid = getUUId();
Boolean isHistory = false;
if (item.getDeviceHistoryKey() != null && !item.getDeviceHistoryKey().isEmpty()) {
isHistory = true;
}
device.setUuid(uuid);
if (requestDate != null)
device.setRequestDate(requestDate);
//2,存储 deviceInfo
deviceService.updateDevice(device);
result++;
//3,存储ContactList
List<DataSetResult.ContactInfo> contactInfos = item.getContactList();
if (contactInfos != null && contactInfos.size() > 0) {
List<Contactlist> contactlistList = new ArrayList<>();
for (DataSetResult.ContactInfo contactInfo : contactInfos) {
Contactlist contactlist = responseToContactlist(contactInfo);
contactlist.setDevicerecordkey(device.getDevicerecordkey());
contactlist.setUuid(uuid);
contactlistList.add(contactlist);
}
deviceService.updateContactlist(contactlistList);
}
//4,存储 Deviceclinical
if (ClinicalInfoAll != null && ClinicalInfoAll.size() > 0) {
List<DataSetResult.ClinicalInfo> deviceclinicals;
if (isHistory == true)
deviceclinicals = ClinicalInfoAll.stream().filter(p -> p.getDeviceHistoryKey().equals(item.getDeviceHistoryKey())).
collect(Collectors.toList());
else
deviceclinicals = ClinicalInfoAll.stream().filter(p -> p.getDeviceRecordKey().equals(item.getDeviceRecordKey())).
collect(Collectors.toList());
List<Deviceclinical> deviceclinicalList = new ArrayList<>();
if (deviceclinicals != null && deviceclinicals.size() > 0) {
for (DataSetResult.ClinicalInfo deviceClinical : deviceclinicals) {
Deviceclinical deviceclinical = responseToDeviceclinical(deviceClinical);
if (isHistory == true)
deviceclinical.setDevicerecordkey(item.getDeviceHistoryKey());
else
deviceclinical.setDevicerecordkey(device.getDevicerecordkey());
deviceclinical.setUuid(uuid);
deviceclinicalList.add(deviceclinical);
}
deviceService.updateDeviceClinical(deviceclinicalList);
}
}
//5 存储 Devicestorage
if (storageInfoAll != null && storageInfoAll.size() > 0) {
List<DataSetResult.StorageInfo> storageInfos;
if (isHistory == true)
storageInfos = storageInfoAll.stream().filter(p -> p.getDeviceHistoryKey().equals(item.getDeviceHistoryKey())).
collect(Collectors.toList());
else
storageInfos = storageInfoAll.stream().filter(p -> p.getDeviceRecordKey().equals(item.getDeviceRecordKey())).
collect(Collectors.toList());
if (storageInfos != null && storageInfos.size() > 0) {
List<Devicestorage> devicestorageList = new ArrayList<>();
for (DataSetResult.StorageInfo storageInfo : storageInfos) {
Devicestorage devicestorage = responseToDevicestorage(storageInfo);
if (isHistory == true)
devicestorage.setDevicerecordkey(item.getDeviceHistoryKey());
else
devicestorage.setDevicerecordkey(device.getDevicerecordkey());
devicestorage.setUuid(uuid);
devicestorageList.add(devicestorage);
}
deviceService.updateDevicestorage(devicestorageList);
}
}
//6 存储Devicepackage
if (packingInfoAll != null && packingInfoAll.size() > 0) {
List<DataSetResult.PackingInfo> packingInfos;
if (isHistory == true)
packingInfos = packingInfoAll.stream().filter(p -> p.getDeviceHistoryKey().equals(item.getDeviceHistoryKey())).
collect(Collectors.toList());
else
packingInfos = packingInfoAll.stream().filter(p -> p.getDeviceRecordKey().equals(item.getDeviceRecordKey())).
collect(Collectors.toList());
if (packingInfos != null && packingInfos.size() > 0) {
List<Devicepackage> devicepackageList = new ArrayList<>();
for (DataSetResult.PackingInfo packingInfo : packingInfos) {
Devicepackage devicepackage = responseToDevicepackage(packingInfo);
if (isHistory == true)
devicepackage.setDevicerecordkey(item.getDeviceHistoryKey());
else
devicepackage.setDevicerecordkey(device.getDevicerecordkey());
devicepackage.setUuid(uuid);
devicepackageList.add(devicepackage);
}
deviceService.updateDevicepackage(devicepackageList);
}
}
//7存储productInfo信息
productInfoSave(uuid);
}
}
return result;
}
/**
* device
*
* @param dataSetBean
* @return
*/
private Device responseToDevice(DataSetResult.DeviceInfo dataSetBean) {
Device device = new Device();
BeanUtils.copyProperties(dataSetBean, device);
device.setDevicehistoryrecordkey(dataSetBean.getDeviceHistoryKey());
device.setDevicerecordkey(dataSetBean.getDeviceRecordKey());
device.setBtcpbs(dataSetBean.getBtcpbs());
device.setBtcpbsyzxxsdycpbssfyz(dataSetBean.getBtcpbsyzxxsdycpbssfyz());
device.setCgzmraqxgxx(dataSetBean.getCgzmraqxgxx());
device.setCpbsbmtxmc(dataSetBean.getCpbsbmtxmc());
device.setCpbsfbrq(dataSetBean.getCpbsfbrq());
device.setCphhhbh(dataSetBean.getCphhhbh());
device.setCplb(dataSetBean.getCplb());
device.setCpmctymc(dataSetBean.getCpmctymc());
device.setCpms(dataSetBean.getCpms());
device.setFlbm(dataSetBean.getFlbm());
device.setGgxh(dataSetBean.getGgxh());
device.setMjfs(dataSetBean.getMjfs());
device.setQtxxdwzlj(dataSetBean.getQtxxdwzlj());
device.setQxlb(dataSetBean.getQxlb());
device.setScbssfbhph(dataSetBean.getScbssfbhph());
device.setScbssfbhscrq(dataSetBean.getScbssfbhscrq());
device.setScbssfbhsxrq(dataSetBean.getScbssfbhsxrq());
device.setScbssfbhxlh(dataSetBean.getScbssfbhxlh());
device.setSfbjwycxsy(dataSetBean.getSfbjwycxsy());
device.setSfwblztlcp(dataSetBean.getSfwblztlcp());
device.setSfwwjbz(dataSetBean.getSfwwjbz());
device.setSfybtzjbs(dataSetBean.getSfybtzjbs());
device.setSpmc(dataSetBean.getSpmc());
device.setSydycpbs(dataSetBean.getSydycpbs());
device.setSyqsfxyjxmj(dataSetBean.getSyqsfxyjxmj());
device.setTscchcztj(dataSetBean.getTscchcztj());
device.setTsccsm(dataSetBean.getTsccsm());
device.setTsrq(dataSetBean.getTsrq());
device.setTyshxydm(dataSetBean.getTyshxydm());
device.setVersionnumber(dataSetBean.getVersionNumber() + "");
device.setVersionstatus(dataSetBean.getVersionStatus());
device.setVersiontime(dataSetBean.getVersionTime());
device.setYbbm(dataSetBean.getYbbm());
device.setYlqxzcrbarmc(dataSetBean.getYlqxzcrbarmc());
device.setYlqxzcrbarywmc(dataSetBean.getYlqxzcrbarywmc());
device.setZczbhhzbapzbh(getString(dataSetBean.getZczbhhzbapzbh()));
device.setZdcfsycs(dataSetBean.getZdcfsycs());
device.setYflbm(dataSetBean.getYflbm());
device.setZxxsdycpbs(dataSetBean.getZxxsdycpbs());
device.setBszt(dataSetBean.getBszt());
device.setSfyzcbayz(dataSetBean.getSfyzcbayz());
device.setZcbacpbs(dataSetBean.getZcbacpbs());
device.setZxxsdyzsydydsl(dataSetBean.getZxxsdyzsydydsl());
device.setBssjzt(dataSetBean.getBssjzt());
device.setLastModifyTime(DateUtil.formatDateTime(new Date()));
device.setCplx(dataSetBean.getCplx());
device.setHchzsb(dataSetBean.getHchzsb());
return device;
}
private Contactlist responseToContactlist(DataSetResult.ContactInfo contactInfo) {
Contactlist contactlist = new Contactlist();
contactlist.setQylxrcz(contactInfo.getQylxrcz());
contactlist.setQylxrdh(contactInfo.getQylxrdh());
contactlist.setQylxryx(contactInfo.getQylxryx());
return contactlist;
}
public Deviceclinical responseToDeviceclinical(DataSetResult.ClinicalInfo clinicalInfo) {
Deviceclinical deviceclinical = new Deviceclinical();
deviceclinical.setLcsycclx(clinicalInfo.getLcsycclx());
deviceclinical.setCcz(clinicalInfo.getCcz());
deviceclinical.setCcdw(clinicalInfo.getCcdw());
return deviceclinical;
}
public Devicestorage responseToDevicestorage(DataSetResult.StorageInfo storageInfo) {
Devicestorage devicestorage = new Devicestorage();
devicestorage.setCchcztj(storageInfo.getCchcztj());
devicestorage.setJldw(storageInfo.getJldw());
devicestorage.setZgz(storageInfo.getZgz());
devicestorage.setZdz(storageInfo.getZdz());
return devicestorage;
}
public Devicepackage responseToDevicepackage(DataSetResult.PackingInfo packingInfo) {
Devicepackage devicepackage = new Devicepackage();
devicepackage.setBzcpbs(packingInfo.getBzcpbs());
devicepackage.setBznhxyjbzcpbs(packingInfo.getBznhxyjbzcpbs());
devicepackage.setCpbzjb(packingInfo.getCpbzjb());
//devicepackage.setBznhxyjcpbssl(Integer.parseInt(packingInfo.getBznhxyjcpbssl()));
devicepackage.setBznhxyjcpbssl(getInteger(packingInfo.getBznhxyjcpbssl()));
return devicepackage;
}
private void productInfoSave(String uuid) {
transUdi(uuid);
}
private String getUUId() {
UUID uuid = UUID.randomUUID();
return uuid.toString().replace("-", "");
}
private String getString(String s) {
if (s != null && s != "")
return s.length() > 255 ? s.substring(0, 255) : s;
else return s;
}
private Integer getInteger(String s) {
try {
return Integer.parseInt(s);
} catch (Exception e) {
return 0;
}
}
public void transUdi(String key) {
DeviceEntity deviceEntity = deviceService.searchById(key);
String di = deviceEntity.getZxxsdycpbs();
ProductInfoEntity productInfoEntity = new ProductInfoEntity();
org.springframework.beans.BeanUtils.copyProperties(deviceEntity, productInfoEntity);
productInfoEntity.setUuid(key);
productInfoEntity.setDeviceRecordKey(deviceEntity.getDevicerecordkey());
productInfoEntity.setNameCode(deviceEntity.getZxxsdycpbs());
productInfoEntity.setCpmctymc(deviceEntity.getCpmctymc());
productInfoEntity.setCplb(deviceEntity.getCplb());
productInfoEntity.setFlbm(deviceEntity.getFlbm());
productInfoEntity.setGgxh(deviceEntity.getGgxh());
productInfoEntity.setQxlb(deviceEntity.getQxlb());
productInfoEntity.setTyshxydm(deviceEntity.getTyshxydm());
productInfoEntity.setYlqxzcrbarmc(deviceEntity.getYlqxzcrbarmc());
productInfoEntity.setZczbhhzbapzbh(deviceEntity.getZczbhhzbapzbh());
productInfoEntity.setScbssfbhph(deviceEntity.getScbssfbhph());
productInfoEntity.setScbssfbhscrq(deviceEntity.getScbssfbhscrq());
productInfoEntity.setScbssfbhsxrq(deviceEntity.getScbssfbhsxrq());
productInfoEntity.setScbssfbhxlh(deviceEntity.getScbssfbhxlh());
productInfoEntity.setBhxjsl(0);
productInfoEntity.setPackLevel(1 + "");
productInfoEntity.setBhxjcpbm("");
productInfoEntity.setBhzxxsbzsl(0);
productInfoEntity.setZxxsbzbhsydysl(0);
productInfoEntity.setScbssfbhxlh(deviceEntity.getScbssfbhxlh());
productInfoEntity.setYbbm(deviceEntity.getYbbm());
productInfoEntity.setSpmc(deviceEntity.getSpmc());
productInfoEntity.setCphhhbh(deviceEntity.getCphhhbh());
productInfoEntity.setCpms(deviceEntity.getCpms());
productInfoEntity.setCpbsbmtxmc(deviceEntity.getCpbsbmtxmc());
productInfoEntity.setCplx(deviceEntity.getCplx());
productInfoEntity.setHchzsb(deviceEntity.getHchzsb());
if (StrUtil.trimToEmpty(productInfoEntity.getSfwblztlcp()).equals("1")) {
productInfoEntity.setSfwblztlcp("是");
} else if (StrUtil.trimToEmpty(productInfoEntity.getSfwblztlcp()).equals("0")) {
productInfoEntity.setSfwblztlcp("否");
}
if (StrUtil.trimToEmpty(productInfoEntity.getCgzmraqxgxx()).equals("0")) {
productInfoEntity.setCgzmraqxgxx("安全");
} else if (StrUtil.trimToEmpty(productInfoEntity.getCgzmraqxgxx()).equals("1")) {
productInfoEntity.setCgzmraqxgxx("条件安全");
} else if (StrUtil.trimToEmpty(productInfoEntity.getCgzmraqxgxx()).equals("2")) {
productInfoEntity.setCgzmraqxgxx("说明书或标签上面不包括 MR 安全信息");
}
if (StrUtil.trimToEmpty(productInfoEntity.getSfwwjbz()).equals("1")) {
productInfoEntity.setSfwwjbz("是");
} else if (StrUtil.trimToEmpty(productInfoEntity.getSfwwjbz()).equals("0")) {
productInfoEntity.setSfwwjbz("否");
}
if (StrUtil.trimToEmpty(productInfoEntity.getSyqsfxyjxmj()).equals("1")) {
productInfoEntity.setSyqsfxyjxmj("是");
} else if (StrUtil.trimToEmpty(productInfoEntity.getSyqsfxyjxmj()).equals("0")) {
productInfoEntity.setSyqsfxyjxmj("否");
}
ProductClassify productClassifyEntity = productClassifyService.findByCode(productInfoEntity.getFlbm(), productInfoEntity.getCplx());
productInfoEntity.setCategoryName(productClassifyEntity.getName());
productInfoEntity.setVersionNumber(Integer.parseInt(deviceEntity.getVersionnumber()));
if (deviceEntity.getSydycpbs() != null && !deviceEntity.getSydycpbs().equals("")) {
productInfoEntity.setBhxjcpbm("");
productInfoEntity.setBhxjsl(0);
productInfoEntity.setBzcj("");
productInfoEntity.setBhzxxsbzsl(0);
productInfoEntity.setPackLevel(1 + "");
productInfoEntity.setAddType(1 + "");
productInfoEntity.setZxxsbzbhsydysl(0);
productInfoEntity.setDiType(2);
productInfoEntity.setNameCode(deviceEntity.getSydycpbs());
productInfoEntity.setSjcpbm(deviceEntity.getZxxsdycpbs());
productInfoEntity.setUpdateTime(new Date());
productInfoService.insertProductInfo(productInfoEntity);
productInfoEntity.setBhxjcpbm(deviceEntity.getSydycpbs());
productInfoEntity.setBhxjsl(1);
productInfoEntity.setPackLevel(2 + "");
productInfoEntity.setZxxsbzbhsydysl(1);
} else if (deviceEntity.getBtcpbs() != null && !deviceEntity.getBtcpbs().equals("")) {
productInfoEntity.setBhxjcpbm("");
productInfoEntity.setBhxjsl(0);
productInfoEntity.setBzcj("");
productInfoEntity.setBhzxxsbzsl(0);
productInfoEntity.setPackLevel(1 + "");
productInfoEntity.setAddType(1 + "");
productInfoEntity.setZxxsbzbhsydysl(0);
productInfoEntity.setDiType(3);
productInfoEntity.setSjcpbm(deviceEntity.getZxxsdycpbs());
productInfoEntity.setNameCode(deviceEntity.getBtcpbs());
productInfoEntity.setUpdateTime(new Date());
productInfoService.insertProductInfo(productInfoEntity);
productInfoEntity.setBhxjcpbm(deviceEntity.getBtcpbs());
productInfoEntity.setBhxjsl(1);
productInfoEntity.setPackLevel(2 + "");
productInfoEntity.setZxxsbzbhsydysl(1);
}
productInfoEntity.setDiType(1);
productInfoEntity.setBzcj("");
productInfoEntity.setAddType(1 + "");
productInfoEntity.setNameCode(deviceEntity.getZxxsdycpbs());
if (deviceEntity.getZxxsdyzsydydsl() != null && !deviceEntity.getZxxsdyzsydydsl().equals("") && Integer.parseInt(deviceEntity.getZxxsdyzsydydsl()) > 1) {
productInfoEntity.setZxxsbzbhsydysl(Integer.parseInt(deviceEntity.getZxxsdyzsydydsl()));
productInfoEntity.setBhxjsl(Integer.parseInt(deviceEntity.getZxxsdyzsydydsl()));
}
List<Devicepackage> devicepackages = deviceEntity.getDevicepackages();
productInfoEntity.setSjcpbm(getSjcpbm(devicepackages, productInfoEntity.getNameCode()));
productInfoEntity.setUpdateTime(new Date());
productInfoService.insertProductInfo(productInfoEntity);
List<CountProductEntity> countProductEntities = new ArrayList<>();
int curLevel = Integer.parseInt(productInfoEntity.getPackLevel()) + 1;
if (devicepackages != null && devicepackages.size() > 0) {
HashMap<String, String> packRation = new HashMap<>();
for (Devicepackage devicepackage : devicepackages) {
CountProductEntity countProductEntity = new CountProductEntity();
Devicepackage head = devicepackage;
//包装层级初始为2最小销售单元为1
int level = curLevel;
int zxbsCount = devicepackage.getBznhxyjcpbssl(); //最小销售单元数量
int count = 1; //计数,如果计数超过包装标识层级,就是死循环,包装标识有误
while (!head.getBznhxyjbzcpbs().equals(deviceEntity.getZxxsdycpbs())) {
head = getNext(devicepackages, head);
if (head == null) {
break;
}
count++;
if (count > devicepackages.size()) {
break;
}
level++;
zxbsCount = zxbsCount * head.getBznhxyjcpbssl();
}
packRation.put(level - 1 + "", devicepackage.getBznhxyjcpbssl() + "");
countProductEntity.setLevel(level);
countProductEntity.setZxbsCount(zxbsCount);
countProductEntities.add(countProductEntity);
}
CountProductEntity max = getMaxLevel(countProductEntities);
packRation.put(max.getLevel() + "", max.getZxbsCount() + "");
for (int i = 0; i < devicepackages.size(); i++) {
Devicepackage devicepackage = devicepackages.get(i);
CountProductEntity countProductEntity = countProductEntities.get(i);
productInfoEntity.setNameCode(devicepackage.getBzcpbs());
productInfoEntity.setBhxjcpbm(devicepackage.getBznhxyjbzcpbs());
productInfoEntity.setBhxjsl(devicepackage.getBznhxyjcpbssl());
productInfoEntity.setBzcj(devicepackage.getCpbzjb());
productInfoEntity.setBhzxxsbzsl(countProductEntity.getZxbsCount());
productInfoEntity.setPackLevel(countProductEntity.getLevel() + "");
productInfoEntity.setSjcpbm(getSjcpbm(devicepackages, productInfoEntity.getNameCode()));
productInfoEntity.setDiType(4);
productInfoEntity.setUpdateTime(new Date());
productInfoService.insertProductInfo(productInfoEntity);
}
}
//更新为最新版本
ProductInfoFilterRequest filterRequest1 = new ProductInfoFilterRequest();
filterRequest1.setNameCode(di);
List<ProductInfoEntity> updateEntitys = productInfoService.filterUdi(filterRequest1);
if (updateEntitys != null && updateEntitys.size() > 0) {
//获取最高版本号
ProductInfoEntity updateEntity = updateEntitys.get(0);
for (ProductInfoEntity tempEntity : updateEntitys) {
if (tempEntity.getVersionNumber() > updateEntity.getVersionNumber()) {
updateEntity = tempEntity;
}
}
ProductInfoFilterRequest filterRequest = new ProductInfoFilterRequest();
filterRequest.setDeviceRecordKey(updateEntity.getDeviceRecordKey());
List<ProductInfoEntity> temps = productInfoService.filterProductInfo(filterRequest);
if (temps != null && temps.size() > 0) {
for (ProductInfoEntity change : temps) {
change.setIsNewest(false);
change.setUpdateTime(new Date());
productInfoService.updateProductInfo(change);
}
}
List<ProductInfoEntity> updates = productInfoService.selectByUuid(updateEntity.getUuid());
for (ProductInfoEntity update : updates) {
update.setIsNewest(true);
update.setUpdateTime(new Date());
productInfoService.updateProductInfo(update);
}
}
//更新厂家信息,
UdiCompanyRequest udiCompanyRequest = new UdiCompanyRequest();
udiCompanyRequest.setTyshxydm(productInfoEntity.getTyshxydm());
if (StrUtil.isNotEmpty(udiCompanyRequest.getTyshxydm())) {
List<UdiCompanyEntity> udiCompanyEntitys = udiCompanyService.filterUdiCompany(udiCompanyRequest);
if (udiCompanyEntitys == null || udiCompanyEntitys.size() == 0) {
UdiCompanyEntity udiCompanyEntity = new UdiCompanyEntity();
udiCompanyEntity.setTyshxydm(productInfoEntity.getTyshxydm());
udiCompanyEntity.setUpdateTime(new Date());
udiCompanyEntity.setYlqxzcrbarywmc(productInfoEntity.getYlqxzcrbarywmc());
udiCompanyEntity.setYlqxzcrbarmc(productInfoEntity.getYlqxzcrbarmc());
List<Contactlist> contactlists = udiCompanyService.selectContactBykey(productInfoEntity.getDeviceRecordKey());
if (contactlists != null && contactlists.size() > 0) {
udiCompanyEntity.setQylxrcz(contactlists.get(0).getQylxrcz());
udiCompanyEntity.setQylxrdh(contactlists.get(0).getQylxrdh());
udiCompanyEntity.setQylxryx(contactlists.get(0).getQylxryx());
}
udiCompanyEntity.setUpdateTime(new Date());
udiCompanyService.insertUdiCompany(udiCompanyEntity);
}
}
}
public String getSjcpbm(List<Devicepackage> devicepackages, String nameCode) {
String sjcpbs = "";
if (devicepackages != null && devicepackages.size() > 0) {
for (Devicepackage devicepackage : devicepackages) {
if (devicepackage.getBznhxyjbzcpbs() != null && devicepackage.getBznhxyjbzcpbs().equals(nameCode)) {
sjcpbs = sjcpbs + "," + devicepackage.getBzcpbs();
}
}
}
if (sjcpbs.length() > 1)
return sjcpbs.substring(1);
return sjcpbs;
}
public CountProductEntity getMaxLevel(List<CountProductEntity> countProductEntities) {
int index = 0;
int max = 0;
for (int i = 0; i < countProductEntities.size(); i++) {
CountProductEntity countProductEntity = countProductEntities.get(i);
if (countProductEntity.getZxbsCount() > max) {
max = countProductEntity.getZxbsCount();
index = i;
}
}
return countProductEntities.get(index);
}
public Devicepackage getNext(List<Devicepackage> devicepackages, Devicepackage devicepackage) {
if (devicepackages != null && devicepackages.size() > 0) {
for (int i = 0; i < devicepackages.size(); i++) {
Devicepackage temp = devicepackages.get(i);
if (temp.getBzcpbs().equals(devicepackage.getBznhxyjbzcpbs())) {
return temp;
}
}
}
return null;
}
}

@ -0,0 +1,141 @@
package com.glxp.udidl.admin.service.dataUpdate;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.glxp.udidl.admin.constant.Constant;
import com.glxp.udidl.admin.entity.info.CompanyEntity;
import com.glxp.udidl.admin.entity.udid.JobLog;
import com.glxp.udidl.admin.entity.udid.TokenEntity;
import com.glxp.udidl.admin.req.UpdateUdiRequest;
import com.glxp.udidl.admin.req.udid.DownloadDiRequest;
import com.glxp.udidl.admin.req.udid.TokenRequest;
import com.glxp.udidl.admin.res.udid.DataSetSingleResult;
import com.glxp.udidl.admin.service.info.CompanyService;
import com.glxp.udidl.admin.service.inout.DeviceService;
import com.glxp.udidl.admin.service.inout.ProductInfoService;
import com.glxp.udidl.admin.service.udi.JobLogService;
import com.glxp.udidl.admin.util.HttpClient;
import com.glxp.udidl.admin.util.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class DeviceUpdateService {
private String token;
private String url = "sharing/get";
@Resource
private RedisUtil redisUtil;
@Resource
private CompanyService companyService;
@Resource
private JobLogService jobLogService; //日志
@Resource
private DeviceParseService deviceParseService;
@Resource
private DeviceService deviceService;
@Resource
private ProductInfoService productInfoService;
public void updateUdiData(UpdateUdiRequest updateUdiRequest) {
JobLog jobLog = new JobLog();
jobLog.setCreateTime(new Date());
jobLog.setStatus(0);
jobLog.setType(Constant.LOG_TYPE_INFO);
jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL);
jobLog.setTaskType(Constant.JOB_TASK_TYPE_UPDATE);
jobLogService.insert(jobLog);
if (updateUdiRequest.getType() == 0) {
//按时间更新
log.info("开始更新数据,更新时间段为: {} - {}", updateUdiRequest.getStartDate(), updateUdiRequest.getEndDate());
//解析更新参数
DateTime startDate = DateUtil.parse(updateUdiRequest.getStartDate(), DatePattern.SIMPLE_MONTH_PATTERN);
DateTime endDate = DateUtil.parse(updateUdiRequest.getEndDate(), DatePattern.SIMPLE_MONTH_PATTERN);
List<DateTime> dateRanges = DateUtil.rangeToList(startDate, endDate, DateField.MONTH);
for (DateTime date : dateRanges) {
}
} else if (updateUdiRequest.getType() == 1) {
jobLog.setTotalCount(1);
jobLog.setRealCount(1);
//按DI更新
log.info("按照DI更新更新的DI标识为{}", updateUdiRequest.getNameCode());
DataSetSingleResult dataSetSingleResult = downloadByDi(updateUdiRequest.getNameCode());
if (dataSetSingleResult.getReturnCode() == -1) {
log.error("更新DI信息异常" + dataSetSingleResult.getReturnMsg());
jobLog.setType(Constant.LOG_TYPE_ERROR);
jobLog.setMsg(dataSetSingleResult.getReturnMsg());
jobLog.setInsertCount(0);
} else {
log.info("下载成功,开始更新数据");
deviceParseService.DeviceSave(Collections.singletonList(dataSetSingleResult.getDataSet()), new Date());
jobLog.setInsertCount(1);
}
}
jobLog.setUpdateTime(new Date());
jobLog.setStatus(1);
jobLogService.update(jobLog);
}
/**
* token
*
* @return
*/
public String getToken() {
token = redisUtil.get("UDI_UPDATE_TOKEN");
if (StrUtil.isEmpty(token)) {
//查询下载数据使用的appid
CompanyEntity companyEntity = companyService.findByTaskType(Constant.TASK_TYPE_UPDATE);
TokenRequest tokenRequest = new TokenRequest();
tokenRequest.setAppId(companyEntity.getAppId());
tokenRequest.setAppSecret(companyEntity.getAppSecret());
tokenRequest.setTyshxydm(companyEntity.getTyshxydm());
String response = HttpClient.post("token/get", tokenRequest);
TokenEntity tokenEntity = JSONObject.parseObject(response, TokenEntity.class);
token = tokenEntity.getAccessToken();
redisUtil.setEx("UDI_UPDATE_TOKEN", token, 1 * 60 * 60 * 6);
}
return token;
}
/**
*
*
* @param deviceId
* @return
*/
public DataSetSingleResult downloadByDi(String deviceId) {
DataSetSingleResult result = new DataSetSingleResult();
DownloadDiRequest downloadDiRequest = new DownloadDiRequest();
downloadDiRequest.setAccessToken(getToken());
downloadDiRequest.setPrimaryDeviceId(deviceId);
String response = "";
try {
response = HttpClient.post("sharing/single", downloadDiRequest);
} catch (Exception e) {
log.error("下载产品标识详情数据异常,响应结果:{}", response);
result.setReturnCode(-1);
result.setReturnMsg(e.getMessage());
return result;//发生错误 退出
}
return JSONObject.parseObject(response, DataSetSingleResult.class);
}
}

@ -4,7 +4,6 @@ import com.glxp.udidl.admin.entity.udid.*;
import com.glxp.udidl.admin.req.ListPageRequest;
import com.glxp.udidl.admin.req.udid.DeviceListRequest;
import com.glxp.udidl.admin.req.udid.DeviceSearchRequest;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -47,4 +46,14 @@ public interface DeviceService {
List<String> findAllByZxxscpbsPage(ListPageRequest listPageRequest);
boolean updateCplx(Device device);
boolean updateDevice(Device device);
boolean updateContactlist(List<Contactlist> contactlistList);
boolean updateDeviceClinical(List<Deviceclinical> deviceclinicalList);
boolean updateDevicestorage(List<Devicestorage> devicestorageList);
boolean updateDevicepackage(List<Devicepackage> devicepackageList);
}

@ -16,6 +16,7 @@ import java.util.Collections;
import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class DeviceServiceImpl implements DeviceService {
@Resource
@ -211,20 +212,63 @@ public class DeviceServiceImpl implements DeviceService {
return deviceMapper.findAllByZxxscpbsPage(listPageRequest);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateCplx(Device device) {
return deviceMapper.updateCplx(device);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateDevice(Device device) {
deviceMapper.updateDevice(device);
return true;
}
@Override
public boolean updateContactlist(List<Contactlist> contactlistList) {
if (contactlistList != null && contactlistList.size() > 0) {
for (int i = 0; i < contactlistList.size(); i++) {
contactlistMapper.update(contactlistList.get(i));
}
}
return true;
}
@Override
public boolean updateDeviceClinical(List<Deviceclinical> deviceclinicals) {
if (deviceclinicals != null && deviceclinicals.size() > 0) {
for (int i = 0; i < deviceclinicals.size(); i++) {
deviceclinicalMapper.update(deviceclinicals.get(i));
}
}
return true;
}
@Override
public boolean updateDevicestorage(List<Devicestorage> devicestorages) {
if (devicestorages != null && devicestorages.size() > 0) {
for (int i = 0; i < devicestorages.size(); i++) {
devicestorageMapper.update(devicestorages.get(i));
}
}
return true;
}
@Override
public boolean updateDevicepackage(List<Devicepackage> devicepackages) {
if (devicepackages != null && devicepackages.size() > 0) {
for (int i = 0; i < devicepackages.size(); i++) {
devicepackageMapper.update(devicepackages.get(i));
}
}
return true;
}
@Override
public boolean insertDevice(Device device) {
deviceMapper.insert(device);
return true;
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean insertDeviceClinical(List<Deviceclinical> deviceclinicals) {
if (deviceclinicals != null && deviceclinicals.size() > 0) {
@ -235,7 +279,6 @@ public class DeviceServiceImpl implements DeviceService {
return true;
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean insertDevicestorage(List<Devicestorage> devicestorages) {
if (devicestorages != null && devicestorages.size() > 0) {
@ -246,7 +289,6 @@ public class DeviceServiceImpl implements DeviceService {
return true;
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean insertDevicepackage(List<Devicepackage> devicepackages) {
if (devicepackages != null && devicepackages.size() > 0) {
@ -257,7 +299,6 @@ public class DeviceServiceImpl implements DeviceService {
return true;
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean insertContactlist(List<Contactlist> contactlists) {
if (contactlists != null && contactlists.size() > 0) {

@ -62,6 +62,7 @@ public class DownloadProductInfoTask implements SchedulingConfigurer {
JobLog jobLog = new JobLog();
jobLog.setType(Constant.LOG_TYPE_ERROR);
jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_AUTO);
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD);
jobLog.setMsg("下载文件失败:" + res.getMessage());
jobLog.setCreateTime(new Date());
jobLogService.insert(jobLog);

@ -239,4 +239,13 @@
resultMap="BaseResultMap">
select * from contactlist
</select>
<insert id="update" parameterType="com.glxp.udidl.admin.entity.udid.Contactlist">
replace into contactlist ( deviceRecordKey, qylxrcz,
qylxrdh, qylxryx, uuid
)
values ( #{devicerecordkey,jdbcType=VARCHAR}, #{qylxrcz,jdbcType=VARCHAR},
#{qylxrdh,jdbcType=VARCHAR}, #{qylxryx,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR}
)
</insert>
</mapper>

@ -1031,4 +1031,41 @@
WHERE devicerecordkey=#{devicerecordkey}
</update>
<insert id="updateDevice" parameterType="com.glxp.udidl.admin.entity.udid.Device">
replace into device (uuid, deviceRecordKey, btcpbs,
btcpbsyzxxsdycpbssfyz, cgzmraqxgxx, cpbsbmtxmc,
cpbsfbrq, cphhhbh, cplb,
cpmctymc, cpms, flbm,
ggxh, mjfs, qtxxdwzlj,
qxlb, scbssfbhph, scbssfbhscrq,
scbssfbhsxrq, scbssfbhxlh, sfbjwycxsy,
sfwblztlcp, sfwwjbz, sfybtzjbs,
spmc, sydycpbs, syqsfxyjxmj,
tscchcztj, tsccsm, tsrq,
tyshxydm, versionNumber, versionStatus,
versionTime, ybbm, yflbm,
ylqxzcrbarmc, ylqxzcrbarywmc, zczbhhzbapzbh,
zdcfsycs, zxxsdycpbs, bszt,
sfyzcbayz, zcbacpbs, zxxsdyzsydydsl,
deviceHistoryRecordKey, bssjzt, lastModifyTime, requestDate, hchzsb, cplx)
values (#{uuid,jdbcType=VARCHAR}, #{devicerecordkey,jdbcType=VARCHAR}, #{btcpbs,jdbcType=VARCHAR},
#{btcpbsyzxxsdycpbssfyz,jdbcType=VARCHAR}, #{cgzmraqxgxx,jdbcType=VARCHAR},
#{cpbsbmtxmc,jdbcType=VARCHAR},
#{cpbsfbrq,jdbcType=VARCHAR}, #{cphhhbh,jdbcType=VARCHAR}, #{cplb,jdbcType=VARCHAR},
#{cpmctymc,jdbcType=VARCHAR}, #{cpms,jdbcType=VARCHAR}, #{flbm,jdbcType=VARCHAR},
#{ggxh,jdbcType=VARCHAR}, #{mjfs,jdbcType=VARCHAR}, #{qtxxdwzlj,jdbcType=VARCHAR},
#{qxlb,jdbcType=VARCHAR}, #{scbssfbhph,jdbcType=VARCHAR}, #{scbssfbhscrq,jdbcType=VARCHAR},
#{scbssfbhsxrq,jdbcType=VARCHAR}, #{scbssfbhxlh,jdbcType=VARCHAR}, #{sfbjwycxsy,jdbcType=VARCHAR},
#{sfwblztlcp,jdbcType=VARCHAR}, #{sfwwjbz,jdbcType=VARCHAR}, #{sfybtzjbs,jdbcType=VARCHAR},
#{spmc,jdbcType=VARCHAR}, #{sydycpbs,jdbcType=VARCHAR}, #{syqsfxyjxmj,jdbcType=VARCHAR},
#{tscchcztj,jdbcType=VARCHAR}, #{tsccsm,jdbcType=VARCHAR}, #{tsrq,jdbcType=VARCHAR},
#{tyshxydm,jdbcType=VARCHAR}, #{versionnumber,jdbcType=VARCHAR}, #{versionstatus,jdbcType=VARCHAR},
#{versiontime,jdbcType=VARCHAR}, #{ybbm,jdbcType=VARCHAR}, #{yflbm,jdbcType=VARCHAR},
#{ylqxzcrbarmc,jdbcType=VARCHAR}, #{ylqxzcrbarywmc,jdbcType=VARCHAR}, #{zczbhhzbapzbh,jdbcType=VARCHAR},
#{zdcfsycs,jdbcType=VARCHAR}, #{zxxsdycpbs,jdbcType=VARCHAR}, #{bszt,jdbcType=VARCHAR},
#{sfyzcbayz,jdbcType=VARCHAR}, #{zcbacpbs,jdbcType=VARCHAR}, #{zxxsdyzsydydsl,jdbcType=VARCHAR},
#{devicehistoryrecordkey,jdbcType=VARCHAR}, #{bssjzt,jdbcType=VARCHAR},
#{lastModifyTime,jdbcType=VARCHAR}, #{requestDate}, #{hchzsb}, #{cplx})
</insert>
</mapper>

@ -1,230 +1,251 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.udidl.admin.dao.udid.DeviceclinicalMapper">
<resultMap id="BaseResultMap" type="com.glxp.udidl.admin.entity.udid.Deviceclinical">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="deviceRecordKey" jdbcType="VARCHAR" property="devicerecordkey" />
<result column="lcsycclx" jdbcType="VARCHAR" property="lcsycclx" />
<result column="ccz" jdbcType="VARCHAR" property="ccz" />
<result column="ccdw" jdbcType="VARCHAR" property="ccdw" />
<result column="uuid" jdbcType="VARCHAR" property="uuid" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
<resultMap id="BaseResultMap" type="com.glxp.udidl.admin.entity.udid.Deviceclinical">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="deviceRecordKey" jdbcType="VARCHAR" property="devicerecordkey"/>
<result column="lcsycclx" jdbcType="VARCHAR" property="lcsycclx"/>
<result column="ccz" jdbcType="VARCHAR" property="ccz"/>
<result column="ccdw" jdbcType="VARCHAR" property="ccdw"/>
<result column="uuid" jdbcType="VARCHAR" property="uuid"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, deviceRecordKey, lcsycclx, ccz, ccdw, uuid
</sql>
<select id="selectByExample" parameterType="com.glxp.udidl.admin.entity.udid.DeviceclinicalExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from deviceclinical
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from deviceclinical
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from deviceclinical
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.glxp.udidl.admin.entity.udid.DeviceclinicalExample">
delete from deviceclinical
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.glxp.udidl.admin.entity.udid.Deviceclinical">
insert into deviceclinical ( deviceRecordKey, lcsycclx,
ccz, ccdw, uuid)
values ( #{devicerecordkey,jdbcType=VARCHAR}, #{lcsycclx,jdbcType=VARCHAR},
#{ccz,jdbcType=VARCHAR}, #{ccdw,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.glxp.udidl.admin.entity.udid.Deviceclinical">
insert into deviceclinical
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
</where>
</sql>
<sql id="Base_Column_List">
id,
</if>
<if test="devicerecordkey != null">
deviceRecordKey,
</if>
<if test="lcsycclx != null">
lcsycclx,
</if>
<if test="ccz != null">
ccz,
</if>
<if test="ccdw != null">
ccdw,
</if>
<if test="uuid != null">
uuid,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="devicerecordkey != null">
#{devicerecordkey,jdbcType=VARCHAR},
</if>
<if test="lcsycclx != null">
#{lcsycclx,jdbcType=VARCHAR},
</if>
<if test="ccz != null">
#{ccz,jdbcType=VARCHAR},
</if>
<if test="ccdw != null">
#{ccdw,jdbcType=VARCHAR},
</if>
<if test="uuid != null">
#{uuid,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glxp.udidl.admin.entity.udid.DeviceclinicalExample" resultType="java.lang.Long">
select count(*) from deviceclinical
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update deviceclinical
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.devicerecordkey != null">
deviceRecordKey = #{record.devicerecordkey,jdbcType=VARCHAR},
</if>
<if test="record.lcsycclx != null">
lcsycclx = #{record.lcsycclx,jdbcType=VARCHAR},
</if>
<if test="record.ccz != null">
ccz = #{record.ccz,jdbcType=VARCHAR},
</if>
<if test="record.ccdw != null">
ccdw = #{record.ccdw,jdbcType=VARCHAR},
</if>
<if test="record.uuid != null">
uuid = #{record.uuid,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update deviceclinical
set id = #{record.id,jdbcType=INTEGER},
deviceRecordKey = #{record.devicerecordkey,jdbcType=VARCHAR},
lcsycclx = #{record.lcsycclx,jdbcType=VARCHAR},
ccz = #{record.ccz,jdbcType=VARCHAR},
ccdw = #{record.ccdw,jdbcType=VARCHAR},
uuid = #{record.uuid,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.glxp.udidl.admin.entity.udid.Deviceclinical">
update deviceclinical
<set>
<if test="devicerecordkey != null">
deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR},
</if>
<if test="lcsycclx != null">
lcsycclx = #{lcsycclx,jdbcType=VARCHAR},
</if>
<if test="ccz != null">
ccz = #{ccz,jdbcType=VARCHAR},
</if>
<if test="ccdw != null">
ccdw = #{ccdw,jdbcType=VARCHAR},
</if>
<if test="uuid != null">
uuid = #{uuid,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glxp.udidl.admin.entity.udid.Deviceclinical">
update deviceclinical
set deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR},
lcsycclx = #{lcsycclx,jdbcType=VARCHAR},
ccz = #{ccz,jdbcType=VARCHAR},
ccdw = #{ccdw,jdbcType=VARCHAR},
uuid = #{uuid,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="downloadDeviceclinical" parameterType="com.glxp.udidl.admin.req.DownloadUdiRequest" resultMap="BaseResultMap">
select * from deviceclinical
uuid
</sql>
<select id="selectByExample" parameterType="com.glxp.udidl.admin.entity.udid.DeviceclinicalExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from deviceclinical
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from deviceclinical
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete
from deviceclinical
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.glxp.udidl.admin.entity.udid.DeviceclinicalExample">
delete
from deviceclinical
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.glxp.udidl.admin.entity.udid.Deviceclinical">
insert into deviceclinical (deviceRecordKey, lcsycclx,
ccz, ccdw, uuid)
values (#{devicerecordkey,jdbcType=VARCHAR}, #{lcsycclx,jdbcType=VARCHAR},
#{ccz,jdbcType=VARCHAR}, #{ccdw,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.glxp.udidl.admin.entity.udid.Deviceclinical">
insert into deviceclinical
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="devicerecordkey != null">
deviceRecordKey,
</if>
<if test="lcsycclx != null">
lcsycclx,
</if>
<if test="ccz != null">
ccz,
</if>
<if test="ccdw != null">
ccdw,
</if>
<if test="uuid != null">
uuid,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="devicerecordkey != null">
#{devicerecordkey,jdbcType=VARCHAR},
</if>
<if test="lcsycclx != null">
#{lcsycclx,jdbcType=VARCHAR},
</if>
<if test="ccz != null">
#{ccz,jdbcType=VARCHAR},
</if>
<if test="ccdw != null">
#{ccdw,jdbcType=VARCHAR},
</if>
<if test="uuid != null">
#{uuid,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glxp.udidl.admin.entity.udid.DeviceclinicalExample"
resultType="java.lang.Long">
select count(*)
from deviceclinical
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update deviceclinical
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.devicerecordkey != null">
deviceRecordKey = #{record.devicerecordkey,jdbcType=VARCHAR},
</if>
<if test="record.lcsycclx != null">
lcsycclx = #{record.lcsycclx,jdbcType=VARCHAR},
</if>
<if test="record.ccz != null">
ccz = #{record.ccz,jdbcType=VARCHAR},
</if>
<if test="record.ccdw != null">
ccdw = #{record.ccdw,jdbcType=VARCHAR},
</if>
<if test="record.uuid != null">
uuid = #{record.uuid,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update deviceclinical
set id = #{record.id,jdbcType=INTEGER},
deviceRecordKey = #{record.devicerecordkey,jdbcType=VARCHAR},
lcsycclx = #{record.lcsycclx,jdbcType=VARCHAR},
ccz = #{record.ccz,jdbcType=VARCHAR},
ccdw = #{record.ccdw,jdbcType=VARCHAR},
uuid = #{record.uuid,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.glxp.udidl.admin.entity.udid.Deviceclinical">
update deviceclinical
<set>
<if test="devicerecordkey != null">
deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR},
</if>
<if test="lcsycclx != null">
lcsycclx = #{lcsycclx,jdbcType=VARCHAR},
</if>
<if test="ccz != null">
ccz = #{ccz,jdbcType=VARCHAR},
</if>
<if test="ccdw != null">
ccdw = #{ccdw,jdbcType=VARCHAR},
</if>
<if test="uuid != null">
uuid = #{uuid,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glxp.udidl.admin.entity.udid.Deviceclinical">
update deviceclinical
set deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR},
lcsycclx = #{lcsycclx,jdbcType=VARCHAR},
ccz = #{ccz,jdbcType=VARCHAR},
ccdw = #{ccdw,jdbcType=VARCHAR},
uuid = #{uuid,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="downloadDeviceclinical" parameterType="com.glxp.udidl.admin.req.DownloadUdiRequest"
resultMap="BaseResultMap">
select *
from deviceclinical
limit #{page},#{limit}
</select>
<insert id="update" parameterType="com.glxp.udidl.admin.entity.udid.Deviceclinical">
replace into deviceclinical (deviceRecordKey, lcsycclx,
ccz, ccdw, uuid)
values (#{devicerecordkey,jdbcType=VARCHAR}, #{lcsycclx,jdbcType=VARCHAR},
#{ccz,jdbcType=VARCHAR}, #{ccdw,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR})
</insert>
</mapper>

@ -245,4 +245,13 @@
select * from devicepackage
limit #{page},#{limit}
</select>
<insert id="update" parameterType="com.glxp.udidl.admin.entity.udid.Devicepackage">
replace into devicepackage (bzcpbs, bznhxyjbzcpbs,
cpbzjb, bznhxyjcpbssl, deviceRecordKey,
uuid)
values ( #{bzcpbs,jdbcType=VARCHAR}, #{bznhxyjbzcpbs,jdbcType=VARCHAR},
#{cpbzjb,jdbcType=VARCHAR}, #{bznhxyjcpbssl,jdbcType=INTEGER}, #{devicerecordkey,jdbcType=VARCHAR},
#{uuid,jdbcType=VARCHAR})
</insert>
</mapper>

@ -1,248 +1,267 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.udidl.admin.dao.udid.DevicestorageMapper">
<resultMap id="BaseResultMap" type="com.glxp.udidl.admin.entity.udid.Devicestorage">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="deviceRecordKey" jdbcType="VARCHAR" property="devicerecordkey" />
<result column="cchcztj" jdbcType="VARCHAR" property="cchcztj" />
<result column="jldw" jdbcType="VARCHAR" property="jldw" />
<result column="zdz" jdbcType="VARCHAR" property="zdz" />
<result column="zgz" jdbcType="VARCHAR" property="zgz" />
<result column="uuid" jdbcType="VARCHAR" property="uuid" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
<resultMap id="BaseResultMap" type="com.glxp.udidl.admin.entity.udid.Devicestorage">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="deviceRecordKey" jdbcType="VARCHAR" property="devicerecordkey"/>
<result column="cchcztj" jdbcType="VARCHAR" property="cchcztj"/>
<result column="jldw" jdbcType="VARCHAR" property="jldw"/>
<result column="zdz" jdbcType="VARCHAR" property="zdz"/>
<result column="zgz" jdbcType="VARCHAR" property="zgz"/>
<result column="uuid" jdbcType="VARCHAR" property="uuid"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, deviceRecordKey, cchcztj, jldw, zdz, zgz, uuid
</sql>
<select id="selectByExample" parameterType="com.glxp.udidl.admin.entity.udid.DevicestorageExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from devicestorage
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from devicestorage
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from devicestorage
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.glxp.udidl.admin.entity.udid.DevicestorageExample">
delete from devicestorage
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.glxp.udidl.admin.entity.udid.Devicestorage">
insert into devicestorage ( deviceRecordKey, cchcztj,
jldw, zdz, zgz, uuid
)
values ( #{devicerecordkey,jdbcType=VARCHAR}, #{cchcztj,jdbcType=VARCHAR},
#{jldw,jdbcType=VARCHAR}, #{zdz,jdbcType=VARCHAR}, #{zgz,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.glxp.udidl.admin.entity.udid.Devicestorage">
insert into devicestorage
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
</where>
</sql>
<sql id="Base_Column_List">
id,
</if>
<if test="devicerecordkey != null">
deviceRecordKey,
</if>
<if test="cchcztj != null">
cchcztj,
</if>
<if test="jldw != null">
jldw,
</if>
<if test="zdz != null">
zdz,
</if>
<if test="zgz != null">
zgz,
</if>
<if test="uuid != null">
uuid,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="devicerecordkey != null">
#{devicerecordkey,jdbcType=VARCHAR},
</if>
<if test="cchcztj != null">
#{cchcztj,jdbcType=VARCHAR},
</if>
<if test="jldw != null">
#{jldw,jdbcType=VARCHAR},
</if>
<if test="zdz != null">
#{zdz,jdbcType=VARCHAR},
</if>
<if test="zgz != null">
#{zgz,jdbcType=VARCHAR},
</if>
<if test="uuid != null">
#{uuid,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glxp.udidl.admin.entity.udid.DevicestorageExample" resultType="java.lang.Long">
select count(*) from devicestorage
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update devicestorage
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.devicerecordkey != null">
deviceRecordKey = #{record.devicerecordkey,jdbcType=VARCHAR},
</if>
<if test="record.cchcztj != null">
cchcztj = #{record.cchcztj,jdbcType=VARCHAR},
</if>
<if test="record.jldw != null">
jldw = #{record.jldw,jdbcType=VARCHAR},
</if>
<if test="record.zdz != null">
zdz = #{record.zdz,jdbcType=VARCHAR},
</if>
<if test="record.zgz != null">
zgz = #{record.zgz,jdbcType=VARCHAR},
</if>
<if test="record.uuid != null">
uuid = #{record.uuid,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update devicestorage
set id = #{record.id,jdbcType=INTEGER},
deviceRecordKey = #{record.devicerecordkey,jdbcType=VARCHAR},
cchcztj = #{record.cchcztj,jdbcType=VARCHAR},
jldw = #{record.jldw,jdbcType=VARCHAR},
zdz = #{record.zdz,jdbcType=VARCHAR},
zgz = #{record.zgz,jdbcType=VARCHAR},
uuid = #{record.uuid,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.glxp.udidl.admin.entity.udid.Devicestorage">
update devicestorage
<set>
<if test="devicerecordkey != null">
deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR},
</if>
<if test="cchcztj != null">
cchcztj = #{cchcztj,jdbcType=VARCHAR},
</if>
<if test="jldw != null">
jldw = #{jldw,jdbcType=VARCHAR},
</if>
<if test="zdz != null">
zdz = #{zdz,jdbcType=VARCHAR},
</if>
<if test="zgz != null">
zgz = #{zgz,jdbcType=VARCHAR},
</if>
<if test="uuid != null">
uuid = #{uuid,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glxp.udidl.admin.entity.udid.Devicestorage">
update devicestorage
set deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR},
cchcztj = #{cchcztj,jdbcType=VARCHAR},
jldw = #{jldw,jdbcType=VARCHAR},
zdz = #{zdz,jdbcType=VARCHAR},
zgz = #{zgz,jdbcType=VARCHAR},
uuid = #{uuid,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="downloadDevicestorage" parameterType="com.glxp.udidl.admin.req.DownloadUdiRequest" resultMap="BaseResultMap">
select * from devicestorage
uuid
</sql>
<select id="selectByExample" parameterType="com.glxp.udidl.admin.entity.udid.DevicestorageExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from devicestorage
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from devicestorage
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete
from devicestorage
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.glxp.udidl.admin.entity.udid.DevicestorageExample">
delete
from devicestorage
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.glxp.udidl.admin.entity.udid.Devicestorage">
insert into devicestorage (deviceRecordKey, cchcztj,
jldw, zdz, zgz, uuid)
values (#{devicerecordkey,jdbcType=VARCHAR}, #{cchcztj,jdbcType=VARCHAR},
#{jldw,jdbcType=VARCHAR}, #{zdz,jdbcType=VARCHAR}, #{zgz,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.glxp.udidl.admin.entity.udid.Devicestorage">
insert into devicestorage
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="devicerecordkey != null">
deviceRecordKey,
</if>
<if test="cchcztj != null">
cchcztj,
</if>
<if test="jldw != null">
jldw,
</if>
<if test="zdz != null">
zdz,
</if>
<if test="zgz != null">
zgz,
</if>
<if test="uuid != null">
uuid,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="devicerecordkey != null">
#{devicerecordkey,jdbcType=VARCHAR},
</if>
<if test="cchcztj != null">
#{cchcztj,jdbcType=VARCHAR},
</if>
<if test="jldw != null">
#{jldw,jdbcType=VARCHAR},
</if>
<if test="zdz != null">
#{zdz,jdbcType=VARCHAR},
</if>
<if test="zgz != null">
#{zgz,jdbcType=VARCHAR},
</if>
<if test="uuid != null">
#{uuid,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glxp.udidl.admin.entity.udid.DevicestorageExample"
resultType="java.lang.Long">
select count(*)
from devicestorage
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update devicestorage
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.devicerecordkey != null">
deviceRecordKey = #{record.devicerecordkey,jdbcType=VARCHAR},
</if>
<if test="record.cchcztj != null">
cchcztj = #{record.cchcztj,jdbcType=VARCHAR},
</if>
<if test="record.jldw != null">
jldw = #{record.jldw,jdbcType=VARCHAR},
</if>
<if test="record.zdz != null">
zdz = #{record.zdz,jdbcType=VARCHAR},
</if>
<if test="record.zgz != null">
zgz = #{record.zgz,jdbcType=VARCHAR},
</if>
<if test="record.uuid != null">
uuid = #{record.uuid,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update devicestorage
set id = #{record.id,jdbcType=INTEGER},
deviceRecordKey = #{record.devicerecordkey,jdbcType=VARCHAR},
cchcztj = #{record.cchcztj,jdbcType=VARCHAR},
jldw = #{record.jldw,jdbcType=VARCHAR},
zdz = #{record.zdz,jdbcType=VARCHAR},
zgz = #{record.zgz,jdbcType=VARCHAR},
uuid = #{record.uuid,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.glxp.udidl.admin.entity.udid.Devicestorage">
update devicestorage
<set>
<if test="devicerecordkey != null">
deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR},
</if>
<if test="cchcztj != null">
cchcztj = #{cchcztj,jdbcType=VARCHAR},
</if>
<if test="jldw != null">
jldw = #{jldw,jdbcType=VARCHAR},
</if>
<if test="zdz != null">
zdz = #{zdz,jdbcType=VARCHAR},
</if>
<if test="zgz != null">
zgz = #{zgz,jdbcType=VARCHAR},
</if>
<if test="uuid != null">
uuid = #{uuid,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glxp.udidl.admin.entity.udid.Devicestorage">
update devicestorage
set deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR},
cchcztj = #{cchcztj,jdbcType=VARCHAR},
jldw = #{jldw,jdbcType=VARCHAR},
zdz = #{zdz,jdbcType=VARCHAR},
zgz = #{zgz,jdbcType=VARCHAR},
uuid = #{uuid,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="downloadDevicestorage" parameterType="com.glxp.udidl.admin.req.DownloadUdiRequest"
resultMap="BaseResultMap">
select *
from devicestorage
limit #{page},#{limit}
</select>
<insert id="update" parameterType="com.glxp.udidl.admin.entity.udid.Devicestorage">
replace into devicestorage (deviceRecordKey, cchcztj,
jldw, zdz, zgz, uuid)
values (#{devicerecordkey,jdbcType=VARCHAR}, #{cchcztj,jdbcType=VARCHAR},
#{jldw,jdbcType=VARCHAR}, #{zdz,jdbcType=VARCHAR}, #{zgz,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR})
</insert>
</mapper>

@ -0,0 +1,6 @@
ALTER TABLE `udidl_test`.`company`
ADD COLUMN `taskType` int NULL COMMENT '任务类型: 0下载任务 1更新任务' AFTER `id`;
ALTER TABLE `udidl_test`.`job_log`
ADD COLUMN `taskType` varchar(255) NULL COMMENT '任务类型' AFTER `lastUploadRequest`;
Loading…
Cancel
Save