diff --git a/pom.xml b/pom.xml
index 5f6da07..34f68ee 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>fastjson</artifactId>
-            <version>1.2.51</version>
+            <version>2.0.4</version>
         </dependency>
 
         <!--common-->
diff --git a/src/main/java/com/glxp/udidl/admin/controller/device/DownloadDeviceHelper.java b/src/main/java/com/glxp/udidl/admin/controller/device/DownloadDeviceHelper.java
index dd7a4c8..3cd0ce5 100644
--- a/src/main/java/com/glxp/udidl/admin/controller/device/DownloadDeviceHelper.java
+++ b/src/main/java/com/glxp/udidl/admin/controller/device/DownloadDeviceHelper.java
@@ -175,6 +175,29 @@ public class DownloadDeviceHelper {
         return result;
     }
 
+    public int simpleDownloadDevices(ProductInfoService productInfoService, DeviceService deviceService, DeviceRequest deviceRequest) {
+        String response = HttpClient.post(url, deviceRequest);
+        int result = -1;
+        List<DataSetBean> dataSetBeanList = null;
+        MedicalResonse medicalResonse = null;
+        if (url.equals("sharing/get")) {
+            medicalResonse = (MedicalResonse) JSONObject.parseObject(response, MedicalResonse.class);
+            result = medicalResonse.getReturnCode();
+            dataSetBeanList = medicalResonse.getDataSet();
+        }
+
+        if (dataSetBeanList != null && dataSetBeanList.size() > 0) {
+            for (int i = 0; i < dataSetBeanList.size(); i++) {
+                DataSetBean dataSetBean = dataSetBeanList.get(i);
+                Device device = WarehousBeanUtils.responseToDevice(dataSetBean);
+            }
+        }
+        if (Integer.parseInt(deviceRequest.getCurrentPageNumber()) >= medicalResonse.getTotalPageCount()) {
+            return -1;
+        }
+        return result;
+    }
+
     //下载生产企业
     public int downloadProduct(ProductInfoService productInfoService, DeviceService deviceService, DeviceRequest deviceRequest) {
         String response = HttpClient.post(url, deviceRequest);
diff --git a/src/main/java/com/glxp/udidl/admin/controller/device/ProductInfoController.java b/src/main/java/com/glxp/udidl/admin/controller/device/ProductInfoController.java
index 59e9ad4..9281ba6 100644
--- a/src/main/java/com/glxp/udidl/admin/controller/device/ProductInfoController.java
+++ b/src/main/java/com/glxp/udidl/admin/controller/device/ProductInfoController.java
@@ -3,12 +3,15 @@ package com.glxp.udidl.admin.controller.device;
 import com.github.pagehelper.PageInfo;
 import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
 import com.glxp.udidl.admin.entity.udi.ProductInfoEntity;
+import com.glxp.udidl.admin.entity.udi.UdiCompanyEntity;
 import com.glxp.udidl.admin.entity.udid.UdiEntity;
 import com.glxp.udidl.admin.req.ProductInfoFilterRequest;
+import com.glxp.udidl.admin.req.UdiCompanyRequest;
 import com.glxp.udidl.admin.res.BaseResponse;
 import com.glxp.udidl.admin.res.PageSimpleResponse;
 import com.glxp.udidl.admin.res.udid.ProductInfoResponse;
 import com.glxp.udidl.admin.service.inout.ProductInfoService;
+import com.glxp.udidl.admin.service.udi.UdiCompanyService;
 import com.glxp.udidl.admin.thread.AsyncDownloadTask;
 import com.glxp.udidl.admin.util.FilterUdiUtils;
 import com.glxp.udidl.admin.util.ResultVOUtils;
@@ -31,6 +34,8 @@ public class ProductInfoController {
     @Resource
     ProductInfoService productInfoService;
     @Resource
+    UdiCompanyService udiCompanyService;
+    @Resource
     AsyncDownloadTask asyncDownloadTask;
 
     //手持枪扫码查询
@@ -123,6 +128,13 @@ public class ProductInfoController {
         return ResultVOUtils.success(productInfoEntityList);
     }
 
+    //出入库同步下载
+    @AuthRuleAnnotation("udidl_company_all")
+    @GetMapping("udidl/udiwms/syncCompany")
+    public BaseResponse syncCompany(UdiCompanyRequest udiCompanyRequest) {
+        List<UdiCompanyEntity> udiCompanyEntities = udiCompanyService.syncDlCompany(udiCompanyRequest);
+        return ResultVOUtils.success(udiCompanyEntities);
+    }
 
     //开放查询 查询只查询主DI,
     @ApiOperation(value = "根据主DI查询产品信息", response = ProductInfoEntity.class)
@@ -163,9 +175,9 @@ public class ProductInfoController {
             }
         }
 
-        if (productInfoFilterRequest.getCpmctymc() != null && !productInfoFilterRequest.getCpmctymc().equals("") && productInfoFilterRequest.getCpmctymc().length() < 4) {
+       /* if (productInfoFilterRequest.getCpmctymc() != null && !productInfoFilterRequest.getCpmctymc().equals("") && productInfoFilterRequest.getCpmctymc().length() < 4) {
             return ResultVOUtils.error(500, "请输入完整的产品通用名称!");
-        }
+        }*/
         productInfoFilterRequest.setIsNewest(1);
         productInfoFilterRequest.setDiType("1");
         List<ProductInfoEntity> productInfoEntityList = productInfoService.filterUdi(productInfoFilterRequest);
@@ -230,7 +242,7 @@ public class ProductInfoController {
         return ResultVOUtils.success(pageSimpleResponse);
     }
 
-    @ApiOperation(value = "根据UUID查询产品信息",response = ProductInfoEntity.class)
+    @ApiOperation(value = "根据UUID查询产品信息", response = ProductInfoEntity.class)
     @AuthRuleAnnotation("udidl/device/filterByUuid")
     @GetMapping("udidl/device/filterByUuid")
     public BaseResponse filterByUuid(ProductInfoFilterRequest productInfoFilterRequest) {
@@ -238,7 +250,7 @@ public class ProductInfoController {
         return ResultVOUtils.success(productInfoEntityList);
     }
 
-    @ApiOperation(value = "根据最小标识查询产品信息",response = ProductInfoEntity.class)
+    @ApiOperation(value = "根据最小标识查询产品信息", response = ProductInfoEntity.class)
     @AuthRuleAnnotation("udidl/device/filterByNameCode")
     @GetMapping("udidl/device/filterByNameCode")
     public BaseResponse filterByNameCode(ProductInfoFilterRequest productInfoFilterRequest) {
diff --git a/src/main/java/com/glxp/udidl/admin/controller/device/TestController.java b/src/main/java/com/glxp/udidl/admin/controller/device/TestController.java
index bf1c9de..94bc2e2 100644
--- a/src/main/java/com/glxp/udidl/admin/controller/device/TestController.java
+++ b/src/main/java/com/glxp/udidl/admin/controller/device/TestController.java
@@ -2,8 +2,13 @@ package com.glxp.udidl.admin.controller.device;
 
 import com.alibaba.fastjson.JSONObject;
 import com.glxp.udidl.admin.dao.udi.ProductInfoMapper;
+import com.glxp.udidl.admin.entity.udi.ProductInfoEntity;
+import com.glxp.udidl.admin.entity.udi.UdiCompanyEntity;
+import com.glxp.udidl.admin.entity.udid.Contactlist;
 import com.glxp.udidl.admin.entity.udid.Device;
 import com.glxp.udidl.admin.req.ListPageRequest;
+import com.glxp.udidl.admin.req.ProductInfoFilterRequest;
+import com.glxp.udidl.admin.req.UdiCompanyRequest;
 import com.glxp.udidl.admin.res.BaseResponse;
 import com.glxp.udidl.admin.service.dataSync.DeviceSyncService;
 import com.glxp.udidl.admin.service.dataSync.UdplatDownloadService;
@@ -24,6 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
 import springfox.documentation.annotations.ApiIgnore;
 
 import javax.annotation.Resource;
+import java.util.Date;
 import java.util.List;
 
 @ApiIgnore
@@ -96,6 +102,13 @@ public class TestController {
         asyncDownloadTask.downloadByMonth(month, page);
     }
 
+    @GetMapping("udidl/device/dlBymonthTest")
+    public void dlBymonthTest(String month, int page) {
+
+        logger.info(month + "---按月开启下载");
+        asyncDownloadTask.downloadByMonthTest(month, page);
+    }
+
     @GetMapping("/test/getDistributor")
     public String udplatTest() {
         return udplatDownloadService.getDistributor();
@@ -131,4 +144,40 @@ public class TestController {
     public JSONObject getDistributeOrderDetails(Long orderId) {
         return udplatDownloadService.getDistributeOrderDetails(orderId);
     }
+
+    @GetMapping("/test/transferUdiCompany")
+    public BaseResponse transferUdiCompany(String nameCode) {
+        //更新为最新版本
+        ProductInfoFilterRequest filterRequest1 = new ProductInfoFilterRequest();
+        filterRequest1.setNameCode(nameCode);
+        List<ProductInfoEntity> updateEntitys = productInfoService.filterUdi(filterRequest1);
+        ProductInfoEntity productInfoEntity;
+        if (updateEntitys != null && updateEntitys.size() > 0) {
+            //获取最高版本号
+            productInfoEntity = updateEntitys.get(0);
+            //更新厂家信息,
+            UdiCompanyRequest udiCompanyRequest = new UdiCompanyRequest();
+            udiCompanyRequest.setTyshxydm(productInfoEntity.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);
+                return ResultVOUtils.success(udiCompanyEntity);
+            }
+
+        }
+        return ResultVOUtils.error(500, "未查询到数据");
+    }
+
 }
diff --git a/src/main/java/com/glxp/udidl/admin/controller/device/UdidlDeviceController.java b/src/main/java/com/glxp/udidl/admin/controller/device/UdidlDeviceController.java
index 3dc5a5c..a6fe6fb 100644
--- a/src/main/java/com/glxp/udidl/admin/controller/device/UdidlDeviceController.java
+++ b/src/main/java/com/glxp/udidl/admin/controller/device/UdidlDeviceController.java
@@ -59,6 +59,13 @@ public class UdidlDeviceController {
         return deviceSyncService.downloadByDi(deviceId);
     }
 
+
+    @AuthRuleAnnotation("udidl_udidlDevice_all")
+    @GetMapping("udidl/device/serchDlByDi")
+    public BaseResponse serchDlByDi(String deviceId) {
+        return deviceSyncService.searchDlByDi(deviceId);
+    }
+
     /**
      * 获取产品标识详情
      *
diff --git a/src/main/java/com/glxp/udidl/admin/dao/udi/ProductInfoMapper.java b/src/main/java/com/glxp/udidl/admin/dao/udi/ProductInfoMapper.java
index 7d09b96..c5db4b0 100644
--- a/src/main/java/com/glxp/udidl/admin/dao/udi/ProductInfoMapper.java
+++ b/src/main/java/com/glxp/udidl/admin/dao/udi/ProductInfoMapper.java
@@ -48,4 +48,6 @@ public interface ProductInfoMapper extends BaseMapper<ProductInfoEntity> {
     List<String> findAllTyshxyh();
 
     List<ProductDetailModel> selectByDeviceRecordKey(String key);
+
+    boolean updateCplx(ProductInfoEntity productInfoEntity);
 }
diff --git a/src/main/java/com/glxp/udidl/admin/dao/udi/UdiCompanyMapper.java b/src/main/java/com/glxp/udidl/admin/dao/udi/UdiCompanyMapper.java
index 8c814ac..0368ad7 100644
--- a/src/main/java/com/glxp/udidl/admin/dao/udi/UdiCompanyMapper.java
+++ b/src/main/java/com/glxp/udidl/admin/dao/udi/UdiCompanyMapper.java
@@ -28,4 +28,6 @@ public interface UdiCompanyMapper extends BaseMapper<UdiCompanyEntity> {
 
     List<String> searchByName(String name);//公司名称搜索
 
+    List<UdiCompanyEntity> syncDlCompany(UdiCompanyRequest udiCompanyRequest);
+
 }
diff --git a/src/main/java/com/glxp/udidl/admin/dao/udid/DeviceMapper.java b/src/main/java/com/glxp/udidl/admin/dao/udid/DeviceMapper.java
index 3e065cf..c175386 100644
--- a/src/main/java/com/glxp/udidl/admin/dao/udid/DeviceMapper.java
+++ b/src/main/java/com/glxp/udidl/admin/dao/udid/DeviceMapper.java
@@ -60,4 +60,6 @@ public interface DeviceMapper extends BaseMapper<Device> {
     List<String> findAllByZxxscpbs();
 
     List<String> findAllByZxxscpbsPage(ListPageRequest listPageRequest);
+
+    boolean updateCplx(Device device);
 }
\ No newline at end of file
diff --git a/src/main/java/com/glxp/udidl/admin/entity/udi/ProductInfoEntity.java b/src/main/java/com/glxp/udidl/admin/entity/udi/ProductInfoEntity.java
index fcad03b..d72d600 100644
--- a/src/main/java/com/glxp/udidl/admin/entity/udi/ProductInfoEntity.java
+++ b/src/main/java/com/glxp/udidl/admin/entity/udi/ProductInfoEntity.java
@@ -138,4 +138,11 @@ public class ProductInfoEntity {
     @ApiModelProperty(value = "更新时间", example = "2022-05-09 14:36:00")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date updateTime;
+
+    @ApiModelProperty(value = "是否最新")
+    private String hchzsb;
+
+    @ApiModelProperty(value = "产品类型")
+    private String cplx;
+
 }
diff --git a/src/main/java/com/glxp/udidl/admin/entity/udid/Device.java b/src/main/java/com/glxp/udidl/admin/entity/udid/Device.java
index aca11ff..6692782 100644
--- a/src/main/java/com/glxp/udidl/admin/entity/udid/Device.java
+++ b/src/main/java/com/glxp/udidl/admin/entity/udid/Device.java
@@ -156,6 +156,11 @@ public class Device {
     @ApiModelProperty(value = "请求日期")
     private Date requestDate;
 
+    private String hchzsb;
+
+    @ApiModelProperty(value = "产品类型")
+    private String cplx;
+
     public Date getRequestDate() {
         return requestDate;
     }
@@ -188,6 +193,22 @@ public class Device {
         this.btcpbs = btcpbs == null ? null : btcpbs.trim();
     }
 
+    public String getHchzsb() {
+        return hchzsb;
+    }
+
+    public void setHchzsb(String hchzsb) {
+        this.hchzsb = hchzsb;
+    }
+
+    public String getCplx() {
+        return cplx;
+    }
+
+    public void setCplx(String cplx) {
+        this.cplx = cplx;
+    }
+
     public String getBtcpbsyzxxsdycpbssfyz() {
         return btcpbsyzxxsdycpbssfyz;
     }
diff --git a/src/main/java/com/glxp/udidl/admin/entity/udid/DeviceEntity.java b/src/main/java/com/glxp/udidl/admin/entity/udid/DeviceEntity.java
index 52316f8..fde2f26 100644
--- a/src/main/java/com/glxp/udidl/admin/entity/udid/DeviceEntity.java
+++ b/src/main/java/com/glxp/udidl/admin/entity/udid/DeviceEntity.java
@@ -203,6 +203,11 @@ public class DeviceEntity {
     @ApiModelProperty(value = "")
     private boolean check;
 
+    private String hchzsb;
+
+    @ApiModelProperty(value = "产品类型")
+    private String cplx;
+
     @ApiModelProperty(value = "联系人信息")
     private List<Contactlist> contactlistList;
 
diff --git a/src/main/java/com/glxp/udidl/admin/req/UdiCompanyRequest.java b/src/main/java/com/glxp/udidl/admin/req/UdiCompanyRequest.java
index ca66dd8..6d47a61 100644
--- a/src/main/java/com/glxp/udidl/admin/req/UdiCompanyRequest.java
+++ b/src/main/java/com/glxp/udidl/admin/req/UdiCompanyRequest.java
@@ -23,4 +23,6 @@ public class UdiCompanyRequest extends ListPageRequest {
     @ApiModelProperty(value = "区域代码")
     private String areaCode;
 
+    @ApiModelProperty(value = "更新时间")
+    private String updateTime;
 }
diff --git a/src/main/java/com/glxp/udidl/admin/res/udid/DataSetBean.java b/src/main/java/com/glxp/udidl/admin/res/udid/DataSetBean.java
index 23ed3a0..32db5fd 100644
--- a/src/main/java/com/glxp/udidl/admin/res/udid/DataSetBean.java
+++ b/src/main/java/com/glxp/udidl/admin/res/udid/DataSetBean.java
@@ -92,6 +92,8 @@ public class DataSetBean {
     private String ylqxzcrbarywmc;
     private String zxxsdyzsydydsl;
     private String tsrq;
+    private String hchzsb;
+    private String cplx;
 
     private String bszt;
     private String sfyzcbayz;
@@ -102,6 +104,22 @@ public class DataSetBean {
     private List<DeviceStorageBean> deviceStorage;
     private List<ContactListBean> contactList;
 
+    public String getHchzsb() {
+        return hchzsb;
+    }
+
+    public void setHchzsb(String hchzsb) {
+        this.hchzsb = hchzsb;
+    }
+
+    public String getCplx() {
+        return cplx;
+    }
+
+    public void setCplx(String cplx) {
+        this.cplx = cplx;
+    }
+
     public String getDeviceHistoryRecordKey() {
         return deviceHistoryRecordKey;
     }
diff --git a/src/main/java/com/glxp/udidl/admin/res/udid/DataSetResult.java b/src/main/java/com/glxp/udidl/admin/res/udid/DataSetResult.java
index 3094128..96f7525 100644
--- a/src/main/java/com/glxp/udidl/admin/res/udid/DataSetResult.java
+++ b/src/main/java/com/glxp/udidl/admin/res/udid/DataSetResult.java
@@ -75,7 +75,7 @@ public class DataSetResult {
         private String bssjzt;                  //"标识数据状态
         //文档有,接口返回无该字段
         private String cplx;                    //"产品类型:1 器械,2 体外诊断试剂
-        private String HCHZSB;                  //耗材或者设备:0 耗材, 1 设备
+        private String hchzsb;                  //耗材或者设备:0 耗材, 1 设备
         private List<ContactInfo> contactList;
     }
 
diff --git a/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceDownloadService.java b/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceDownloadService.java
index 05b01e9..cc489f4 100644
--- a/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceDownloadService.java
+++ b/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceDownloadService.java
@@ -4,6 +4,8 @@ package com.glxp.udidl.admin.service.dataSync;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.glxp.udidl.admin.entity.info.CompanyEntity;
+import com.glxp.udidl.admin.entity.udi.ProductInfoEntity;
+import com.glxp.udidl.admin.entity.udid.Device;
 import com.glxp.udidl.admin.entity.udid.JobLog;
 import com.glxp.udidl.admin.entity.udid.TokenEntity;
 import com.glxp.udidl.admin.req.udid.DeviceRequest;
@@ -16,6 +18,8 @@ import com.glxp.udidl.admin.res.udid.DataSetResult;
 import com.glxp.udidl.admin.res.udid.DataSetSingleResult;
 import com.glxp.udidl.admin.res.udid.DataSetTotalResult;
 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.DateUtil;
 import com.glxp.udidl.admin.util.HttpClient;
@@ -50,6 +54,10 @@ public class DeviceDownloadService {
     JobLogService jobLogService;                //日志
     @Autowired
     DeviceSaveService deviceSaveService;
+    @Autowired
+    private DeviceService deviceService;
+    @Autowired
+    private ProductInfoService productInfoService;
 
     private void SetTokenEmpty() {
         token = "";
@@ -362,4 +370,70 @@ public class DeviceDownloadService {
         }
         return ResultVOUtils.success();
     }
+
+    //按月份下载 边下载边保存
+    public BaseResponse downloadByMonthTest(String month, int page) {
+        try {
+            int totalPage = page;
+            int totalRecordCount = 0;
+            while (page <= totalPage) {
+                DataSetResult dataSetResult = getData(month, 2, page);
+                if (dataSetResult.getReturnCode() != 1) {
+                    String msg = "下载到第" + page + "页发生错误";
+                    //发生错误,存储日志
+                    JobLog jobLog = new JobLog();
+                    jobLog.setDownloadType("manual");
+                    jobLog.setType("error");
+                    jobLog.setMsg(msg);
+                    jobLog.setContent(dataSetResult.getReturnMsg());
+                    jobLog.setCreateTime(new Date());
+                    jobLogService.insert(jobLog);
+                    return ResultVOUtils.error(-1, msg + ",错误信息:" + dataSetResult.getReturnMsg());
+                } else if (dataSetResult.getDataSet().getDeviceInfo() != null && dataSetResult.getDataSet().getDeviceInfo().size() > 0) {
+                    //存储数据
+                    List<DataSetResult.DataSet> dataSets = new ArrayList<>();
+                    dataSets.add(dataSetResult.getDataSet());
+                    for (DataSetResult.DataSet ds : dataSets) {
+                        for (DataSetResult.DeviceInfo item : ds.getDeviceInfo()) {
+                            Device device = new Device();
+                            device.setHchzsb(item.getHchzsb());
+                            device.setCplx(item.getCplx());
+                            device.setDevicerecordkey(item.getDeviceRecordKey());
+                            deviceService.updateCplx(device);
+
+
+                            ProductInfoEntity productInfoEntity = new ProductInfoEntity();
+                            productInfoEntity.setHchzsb(item.getHchzsb());
+                            productInfoEntity.setCplx(item.getCplx());
+                            productInfoEntity.setDeviceRecordKey(item.getDeviceRecordKey());
+                            productInfoService.updateCplx(productInfoEntity);
+
+                        }
+                    }
+                }
+                totalPage = dataSetResult.getTotalPageCount();
+                totalRecordCount = dataSetResult.getTotalRecordCount();
+                page++;
+            }
+            JobLog jobLog = new JobLog();
+            jobLog.setType("info");
+            jobLog.setDownloadType("manual");
+            jobLog.setMsg("月份:" + month + ",执行成功!");
+            jobLog.setCreateTime(new Date());
+            jobLogService.insert(jobLog);
+        } catch (Exception e) {
+            e.printStackTrace();
+            JobLog jobLog = new JobLog();
+            jobLog.setDownloadType("manual");
+            jobLog.setType("error");
+            jobLog.setMsg("月份:" + month + ",执行失败:" + e.getMessage());
+            jobLog.setContent(JSON.toJSONString(e.getStackTrace()));
+            jobLog.setCreateTime(new Date());
+            jobLogService.insert(jobLog);
+            return ResultVOUtils.error(-1, jobLog.getMsg());
+        }
+
+        return ResultVOUtils.success();
+    }
+
 }
diff --git a/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSaveService.java b/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSaveService.java
index c2eba51..d8fc641 100644
--- a/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSaveService.java
+++ b/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSaveService.java
@@ -206,6 +206,8 @@ public class DeviceSaveService {
         device.setZxxsdyzsydydsl(dataSetBean.getZxxsdyzsydydsl());
         device.setBssjzt(dataSetBean.getBssjzt());
         device.setLastModifyTime(DateUtil.formatDateTime(new Date()));
+        device.setCplx(dataSetBean.getCplx());
+        device.setHchzsb(dataSetBean.getHchzsb());
         return device;
     }
 
diff --git a/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSyncService.java b/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSyncService.java
index 822f4a6..76b327b 100644
--- a/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSyncService.java
+++ b/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSyncService.java
@@ -1,22 +1,26 @@
 package com.glxp.udidl.admin.service.dataSync;
 
+import cn.hutool.core.collection.CollUtil;
 import com.alibaba.fastjson.JSON;
+import com.glxp.udidl.admin.entity.udi.ProductInfoEntity;
 import com.glxp.udidl.admin.entity.udid.*;
+import com.glxp.udidl.admin.req.ProductInfoFilterRequest;
 import com.glxp.udidl.admin.res.BaseResponse;
 import com.glxp.udidl.admin.res.udid.DataSetResult;
 import com.glxp.udidl.admin.res.udid.DataSetSingleHistoryResult;
 import com.glxp.udidl.admin.res.udid.DataSetSingleResult;
 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.ResultVOUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
+import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -26,12 +30,14 @@ import java.util.stream.Collectors;
 @Service
 public class DeviceSyncService {
 
-    @Autowired
+    @Resource
     private DeviceSaveService deviceSaveService;
-    @Autowired
+    @Resource
     private DeviceDownloadService deviceDownloadService;
-    @Autowired
+    @Resource
     JobLogService jobLogService;                //日志
+    @Resource
+    private ProductInfoService productInfoService;
 
     public void downloadAndSave(String day, String downloadType) {
         //1.下载唯一标识数据
@@ -142,6 +148,41 @@ public class DeviceSyncService {
         return ResultVOUtils.success("执行完成,详情请查看日志!");
     }
 
+    public BaseResponse searchDlByDi(String deviceId) {
+        ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest();
+        productInfoFilterRequest.setNameCode(deviceId);
+        List<ProductInfoEntity> productInfoEntityList = productInfoService.findAll(productInfoFilterRequest);
+        if (CollUtil.isEmpty(productInfoEntityList)) {
+            DataSetSingleResult result1 = deviceDownloadService.downloadByDi(deviceId);
+            if (result1.getReturnCode() != 1)
+                return ResultVOUtils.error(-1, result1.getReturnMsg());
+
+            if (CollUtil.isNotEmpty(result1.getDataSet().getDeviceInfo())) {
+                List<DataSetResult.DataSet> dataSets = new ArrayList<>();
+                dataSets.add(result1.getDataSet());
+                deviceSaveService.DeviceSave(dataSets, new Date());
+                productInfoEntityList = productInfoService.findAll(productInfoFilterRequest);
+            } else {
+                return ResultVOUtils.error(501, "医疗器械唯一标识数据库未找到此产品DI,请检查是否输入正确或联系厂家是否已上传");
+            }
+
+        }
+        return ResultVOUtils.success(productInfoEntityList);
+    }
+
+    public void dlHistory(DataSetSingleResult result1) {
+
+        DataSetSingleHistoryResult result = new DataSetSingleHistoryResult();
+        result.setDataSet(result1.getDataSet());
+        if (result1.getDataSet().getDeviceInfo() != null && result1.getDataSet().getDeviceInfo().size() > 0) {
+            List<String> keyList = deviceDownloadService.getKeyList(result1.getDataSet());
+            if (keyList.size() > 0) {
+                DataSetTotalResult result2 = deviceDownloadService.getHistoryData(keyList);
+                result.setDataList(result2.getData());
+            }
+        }
+    }
+
     public BaseResponse downloadByDi(String deviceId) {
         DataSetSingleResult result1 = deviceDownloadService.downloadByDi(deviceId);
         if (result1.getReturnCode() != 1)
@@ -155,6 +196,9 @@ public class DeviceSyncService {
                 result.setDataList(result2.getData());
             }
         }
+        List<DataSetResult.DataSet> dataSets = new ArrayList<>();
+        dataSets.add(result1.getDataSet());
+        deviceSaveService.DeviceSave(dataSets, new Date());
         return ResultVOUtils.success(result);
     }
 
@@ -162,8 +206,10 @@ public class DeviceSyncService {
         DataSetSingleResult res = deviceDownloadService.downloadByDi(deviceId);
         if (res.getReturnCode() != 1)
             return ResultVOUtils.error(-1, res.getReturnMsg());
+        List<DataSetResult.DataSet> dataSets = new ArrayList<>();
+        dataSets.add(res.getDataSet());
+        deviceSaveService.DeviceSave(dataSets, new Date());
         return ResultVOUtils.success(Convert(res.getDataSet()));
-
     }
 
     /**
diff --git a/src/main/java/com/glxp/udidl/admin/service/inout/DeviceService.java b/src/main/java/com/glxp/udidl/admin/service/inout/DeviceService.java
index 5e2466d..4e7cb86 100644
--- a/src/main/java/com/glxp/udidl/admin/service/inout/DeviceService.java
+++ b/src/main/java/com/glxp/udidl/admin/service/inout/DeviceService.java
@@ -42,4 +42,6 @@ public interface DeviceService {
     List<String> findAllByZxxscpbs();
 
     List<String> findAllByZxxscpbsPage(ListPageRequest listPageRequest);
+
+    boolean updateCplx(Device device);
 }
diff --git a/src/main/java/com/glxp/udidl/admin/service/inout/ProductInfoService.java b/src/main/java/com/glxp/udidl/admin/service/inout/ProductInfoService.java
index df0cc29..2b11d00 100644
--- a/src/main/java/com/glxp/udidl/admin/service/inout/ProductInfoService.java
+++ b/src/main/java/com/glxp/udidl/admin/service/inout/ProductInfoService.java
@@ -42,5 +42,5 @@ public interface ProductInfoService {
 
     boolean updateProductInfo(ProductInfoEntity productInfoEntity);
 
-
+    boolean updateCplx(ProductInfoEntity productInfoEntity);
 }
diff --git a/src/main/java/com/glxp/udidl/admin/service/inout/impl/DeviceServiceImpl.java b/src/main/java/com/glxp/udidl/admin/service/inout/impl/DeviceServiceImpl.java
index 6fc2628..14fee05 100644
--- a/src/main/java/com/glxp/udidl/admin/service/inout/impl/DeviceServiceImpl.java
+++ b/src/main/java/com/glxp/udidl/admin/service/inout/impl/DeviceServiceImpl.java
@@ -206,6 +206,12 @@ 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 insertDevice(Device device) {
diff --git a/src/main/java/com/glxp/udidl/admin/service/inout/impl/ProductInfoServiceImpl.java b/src/main/java/com/glxp/udidl/admin/service/inout/impl/ProductInfoServiceImpl.java
index 31bf9b8..dbb27b5 100644
--- a/src/main/java/com/glxp/udidl/admin/service/inout/impl/ProductInfoServiceImpl.java
+++ b/src/main/java/com/glxp/udidl/admin/service/inout/impl/ProductInfoServiceImpl.java
@@ -138,6 +138,12 @@ public class ProductInfoServiceImpl implements ProductInfoService {
         return productInfoDao.updateProductInfo(productInfoEntity);
     }
 
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public boolean updateCplx(ProductInfoEntity productInfoEntity) {
+        return productInfoDao.updateCplx(productInfoEntity);
+    }
+
     @Transactional(rollbackFor = Exception.class)
     @Override
     public boolean deleteById(String id) {
diff --git a/src/main/java/com/glxp/udidl/admin/service/udi/UdiCompanyService.java b/src/main/java/com/glxp/udidl/admin/service/udi/UdiCompanyService.java
index 732800e..1bce2d1 100644
--- a/src/main/java/com/glxp/udidl/admin/service/udi/UdiCompanyService.java
+++ b/src/main/java/com/glxp/udidl/admin/service/udi/UdiCompanyService.java
@@ -26,4 +26,6 @@ public interface UdiCompanyService {
     boolean updateUdiCompany(UdiCompanyEntity udiCompanyEntity);
 
     BaseResponse searchByName(String name);//公司名称搜索
+
+    List<UdiCompanyEntity> syncDlCompany(UdiCompanyRequest udiCompanyRequest);
 }
diff --git a/src/main/java/com/glxp/udidl/admin/service/udi/impl/UdiCompanyServiceImpl.java b/src/main/java/com/glxp/udidl/admin/service/udi/impl/UdiCompanyServiceImpl.java
index 05d977b..08d1e7b 100644
--- a/src/main/java/com/glxp/udidl/admin/service/udi/impl/UdiCompanyServiceImpl.java
+++ b/src/main/java/com/glxp/udidl/admin/service/udi/impl/UdiCompanyServiceImpl.java
@@ -67,4 +67,12 @@ public class UdiCompanyServiceImpl implements UdiCompanyService {
         List<String> result = udiCompanyDao.searchByName(name);
         return ResultVOUtils.success(result);
     }
+
+    @Override
+    public List<UdiCompanyEntity> syncDlCompany(UdiCompanyRequest udiCompanyRequest) {
+        int offset = (udiCompanyRequest.getPage() - 1) * udiCompanyRequest.getLimit() + 1;
+        udiCompanyRequest.setPage(offset);
+        return udiCompanyDao.syncDlCompany(udiCompanyRequest);
+    }
+
 }
diff --git a/src/main/java/com/glxp/udidl/admin/thread/AsyncDownloadTask.java b/src/main/java/com/glxp/udidl/admin/thread/AsyncDownloadTask.java
index 45acde5..b5773b3 100644
--- a/src/main/java/com/glxp/udidl/admin/thread/AsyncDownloadTask.java
+++ b/src/main/java/com/glxp/udidl/admin/thread/AsyncDownloadTask.java
@@ -39,9 +39,9 @@ public class AsyncDownloadTask {
     @Async
     public void downloadByDi(String primaryDeviceId) {
         DownloadDeviceHelper downloadDeviceHelper = new DownloadDeviceHelper(companyService, udiCompanyService);
-        TokenEntity token = downloadDeviceHelper.getToken();
+        String token = deviceDownloadService.getToken();
         DownloadDiRequest downloadDiRequest = new DownloadDiRequest();
-        downloadDiRequest.setAccessToken(token.getAccessToken());
+        downloadDiRequest.setAccessToken(token);
         downloadDiRequest.setPrimaryDeviceId(primaryDeviceId);
         downloadDeviceHelper.downloadBydi(downloadDiRequest, deviceService, productInfoService);
     }
@@ -54,6 +54,28 @@ public class AsyncDownloadTask {
     }
 
 
+    @Async
+    public void downloadByMonthTest(String month, int page) {
+        deviceDownloadService.downloadByMonthTest(month, page);
+
+        /*int curpage = page;
+        DownloadDeviceHelper downloadDeviceHelper = new DownloadDeviceHelper(companyService,udiCompanyService);
+        TokenEntity token = downloadDeviceHelper.getToken();
+        while (true) {
+            DeviceRequest deviceRequest = new DeviceRequest();
+            deviceRequest.setAccessToken(token.getAccessToken());
+            deviceRequest.setRequestType("2");
+            deviceRequest.setRangeValue(month);
+            deviceRequest.setCurrentPageNumber(curpage + "");
+            int result = downloadDeviceHelper.downloadDevices(productInfoService, deviceService, deviceRequest);
+            if (result == -1) {
+                return;// ResultVOUtils.error(505, "下载出错");
+            }
+            curpage++;
+        }*/
+    }
+
+
     //按天下载UDI  , 手动下载
     @Async
     public void downloadByDay(String day) {
diff --git a/src/main/java/com/glxp/udidl/admin/thread/UdiCompanyTask.java b/src/main/java/com/glxp/udidl/admin/thread/UdiCompanyTask.java
index 16ed181..f9d8ed9 100644
--- a/src/main/java/com/glxp/udidl/admin/thread/UdiCompanyTask.java
+++ b/src/main/java/com/glxp/udidl/admin/thread/UdiCompanyTask.java
@@ -12,6 +12,7 @@ import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -39,6 +40,7 @@ public class UdiCompanyTask {
                         udiCompanyEntity.setQylxrcz(contactlist.getQylxrcz());
                         udiCompanyEntity.setQylxrdh(contactlist.getQylxrdh());
                         udiCompanyEntity.setQylxryx(contactlist.getQylxryx());
+                        udiCompanyEntity.setUpdateTime(new Date());
                     }
                 }
                 udiCompanyService.insertUdiCompany(udiCompanyEntity);
diff --git a/src/main/java/com/glxp/udidl/admin/thread/UdiTransferUtils.java b/src/main/java/com/glxp/udidl/admin/thread/UdiTransferUtils.java
index 385da3c..1c9a106 100644
--- a/src/main/java/com/glxp/udidl/admin/thread/UdiTransferUtils.java
+++ b/src/main/java/com/glxp/udidl/admin/thread/UdiTransferUtils.java
@@ -49,6 +49,8 @@ public class UdiTransferUtils {
         productInfoEntity.setCphhhbh(deviceEntity.getCphhhbh());
         productInfoEntity.setCpms(deviceEntity.getCpms());
         productInfoEntity.setCpbsbmtxmc(deviceEntity.getCpbsbmtxmc());
+        productInfoEntity.setCplx(deviceEntity.getCplx());
+        productInfoEntity.setHchzsb(deviceEntity.getHchzsb());
 
         productInfoEntity.setVersionNumber(Integer.parseInt(deviceEntity.getVersionnumber()));
         if (deviceEntity.getSydycpbs() != null && !deviceEntity.getSydycpbs().equals("")) {
@@ -179,9 +181,6 @@ public class UdiTransferUtils {
                 update.setUpdateTime(new Date());
                 productInfoService.updateProductInfo(update);
             }
-//            updateEntity.setIsNewest(true);
-//            updateEntity.setUpdateTime(new Date());
-//            productInfoService.updateProductInfo(updateEntity);
         }
 
         //更新厂家信息,
@@ -191,6 +190,7 @@ public class UdiTransferUtils {
         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());
diff --git a/src/main/java/com/glxp/udidl/admin/util/DateUtils.java b/src/main/java/com/glxp/udidl/admin/util/DateUtils.java
index a39c5c2..3369368 100644
--- a/src/main/java/com/glxp/udidl/admin/util/DateUtils.java
+++ b/src/main/java/com/glxp/udidl/admin/util/DateUtils.java
@@ -2,7 +2,7 @@ package com.glxp.udidl.admin.util;
 
 import java.util.Date;
 
-public class DateUtils extends cn.hutool.core.date.DateUtil{
+public class DateUtils extends cn.hutool.core.date.DateUtil {
     /**
      * 日期型字符串转化为日期 格式
      */
diff --git a/src/main/resources/mybatis/mapper/udi/ProductInfoMapper.xml b/src/main/resources/mybatis/mapper/udi/ProductInfoMapper.xml
index 2bb4c1c..60c6b17 100644
--- a/src/main/resources/mybatis/mapper/udi/ProductInfoMapper.xml
+++ b/src/main/resources/mybatis/mapper/udi/ProductInfoMapper.xml
@@ -2,19 +2,19 @@
 <!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.udi.ProductInfoMapper">
-
     <select id="filterProductInfo" parameterType="com.glxp.udidl.admin.req.ProductInfoFilterRequest"
             resultType="com.glxp.udidl.admin.entity.udi.ProductInfoEntity">
-        SELECT * FROM productinfo
+        SELECT *
+        FROM productinfo
         <where>
             <if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
-                AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc},'%')
+                AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc}, '%')
             </if>
             <if test="cpmctymc != '' and cpmctymc != null">
-                AND cpmctymc LIKE concat(#{cpmctymc},'%')
+                AND cpmctymc LIKE concat(#{cpmctymc}, '%')
             </if>
             <if test="nameCode != '' and nameCode != null">
-                AND nameCode LIKE concat(#{nameCode},'%')
+                AND nameCode LIKE concat(#{nameCode}, '%')
             </if>
             <if test="uuid != '' and uuid != null">
                 AND uuid = #{uuid}
@@ -23,39 +23,41 @@
                 AND deviceRecordKey = #{deviceRecordKey}
             </if>
             <if test="ggxh != '' and ggxh != null">
-                AND ggxh LIKE concat(#{ggxh},'%')
+                AND ggxh LIKE concat(#{ggxh}, '%')
             </if>
             <if test="tyshxydm != '' and tyshxydm != null">
                 AND tyshxydm = #{tyshxydm}
             </if>
-            <if test="updateTime!=null and updateTime!=''">
-                <![CDATA[   and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>=  DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')   ]]>
+            <if test="updateTime != null and updateTime != ''">
+                <![CDATA[
+                and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')
+                ]]>
             </if>
-
-
         </where>
-
     </select>
 
 
     <select id="filterCpmctymc" parameterType="com.glxp.udidl.admin.req.ProductInfoFilterRequest"
             resultType="com.glxp.udidl.admin.entity.udi.ProductInfoEntity">
-        select * from productinfo
+        select *
+        from productinfo
         <where>
             <if test="tyshxydm != '' and tyshxydm != null">
                 AND tyshxydm = #{tyshxydm}
             </if>
             <if test="cpmctymc != '' and cpmctymc != null">
-                AND cpmctymc LIKE concat(#{cpmctymc},'%')
+                AND cpmctymc LIKE concat(#{cpmctymc}, '%')
             </if>
             <if test="nameCode != '' and nameCode != null">
-                AND nameCode LIKE concat(#{nameCode},'%')
+                AND nameCode LIKE concat(#{nameCode}, '%')
             </if>
             <if test="uuid != '' and uuid != null">
                 AND uuid = #{uuid}
             </if>
-            <if test="updateTime!=null and updateTime!=''">
-                <![CDATA[   and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>=  DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')   ]]>
+            <if test="updateTime != null and updateTime != ''">
+                <![CDATA[
+                and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')
+                ]]>
             </if>
         </where>
         GROUP BY cpmctymc
@@ -64,23 +66,26 @@
 
     <select id="filterUdiByTyshxydm" parameterType="com.glxp.udidl.admin.req.ProductInfoFilterRequest"
             resultType="com.glxp.udidl.admin.entity.udi.ProductInfoEntity">
-        SELECT * FROM productinfo
+        SELECT *
+        FROM productinfo
         <where>
             diType = 1
             <if test="tyshxydm != '' and tyshxydm != null">
                 AND tyshxydm = #{tyshxydm}
             </if>
             <if test="cpmctymc != '' and cpmctymc != null">
-                AND cpmctymc LIKE concat(#{cpmctymc},'%')
+                AND cpmctymc LIKE concat(#{cpmctymc}, '%')
             </if>
             <if test="nameCode != '' and nameCode != null">
-                AND nameCode LIKE concat(#{nameCode},'%')
+                AND nameCode LIKE concat(#{nameCode}, '%')
             </if>
             <if test="uuid != '' and uuid != null">
                 AND uuid = #{uuid}
             </if>
-            <if test="updateTime!=null and updateTime!=''">
-                <![CDATA[   and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>=  DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')   ]]>
+            <if test="updateTime != null and updateTime != ''">
+                <![CDATA[
+                and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')
+                ]]>
             </if>
         </where>
         GROUP BY nameCode
@@ -88,8 +93,9 @@
 
     <select id="selectAllByUuid" parameterType="java.util.List"
             resultType="com.glxp.udidl.admin.entity.udi.ProductInfoEntity">
-        select * from productinfo where
-        uuid in (
+        select *
+        from productinfo where
+                uuid in (
         <foreach collection="ids" item="item" index="index"
                  separator=",">
             #{item}
@@ -107,27 +113,27 @@
     <!--   CHAR_LENGTH(nameCode)  <![CDATA[ >= ]]>  14-->
     <select id="filterUdiByCreditNo" parameterType="com.glxp.udidl.admin.req.ProductInfoFilterRequest"
             resultType="com.glxp.udidl.admin.entity.udi.ProductInfoEntity">
-
-        select p.* from productinfo p INNER JOIN
-        (select deviceRecordKey ,max(versionNumber) versionNumber from productinfo
+        select p.* from productinfo p
+                INNER JOIN
+                (select deviceRecordKey, max(versionNumber) versionNumber
+                 from productinfo
 
         <where>
-
             <if test="tyshxydm != '' and tyshxydm != null">
                 AND tyshxydm = #{tyshxydm}
             </if>
             <if test="cpmctymc != '' and cpmctymc != null">
-                AND cpmctymc LIKE concat(#{cpmctymc},'%')
+                AND cpmctymc LIKE concat(#{cpmctymc}, '%')
             </if>
             <if test="nameCode != '' and nameCode != null">
-                AND nameCode LIKE concat(#{nameCode},'%')
+                AND nameCode LIKE concat(#{nameCode}, '%')
             </if>
             <if test="uuid != '' and uuid != null">
                 AND uuid = #{uuid}
             </if>
         </where>
         GROUP BY deviceRecordKey)
-        a on p.deviceRecordKey = a.deviceRecordKey and p.versionNumber = a.versionNumber
+                a on p.deviceRecordKey = a.deviceRecordKey and p.versionNumber = a.versionNumber
         <where>
             <if test="diType != '' and diType != null">
                 AND diType = #{diType}
@@ -138,17 +144,17 @@
 
     <select id="filterUdiByNewest" parameterType="com.glxp.udidl.admin.req.ProductInfoFilterRequest"
             resultType="com.glxp.udidl.admin.entity.udi.ProductInfoEntity">
-
-        SELECT * FROM productinfo
+        SELECT *
+        FROM productinfo
         <where>
             <if test="tyshxydm != '' and tyshxydm != null">
                 AND tyshxydm = #{tyshxydm}
             </if>
             <if test="cpmctymc != '' and cpmctymc != null">
-                AND cpmctymc LIKE concat(#{cpmctymc},'%')
+                AND cpmctymc LIKE concat(#{cpmctymc}, '%')
             </if>
             <if test="nameCode != '' and nameCode != null">
-                AND nameCode LIKE concat(#{nameCode},'%')
+                AND nameCode LIKE concat(#{nameCode}, '%')
             </if>
             <if test="uuid != '' and uuid != null">
                 AND uuid = #{uuid}
@@ -161,64 +167,67 @@
 
     <select id="filterUuidByCreditNo" parameterType="com.glxp.udidl.admin.req.ProductInfoFilterRequest"
             resultType="java.lang.String">
-
-        select p.uuid from productinfo p INNER JOIN
-        (select deviceRecordKey ,max(versionNumber) versionNumber from productinfo
+        select p.uuid from productinfo p
+                INNER JOIN
+                (select deviceRecordKey, max(versionNumber) versionNumber
+                 from productinfo
 
         <where>
             <if test="tyshxydm != '' and tyshxydm != null">
                 AND tyshxydm = #{tyshxydm}
             </if>
             <if test="cpmctymc != '' and cpmctymc != null">
-                AND cpmctymc LIKE concat(#{cpmctymc},'%')
+                AND cpmctymc LIKE concat(#{cpmctymc}, '%')
             </if>
             <if test="nameCode != '' and nameCode != null">
-                AND nameCode LIKE concat(#{nameCode},'%')
+                AND nameCode LIKE concat(#{nameCode}, '%')
             </if>
             <if test="uuid != '' and uuid != null">
                 AND uuid = #{uuid}
             </if>
         </where>
         GROUP BY deviceRecordKey)
-        a on p.deviceRecordKey = a.deviceRecordKey and p.versionNumber = a.versionNumber
-        group by uuid
+                a on p.deviceRecordKey = a.deviceRecordKey and p.versionNumber = a.versionNumber
+                group by uuid
     </select>
     <select id="filterUdi" parameterType="com.glxp.udidl.admin.req.ProductInfoFilterRequest"
             resultType="com.glxp.udidl.admin.entity.udi.ProductInfoEntity">
-
-        select * from productinfo
+        select *
+        from productinfo
         <where>
             <if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
-                AND ylqxzcrbarmc= #{ylqxzcrbarmc}
+                AND ylqxzcrbarmc = #{ylqxzcrbarmc}
             </if>
 
             <if test="ylqxzcrbarmc == null and cpmctymc != '' and cpmctymc != null">
-                AND cpmctymc LIKE concat(#{cpmctymc},'%')
+                AND cpmctymc LIKE concat(#{cpmctymc}, '%')
             </if>
 
             <if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null and cpmctymc != '' and cpmctymc != null">
-                AND cpmctymc LIKE concat('%',#{cpmctymc},'%')
+                AND cpmctymc LIKE concat('%', #{cpmctymc}, '%')
             </if>
             <if test="nameCode != '' and nameCode != null">
-                AND nameCode LIKE concat(#{nameCode},'%')
+                AND nameCode LIKE concat(#{nameCode}, '%')
             </if>
             <if test="uuid != '' and uuid != null">
                 AND uuid = #{uuid}
             </if>
             <if test="ggxh != '' and ggxh != null">
-                AND ggxh LIKE concat('%',#{ggxh},'%')
+                AND ggxh LIKE concat('%', #{ggxh}, '%')
             </if>
             <if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
-                AND zczbhhzbapzbh LIKE concat('%',#{zczbhhzbapzbh},'%')
+                AND zczbhhzbapzbh LIKE concat('%', #{zczbhhzbapzbh}, '%')
             </if>
 
             <if test="deviceRecordKey != '' and deviceRecordKey != null">
                 AND deviceRecordKey = #{deviceRecordKey}
             </if>
-            <if test="updateTime!=null and updateTime!=''">
-                <![CDATA[   and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>=  DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')   ]]>
+            <if test="updateTime != null and updateTime != ''">
+                <![CDATA[
+                and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')
+                ]]>
             </if>
-            <if test="isNewest != null and isNewest!=''">
+            <if test="isNewest != null and isNewest != ''">
                 AND isNewest = #{isNewest}
             </if>
             <if test="diType != '' and diType != null">
@@ -226,34 +235,78 @@
             </if>
         </where>
     </select>
-
     <select id="selectByUpdateTime"
             resultType="com.glxp.udidl.admin.entity.udi.ProductInfoEntity">
-        select * from productinfo where
- <![CDATA[   DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>=  DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S')   ]]>
+        select *
+        from productinfo
+        where
+ <![CDATA[   DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S')   ]]>
         and
-  <![CDATA[   DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')<=  DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%S')   ]]>
+  <![CDATA[   DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%S')
+        ]]>
     </select>
+    <!--<select id="filterUdi" parameterType="com.glxp.udidl.admin.req.ProductInfoFilterRequest"-->
+    <!--resultType="com.glxp.udidl.admin.entity.udi.ProductInfoEntity">-->
+    <!--&#45;&#45;         GROUP BY deviceRecordKey-->
+    <!--select p.* from productinfo p INNER JOIN-->
+    <!--(select deviceRecordKey ,max(versionNumber) versionNumber from productinfo-->
+    <!--<where>-->
+
+    <!--<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">-->
+    <!--AND ylqxzcrbarmc= #{ylqxzcrbarmc}-->
+    <!--</if>-->
+
+    <!--<if test="ylqxzcrbarmc == '' and ylqxzcrbarmc == null and cpmctymc != '' and cpmctymc != null">-->
+    <!--AND cpmctymc LIKE concat(#{cpmctymc},'%')-->
+    <!--</if>-->
+
+    <!--<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null and cpmctymc != '' and cpmctymc != null">-->
+    <!--AND cpmctymc LIKE concat('%',#{cpmctymc},'%')-->
+    <!--</if>-->
+    <!--<if test="nameCode != '' and nameCode != null">-->
+    <!--AND nameCode LIKE concat(#{nameCode},'%')-->
+    <!--</if>-->
+    <!--<if test="uuid != '' and uuid != null">-->
+    <!--AND uuid = #{uuid}-->
+    <!--</if>-->
+    <!--<if test="ggxh != '' and ggxh != null">-->
+    <!--AND ggxh LIKE concat('%',#{ggxh},'%')-->
+    <!--</if>-->
+    <!--<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">-->
+    <!--AND zczbhhzbapzbh LIKE concat('%',#{zczbhhzbapzbh},'%')-->
+    <!--</if>-->
+
+    <!--<if test="deviceRecordKey != '' and deviceRecordKey != null">-->
+    <!--AND deviceRecordKey = #{deviceRecordKey}-->
+    <!--</if>-->
+    <!--<if test="updateTime!=null and updateTime!=''">-->
+    <!--<![CDATA[   and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>=  DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')   ]]>-->
+    <!--</if>-->
+    <!--</where>-->
+    <!--GROUP BY deviceRecordKey)-->
+    <!--a on p.deviceRecordKey = a.deviceRecordKey and p.versionNumber = a.versionNumber-->
+
+    <!--</select>-->
 
     <select id="syncDlUdi" parameterType="com.glxp.udidl.admin.req.ProductInfoFilterRequest"
             resultType="com.glxp.udidl.admin.entity.udi.ProductInfoEntity">
-
-        SELECT * FROM productinfo
+        SELECT *
+        FROM productinfo
         <where>
             <if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
-                AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc},'%')
+                AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc}, '%')
             </if>
             <if test="cpmctymc != '' and cpmctymc != null">
-                AND cpmctymc LIKE concat(#{cpmctymc},'%')
+                AND cpmctymc LIKE concat(#{cpmctymc}, '%')
             </if>
             <if test="nameCode != '' and nameCode != null">
-                AND nameCode LIKE concat(#{nameCode},'%')
+                AND nameCode LIKE concat(#{nameCode}, '%')
             </if>
             <if test="uuid != '' and uuid != null">
                 AND uuid = #{uuid}
             </if>
             <if test="ggxh != '' and ggxh != null">
-                AND ggxh LIKE concat('%',#{ggxh},'%')
+                AND ggxh LIKE concat('%', #{ggxh}, '%')
             </if>
             <if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
                 AND zczbhhzbapzbh = #{zczbhhzbapzbh}
@@ -261,8 +314,10 @@
             <if test="deviceRecordKey != '' and deviceRecordKey != null">
                 AND deviceRecordKey = #{deviceRecordKey}
             </if>
-            <if test="updateTime!=null and updateTime!=''">
-                <![CDATA[   and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>=  DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')   ]]>
+            <if test="updateTime != null and updateTime != ''">
+                <![CDATA[
+                and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')
+                ]]>
             </if>
         </where>
         limit #{page},#{limit}
@@ -271,54 +326,51 @@
 
     <insert id="insertProductInfo" keyProperty="id" parameterType="com.glxp.udidl.admin.entity.udi.ProductInfoEntity">
         REPLACE
-        INTO productinfo
-        (
-        nameCode,packRatio,packLevel,bhxjsl,
-        bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,thirdProductNo,addType,deviceRecordKey,isUseDy,thirdProductName,
-        cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber
-        ,diType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,
-        ybbm,spmc,cphhhbh,cpms,cpbsbmtxmc,isNewest,updateTime
-        )
-        values
-            (
-        #{nameCode},
-        #{packRatio},
-        #{packLevel},
-        #{bhxjsl},
-        #{bhzxxsbzsl},
-        #{zxxsbzbhsydysl},
-        #{bhxjcpbm},
-        #{bzcj},
-        #{thirdProductNo},
-        #{addType},
-        #{deviceRecordKey},
-        #{isUseDy},
-        #{thirdProductName},
-        #{cpmctymc},
-        #{cplb},
-        #{flbm},
-        #{ggxh},
-        #{qxlb},
-        #{tyshxydm},
-        #{ylqxzcrbarmc},
-        #{zczbhhzbapzbh},
-        #{ylqxzcrbarywmc},
-        #{uuid},
-        #{sjcpbm},
-        #{versionNumber},
-        #{diType},
-        #{scbssfbhph},
-        #{scbssfbhxlh},
-        #{scbssfbhscrq},
-        #{scbssfbhsxrq},
-        #{ybbm},
-        #{spmc},
-        #{cphhhbh},
-        #{cpms},
-        #{cpbsbmtxmc},
-        #{isNewest},
-        #{updateTime}
-        )
+                INTO productinfo
+                (nameCode, packRatio, packLevel, bhxjsl,
+                 bhzxxsbzsl, zxxsbzbhsydysl, bhxjcpbm, bzcj, thirdProductNo, addType, deviceRecordKey, isUseDy,
+                 thirdProductName,
+                 cpmctymc, cplb, flbm, ggxh, qxlb, tyshxydm, ylqxzcrbarmc, zczbhhzbapzbh, ylqxzcrbarywmc, uuid, sjcpbm,
+                 versionNumber
+                        , diType, scbssfbhph, scbssfbhxlh, scbssfbhscrq, scbssfbhsxrq,
+                 ybbm, spmc, cphhhbh, cpms, cpbsbmtxmc, isNewest, updateTime, hchzsb, cplx)
+        values (#{nameCode},
+                #{packRatio},
+                #{packLevel},
+                #{bhxjsl},
+                #{bhzxxsbzsl},
+                #{zxxsbzbhsydysl},
+                #{bhxjcpbm},
+                #{bzcj},
+                #{thirdProductNo},
+                #{addType},
+                #{deviceRecordKey},
+                #{isUseDy},
+                #{thirdProductName},
+                #{cpmctymc},
+                #{cplb},
+                #{flbm},
+                #{ggxh},
+                #{qxlb},
+                #{tyshxydm},
+                #{ylqxzcrbarmc},
+                #{zczbhhzbapzbh},
+                #{ylqxzcrbarywmc},
+                #{uuid},
+                #{sjcpbm},
+                #{versionNumber},
+                #{diType},
+                #{scbssfbhph},
+                #{scbssfbhxlh},
+                #{scbssfbhscrq},
+                #{scbssfbhsxrq},
+                #{ybbm},
+                #{spmc},
+                #{cphhhbh},
+                #{cpms},
+                #{cpbsbmtxmc},
+                #{isNewest},
+                #{updateTime}, #{hchzsb}, #{cplx})
     </insert>
 
     <delete id="deleteById" parameterType="Map">
@@ -328,7 +380,8 @@
     </delete>
 
     <delete id="deleteAll" parameterType="java.util.List">
-        DELETE FROM productinfo WHERE thirdProductNo in
+        DELETE
+        FROM productinfo WHERE thirdProductNo in
         <foreach collection="ids" item="item" open="(" separator="," close=")">
             #{item}
         </foreach>
@@ -337,33 +390,93 @@
     <update id="updateProductInfo" parameterType="com.glxp.udidl.admin.entity.udi.ProductInfoEntity">
         UPDATE productinfo
         <set>
-            <if test="nameCode != null">nameCode=#{nameCode},</if>
-            <if test="packRatio != null">packRatio=#{packRatio},</if>
-            <if test="packLevel != null">packLevel=#{packLevel},</if>
-            <if test="bhxjsl != null">bhxjsl=#{bhxjsl},</if>
-            <if test="bhzxxsbzsl != null">bhzxxsbzsl=#{bhzxxsbzsl},</if>
-            <if test="zxxsbzbhsydysl != null">zxxsbzbhsydysl=#{zxxsbzbhsydysl},</if>
-            <if test="bhxjcpbm != null">bhxjcpbm=#{bhxjcpbm},</if>
-            <if test="bzcj != null">bzcj=#{bzcj},</if>
-            <if test="thirdProductNo != null">thirdProductNo=#{thirdProductNo},</if>
-            <if test="addType != null">addType=#{addType},</if>
-            <if test="deviceRecordKey != null">deviceRecordKey=#{deviceRecordKey},</if>
-            <if test="isUseDy != null">isUseDy=#{isUseDy},</if>
-            <if test="thirdProductName != null">thirdProductName=#{thirdProductName},</if>
-            <if test="cpmctymc != null">cpmctymc=#{cpmctymc},</if>
-            <if test="cplb != null">cplb=#{cplb},</if>
-            <if test="flbm != null">flbm=#{flbm},</if>
-            <if test="ggxh != null">ggxh=#{ggxh},</if>
-            <if test="qxlb != null">qxlb=#{qxlb},</if>
-            <if test="tyshxydm != null">tyshxydm=#{tyshxydm},</if>
-            <if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if>
-            <if test="ylqxzcrbarywmc != null">ylqxzcrbarywmc=#{ylqxzcrbarywmc},</if>
-            <if test="uuid != null">uuid=#{uuid},</if>
-            <if test="sjcpbm != null">sjcpbm=#{sjcpbm},</if>
-            <if test="versionNumber != null">versionNumber=#{versionNumber},</if>
-            <if test="diType != null">diType=#{diType},</if>
-            <if test="isNewest != null">isNewest=#{isNewest},</if>
-            <if test="updateTime != null">updateTime=#{updateTime},</if>
+            <if test="nameCode != null">
+                nameCode=#{nameCode},
+            </if>
+            <if test="packRatio != null">
+                packRatio=#{packRatio},
+            </if>
+            <if test="packLevel != null">
+                packLevel=#{packLevel},
+            </if>
+            <if test="bhxjsl != null">
+                bhxjsl=#{bhxjsl},
+            </if>
+            <if test="bhzxxsbzsl != null">
+                bhzxxsbzsl=#{bhzxxsbzsl},
+            </if>
+            <if test="zxxsbzbhsydysl != null">
+                zxxsbzbhsydysl=#{zxxsbzbhsydysl},
+            </if>
+            <if test="bhxjcpbm != null">
+                bhxjcpbm=#{bhxjcpbm},
+            </if>
+            <if test="bzcj != null">
+                bzcj=#{bzcj},
+            </if>
+            <if test="thirdProductNo != null">
+                thirdProductNo=#{thirdProductNo},
+            </if>
+            <if test="addType != null">
+                addType=#{addType},
+            </if>
+            <if test="deviceRecordKey != null">
+                deviceRecordKey=#{deviceRecordKey},
+            </if>
+            <if test="isUseDy != null">
+                isUseDy=#{isUseDy},
+            </if>
+            <if test="thirdProductName != null">
+                thirdProductName=#{thirdProductName},
+            </if>
+            <if test="cpmctymc != null">
+                cpmctymc=#{cpmctymc},
+            </if>
+            <if test="cplb != null">
+                cplb=#{cplb},
+            </if>
+            <if test="flbm != null">
+                flbm=#{flbm},
+            </if>
+            <if test="ggxh != null">
+                ggxh=#{ggxh},
+            </if>
+            <if test="qxlb != null">
+                qxlb=#{qxlb},
+            </if>
+            <if test="tyshxydm != null">
+                tyshxydm=#{tyshxydm},
+            </if>
+            <if test="ylqxzcrbarmc != null">
+                ylqxzcrbarmc=#{ylqxzcrbarmc},
+            </if>
+            <if test="ylqxzcrbarywmc != null">
+                ylqxzcrbarywmc=#{ylqxzcrbarywmc},
+            </if>
+            <if test="uuid != null">
+                uuid=#{uuid},
+            </if>
+            <if test="sjcpbm != null">
+                sjcpbm=#{sjcpbm},
+            </if>
+            <if test="versionNumber != null">
+                versionNumber=#{versionNumber},
+            </if>
+            <if test="diType != null">
+                diType=#{diType},
+            </if>
+            <if test="isNewest != null">
+                isNewest=#{isNewest},
+            </if>
+            <if test="updateTime != null">
+                updateTime=#{updateTime},
+            </if>
+            <if test="hchzsb != null">
+                hchzsb=#{hchzsb},
+            </if>
+            <if test="cplx != null">
+                cplx=#{cplx},
+            </if>
         </set>
         WHERE id = #{id}
     </update>
@@ -371,17 +484,45 @@
     <update id="updateProductByUuid" parameterType="com.glxp.udidl.admin.entity.udi.ProductInfoEntity">
         UPDATE productinfo
         <set>
-            <if test="scbssfbhph != null">scbssfbhph=#{scbssfbhph},</if>
-            <if test="scbssfbhxlh != null">scbssfbhxlh=#{scbssfbhxlh},</if>
-            <if test="scbssfbhscrq != null">scbssfbhscrq=#{scbssfbhscrq},</if>
-            <if test="scbssfbhsxrq != null">scbssfbhsxrq=#{scbssfbhsxrq},</if>
-            <if test="ybbm != null">ybbm=#{ybbm},</if>
-            <if test="spmc != null">spmc=#{spmc},</if>
-            <if test="cphhhbh != null">cphhhbh=#{cphhhbh},</if>
-            <if test="cpms != null">cpms=#{cpms},</if>
-            <if test="cpbsbmtxmc != null">cpbsbmtxmc=#{cpbsbmtxmc},</if>
-            <if test="isNewest != null">isNewest=#{isNewest},</if>
-            <if test="updateTime != null">updateTime=#{updateTime},</if>
+            <if test="scbssfbhph != null">
+                scbssfbhph=#{scbssfbhph},
+            </if>
+            <if test="scbssfbhxlh != null">
+                scbssfbhxlh=#{scbssfbhxlh},
+            </if>
+            <if test="scbssfbhscrq != null">
+                scbssfbhscrq=#{scbssfbhscrq},
+            </if>
+            <if test="scbssfbhsxrq != null">
+                scbssfbhsxrq=#{scbssfbhsxrq},
+            </if>
+            <if test="ybbm != null">
+                ybbm=#{ybbm},
+            </if>
+            <if test="spmc != null">
+                spmc=#{spmc},
+            </if>
+            <if test="cphhhbh != null">
+                cphhhbh=#{cphhhbh},
+            </if>
+            <if test="cpms != null">
+                cpms=#{cpms},
+            </if>
+            <if test="cpbsbmtxmc != null">
+                cpbsbmtxmc=#{cpbsbmtxmc},
+            </if>
+            <if test="isNewest != null">
+                isNewest=#{isNewest},
+            </if>
+            <if test="updateTime != null">
+                updateTime=#{updateTime},
+            </if>
+            <if test="hchzsb != null">
+                hchzsb=#{hchzsb},
+            </if>
+            <if test="cplx != null">
+                cplx=#{cplx},
+            </if>
         </set>
         WHERE uuid = #{uuid}
     </update>
@@ -391,16 +532,33 @@
     <select id="findAllUuids" parameterType="com.glxp.udidl.admin.req.ListPageRequest" resultType="java.lang.String">
         SELECT uuid
         from device
-        group by uuid limit #{page}, #{limit}
+        group by uuid
+        limit #{page}, #{limit}
     </select>
-
     <select id="findAllTyshxyh" resultType="java.lang.String">
         SELECT tyshxydm
         from productinfo
         group by tyshxydm
     </select>
-
-    <select id="selectByDeviceRecordKey" resultType="com.glxp.udidl.admin.dto.device.ProductDetailModel" parameterType="java.lang.String">
-        select nameCode,cpmctymc,packLevel,bzcj from productinfo where isNewest=1 and deviceRecordKey=#{key}
+    <select id="selectByDeviceRecordKey" resultType="com.glxp.udidl.admin.dto.device.ProductDetailModel"
+            parameterType="java.lang.String">
+        select nameCode, cpmctymc, packLevel, bzcj
+        from productinfo
+        where isNewest = 1
+          and deviceRecordKey = #{key}
     </select>
+
+
+    <update id="updateCplx" parameterType="com.glxp.udidl.admin.entity.udi.ProductInfoEntity">
+        UPDATE productinfo
+        <set>
+            <if test="hchzsb != null">
+                hchzsb=#{hchzsb},
+            </if>
+            <if test="cplx != null">
+                cplx=#{cplx},
+            </if>
+        </set>
+        WHERE deviceRecordKey = #{deviceRecordKey}
+    </update>
 </mapper>
diff --git a/src/main/resources/mybatis/mapper/udi/UdiCompanyMapper.xml b/src/main/resources/mybatis/mapper/udi/UdiCompanyMapper.xml
index cc78d37..92609af 100644
--- a/src/main/resources/mybatis/mapper/udi/UdiCompanyMapper.xml
+++ b/src/main/resources/mybatis/mapper/udi/UdiCompanyMapper.xml
@@ -2,88 +2,107 @@
 <!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.udi.UdiCompanyMapper">
-
     <select id="selectAllTyshxyh"
             resultType="com.glxp.udidl.admin.entity.udi.UdiCompanyEntity">
-        SELECT deviceRecordKey,tyshxydm,ylqxzcrbarmc,ylqxzcrbarywmc FROM device
+        SELECT deviceRecordKey, tyshxydm, ylqxzcrbarmc, ylqxzcrbarywmc
+        FROM device
         GROUP BY tyshxydm
-
     </select>
 
     <select id="selectContactBykey" parameterType="Map"
             resultType="com.glxp.udidl.admin.entity.udid.Contactlist">
-        SELECT qylxrdh,qylxryx,qylxrcz from contactlist
-        WHERE deviceRecordKey =  #{deviceRecordKey}
+        SELECT qylxrdh, qylxryx, qylxrcz
+        from contactlist
+        WHERE deviceRecordKey = #{deviceRecordKey}
     </select>
 
     <select id="filterUdiCompany"
             parameterType="com.glxp.udidl.admin.req.UdiCompanyRequest"
             resultType="com.glxp.udidl.admin.entity.udi.UdiCompanyEntity">
-        SELECT * FROM udicompany
+        SELECT *
+        FROM udicompany
         <where>
             <if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
-                AND ylqxzcrbarmc LIKE concat('%',#{ylqxzcrbarmc},'%')
+                AND ylqxzcrbarmc LIKE concat('%', #{ylqxzcrbarmc}, '%')
             </if>
             <if test="tyshxydm != '' and tyshxydm != null">
-                AND tyshxydm =#{tyshxydm}
+                AND tyshxydm = #{tyshxydm}
             </if>
             <if test="provinceCode != '' and provinceCode != null">
-                AND SUBSTRING(tyshxydm,3,2) = #{provinceCode}
+                AND SUBSTRING(tyshxydm, 3, 2) = #{provinceCode}
             </if>
             <if test="cityCode != '' and cityCode != null">
-                AND SUBSTRING(tyshxydm,3,4) = #{cityCode}
+                AND SUBSTRING(tyshxydm, 3, 4) = #{cityCode}
             </if>
             <if test="areaCode != '' and areaCode != null">
-                AND SUBSTRING(tyshxydm,3,6) = #{areaCode}
+                AND SUBSTRING(tyshxydm, 3, 6) = #{areaCode}
             </if>
         </where>
+    </select>
 
+
+    <select id="syncDlCompany" parameterType="com.glxp.udidl.admin.req.UdiCompanyRequest"
+            resultType="com.glxp.udidl.admin.entity.udi.UdiCompanyEntity">
+        SELECT *
+        FROM udicompany
+        <where>
+            <if test="updateTime != null and updateTime != ''">
+                <![CDATA[
+                and DATE_FORMAT(updateTime
+                  , '%Y-%m-%d')>=  DATE_FORMAT(#{updateTime}
+                  , '%Y-%m-%d %H:%i:%S')
+                ]]>
+            </if>
+        </where>
+        limit #{page}
+                ,#{limit}
     </select>
+
+
     <select id="searchByName" parameterType="java.lang.String" resultType="java.lang.String">
-        select ylqxzcrbarmc from udicompany where ylqxzcrbarmc like concat('%',#{name},'%') limit 50
+        select ylqxzcrbarmc
+        from udicompany
+        where ylqxzcrbarmc like concat('%', #{name}, '%')
+        limit 50
     </select>
 
     <insert id="insertUdiCompany" keyProperty="id" parameterType="com.glxp.udidl.admin.entity.udi.UdiCompanyEntity">
-        REPLACE INTO udicompany
-        (
-        tyshxydm,ylqxzcrbarmc,ylqxzcrbarywmc,qylxrdh,
-        qylxrcz,qylxryx
-        )
-        values
-        (
-        #{tyshxydm},
-        #{ylqxzcrbarmc},
-        #{ylqxzcrbarywmc},
-        #{qylxrdh},
-        #{qylxrcz},
-        #{qylxryx}
-        )
+        REPLACE
+                INTO udicompany
+                (tyshxydm, ylqxzcrbarmc, ylqxzcrbarywmc, qylxrdh,
+                 qylxrcz, qylxryx, updateTime)
+        values (#{tyshxydm},
+                #{ylqxzcrbarmc},
+                #{ylqxzcrbarywmc},
+                #{qylxrdh},
+                #{qylxrcz},
+                #{qylxryx},
+                #{updateTime})
     </insert>
 
     <insert id="insertUdiCompanys" keyProperty="id" parameterType="com.glxp.udidl.admin.entity.udi.UdiCompanyEntity">
-        replace INTO udicompany(
-        tyshxydm,ylqxzcrbarmc,ylqxzcrbarywmc,qylxrdh,
-        qylxrcz,qylxryx)
-        values
+        replace INTO udicompany(tyshxydm, ylqxzcrbarmc, ylqxzcrbarywmc, qylxrdh,
+                                qylxrcz, qylxryx, updateTime)
+                values
         <foreach collection="udiCompanyEntities" item="item" index="index"
                  separator=",">
-
-            (
-            #{item.tyshxydm},
-            #{item.ylqxzcrbarmc},
-            #{item.ylqxzcrbarywmc},
-            #{item.qylxrdh},
-            #{item.qylxrcz},
-            #{item.qylxryx})
+            (#{item.tyshxydm},
+             #{item.ylqxzcrbarmc},
+             #{item.ylqxzcrbarywmc},
+             #{item.qylxrdh},
+             #{item.qylxrcz},
+             #{item.qylxryx}),#{item.updateTime}
         </foreach>
-
     </insert>
     <delete id="deleteById" parameterType="Map">
-        DELETE FROM udicompany  WHERE id =  #{id}
+        DELETE
+        FROM udicompany
+        WHERE id = #{id}
     </delete>
 
     <delete id="deleteAll" parameterType="java.util.List">
-        DELETE FROM udicompany WHERE id in
+        DELETE
+        FROM udicompany WHERE id in
         <foreach collection="ids" item="item" open="(" separator="," close=")">
             #{item}
         </foreach>
@@ -92,12 +111,27 @@
     <update id="updateUdiCompany" parameterType="com.glxp.udidl.admin.entity.udi.UdiCompanyEntity">
         UPDATE udicompany
         <set>
-            <if test="tyshxydm != null">tyshxydm=#{tyshxydm},</if>
-            <if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if>
-            <if test="ylqxzcrbarywmc != null">ylqxzcrbarywmc=#{ylqxzcrbarywmc},</if>
-            <if test="qylxrdh != null">qylxrdh=#{qylxrdh},</if>
-            <if test="qylxrcz != null">qylxrcz=#{qylxrcz},</if>
-            <if test="qylxryx != null">qylxryx=#{qylxryx},</if>
+            <if test="tyshxydm != null">
+                tyshxydm=#{tyshxydm},
+            </if>
+            <if test="ylqxzcrbarmc != null">
+                ylqxzcrbarmc=#{ylqxzcrbarmc},
+            </if>
+            <if test="ylqxzcrbarywmc != null">
+                ylqxzcrbarywmc=#{ylqxzcrbarywmc},
+            </if>
+            <if test="qylxrdh != null">
+                qylxrdh=#{qylxrdh},
+            </if>
+            <if test="qylxrcz != null">
+                qylxrcz=#{qylxrcz},
+            </if>
+            <if test="qylxryx != null">
+                qylxryx=#{qylxryx},
+            </if>
+            <if test="updateTime != null">
+                updateTime=#{updateTime},
+            </if>
         </set>
         WHERE id = #{id}
     </update>
diff --git a/src/main/resources/mybatis/mapper/udid/DeviceMapper.xml b/src/main/resources/mybatis/mapper/udid/DeviceMapper.xml
index 665efe5..e68d22f 100644
--- a/src/main/resources/mybatis/mapper/udid/DeviceMapper.xml
+++ b/src/main/resources/mybatis/mapper/udid/DeviceMapper.xml
@@ -16,6 +16,7 @@
         <result column="flbm" jdbcType="VARCHAR" property="flbm"/>
         <result column="ggxh" jdbcType="VARCHAR" property="ggxh"/>
         <result column="mjfs" jdbcType="VARCHAR" property="mjfs"/>
+        <result column="hchzsb" jdbcType="VARCHAR" property="hchzsb"/>
         <result column="qtxxdwzlj" jdbcType="VARCHAR" property="qtxxdwzlj"/>
         <result column="qxlb" jdbcType="VARCHAR" property="qxlb"/>
         <result column="scbssfbhph" jdbcType="VARCHAR" property="scbssfbhph"/>
@@ -49,6 +50,7 @@
         <result column="zxxsdyzsydydsl" jdbcType="VARCHAR" property="zxxsdyzsydydsl"/>
         <result column="deviceHistoryRecordKey" jdbcType="VARCHAR" property="devicehistoryrecordkey"/>
         <result column="bssjzt" jdbcType="VARCHAR" property="bssjzt"/>
+        <result column="cplx" jdbcType="VARCHAR" property="cplx"/>
     </resultMap>
     <sql id="Example_Where_Clause">
         <where>
@@ -111,14 +113,16 @@
         </where>
     </sql>
     <sql id="Base_Column_List">
-    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
-  </sql>
-    <select id="selectByExample" parameterType="com.glxp.udidl.admin.entity.udid.DeviceExample" resultMap="BaseResultMap">
+        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,hchzsb,cplx
+    </sql>
+    <select id="selectByExample" parameterType="com.glxp.udidl.admin.entity.udid.DeviceExample"
+            resultMap="BaseResultMap">
         select
         <if test="distinct">
             distinct
@@ -139,9 +143,10 @@
         where uuid = #{uuid,jdbcType=VARCHAR}
     </select>
     <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
-    delete from device
-    where uuid = #{uuid,jdbcType=VARCHAR}
-  </delete>
+        delete
+        from device
+        where uuid = #{uuid,jdbcType=VARCHAR}
+    </delete>
     <delete id="deleteByExample" parameterType="com.glxp.udidl.admin.entity.udid.DeviceExample">
         delete from device
         <if test="_parameter != null">
@@ -149,39 +154,41 @@
         </if>
     </delete>
     <insert id="insert" parameterType="com.glxp.udidl.admin.entity.udid.Device">
-    insert 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)
-    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})
-  </insert>
+        insert 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>
     <insert id="insertSelective" parameterType="com.glxp.udidl.admin.entity.udid.Device">
         insert into device
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -326,6 +333,10 @@
             <if test="bssjzt != null">
                 bssjzt,
             </if>
+            <if test="hchzsb != null">
+                hchzsb,
+            </if>
+
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="uuid != null">
@@ -469,6 +480,10 @@
             <if test="bssjzt != null">
                 #{bssjzt,jdbcType=VARCHAR},
             </if>
+            <if test="hchzsb != null">
+                #{hchzsb,jdbcType=VARCHAR},
+            </if>
+
         </trim>
     </insert>
     <select id="countByExample" parameterType="com.glxp.udidl.admin.entity.udid.DeviceExample"
@@ -821,67 +836,78 @@
             <if test="bssjzt != null">
                 bssjzt = #{bssjzt,jdbcType=VARCHAR},
             </if>
+            <if test="hchzsb != null">
+                hchzsb = #{bssjzt,jdbcType=VARCHAR},
+            </if>
+
         </set>
         where uuid = #{uuid,jdbcType=VARCHAR}
     </update>
     <update id="updateByPrimaryKey" parameterType="com.glxp.udidl.admin.entity.udid.Device">
-    update device
-    set deviceRecordKey = #{devicerecordkey,jdbcType=VARCHAR},
-      btcpbs = #{btcpbs,jdbcType=VARCHAR},
-      btcpbsyzxxsdycpbssfyz = #{btcpbsyzxxsdycpbssfyz,jdbcType=VARCHAR},
-      cgzmraqxgxx = #{cgzmraqxgxx,jdbcType=VARCHAR},
-      cpbsbmtxmc = #{cpbsbmtxmc,jdbcType=VARCHAR},
-      cpbsfbrq = #{cpbsfbrq,jdbcType=VARCHAR},
-      cphhhbh = #{cphhhbh,jdbcType=VARCHAR},
-      cplb = #{cplb,jdbcType=VARCHAR},
-      cpmctymc = #{cpmctymc,jdbcType=VARCHAR},
-      cpms = #{cpms,jdbcType=VARCHAR},
-      flbm = #{flbm,jdbcType=VARCHAR},
-      ggxh = #{ggxh,jdbcType=VARCHAR},
-      mjfs = #{mjfs,jdbcType=VARCHAR},
-      qtxxdwzlj = #{qtxxdwzlj,jdbcType=VARCHAR},
-      qxlb = #{qxlb,jdbcType=VARCHAR},
-      scbssfbhph = #{scbssfbhph,jdbcType=VARCHAR},
-      scbssfbhscrq = #{scbssfbhscrq,jdbcType=VARCHAR},
-      scbssfbhsxrq = #{scbssfbhsxrq,jdbcType=VARCHAR},
-      scbssfbhxlh = #{scbssfbhxlh,jdbcType=VARCHAR},
-      sfbjwycxsy = #{sfbjwycxsy,jdbcType=VARCHAR},
-      sfwblztlcp = #{sfwblztlcp,jdbcType=VARCHAR},
-      sfwwjbz = #{sfwwjbz,jdbcType=VARCHAR},
-      sfybtzjbs = #{sfybtzjbs,jdbcType=VARCHAR},
-      spmc = #{spmc,jdbcType=VARCHAR},
-      sydycpbs = #{sydycpbs,jdbcType=VARCHAR},
-      syqsfxyjxmj = #{syqsfxyjxmj,jdbcType=VARCHAR},
-      tscchcztj = #{tscchcztj,jdbcType=VARCHAR},
-      tsccsm = #{tsccsm,jdbcType=VARCHAR},
-      tsrq = #{tsrq,jdbcType=VARCHAR},
-      tyshxydm = #{tyshxydm,jdbcType=VARCHAR},
-      versionNumber = #{versionnumber,jdbcType=VARCHAR},
-      versionStatus = #{versionstatus,jdbcType=VARCHAR},
-      versionTime = #{versiontime,jdbcType=VARCHAR},
-      ybbm = #{ybbm,jdbcType=VARCHAR},
-      yflbm = #{yflbm,jdbcType=VARCHAR},
-      ylqxzcrbarmc = #{ylqxzcrbarmc,jdbcType=VARCHAR},
-      ylqxzcrbarywmc = #{ylqxzcrbarywmc,jdbcType=VARCHAR},
-      zczbhhzbapzbh = #{zczbhhzbapzbh,jdbcType=VARCHAR},
-      zdcfsycs = #{zdcfsycs,jdbcType=VARCHAR},
-      zxxsdycpbs = #{zxxsdycpbs,jdbcType=VARCHAR},
-      bszt = #{bszt,jdbcType=VARCHAR},
-      sfyzcbayz = #{sfyzcbayz,jdbcType=VARCHAR},
-      zcbacpbs = #{zcbacpbs,jdbcType=VARCHAR},
-      zxxsdyzsydydsl = #{zxxsdyzsydydsl,jdbcType=VARCHAR},
-      deviceHistoryRecordKey = #{devicehistoryrecordkey,jdbcType=VARCHAR},
-      bssjzt = #{bssjzt,jdbcType=VARCHAR}
-    where uuid = #{uuid,jdbcType=VARCHAR}
-  </update>
+        update device
+        set deviceRecordKey        = #{devicerecordkey,jdbcType=VARCHAR},
+            btcpbs                 = #{btcpbs,jdbcType=VARCHAR},
+            btcpbsyzxxsdycpbssfyz  = #{btcpbsyzxxsdycpbssfyz,jdbcType=VARCHAR},
+            cgzmraqxgxx            = #{cgzmraqxgxx,jdbcType=VARCHAR},
+            cpbsbmtxmc             = #{cpbsbmtxmc,jdbcType=VARCHAR},
+            cpbsfbrq               = #{cpbsfbrq,jdbcType=VARCHAR},
+            cphhhbh                = #{cphhhbh,jdbcType=VARCHAR},
+            cplb                   = #{cplb,jdbcType=VARCHAR},
+            cpmctymc               = #{cpmctymc,jdbcType=VARCHAR},
+            cpms                   = #{cpms,jdbcType=VARCHAR},
+            flbm                   = #{flbm,jdbcType=VARCHAR},
+            ggxh                   = #{ggxh,jdbcType=VARCHAR},
+            mjfs                   = #{mjfs,jdbcType=VARCHAR},
+            qtxxdwzlj              = #{qtxxdwzlj,jdbcType=VARCHAR},
+            qxlb                   = #{qxlb,jdbcType=VARCHAR},
+            scbssfbhph             = #{scbssfbhph,jdbcType=VARCHAR},
+            scbssfbhscrq           = #{scbssfbhscrq,jdbcType=VARCHAR},
+            scbssfbhsxrq           = #{scbssfbhsxrq,jdbcType=VARCHAR},
+            scbssfbhxlh            = #{scbssfbhxlh,jdbcType=VARCHAR},
+            sfbjwycxsy             = #{sfbjwycxsy,jdbcType=VARCHAR},
+            sfwblztlcp             = #{sfwblztlcp,jdbcType=VARCHAR},
+            sfwwjbz                = #{sfwwjbz,jdbcType=VARCHAR},
+            sfybtzjbs              = #{sfybtzjbs,jdbcType=VARCHAR},
+            spmc                   = #{spmc,jdbcType=VARCHAR},
+            sydycpbs               = #{sydycpbs,jdbcType=VARCHAR},
+            syqsfxyjxmj            = #{syqsfxyjxmj,jdbcType=VARCHAR},
+            tscchcztj              = #{tscchcztj,jdbcType=VARCHAR},
+            tsccsm                 = #{tsccsm,jdbcType=VARCHAR},
+            tsrq                   = #{tsrq,jdbcType=VARCHAR},
+            tyshxydm               = #{tyshxydm,jdbcType=VARCHAR},
+            versionNumber          = #{versionnumber,jdbcType=VARCHAR},
+            versionStatus          = #{versionstatus,jdbcType=VARCHAR},
+            versionTime            = #{versiontime,jdbcType=VARCHAR},
+            ybbm                   = #{ybbm,jdbcType=VARCHAR},
+            yflbm                  = #{yflbm,jdbcType=VARCHAR},
+            ylqxzcrbarmc           = #{ylqxzcrbarmc,jdbcType=VARCHAR},
+            ylqxzcrbarywmc         = #{ylqxzcrbarywmc,jdbcType=VARCHAR},
+            zczbhhzbapzbh          = #{zczbhhzbapzbh,jdbcType=VARCHAR},
+            zdcfsycs               = #{zdcfsycs,jdbcType=VARCHAR},
+            zxxsdycpbs             = #{zxxsdycpbs,jdbcType=VARCHAR},
+            bszt                   = #{bszt,jdbcType=VARCHAR},
+            sfyzcbayz              = #{sfyzcbayz,jdbcType=VARCHAR},
+            zcbacpbs               = #{zcbacpbs,jdbcType=VARCHAR},
+            zxxsdyzsydydsl         = #{zxxsdyzsydydsl,jdbcType=VARCHAR},
+            deviceHistoryRecordKey = #{devicehistoryrecordkey,jdbcType=VARCHAR},
+            bssjzt                 = #{bssjzt,jdbcType=VARCHAR}
+            hchzsb                 = #{hchzsb,jdbcType=VARCHAR}
+
+        where uuid = #{uuid,jdbcType=VARCHAR}
+    </update>
 
     <select id="searchBykey" parameterType="com.glxp.udidl.admin.req.udid.DeviceListRequest" resultMap="BaseResultMap">
-      select * from  device WHERE ( zxxsdycpbs like concat(#{key},'%')  or cpmctymc like concat(#{key},'%') ) limit #{page},#{limit}
+        select *
+        from device
+        WHERE (zxxsdycpbs like concat(#{key}, '%') or cpmctymc like concat(#{key}, '%')) limit #{page}
+            , #{limit}
     </select>
 
 
     <select id="searchByBs" parameterType="Map" resultType="com.glxp.udidl.admin.entity.udid.Device">
-      SELECT * FROM device WHERE `zxxsdycpbs`= #{zxxsdycpbs}
+        SELECT *
+        FROM device
+        WHERE `zxxsdycpbs` = #{zxxsdycpbs}
     </select>
 
     <select id="search" parameterType="com.glxp.udidl.admin.req.udid.DeviceSearchRequest" resultMap="BaseResultMap">
@@ -931,42 +957,71 @@
         </where>
     </select>
     <delete id="deleteHistory" parameterType="Map">
-        DELETE FROM device  WHERE deviceRecordKey =  #{deviceRecordKey}
+        DELETE
+        FROM device
+        WHERE deviceRecordKey = #{deviceRecordKey}
     </delete>
 
     <select id="searchByDeviceRecordKey" parameterType="Map" resultType="com.glxp.udidl.admin.entity.udid.Device">
-     SELECT * from device WHERE deviceRecordKey = #{deviceRecordKey} ORDER BY versionNumber DESC LIMIT 1
+        SELECT *
+        from device
+        WHERE deviceRecordKey = #{deviceRecordKey}
+        ORDER BY versionNumber DESC LIMIT 1
     </select>
 
     <select id="searchByZxxscpbs" parameterType="Map" resultType="com.glxp.udidl.admin.entity.udid.Device">
-     SELECT * from device
+        SELECT *
+        from device
 
-     WHERE zxxsdycpbs = #{zxxsdycpbs}
+        WHERE zxxsdycpbs = #{zxxsdycpbs}
 
-     ORDER BY versionNumber DESC LIMIT 1
+        ORDER BY versionNumber DESC LIMIT 1
     </select>
     <select id="searchHistory" parameterType="Map" resultType="com.glxp.udidl.admin.entity.udid.Device">
-     SELECT * from device WHERE deviceRecordKey = #{deviceRecordKey}
+        SELECT *
+        from device
+        WHERE deviceRecordKey = #{deviceRecordKey}
     </select>
 
     <select id="selectisSame" parameterType="Map" resultType="java.lang.String">
-     SELECT uuid from device WHERE deviceRecordKey = #{deviceRecordKey} and versionNumber = #{versionNumber} limit 1
+        SELECT uuid
+        from device
+        WHERE deviceRecordKey = #{deviceRecordKey}
+          and versionNumber = #{versionNumber} limit 1
     </select>
 
     <select id="selectKey" parameterType="Map" resultType="java.lang.String">
-     SELECT uuid from device WHERE zxxsdycpbs = #{zxxsdycpbs}  limit 1
+        SELECT uuid
+        from device
+        WHERE zxxsdycpbs = #{zxxsdycpbs} limit 1
     </select>
 
-    <select id="findAllByZxxscpbs"  resultType="java.lang.String">
-     SELECT uuid from device
+    <select id="findAllByZxxscpbs" resultType="java.lang.String">
+        SELECT uuid
+        from device
     </select>
 
-    <select id="findAllByZxxscpbsPage"  parameterType="com.glxp.udidl.admin.req.ListPageRequest" resultType="java.lang.String">
-     SELECT uuid from device   limit #{page},#{limit}
+
+    <select id="findAllByZxxscpbsPage" parameterType="com.glxp.udidl.admin.req.ListPageRequest"
+            resultType="java.lang.String">
+        SELECT uuid
+        from device limit #{page},#{limit}
     </select>
 
+
     <select id="downloadDevice" parameterType="com.glxp.udidl.admin.req.DownloadUdiRequest" resultMap="BaseResultMap">
-        select * from device
-        limit #{page},#{limit}
+        select *
+        from device limit #{page},#{limit}
     </select>
+
+
+    <update id="updateCplx" parameterType="com.glxp.udidl.admin.entity.udid.Device">
+        UPDATE device
+        <set>
+            <if test="hchzsb != null">hchzsb=#{hchzsb},</if>
+            <if test="cplx != null">cplx=#{cplx},</if>
+        </set>
+        WHERE devicerecordkey=#{devicerecordkey}
+    </update>
+
 </mapper>
\ No newline at end of file