UDI数据更新接口完善

zhairh
anthonyywj2 3 years ago
parent 7c98851352
commit 34a4b9dfd7

@ -55,5 +55,9 @@ public interface Constant {
*/ */
String JOB_TASK_TYPE_UPDATE = "update"; String JOB_TASK_TYPE_UPDATE = "update";
int DL_TYPE_ADD = 1;
int DL_TYPE_UPDATE = 2;
} }

@ -91,13 +91,19 @@ public class UdidlDeviceController {
jobLog.setCreateTime(new Date()); jobLog.setCreateTime(new Date());
jobLog.setType(Constant.LOG_TYPE_INFO); jobLog.setType(Constant.LOG_TYPE_INFO);
jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL); jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL);
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD); Integer dlType = 1;
if (jobLog.getTaskType() == Constant.JOB_TASK_TYPE_DOWNLOAD) {
dlType = Constant.DL_TYPE_ADD;
} else if (jobLog.getTaskType() == Constant.JOB_TASK_TYPE_DOWNLOAD) {
dlType = Constant.DL_TYPE_UPDATE;
}
jobLogService.update(jobLog); jobLogService.update(jobLog);
if (StrUtil.isNotEmpty(jobLog.getLastUploadRequest())) { if (StrUtil.isNotEmpty(jobLog.getLastUploadRequest())) {
DeviceRequest deviceRequest = JSONUtil.toBean(jobLog.getLastUploadRequest(), DeviceRequest.class); DeviceRequest deviceRequest = JSONUtil.toBean(jobLog.getLastUploadRequest(), DeviceRequest.class);
if (deviceRequest != null) { if (deviceRequest != null) {
logger.info("继续上一次下载"); logger.info("继续上一次下载");
boolean b = deviceDownloadService.getDataAndSave(deviceRequest, jobLog); boolean b = deviceDownloadService.getDataAndSave(deviceRequest, jobLog, dlType);
if (b) { if (b) {
jobLog.setStatus(1); jobLog.setStatus(1);
jobLog.setType(Constant.LOG_TYPE_SUCCESS); jobLog.setType(Constant.LOG_TYPE_SUCCESS);
@ -150,7 +156,7 @@ public class UdidlDeviceController {
@AuthRuleAnnotation("udidl/device/downloadSingle") @AuthRuleAnnotation("udidl/device/downloadSingle")
@PostMapping("udidl/device/downloadSingle") @PostMapping("udidl/device/downloadSingle")
public BaseResponse downloadSingle(String deviceId) { public BaseResponse downloadSingle(String deviceId) {
return deviceSyncService.downloadSingle(deviceId); return deviceSyncService.downloadSingle(deviceId, Constant.DL_TYPE_UPDATE);
} }
@ApiOperation(value = "下载产品历史信息", response = DeviceEntity.class) @ApiOperation(value = "下载产品历史信息", response = DeviceEntity.class)
@ -167,7 +173,7 @@ public class UdidlDeviceController {
@AuthRuleAnnotation("udidl/device/dlLastVersionByDi") @AuthRuleAnnotation("udidl/device/dlLastVersionByDi")
@GetMapping("udidl/device/dlLastVersionByDi") @GetMapping("udidl/device/dlLastVersionByDi")
public BaseResponse dlLastVersionByDi(String deviceId) { public BaseResponse dlLastVersionByDi(String deviceId) {
BaseResponse baseResponse = deviceSyncService.downloadSingle(deviceId); deviceSyncService.downloadSingle(deviceId, Constant.DL_TYPE_UPDATE);
ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest(); ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest();
productInfoFilterRequest.setNameCode(deviceId); productInfoFilterRequest.setNameCode(deviceId);
return ResultVOUtils.success(productInfoService.findLastVersion(productInfoFilterRequest)); return ResultVOUtils.success(productInfoService.findLastVersion(productInfoFilterRequest));

@ -40,4 +40,6 @@ public interface ContactlistMapper extends BaseMapper<Contactlist> {
List<Contactlist> dlConnacts(DlConnactRequest dlConnactRequest); List<Contactlist> dlConnacts(DlConnactRequest dlConnactRequest);
void update(Contactlist contactlist); void update(Contactlist contactlist);
int deleteByUuid(@Param("uuid") String uuid);
} }

@ -55,7 +55,7 @@ public interface DeviceMapper extends BaseMapper<Device> {
String selectisSame(@Param("deviceRecordKey") String deviceRecordKey, @Param("versionNumber") String versionNumber); String selectisSame(@Param("deviceRecordKey") String deviceRecordKey, @Param("versionNumber") String versionNumber);
String selectDiIsSame(@Param("zxxsdycpbs") String zxxsdycpbs, @Param("versionNumber") String versionNumber); Device selectDiIsSame(@Param("zxxsdycpbs") String zxxsdycpbs, @Param("versionNumber") String versionNumber);
String selectKey(@Param("zxxsdycpbs") String zxxsdycpbs); String selectKey(@Param("zxxsdycpbs") String zxxsdycpbs);

@ -37,4 +37,6 @@ public interface DeviceclinicalMapper extends BaseMapper<Deviceclinical> {
List<Deviceclinical> downloadDeviceclinical(DownloadUdiRequest downloadUdiRequest); List<Deviceclinical> downloadDeviceclinical(DownloadUdiRequest downloadUdiRequest);
void update(Deviceclinical deviceclinical); void update(Deviceclinical deviceclinical);
int deleteByUuid(@Param("uuid") String uuid);
} }

@ -37,4 +37,6 @@ public interface DevicepackageMapper extends BaseMapper<Devicepackage> {
List<Devicepackage> downloadDevicepackage(DownloadUdiRequest downloadUdiRequest); List<Devicepackage> downloadDevicepackage(DownloadUdiRequest downloadUdiRequest);
void update(Devicepackage devicepackage); void update(Devicepackage devicepackage);
int deleteByUuid(@Param("uuid") String uuid);
} }

@ -37,4 +37,6 @@ public interface DevicestorageMapper extends BaseMapper<Devicestorage> {
List<Devicestorage> downloadDevicestorage(DownloadUdiRequest downloadUdiRequest); List<Devicestorage> downloadDevicestorage(DownloadUdiRequest downloadUdiRequest);
void update(Devicestorage devicestorage); void update(Devicestorage devicestorage);
int deleteByUuid(@Param("uuid") String uuid);
} }

@ -1,10 +1,12 @@
package com.glxp.udidl.admin.entity.udid; package com.glxp.udidl.admin.entity.udid;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import java.util.Objects;
@ApiModel(value = "医疗器械信息实体") @ApiModel(value = "医疗器械信息实体")
@Data @Data
@ -165,9 +167,9 @@ public class Device {
private String deviceHistoryKey; private String deviceHistoryKey;
private String deviceRecordKey; private String deviceRecordKey;
private int versionNumber; // private int versionNumber;
private String versionStatus; private String versionStatus;
private String versionTime; // private String versionTime;
public Date getRequestDate() { public Date getRequestDate() {
return requestDate; return requestDate;
@ -576,4 +578,69 @@ public class Device {
public void setLastModifyTime(String lastModifyTime) { public void setLastModifyTime(String lastModifyTime) {
this.lastModifyTime = lastModifyTime; this.lastModifyTime = lastModifyTime;
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Device device = (Device) o;
return
StrUtil.trimToEmpty(devicerecordkey).equals(StrUtil.trimToEmpty(device.devicerecordkey)
) && StrUtil.trimToEmpty(btcpbs).equals(StrUtil.trimToEmpty(device.btcpbs)
) && StrUtil.trimToEmpty(btcpbsyzxxsdycpbssfyz).equals(StrUtil.trimToEmpty(device.btcpbsyzxxsdycpbssfyz)
) && StrUtil.trimToEmpty(cgzmraqxgxx).equals(StrUtil.trimToEmpty(device.cgzmraqxgxx)
) && StrUtil.trimToEmpty(cpbsbmtxmc).equals(StrUtil.trimToEmpty(device.cpbsbmtxmc)
) && StrUtil.trimToEmpty(cpbsfbrq).equals(StrUtil.trimToEmpty(device.cpbsfbrq)
) && StrUtil.trimToEmpty(cphhhbh).equals(StrUtil.trimToEmpty(device.cphhhbh)
) && StrUtil.trimToEmpty(cplb).equals(StrUtil.trimToEmpty(device.cplb)
) && StrUtil.trimToEmpty(cpmctymc).equals(StrUtil.trimToEmpty(device.cpmctymc)
) && StrUtil.trimToEmpty(cpms).equals(StrUtil.trimToEmpty(device.cpms)
) && StrUtil.trimToEmpty(flbm).equals(StrUtil.trimToEmpty(device.flbm)
) && StrUtil.trimToEmpty(ggxh).equals(StrUtil.trimToEmpty(device.ggxh)
) && StrUtil.trimToEmpty(mjfs).equals(StrUtil.trimToEmpty(device.mjfs)
) && StrUtil.trimToEmpty(qtxxdwzlj).equals(StrUtil.trimToEmpty(device.qtxxdwzlj)
) && StrUtil.trimToEmpty(qxlb).equals(StrUtil.trimToEmpty(device.qxlb)
) && StrUtil.trimToEmpty(scbssfbhph).equals(StrUtil.trimToEmpty(device.scbssfbhph)
) && StrUtil.trimToEmpty(scbssfbhscrq).equals(StrUtil.trimToEmpty(device.scbssfbhscrq)
) && StrUtil.trimToEmpty(scbssfbhsxrq).equals(StrUtil.trimToEmpty(device.scbssfbhsxrq)
) && StrUtil.trimToEmpty(scbssfbhxlh).equals(StrUtil.trimToEmpty(device.scbssfbhxlh)
) && StrUtil.trimToEmpty(sfbjwycxsy).equals(StrUtil.trimToEmpty(device.sfbjwycxsy)
) && StrUtil.trimToEmpty(sfwblztlcp).equals(StrUtil.trimToEmpty(device.sfwblztlcp)
) && StrUtil.trimToEmpty(sfwwjbz).equals(StrUtil.trimToEmpty(device.sfwwjbz)
) && StrUtil.trimToEmpty(sfybtzjbs).equals(StrUtil.trimToEmpty(device.sfybtzjbs)
) && StrUtil.trimToEmpty(spmc).equals(StrUtil.trimToEmpty(device.spmc)
) && StrUtil.trimToEmpty(sydycpbs).equals(StrUtil.trimToEmpty(device.sydycpbs)
) && StrUtil.trimToEmpty(syqsfxyjxmj).equals(StrUtil.trimToEmpty(device.syqsfxyjxmj)
) && StrUtil.trimToEmpty(tscchcztj).equals(StrUtil.trimToEmpty(device.tscchcztj)
) && StrUtil.trimToEmpty(tsccsm).equals(StrUtil.trimToEmpty(device.tsccsm)
) && StrUtil.trimToEmpty(tsrq).equals(StrUtil.trimToEmpty(device.tsrq)
) && StrUtil.trimToEmpty(tyshxydm).equals(StrUtil.trimToEmpty(device.tyshxydm)
) && StrUtil.trimToEmpty(versionnumber).equals(StrUtil.trimToEmpty(device.versionnumber)
) && StrUtil.trimToEmpty(versionstatus).equals(StrUtil.trimToEmpty(device.versionstatus)
) && StrUtil.trimToEmpty(versiontime).equals(StrUtil.trimToEmpty(device.versiontime)
) && StrUtil.trimToEmpty(ybbm).equals(StrUtil.trimToEmpty(device.ybbm)
) && StrUtil.trimToEmpty(yflbm).equals(StrUtil.trimToEmpty(device.yflbm)
) && StrUtil.trimToEmpty(ylqxzcrbarmc).equals(StrUtil.trimToEmpty(device.ylqxzcrbarmc)
) && StrUtil.trimToEmpty(ylqxzcrbarywmc).equals(StrUtil.trimToEmpty(device.ylqxzcrbarywmc)
) && StrUtil.trimToEmpty(zczbhhzbapzbh).equals(StrUtil.trimToEmpty(device.zczbhhzbapzbh)
) && StrUtil.trimToEmpty(zdcfsycs).equals(StrUtil.trimToEmpty(device.zdcfsycs)
) && StrUtil.trimToEmpty(zxxsdycpbs).equals(StrUtil.trimToEmpty(device.zxxsdycpbs)
) && StrUtil.trimToEmpty(bszt).equals(StrUtil.trimToEmpty(device.bszt)
) && StrUtil.trimToEmpty(sfyzcbayz).equals(StrUtil.trimToEmpty(device.sfyzcbayz)
) && StrUtil.trimToEmpty(zcbacpbs).equals(StrUtil.trimToEmpty(device.zcbacpbs)
) && StrUtil.trimToEmpty(zxxsdyzsydydsl).equals(StrUtil.trimToEmpty(device.zxxsdyzsydydsl)
) && StrUtil.trimToEmpty(devicehistoryrecordkey).equals(StrUtil.trimToEmpty(device.devicehistoryrecordkey)
) && StrUtil.trimToEmpty(bssjzt).equals(StrUtil.trimToEmpty(device.bssjzt)
) && StrUtil.trimToEmpty(hchzsb).equals(StrUtil.trimToEmpty(device.hchzsb)
) && StrUtil.trimToEmpty(cplx).equals(StrUtil.trimToEmpty(device.cplx)
) && StrUtil.trimToEmpty(deviceHistoryKey).equals(StrUtil.trimToEmpty(device.deviceHistoryKey)
) && StrUtil.trimToEmpty(deviceRecordKey).equals(StrUtil.trimToEmpty(device.deviceRecordKey)
) && StrUtil.trimToEmpty(versionStatus).equals(StrUtil.trimToEmpty(device.versionStatus)
);
}
@Override
public int hashCode() {
return Objects.hash(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, hchzsb, cplx, deviceHistoryKey, deviceRecordKey, versionStatus);
}
} }

@ -54,6 +54,7 @@ public class DeviceRequest {
private String downloadType; private String downloadType;
private Integer dlType;
} }

@ -284,14 +284,13 @@ public class DeviceDownloadService {
} }
public boolean getDataAndSave(DeviceRequest deviceRequest, JobLog jobLog) { public boolean getDataAndSave(DeviceRequest deviceRequest, JobLog jobLog, Integer dlType) {
DataSetTotalResult results = new DataSetTotalResult(); DataSetTotalResult results = new DataSetTotalResult();
int page = 1; int page = 1;
if (StrUtil.isNotEmpty(deviceRequest.getCurrentPageNumber())) { if (StrUtil.isNotEmpty(deviceRequest.getCurrentPageNumber())) {
page = Integer.parseInt(deviceRequest.getCurrentPageNumber()); page = Integer.parseInt(deviceRequest.getCurrentPageNumber());
} }
boolean hasData = true; //是否还有数据,如无退出 boolean hasData = true; //是否还有数据,如无退出
while (hasData) { while (hasData) {
DataSetResult dataSetResult = getData(deviceRequest, page); DataSetResult dataSetResult = getData(deviceRequest, page);
if (dataSetResult.getReturnCode() != 1 && reCount == 0) { if (dataSetResult.getReturnCode() != 1 && reCount == 0) {
@ -326,7 +325,7 @@ public class DeviceDownloadService {
List<DataSetResult.DataSet> dataSets = new ArrayList<>(); List<DataSetResult.DataSet> dataSets = new ArrayList<>();
dataSets.add(dataSetResult.getDataSet()); dataSets.add(dataSetResult.getDataSet());
try { try {
int insertCount = deviceSaveService.DeviceSave(dataSets, jobLog.getDownloadDate()); int insertCount = deviceSaveService.DeviceSave(dataSets, jobLog.getDownloadDate(), dlType);
jobLog.setRealCount(jobLog.getRealCount() + dataSetResult.getDataSet().getDeviceInfo().size()); jobLog.setRealCount(jobLog.getRealCount() + dataSetResult.getDataSet().getDeviceInfo().size());
jobLog.setInsertCount(jobLog.getInsertCount() + insertCount); jobLog.setInsertCount(jobLog.getInsertCount() + insertCount);
jobLog.setTotalCount(dataSetResult.getTotalRecordCount()); jobLog.setTotalCount(dataSetResult.getTotalRecordCount());
@ -530,7 +529,7 @@ public class DeviceDownloadService {
//存储数据 //存储数据
List<DataSetResult.DataSet> dataSets = new ArrayList<>(); List<DataSetResult.DataSet> dataSets = new ArrayList<>();
dataSets.add(dataSetResult.getDataSet()); dataSets.add(dataSetResult.getDataSet());
deviceSaveService.DeviceSave(dataSets, null); deviceSaveService.DeviceSave(dataSets, null, null);
} }
totalPage = dataSetResult.getTotalPageCount(); totalPage = dataSetResult.getTotalPageCount();
totalRecordCount = dataSetResult.getTotalRecordCount(); totalRecordCount = dataSetResult.getTotalRecordCount();

@ -1,6 +1,7 @@
package com.glxp.udidl.admin.service.dataSync; package com.glxp.udidl.admin.service.dataSync;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.glxp.udidl.admin.constant.Constant;
import com.glxp.udidl.admin.entity.udid.*; import com.glxp.udidl.admin.entity.udid.*;
import com.glxp.udidl.admin.res.udid.DataSetResult; import com.glxp.udidl.admin.res.udid.DataSetResult;
import com.glxp.udidl.admin.service.inout.DeviceService; import com.glxp.udidl.admin.service.inout.DeviceService;
@ -35,7 +36,12 @@ public class DeviceSaveService {
* @param dataSets * @param dataSets
* @return * @return
*/ */
public int DeviceSave(List<DataSetResult.DataSet> dataSets, Date requestDate) { public int DeviceSave(List<DataSetResult.DataSet> dataSets, Date requestDate, Integer dlType) {
if (dlType == null) { //默认新增
dlType = Constant.DL_TYPE_ADD;
}
int result = 0; int result = 0;
for (DataSetResult.DataSet ds : dataSets) { for (DataSetResult.DataSet ds : dataSets) {
List<DataSetResult.ClinicalInfo> ClinicalInfoAll = ds.getClinicalInfo(); List<DataSetResult.ClinicalInfo> ClinicalInfoAll = ds.getClinicalInfo();
@ -43,20 +49,44 @@ public class DeviceSaveService {
List<DataSetResult.PackingInfo> packingInfoAll = ds.getPackingInfo(); List<DataSetResult.PackingInfo> packingInfoAll = ds.getPackingInfo();
for (DataSetResult.DeviceInfo item : ds.getDeviceInfo()) { for (DataSetResult.DeviceInfo item : ds.getDeviceInfo()) {
//1:判断数据是否存在 //1:判断数据是否存在
if (StrUtil.isNotEmpty(deviceService.selectDiIsSame(item.getZxxsdycpbs(), item.getVersionNumber() + ""))) String uuid = null;
continue; Device originDevice = deviceService.selectDiIsSame(item.getZxxsdycpbs(), item.getVersionNumber() + "");
if (dlType == Constant.DL_TYPE_ADD) {
if (originDevice != null)
continue;
}
//2,存储 deviceInfo
Device device = responseToDevice(item); Device device = responseToDevice(item);
String uuid = getUUId();
Boolean isHistory = false; Boolean isHistory = false;
if (item.getDeviceHistoryKey() != null && !item.getDeviceHistoryKey().isEmpty()) { if (item.getDeviceHistoryKey() != null && !item.getDeviceHistoryKey().isEmpty()) {
isHistory = true; isHistory = true;
} }
device.setUuid(uuid);
if (requestDate != null) if (requestDate != null)
device.setRequestDate(requestDate); device.setRequestDate(requestDate);
//2,存储 deviceInfo
deviceService.insertDevice(device); //2.1 判断更新或者新增
if (dlType == Constant.DL_TYPE_ADD || originDevice == null) {
uuid = getUUId();
device.setUuid(uuid);
deviceService.insertDevice(device);
} else {
//2.2 判断字段是否与原来的一致,若不一致则更新
if (!device.equals(originDevice)) {
uuid = originDevice.getUuid();
device.setUuid(uuid);
deviceService.updateDevice(device);
} else { //,若一致则跳过
// uuid = getUUId();
// device.setUuid(uuid);
// deviceService.insertDevice(device);
continue;
}
}
result++; result++;
//3,存储ContactList //3,存储ContactList
List<DataSetResult.ContactInfo> contactInfos = item.getContactList(); List<DataSetResult.ContactInfo> contactInfos = item.getContactList();
@ -68,6 +98,7 @@ public class DeviceSaveService {
contactlist.setUuid(uuid); contactlist.setUuid(uuid);
contactlistList.add(contactlist); contactlistList.add(contactlist);
} }
deviceService.deleteClinicalByUuid(uuid);
deviceService.insertContactlist(contactlistList); deviceService.insertContactlist(contactlistList);
} }
//4,存储 Deviceclinical //4,存储 Deviceclinical
@ -90,6 +121,7 @@ public class DeviceSaveService {
deviceclinical.setUuid(uuid); deviceclinical.setUuid(uuid);
deviceclinicalList.add(deviceclinical); deviceclinicalList.add(deviceclinical);
} }
deviceService.deleteClinicalByUuid(uuid);
deviceService.insertDeviceClinical(deviceclinicalList); deviceService.insertDeviceClinical(deviceclinicalList);
} }
} }
@ -114,6 +146,7 @@ public class DeviceSaveService {
devicestorage.setUuid(uuid); devicestorage.setUuid(uuid);
devicestorageList.add(devicestorage); devicestorageList.add(devicestorage);
} }
deviceService.deleteStorageByUuid(uuid);
deviceService.insertDevicestorage(devicestorageList); deviceService.insertDevicestorage(devicestorageList);
} }
@ -139,6 +172,7 @@ public class DeviceSaveService {
devicepackage.setUuid(uuid); devicepackage.setUuid(uuid);
devicepackageList.add(devicepackage); devicepackageList.add(devicepackage);
} }
deviceService.deletePakcageByUuid(uuid);
deviceService.insertDevicepackage(devicepackageList); deviceService.insertDevicepackage(devicepackageList);
} }

@ -43,8 +43,11 @@ public class DeviceSyncService {
@Resource @Resource
private ProductInfoService productInfoService; private ProductInfoService productInfoService;
public void downloadAndSave(String day, String downloadType) { public void downloadAndSave(String day, String downloadType, Integer dlType) {
//1.下载唯一标识数据 //1.下载唯一标识数据
if (dlType == null) {
dlType = Constant.DL_TYPE_ADD;
}
DataSetTotalResult result; DataSetTotalResult result;
String rangeValue = ""; String rangeValue = "";
if (day.isEmpty()) if (day.isEmpty())
@ -63,7 +66,7 @@ public class DeviceSyncService {
jobLogService.insert(jobLog); jobLogService.insert(jobLog);
return; return;
} }
int insertCount = deviceSaveService.DeviceSave(result.getData(), DateUtil.parseDate(rangeValue)); int insertCount = deviceSaveService.DeviceSave(result.getData(), DateUtil.parseDate(rangeValue), dlType);
//2.下载历史记录 //2.下载历史记录
List<String> keyList = new ArrayList<String>(); List<String> keyList = new ArrayList<String>();
for (DataSetResult.DataSet ds : result.getData()) { for (DataSetResult.DataSet ds : result.getData()) {
@ -83,7 +86,7 @@ public class DeviceSyncService {
List<DataSetResult.DataSet> data = result.getData(); List<DataSetResult.DataSet> data = result.getData();
data.addAll(res.getData()); data.addAll(res.getData());
result.setData(data); result.setData(data);
int hisInsertCount = deviceSaveService.DeviceSave(res.getData(), null); int hisInsertCount = deviceSaveService.DeviceSave(res.getData(), null, dlType);
insertCount = insertCount + hisInsertCount; insertCount = insertCount + hisInsertCount;
} }
} else { } else {
@ -121,7 +124,7 @@ public class DeviceSyncService {
@Async @Async
public void downloadUdi(String day, String downloadType) { public void downloadUdi(String day, String downloadType) {
try { try {
downloadAndSave(day, downloadType); downloadAndSave(day, downloadType, Constant.DL_TYPE_UPDATE);
} catch (Exception e) { } catch (Exception e) {
log.error("下载UDI国家库信息异常", e); log.error("下载UDI国家库信息异常", e);
JobLog jobLog = new JobLog(); JobLog jobLog = new JobLog();
@ -167,7 +170,7 @@ public class DeviceSyncService {
if (CollUtil.isNotEmpty(result1.getDataSet().getDeviceInfo())) { if (CollUtil.isNotEmpty(result1.getDataSet().getDeviceInfo())) {
List<DataSetResult.DataSet> dataSets = new ArrayList<>(); List<DataSetResult.DataSet> dataSets = new ArrayList<>();
dataSets.add(result1.getDataSet()); dataSets.add(result1.getDataSet());
deviceSaveService.DeviceSave(dataSets, new Date()); deviceSaveService.DeviceSave(dataSets, new Date(), Constant.DL_TYPE_UPDATE);
productInfoEntityList = productInfoService.findAll(productInfoFilterRequest); productInfoEntityList = productInfoService.findAll(productInfoFilterRequest);
} else { } else {
return ResultVOUtils.error(501, "医疗器械唯一标识数据库未找到此产品DI,请检查是否输入正确或联系厂家是否已上传"); return ResultVOUtils.error(501, "医疗器械唯一标识数据库未找到此产品DI,请检查是否输入正确或联系厂家是否已上传");
@ -213,11 +216,11 @@ public class DeviceSyncService {
} }
List<DataSetResult.DataSet> dataSets = new ArrayList<>(); List<DataSetResult.DataSet> dataSets = new ArrayList<>();
dataSets.add(result1.getDataSet()); dataSets.add(result1.getDataSet());
deviceSaveService.DeviceSave(dataSets, new Date()); deviceSaveService.DeviceSave(dataSets, new Date(), Constant.DL_TYPE_UPDATE);
return ResultVOUtils.success(result); return ResultVOUtils.success(result);
} }
public BaseResponse downloadSingle(String deviceId) { public BaseResponse downloadSingle(String deviceId, Integer dlType) {
//插入日志 //插入日志
JobLog jobLog = new JobLog(); JobLog jobLog = new JobLog();
jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL); jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL);
@ -232,12 +235,15 @@ public class DeviceSyncService {
DataSetSingleResult res = null; DataSetSingleResult res = null;
try { try {
res = deviceDownloadService.downloadByDi(deviceId); res = deviceDownloadService.downloadByDi(deviceId);
if (res.getReturnCode() != 1) if (res.getReturnCode() != 1) {
log.error("下载产品信息失败", res.getReturnMsg());
jobLog.setMsg("下载失败:" + res.getReturnMsg());
jobLog.setType(Constant.LOG_TYPE_ERROR);
return ResultVOUtils.error(-1, res.getReturnMsg()); return ResultVOUtils.error(-1, res.getReturnMsg());
}
List<DataSetResult.DataSet> dataSets = new ArrayList<>(); List<DataSetResult.DataSet> dataSets = new ArrayList<>();
dataSets.add(res.getDataSet()); dataSets.add(res.getDataSet());
int insertCount = deviceSaveService.DeviceSave(dataSets, new Date()); int insertCount = deviceSaveService.DeviceSave(dataSets, new Date(), dlType);
jobLog.setMsg("下载成功,总条数:" + dataSets.size() + " ;插入数据:" + insertCount + " 条"); jobLog.setMsg("下载成功,总条数:" + dataSets.size() + " ;插入数据:" + insertCount + " 条");
jobLog.setType(Constant.LOG_TYPE_SUCCESS); jobLog.setType(Constant.LOG_TYPE_SUCCESS);
jobLogService.update(jobLog); jobLogService.update(jobLog);
@ -407,8 +413,17 @@ public class DeviceSyncService {
dates.add(deviceRequest.getRangeValue()); dates.add(deviceRequest.getRangeValue());
} }
if (deviceRequest.getDataType().equals("3")) { int dlType = Constant.DL_TYPE_ADD;
if (StrUtil.isEmpty(deviceRequest.getDataType()) || deviceRequest.getDataType().equals("3")) {
deviceRequest.setDataType(null); deviceRequest.setDataType(null);
} else if (deviceRequest.getDataType().equals("1")) {
dlType = Constant.DL_TYPE_ADD;
} else if (deviceRequest.getDataType().equals("2")) {
dlType = Constant.DL_TYPE_UPDATE;
}
if (deviceRequest.getDlType() != null) {
dlType = deviceRequest.getDlType();
} }
log.info("开始下载国家UDI库数据"); log.info("开始下载国家UDI库数据");
@ -420,7 +435,10 @@ public class DeviceSyncService {
//插入日志 //插入日志
JobLog jobLog = new JobLog(); JobLog jobLog = new JobLog();
jobLog.setDownloadType(deviceRequest.getDownloadType()); jobLog.setDownloadType(deviceRequest.getDownloadType());
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD); if (dlType == Constant.DL_TYPE_UPDATE) {
jobLog.setTaskType(Constant.JOB_TASK_TYPE_UPDATE);
} else
jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD);
jobLog.setDownloadDate(DateUtil.parseDate(date)); jobLog.setDownloadDate(DateUtil.parseDate(date));
jobLog.setType(Constant.LOG_TYPE_INFO); jobLog.setType(Constant.LOG_TYPE_INFO);
jobLog.setMsg("下载中"); jobLog.setMsg("下载中");
@ -429,7 +447,7 @@ public class DeviceSyncService {
jobLogService.insertLog(jobLog); jobLogService.insertLog(jobLog);
log.info(jobLog.getId() + "----"); log.info(jobLog.getId() + "----");
//开始下载数据 //开始下载数据
boolean b = deviceDownloadService.getDataAndSave(deviceRequest, jobLog); boolean b = deviceDownloadService.getDataAndSave(deviceRequest, jobLog, dlType);
if (b) { if (b) {
jobLog.setStatus(1); jobLog.setStatus(1);

@ -58,7 +58,8 @@ public class DeviceParseService {
for (DataSetResult.DeviceInfo item : ds.getDeviceInfo()) { for (DataSetResult.DeviceInfo item : ds.getDeviceInfo()) {
//1:不判断数据是否存在,直接以当前拉取到的最新数据进行更新 //1:不判断数据是否存在,直接以当前拉取到的最新数据进行更新
String uuid = deviceService.selectDiIsSame(item.getZxxsdycpbs(), item.getVersionNumber() + ""); Device temp = deviceService.selectDiIsSame(item.getZxxsdycpbs(), item.getVersionNumber() + "");
String uuid = temp.getUuid();
//此版本数据存在使用当前数据库存在的数据的ID进行更新 //此版本数据存在使用当前数据库存在的数据的ID进行更新
Device device = responseToDevice(item); Device device = responseToDevice(item);
if (StrUtil.isBlank(uuid)) { if (StrUtil.isBlank(uuid)) {

@ -46,10 +46,6 @@ public class DeviceUpdateService {
private JobLogService jobLogService; //日志 private JobLogService jobLogService; //日志
@Resource @Resource
private DeviceParseService deviceParseService; private DeviceParseService deviceParseService;
@Resource
private DeviceService deviceService;
@Resource
private ProductInfoService productInfoService;
public void updateUdiData(UpdateUdiRequest updateUdiRequest) { public void updateUdiData(UpdateUdiRequest updateUdiRequest) {
JobLog jobLog = new JobLog(); JobLog jobLog = new JobLog();

@ -4,6 +4,7 @@ import com.glxp.udidl.admin.entity.udid.*;
import com.glxp.udidl.admin.req.ListPageRequest; import com.glxp.udidl.admin.req.ListPageRequest;
import com.glxp.udidl.admin.req.udid.DeviceListRequest; import com.glxp.udidl.admin.req.udid.DeviceListRequest;
import com.glxp.udidl.admin.req.udid.DeviceSearchRequest; import com.glxp.udidl.admin.req.udid.DeviceSearchRequest;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -37,7 +38,7 @@ public interface DeviceService {
String selectisSame(String deviceRecordKey, String versionNumber); String selectisSame(String deviceRecordKey, String versionNumber);
String selectDiIsSame(String zxxsdycpbs, String versionNumber); Device selectDiIsSame(String zxxsdycpbs, String versionNumber);
String selectKey(String zxxsdycpbs); String selectKey(String zxxsdycpbs);
@ -56,4 +57,12 @@ public interface DeviceService {
boolean updateDevicestorage(List<Devicestorage> devicestorageList); boolean updateDevicestorage(List<Devicestorage> devicestorageList);
boolean updateDevicepackage(List<Devicepackage> devicepackageList); boolean updateDevicepackage(List<Devicepackage> devicepackageList);
int deleteClinicalByUuid(String uuid);
int deleteStorageByUuid(String uuid);
int deletePakcageByUuid(String uuid);
int deleteConactByUuid(String uuid);
} }

@ -1,5 +1,6 @@
package com.glxp.udidl.admin.service.inout.impl; package com.glxp.udidl.admin.service.inout.impl;
import cn.hutool.core.util.StrUtil;
import com.glxp.udidl.admin.dao.udid.*; import com.glxp.udidl.admin.dao.udid.*;
import com.glxp.udidl.admin.entity.udid.*; import com.glxp.udidl.admin.entity.udid.*;
import com.glxp.udidl.admin.req.ListPageRequest; import com.glxp.udidl.admin.req.ListPageRequest;
@ -191,7 +192,7 @@ public class DeviceServiceImpl implements DeviceService {
} }
@Override @Override
public String selectDiIsSame(String zxxsdycpbs, String versionNumber) { public Device selectDiIsSame(String zxxsdycpbs, String versionNumber) {
return deviceMapper.selectDiIsSame(zxxsdycpbs, versionNumber); return deviceMapper.selectDiIsSame(zxxsdycpbs, versionNumber);
} }
@ -263,6 +264,34 @@ public class DeviceServiceImpl implements DeviceService {
return true; return true;
} }
@Override
public int deleteClinicalByUuid(String uuid) {
if (StrUtil.isEmpty(uuid))
return 0;
return deviceclinicalMapper.deleteByUuid(uuid);
}
@Override
public int deleteStorageByUuid(String uuid) {
if (StrUtil.isEmpty(uuid))
return 0;
return devicestorageMapper.deleteByUuid(uuid);
}
@Override
public int deletePakcageByUuid(String uuid) {
if (StrUtil.isEmpty(uuid))
return 0;
return devicepackageMapper.deleteByUuid(uuid);
}
@Override
public int deleteConactByUuid(String uuid) {
if (StrUtil.isEmpty(uuid))
return 0;
return contactlistMapper.deleteByUuid(uuid);
}
@Override @Override
public boolean insertDevice(Device device) { public boolean insertDevice(Device device) {
deviceMapper.insert(device); deviceMapper.insert(device);

@ -6,7 +6,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/udidl_test?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true url: jdbc:mysql://127.0.0.1:3306/udidl_test?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root username: root
password: root password: 123456
hikari: hikari:
pool-name: udidl pool-name: udidl
connection-timeout: 100000 #设置等待超时时间为10秒 connection-timeout: 100000 #设置等待超时时间为10秒

@ -28,7 +28,7 @@ ssl = false;
#----- 自定义分组的连接 #----- 自定义分组的连接
[custom] [custom]
# 地址默认localhost # 地址默认localhost
host = 192.168.235.137 host = 127.0.0.1
# 连接耗尽时是否阻塞, false报异常,ture阻塞直到超时, 默认true # 连接耗尽时是否阻塞, false报异常,ture阻塞直到超时, 默认true
BlockWhenExhausted = true; BlockWhenExhausted = true;
# 设置的逐出策略类名, 默认DefaultEvictionPolicy(当连接超过最大空闲时间,或连接数超过最大空闲连接数) # 设置的逐出策略类名, 默认DefaultEvictionPolicy(当连接超过最大空闲时间,或连接数超过最大空闲连接数)

@ -70,8 +70,9 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, deviceRecordKey, qylxrcz, qylxrdh, qylxryx, uuid id
</sql> , deviceRecordKey, qylxrcz, qylxrdh, qylxryx, uuid
</sql>
<select id="selectByExample" parameterType="com.glxp.udidl.admin.entity.udid.ContactlistExample" <select id="selectByExample" parameterType="com.glxp.udidl.admin.entity.udid.ContactlistExample"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select select
@ -94,9 +95,10 @@
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from contactlist delete
where id = #{id,jdbcType=INTEGER} from contactlist
</delete> where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.glxp.udidl.admin.entity.udid.ContactlistExample"> <delete id="deleteByExample" parameterType="com.glxp.udidl.admin.entity.udid.ContactlistExample">
delete from contactlist delete from contactlist
<if test="_parameter != null"> <if test="_parameter != null">
@ -104,13 +106,11 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.glxp.udidl.admin.entity.udid.Contactlist"> <insert id="insert" parameterType="com.glxp.udidl.admin.entity.udid.Contactlist">
insert into contactlist ( deviceRecordKey, qylxrcz, insert into contactlist (deviceRecordKey, qylxrcz,
qylxrdh, qylxryx, uuid qylxrdh, qylxryx, uuid)
) values (#{devicerecordkey,jdbcType=VARCHAR}, #{qylxrcz,jdbcType=VARCHAR},
values ( #{devicerecordkey,jdbcType=VARCHAR}, #{qylxrcz,jdbcType=VARCHAR}, #{qylxrdh,jdbcType=VARCHAR}, #{qylxryx,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR})
#{qylxrdh,jdbcType=VARCHAR}, #{qylxryx,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR} </insert>
)
</insert>
<insert id="insertSelective" parameterType="com.glxp.udidl.admin.entity.udid.Contactlist"> <insert id="insertSelective" parameterType="com.glxp.udidl.admin.entity.udid.Contactlist">
insert into contactlist insert into contactlist
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -221,31 +221,43 @@
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.glxp.udidl.admin.entity.udid.Contactlist"> <update id="updateByPrimaryKey" parameterType="com.glxp.udidl.admin.entity.udid.Contactlist">
update contactlist update contactlist
set deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR}, set deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR},
qylxrcz = #{qylxrcz,jdbcType=VARCHAR}, qylxrcz = #{qylxrcz,jdbcType=VARCHAR},
qylxrdh = #{qylxrdh,jdbcType=VARCHAR}, qylxrdh = #{qylxrdh,jdbcType=VARCHAR},
qylxryx = #{qylxryx,jdbcType=VARCHAR}, qylxryx = #{qylxryx,jdbcType=VARCHAR},
uuid = #{uuid,jdbcType=VARCHAR} uuid = #{uuid,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<select id="downloadContactlist" parameterType="com.glxp.udidl.admin.req.DownloadUdiRequest" <select id="downloadContactlist" parameterType="com.glxp.udidl.admin.req.DownloadUdiRequest"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select * from contactlist select *
limit #{page},#{limit} from contactlist limit #{page},#{limit}
</select> </select>
<select id="dlConnacts" parameterType="com.glxp.udidl.admin.req.DlConnactRequest" <select id="dlConnacts" parameterType="com.glxp.udidl.admin.req.DlConnactRequest"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select * from contactlist select *
from contactlist
</select> </select>
<insert id="update" parameterType="com.glxp.udidl.admin.entity.udid.Contactlist"> <insert id="update" parameterType="com.glxp.udidl.admin.entity.udid.Contactlist">
replace into contactlist ( deviceRecordKey, qylxrcz, replace
into contactlist ( deviceRecordKey, qylxrcz,
qylxrdh, qylxryx, uuid qylxrdh, qylxryx, uuid
) )
values ( #{devicerecordkey,jdbcType=VARCHAR}, #{qylxrcz,jdbcType=VARCHAR}, values (
#{qylxrdh,jdbcType=VARCHAR}, #{qylxryx,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR} #{devicerecordkey,jdbcType=VARCHAR},
#{qylxrcz,jdbcType=VARCHAR},
#{qylxrdh,jdbcType=VARCHAR},
#{qylxryx,jdbcType=VARCHAR},
#{uuid,jdbcType=VARCHAR}
) )
</insert> </insert>
<delete id="deleteByUuid" parameterType="java.lang.String">
delete
from contactlist
where uuid = #{uuid}
</delete>
</mapper> </mapper>

@ -990,8 +990,8 @@
</select> </select>
<select id="selectDiIsSame" parameterType="Map" resultType="java.lang.String"> <select id="selectDiIsSame" parameterType="Map" resultType="com.glxp.udidl.admin.entity.udid.Device">
SELECT uuid SELECT *
from device from device
WHERE zxxsdycpbs = #{zxxsdycpbs} WHERE zxxsdycpbs = #{zxxsdycpbs}
and versionNumber = #{versionNumber} limit 1 and versionNumber = #{versionNumber} limit 1
@ -1032,7 +1032,8 @@
</update> </update>
<insert id="updateDevice" parameterType="com.glxp.udidl.admin.entity.udid.Device"> <insert id="updateDevice" parameterType="com.glxp.udidl.admin.entity.udid.Device">
replace into device (uuid, deviceRecordKey, btcpbs, replace
into device (uuid, deviceRecordKey, btcpbs,
btcpbsyzxxsdycpbssfyz, cgzmraqxgxx, cpbsbmtxmc, btcpbsyzxxsdycpbssfyz, cgzmraqxgxx, cpbsbmtxmc,
cpbsfbrq, cphhhbh, cplb, cpbsfbrq, cphhhbh, cplb,
cpmctymc, cpms, flbm, cpmctymc, cpms, flbm,
@ -1048,24 +1049,59 @@
zdcfsycs, zxxsdycpbs, bszt, zdcfsycs, zxxsdycpbs, bszt,
sfyzcbayz, zcbacpbs, zxxsdyzsydydsl, sfyzcbayz, zcbacpbs, zxxsdyzsydydsl,
deviceHistoryRecordKey, bssjzt, lastModifyTime, requestDate, hchzsb, cplx) deviceHistoryRecordKey, bssjzt, lastModifyTime, requestDate, hchzsb, cplx)
values (#{uuid,jdbcType=VARCHAR}, #{devicerecordkey,jdbcType=VARCHAR}, #{btcpbs,jdbcType=VARCHAR}, values (
#{btcpbsyzxxsdycpbssfyz,jdbcType=VARCHAR}, #{cgzmraqxgxx,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR},
#{cpbsbmtxmc,jdbcType=VARCHAR}, #{devicerecordkey,jdbcType=VARCHAR},
#{cpbsfbrq,jdbcType=VARCHAR}, #{cphhhbh,jdbcType=VARCHAR}, #{cplb,jdbcType=VARCHAR}, #{btcpbs,jdbcType=VARCHAR},
#{cpmctymc,jdbcType=VARCHAR}, #{cpms,jdbcType=VARCHAR}, #{flbm,jdbcType=VARCHAR}, #{btcpbsyzxxsdycpbssfyz,jdbcType=VARCHAR},
#{ggxh,jdbcType=VARCHAR}, #{mjfs,jdbcType=VARCHAR}, #{qtxxdwzlj,jdbcType=VARCHAR}, #{cgzmraqxgxx,jdbcType=VARCHAR},
#{qxlb,jdbcType=VARCHAR}, #{scbssfbhph,jdbcType=VARCHAR}, #{scbssfbhscrq,jdbcType=VARCHAR}, #{cpbsbmtxmc,jdbcType=VARCHAR},
#{scbssfbhsxrq,jdbcType=VARCHAR}, #{scbssfbhxlh,jdbcType=VARCHAR}, #{sfbjwycxsy,jdbcType=VARCHAR}, #{cpbsfbrq,jdbcType=VARCHAR},
#{sfwblztlcp,jdbcType=VARCHAR}, #{sfwwjbz,jdbcType=VARCHAR}, #{sfybtzjbs,jdbcType=VARCHAR}, #{cphhhbh,jdbcType=VARCHAR},
#{spmc,jdbcType=VARCHAR}, #{sydycpbs,jdbcType=VARCHAR}, #{syqsfxyjxmj,jdbcType=VARCHAR}, #{cplb,jdbcType=VARCHAR},
#{tscchcztj,jdbcType=VARCHAR}, #{tsccsm,jdbcType=VARCHAR}, #{tsrq,jdbcType=VARCHAR}, #{cpmctymc,jdbcType=VARCHAR},
#{tyshxydm,jdbcType=VARCHAR}, #{versionnumber,jdbcType=VARCHAR}, #{versionstatus,jdbcType=VARCHAR}, #{cpms,jdbcType=VARCHAR},
#{versiontime,jdbcType=VARCHAR}, #{ybbm,jdbcType=VARCHAR}, #{yflbm,jdbcType=VARCHAR}, #{flbm,jdbcType=VARCHAR},
#{ylqxzcrbarmc,jdbcType=VARCHAR}, #{ylqxzcrbarywmc,jdbcType=VARCHAR}, #{zczbhhzbapzbh,jdbcType=VARCHAR}, #{ggxh,jdbcType=VARCHAR},
#{zdcfsycs,jdbcType=VARCHAR}, #{zxxsdycpbs,jdbcType=VARCHAR}, #{bszt,jdbcType=VARCHAR}, #{mjfs,jdbcType=VARCHAR},
#{sfyzcbayz,jdbcType=VARCHAR}, #{zcbacpbs,jdbcType=VARCHAR}, #{zxxsdyzsydydsl,jdbcType=VARCHAR}, #{qtxxdwzlj,jdbcType=VARCHAR},
#{devicehistoryrecordkey,jdbcType=VARCHAR}, #{bssjzt,jdbcType=VARCHAR}, #{qxlb,jdbcType=VARCHAR},
#{lastModifyTime,jdbcType=VARCHAR}, #{requestDate}, #{hchzsb}, #{cplx}) #{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> </insert>
</mapper> </mapper>

@ -248,4 +248,11 @@
values (#{devicerecordkey,jdbcType=VARCHAR}, #{lcsycclx,jdbcType=VARCHAR}, values (#{devicerecordkey,jdbcType=VARCHAR}, #{lcsycclx,jdbcType=VARCHAR},
#{ccz,jdbcType=VARCHAR}, #{ccdw,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR}) #{ccz,jdbcType=VARCHAR}, #{ccdw,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR})
</insert> </insert>
<delete id="deleteByUuid" parameterType="java.lang.String">
delete
from deviceclinical
where uuid = #{uuid}
</delete>
</mapper> </mapper>

@ -1,257 +1,277 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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.DevicepackageMapper"> <mapper namespace="com.glxp.udidl.admin.dao.udid.DevicepackageMapper">
<resultMap id="BaseResultMap" type="com.glxp.udidl.admin.entity.udid.Devicepackage"> <resultMap id="BaseResultMap" type="com.glxp.udidl.admin.entity.udid.Devicepackage">
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id"/>
<result column="bzcpbs" jdbcType="VARCHAR" property="bzcpbs" /> <result column="bzcpbs" jdbcType="VARCHAR" property="bzcpbs"/>
<result column="bznhxyjbzcpbs" jdbcType="VARCHAR" property="bznhxyjbzcpbs" /> <result column="bznhxyjbzcpbs" jdbcType="VARCHAR" property="bznhxyjbzcpbs"/>
<result column="cpbzjb" jdbcType="VARCHAR" property="cpbzjb" /> <result column="cpbzjb" jdbcType="VARCHAR" property="cpbzjb"/>
<result column="bznhxyjcpbssl" jdbcType="INTEGER" property="bznhxyjcpbssl" /> <result column="bznhxyjcpbssl" jdbcType="INTEGER" property="bznhxyjcpbssl"/>
<result column="deviceRecordKey" jdbcType="VARCHAR" property="devicerecordkey" /> <result column="deviceRecordKey" jdbcType="VARCHAR" property="devicerecordkey"/>
<result column="uuid" jdbcType="VARCHAR" property="uuid" /> <result column="uuid" jdbcType="VARCHAR" property="uuid"/>
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
<foreach collection="oredCriteria" item="criteria" separator="or"> <foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid"> <if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")"> <trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion"> <foreach collection="criteria.criteria" item="criterion">
<choose> <choose>
<when test="criterion.noValue"> <when test="criterion.noValue">
and ${criterion.condition} and ${criterion.condition}
</when> </when>
<when test="criterion.singleValue"> <when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value} and ${criterion.condition} #{criterion.value}
</when> </when>
<when test="criterion.betweenValue"> <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when> </when>
<when test="criterion.listValue"> <when test="criterion.listValue">
and ${criterion.condition} and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> <foreach close=")" collection="criterion.value" item="listItem" open="("
#{listItem} separator=",">
</foreach> #{listItem}
</when> </foreach>
</choose> </when>
</choose>
</foreach>
</trim>
</if>
</foreach> </foreach>
</trim> </where>
</if> </sql>
</foreach> <sql id="Update_By_Example_Where_Clause">
</where> <where>
</sql> <foreach collection="example.oredCriteria" item="criteria" separator="or">
<sql id="Update_By_Example_Where_Clause"> <if test="criteria.valid">
<where> <trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="example.oredCriteria" item="criteria" separator="or"> <foreach collection="criteria.criteria" item="criterion">
<if test="criteria.valid"> <choose>
<trim prefix="(" prefixOverrides="and" suffix=")"> <when test="criterion.noValue">
<foreach collection="criteria.criteria" item="criterion"> and ${criterion.condition}
<choose> </when>
<when test="criterion.noValue"> <when test="criterion.singleValue">
and ${criterion.condition} and ${criterion.condition} #{criterion.value}
</when> </when>
<when test="criterion.singleValue"> <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when> </when>
<when test="criterion.betweenValue"> <when test="criterion.listValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} and ${criterion.condition}
</when> <foreach close=")" collection="criterion.value" item="listItem" open="("
<when test="criterion.listValue"> separator=",">
and ${criterion.condition} #{listItem}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> </foreach>
#{listItem} </when>
</foreach> </choose>
</when> </foreach>
</choose> </trim>
</if>
</foreach> </foreach>
</trim> </where>
</sql>
<sql id="Base_Column_List">
id
, bzcpbs, bznhxyjbzcpbs, cpbzjb, bznhxyjcpbssl, deviceRecordKey, uuid
</sql>
<select id="selectByExample" parameterType="com.glxp.udidl.admin.entity.udid.DevicepackageExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if> </if>
</foreach> <include refid="Base_Column_List"/>
</where> from devicepackage
</sql> <if test="_parameter != null">
<sql id="Base_Column_List"> <include refid="Example_Where_Clause"/>
id, bzcpbs, bznhxyjbzcpbs, cpbzjb, bznhxyjcpbssl, deviceRecordKey, uuid </if>
</sql> <if test="orderByClause != null">
<select id="selectByExample" parameterType="com.glxp.udidl.admin.entity.udid.DevicepackageExample" resultMap="BaseResultMap"> order by ${orderByClause}
select </if>
<if test="distinct"> </select>
distinct <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
</if> select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from devicepackage from devicepackage
<if test="_parameter != null"> where id = #{id,jdbcType=INTEGER}
<include refid="Example_Where_Clause" /> </select>
</if> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<if test="orderByClause != null"> delete
order by ${orderByClause} from devicepackage
</if> where id = #{id,jdbcType=INTEGER}
</select> </delete>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <delete id="deleteByExample" parameterType="com.glxp.udidl.admin.entity.udid.DevicepackageExample">
select delete from devicepackage
<include refid="Base_Column_List" /> <if test="_parameter != null">
from devicepackage <include refid="Example_Where_Clause"/>
where id = #{id,jdbcType=INTEGER} </if>
</select> </delete>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <insert id="insert" parameterType="com.glxp.udidl.admin.entity.udid.Devicepackage">
delete from devicepackage insert into devicepackage (bzcpbs, bznhxyjbzcpbs,
where id = #{id,jdbcType=INTEGER} cpbzjb, bznhxyjcpbssl, deviceRecordKey,
</delete> uuid)
<delete id="deleteByExample" parameterType="com.glxp.udidl.admin.entity.udid.DevicepackageExample"> values (#{bzcpbs,jdbcType=VARCHAR}, #{bznhxyjbzcpbs,jdbcType=VARCHAR},
delete from devicepackage #{cpbzjb,jdbcType=VARCHAR}, #{bznhxyjcpbssl,jdbcType=INTEGER}, #{devicerecordkey,jdbcType=VARCHAR},
<if test="_parameter != null"> #{uuid,jdbcType=VARCHAR})
<include refid="Example_Where_Clause" /> </insert>
</if> <insert id="insertSelective" parameterType="com.glxp.udidl.admin.entity.udid.Devicepackage">
</delete> insert into devicepackage
<insert id="insert" parameterType="com.glxp.udidl.admin.entity.udid.Devicepackage"> <trim prefix="(" suffix=")" suffixOverrides=",">
insert into devicepackage (bzcpbs, bznhxyjbzcpbs, <if test="id != null">
cpbzjb, bznhxyjcpbssl, deviceRecordKey, id,
uuid) </if>
values ( #{bzcpbs,jdbcType=VARCHAR}, #{bznhxyjbzcpbs,jdbcType=VARCHAR}, <if test="bzcpbs != null">
#{cpbzjb,jdbcType=VARCHAR}, #{bznhxyjcpbssl,jdbcType=INTEGER}, #{devicerecordkey,jdbcType=VARCHAR}, bzcpbs,
#{uuid,jdbcType=VARCHAR}) </if>
</insert> <if test="bznhxyjbzcpbs != null">
<insert id="insertSelective" parameterType="com.glxp.udidl.admin.entity.udid.Devicepackage"> bznhxyjbzcpbs,
insert into devicepackage </if>
<trim prefix="(" suffix=")" suffixOverrides=","> <if test="cpbzjb != null">
<if test="id != null"> cpbzjb,
id, </if>
</if> <if test="bznhxyjcpbssl != null">
<if test="bzcpbs != null"> bznhxyjcpbssl,
bzcpbs, </if>
</if> <if test="devicerecordkey != null">
<if test="bznhxyjbzcpbs != null"> deviceRecordKey,
bznhxyjbzcpbs, </if>
</if> <if test="uuid != null">
<if test="cpbzjb != null"> uuid,
cpbzjb, </if>
</if> </trim>
<if test="bznhxyjcpbssl != null"> <trim prefix="values (" suffix=")" suffixOverrides=",">
bznhxyjcpbssl, <if test="id != null">
</if> #{id,jdbcType=INTEGER},
<if test="devicerecordkey != null"> </if>
deviceRecordKey, <if test="bzcpbs != null">
</if> #{bzcpbs,jdbcType=VARCHAR},
<if test="uuid != null"> </if>
uuid, <if test="bznhxyjbzcpbs != null">
</if> #{bznhxyjbzcpbs,jdbcType=VARCHAR},
</trim> </if>
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="cpbzjb != null">
<if test="id != null"> #{cpbzjb,jdbcType=VARCHAR},
#{id,jdbcType=INTEGER}, </if>
</if> <if test="bznhxyjcpbssl != null">
<if test="bzcpbs != null"> #{bznhxyjcpbssl,jdbcType=INTEGER},
#{bzcpbs,jdbcType=VARCHAR}, </if>
</if> <if test="devicerecordkey != null">
<if test="bznhxyjbzcpbs != null"> #{devicerecordkey,jdbcType=VARCHAR},
#{bznhxyjbzcpbs,jdbcType=VARCHAR}, </if>
</if> <if test="uuid != null">
<if test="cpbzjb != null"> #{uuid,jdbcType=VARCHAR},
#{cpbzjb,jdbcType=VARCHAR}, </if>
</if> </trim>
<if test="bznhxyjcpbssl != null"> </insert>
#{bznhxyjcpbssl,jdbcType=INTEGER}, <select id="countByExample" parameterType="com.glxp.udidl.admin.entity.udid.DevicepackageExample"
</if> resultType="java.lang.Long">
<if test="devicerecordkey != null"> select count(*) from devicepackage
#{devicerecordkey,jdbcType=VARCHAR}, <if test="_parameter != null">
</if> <include refid="Example_Where_Clause"/>
<if test="uuid != null"> </if>
#{uuid,jdbcType=VARCHAR}, </select>
</if> <update id="updateByExampleSelective" parameterType="map">
</trim> update devicepackage
</insert> <set>
<select id="countByExample" parameterType="com.glxp.udidl.admin.entity.udid.DevicepackageExample" resultType="java.lang.Long"> <if test="record.id != null">
select count(*) from devicepackage id = #{record.id,jdbcType=INTEGER},
<if test="_parameter != null"> </if>
<include refid="Example_Where_Clause" /> <if test="record.bzcpbs != null">
</if> bzcpbs = #{record.bzcpbs,jdbcType=VARCHAR},
</select> </if>
<update id="updateByExampleSelective" parameterType="map"> <if test="record.bznhxyjbzcpbs != null">
update devicepackage bznhxyjbzcpbs = #{record.bznhxyjbzcpbs,jdbcType=VARCHAR},
<set> </if>
<if test="record.id != null"> <if test="record.cpbzjb != null">
id = #{record.id,jdbcType=INTEGER}, cpbzjb = #{record.cpbzjb,jdbcType=VARCHAR},
</if> </if>
<if test="record.bzcpbs != null"> <if test="record.bznhxyjcpbssl != null">
bznhxyjcpbssl = #{record.bznhxyjcpbssl,jdbcType=INTEGER},
</if>
<if test="record.devicerecordkey != null">
deviceRecordKey = #{record.devicerecordkey,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 devicepackage
set id = #{record.id,jdbcType=INTEGER},
bzcpbs = #{record.bzcpbs,jdbcType=VARCHAR}, bzcpbs = #{record.bzcpbs,jdbcType=VARCHAR},
</if>
<if test="record.bznhxyjbzcpbs != null">
bznhxyjbzcpbs = #{record.bznhxyjbzcpbs,jdbcType=VARCHAR}, bznhxyjbzcpbs = #{record.bznhxyjbzcpbs,jdbcType=VARCHAR},
</if>
<if test="record.cpbzjb != null">
cpbzjb = #{record.cpbzjb,jdbcType=VARCHAR}, cpbzjb = #{record.cpbzjb,jdbcType=VARCHAR},
</if>
<if test="record.bznhxyjcpbssl != null">
bznhxyjcpbssl = #{record.bznhxyjcpbssl,jdbcType=INTEGER}, bznhxyjcpbssl = #{record.bznhxyjcpbssl,jdbcType=INTEGER},
</if>
<if test="record.devicerecordkey != null">
deviceRecordKey = #{record.devicerecordkey,jdbcType=VARCHAR}, deviceRecordKey = #{record.devicerecordkey,jdbcType=VARCHAR},
</if> uuid = #{record.uuid,jdbcType=VARCHAR}
<if test="record.uuid != null"> <if test="_parameter != null">
uuid = #{record.uuid,jdbcType=VARCHAR}, <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
</set> </update>
<if test="_parameter != null"> <update id="updateByPrimaryKeySelective" parameterType="com.glxp.udidl.admin.entity.udid.Devicepackage">
<include refid="Update_By_Example_Where_Clause" /> update devicepackage
</if> <set>
</update> <if test="bzcpbs != null">
<update id="updateByExample" parameterType="map"> bzcpbs = #{bzcpbs,jdbcType=VARCHAR},
update devicepackage </if>
set id = #{record.id,jdbcType=INTEGER}, <if test="bznhxyjbzcpbs != null">
bzcpbs = #{record.bzcpbs,jdbcType=VARCHAR}, bznhxyjbzcpbs = #{bznhxyjbzcpbs,jdbcType=VARCHAR},
bznhxyjbzcpbs = #{record.bznhxyjbzcpbs,jdbcType=VARCHAR}, </if>
cpbzjb = #{record.cpbzjb,jdbcType=VARCHAR}, <if test="cpbzjb != null">
bznhxyjcpbssl = #{record.bznhxyjcpbssl,jdbcType=INTEGER}, cpbzjb = #{cpbzjb,jdbcType=VARCHAR},
deviceRecordKey = #{record.devicerecordkey,jdbcType=VARCHAR}, </if>
uuid = #{record.uuid,jdbcType=VARCHAR} <if test="bznhxyjcpbssl != null">
<if test="_parameter != null"> bznhxyjcpbssl = #{bznhxyjcpbssl,jdbcType=INTEGER},
<include refid="Update_By_Example_Where_Clause" /> </if>
</if> <if test="devicerecordkey != null">
</update> deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR},
<update id="updateByPrimaryKeySelective" parameterType="com.glxp.udidl.admin.entity.udid.Devicepackage"> </if>
update devicepackage <if test="uuid != null">
<set> uuid = #{uuid,jdbcType=VARCHAR},
<if test="bzcpbs != null"> </if>
bzcpbs = #{bzcpbs,jdbcType=VARCHAR}, </set>
</if> where id = #{id,jdbcType=INTEGER}
<if test="bznhxyjbzcpbs != null"> </update>
bznhxyjbzcpbs = #{bznhxyjbzcpbs,jdbcType=VARCHAR}, <update id="updateByPrimaryKey" parameterType="com.glxp.udidl.admin.entity.udid.Devicepackage">
</if> update devicepackage
<if test="cpbzjb != null"> set bzcpbs = #{bzcpbs,jdbcType=VARCHAR},
cpbzjb = #{cpbzjb,jdbcType=VARCHAR}, bznhxyjbzcpbs = #{bznhxyjbzcpbs,jdbcType=VARCHAR},
</if> cpbzjb = #{cpbzjb,jdbcType=VARCHAR},
<if test="bznhxyjcpbssl != null"> bznhxyjcpbssl = #{bznhxyjcpbssl,jdbcType=INTEGER},
bznhxyjcpbssl = #{bznhxyjcpbssl,jdbcType=INTEGER}, deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR},
</if> uuid = #{uuid,jdbcType=VARCHAR}
<if test="devicerecordkey != null"> where id = #{id,jdbcType=INTEGER}
deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR}, </update>
</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.Devicepackage">
update devicepackage
set bzcpbs = #{bzcpbs,jdbcType=VARCHAR},
bznhxyjbzcpbs = #{bznhxyjbzcpbs,jdbcType=VARCHAR},
cpbzjb = #{cpbzjb,jdbcType=VARCHAR},
bznhxyjcpbssl = #{bznhxyjcpbssl,jdbcType=INTEGER},
deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR},
uuid = #{uuid,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="downloadDevicepackage" parameterType="com.glxp.udidl.admin.req.DownloadUdiRequest" resultMap="BaseResultMap"> <select id="downloadDevicepackage" parameterType="com.glxp.udidl.admin.req.DownloadUdiRequest"
select * from devicepackage resultMap="BaseResultMap">
limit #{page},#{limit} select *
from devicepackage limit #{page},#{limit}
</select> </select>
<insert id="update" parameterType="com.glxp.udidl.admin.entity.udid.Devicepackage"> <insert id="update" parameterType="com.glxp.udidl.admin.entity.udid.Devicepackage">
replace into devicepackage (bzcpbs, bznhxyjbzcpbs, replace
into devicepackage (bzcpbs, bznhxyjbzcpbs,
cpbzjb, bznhxyjcpbssl, deviceRecordKey, cpbzjb, bznhxyjcpbssl, deviceRecordKey,
uuid) uuid)
values ( #{bzcpbs,jdbcType=VARCHAR}, #{bznhxyjbzcpbs,jdbcType=VARCHAR}, values (
#{cpbzjb,jdbcType=VARCHAR}, #{bznhxyjcpbssl,jdbcType=INTEGER}, #{devicerecordkey,jdbcType=VARCHAR}, #{bzcpbs,jdbcType=VARCHAR},
#{uuid,jdbcType=VARCHAR}) #{bznhxyjbzcpbs,jdbcType=VARCHAR},
</insert> #{cpbzjb,jdbcType=VARCHAR},
#{bznhxyjcpbssl,jdbcType=INTEGER},
#{devicerecordkey,jdbcType=VARCHAR},
#{uuid,jdbcType=VARCHAR}
)
</insert>
<delete id="deleteByUuid" parameterType="java.lang.String">
delete
from devicepackage
where uuid = #{uuid}
</delete>
</mapper> </mapper>

@ -71,7 +71,8 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, id
,
deviceRecordKey, deviceRecordKey,
cchcztj, cchcztj,
jldw, jldw,
@ -206,13 +207,13 @@
</update> </update>
<update id="updateByExample" parameterType="map"> <update id="updateByExample" parameterType="map">
update devicestorage update devicestorage
set id = #{record.id,jdbcType=INTEGER}, set id = #{record.id,jdbcType=INTEGER},
deviceRecordKey = #{record.devicerecordkey,jdbcType=VARCHAR}, deviceRecordKey = #{record.devicerecordkey,jdbcType=VARCHAR},
cchcztj = #{record.cchcztj,jdbcType=VARCHAR}, cchcztj = #{record.cchcztj,jdbcType=VARCHAR},
jldw = #{record.jldw,jdbcType=VARCHAR}, jldw = #{record.jldw,jdbcType=VARCHAR},
zdz = #{record.zdz,jdbcType=VARCHAR}, zdz = #{record.zdz,jdbcType=VARCHAR},
zgz = #{record.zgz,jdbcType=VARCHAR}, zgz = #{record.zgz,jdbcType=VARCHAR},
uuid = #{record.uuid,jdbcType=VARCHAR} uuid = #{record.uuid,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/> <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
@ -254,14 +255,26 @@
<select id="downloadDevicestorage" parameterType="com.glxp.udidl.admin.req.DownloadUdiRequest" <select id="downloadDevicestorage" parameterType="com.glxp.udidl.admin.req.DownloadUdiRequest"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select * select *
from devicestorage from devicestorage limit #{page},#{limit}
limit #{page},#{limit}
</select> </select>
<insert id="update" parameterType="com.glxp.udidl.admin.entity.udid.Devicestorage"> <insert id="update" parameterType="com.glxp.udidl.admin.entity.udid.Devicestorage">
replace into devicestorage (deviceRecordKey, cchcztj, replace
into devicestorage (deviceRecordKey, cchcztj,
jldw, zdz, zgz, uuid) jldw, zdz, zgz, uuid)
values (#{devicerecordkey,jdbcType=VARCHAR}, #{cchcztj,jdbcType=VARCHAR}, values (
#{jldw,jdbcType=VARCHAR}, #{zdz,jdbcType=VARCHAR}, #{zgz,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR}) #{devicerecordkey,jdbcType=VARCHAR},
#{cchcztj,jdbcType=VARCHAR},
#{jldw,jdbcType=VARCHAR},
#{zdz,jdbcType=VARCHAR},
#{zgz,jdbcType=VARCHAR},
#{uuid,jdbcType=VARCHAR}
)
</insert> </insert>
<delete id="deleteByUuid" parameterType="java.lang.String">
delete
from devicestorage
where uuid = #{uuid}
</delete>
</mapper> </mapper>

@ -16,10 +16,10 @@
and createTime >= #{startDate} and createTime >= #{startDate}
</if> </if>
<if test="endDate != '' and endDate != null"> <if test="endDate != '' and endDate != null">
and createTime &lt;= #{endDate} and createTime &lt;= #{endDate}
</if> </if>
</where> </where>
order by downloadDate desc, createTime desc order by createTime desc
</select> </select>
</mapper> </mapper>
Loading…
Cancel
Save