diff --git a/app/src/main/java/com/casic/detector/bean/LabelBean.java b/app/src/main/java/com/casic/detector/bean/LabelBean.java deleted file mode 100644 index d22d835..0000000 --- a/app/src/main/java/com/casic/detector/bean/LabelBean.java +++ /dev/null @@ -1,321 +0,0 @@ -package com.casic.detector.bean; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -@Entity -public class LabelBean { - @Id(autoincrement = true) - private Long id;//主键ID - // 标记对象类型 - private String objectType; - // 管线类型 - private String pipelineType; - // 管材 - private String pipelineMaterial; - // 管直 - private String pipelineDiameter; - // 埋深 - private String buryDeep; - // 下层管线类型 - private String lowerType; - // 下层管材 - private String lowerMaterial; - // 下层管径 - private String lowerDiameter; - // 下层埋深 - private String lowerDeep; - // 埋设方式 - private String buryMethod; - // 所属区域 - private String area; - // 所属线路 - private String line; - // 所属道路 - private String road; - // 建设年代 - private String constructTime; - // 权属单位 - private String owner; - // 对象ID - private String objectId; - // 标识器ID号 - private String identifierId; - // 标识器类型 - private String identifierType; - // 标识器埋深 - private String identifierDeep; - // 安装人员 - private String person; - // 安装时间 - private String installTime; - // 经度 - private String lng; - // 纬度 - private String lat; - // 颜色 - private String color; - // 备注信息 - private String remark; - // 图片路径 - private String imagePath; - - @Generated(hash = 1718746860) - public LabelBean(Long id, String objectType, String pipelineType, - String pipelineMaterial, String pipelineDiameter, String buryDeep, - String lowerType, String lowerMaterial, String lowerDiameter, - String lowerDeep, String buryMethod, String area, String line, - String road, String constructTime, String owner, String objectId, - String identifierId, String identifierType, String identifierDeep, - String person, String installTime, String lng, String lat, String color, - String remark, String imagePath) { - this.id = id; - this.objectType = objectType; - this.pipelineType = pipelineType; - this.pipelineMaterial = pipelineMaterial; - this.pipelineDiameter = pipelineDiameter; - this.buryDeep = buryDeep; - this.lowerType = lowerType; - this.lowerMaterial = lowerMaterial; - this.lowerDiameter = lowerDiameter; - this.lowerDeep = lowerDeep; - this.buryMethod = buryMethod; - this.area = area; - this.line = line; - this.road = road; - this.constructTime = constructTime; - this.owner = owner; - this.objectId = objectId; - this.identifierId = identifierId; - this.identifierType = identifierType; - this.identifierDeep = identifierDeep; - this.person = person; - this.installTime = installTime; - this.lng = lng; - this.lat = lat; - this.color = color; - this.remark = remark; - this.imagePath = imagePath; - } - - @Generated(hash = 1285554626) - public LabelBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getObjectType() { - return this.objectType; - } - - public void setObjectType(String objectType) { - this.objectType = objectType; - } - - public String getPipelineType() { - return this.pipelineType; - } - - public void setPipelineType(String pipelineType) { - this.pipelineType = pipelineType; - } - - public String getPipelineMaterial() { - return this.pipelineMaterial; - } - - public void setPipelineMaterial(String pipelineMaterial) { - this.pipelineMaterial = pipelineMaterial; - } - - public String getPipelineDiameter() { - return this.pipelineDiameter; - } - - public void setPipelineDiameter(String pipelineDiameter) { - this.pipelineDiameter = pipelineDiameter; - } - - public String getBuryDeep() { - return this.buryDeep; - } - - public void setBuryDeep(String buryDeep) { - this.buryDeep = buryDeep; - } - - public String getLowerType() { - return this.lowerType; - } - - public void setLowerType(String lowerType) { - this.lowerType = lowerType; - } - - public String getLowerMaterial() { - return this.lowerMaterial; - } - - public void setLowerMaterial(String lowerMaterial) { - this.lowerMaterial = lowerMaterial; - } - - public String getLowerDiameter() { - return this.lowerDiameter; - } - - public void setLowerDiameter(String lowerDiameter) { - this.lowerDiameter = lowerDiameter; - } - - public String getLowerDeep() { - return this.lowerDeep; - } - - public void setLowerDeep(String lowerDeep) { - this.lowerDeep = lowerDeep; - } - - public String getBuryMethod() { - return this.buryMethod; - } - - public void setBuryMethod(String buryMethod) { - this.buryMethod = buryMethod; - } - - public String getArea() { - return this.area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getLine() { - return this.line; - } - - public void setLine(String line) { - this.line = line; - } - - public String getRoad() { - return this.road; - } - - public void setRoad(String road) { - this.road = road; - } - - public String getConstructTime() { - return this.constructTime; - } - - public void setConstructTime(String constructTime) { - this.constructTime = constructTime; - } - - public String getOwner() { - return this.owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getObjectId() { - return this.objectId; - } - - public void setObjectId(String objectId) { - this.objectId = objectId; - } - - public String getIdentifierId() { - return this.identifierId; - } - - public void setIdentifierId(String identifierId) { - this.identifierId = identifierId; - } - - public String getIdentifierType() { - return this.identifierType; - } - - public void setIdentifierType(String identifierType) { - this.identifierType = identifierType; - } - - public String getIdentifierDeep() { - return this.identifierDeep; - } - - public void setIdentifierDeep(String identifierDeep) { - this.identifierDeep = identifierDeep; - } - - public String getPerson() { - return this.person; - } - - public void setPerson(String person) { - this.person = person; - } - - public String getInstallTime() { - return this.installTime; - } - - public void setInstallTime(String installTime) { - this.installTime = installTime; - } - - public String getLng() { - return this.lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getLat() { - return this.lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getColor() { - return this.color; - } - - public void setColor(String color) { - this.color = color; - } - - public String getRemark() { - return this.remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getImagePath() { - return this.imagePath; - } - - public void setImagePath(String imagePath) { - this.imagePath = imagePath; - } -} diff --git a/app/src/main/java/com/casic/detector/bean/LabelBean.java b/app/src/main/java/com/casic/detector/bean/LabelBean.java deleted file mode 100644 index d22d835..0000000 --- a/app/src/main/java/com/casic/detector/bean/LabelBean.java +++ /dev/null @@ -1,321 +0,0 @@ -package com.casic.detector.bean; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -@Entity -public class LabelBean { - @Id(autoincrement = true) - private Long id;//主键ID - // 标记对象类型 - private String objectType; - // 管线类型 - private String pipelineType; - // 管材 - private String pipelineMaterial; - // 管直 - private String pipelineDiameter; - // 埋深 - private String buryDeep; - // 下层管线类型 - private String lowerType; - // 下层管材 - private String lowerMaterial; - // 下层管径 - private String lowerDiameter; - // 下层埋深 - private String lowerDeep; - // 埋设方式 - private String buryMethod; - // 所属区域 - private String area; - // 所属线路 - private String line; - // 所属道路 - private String road; - // 建设年代 - private String constructTime; - // 权属单位 - private String owner; - // 对象ID - private String objectId; - // 标识器ID号 - private String identifierId; - // 标识器类型 - private String identifierType; - // 标识器埋深 - private String identifierDeep; - // 安装人员 - private String person; - // 安装时间 - private String installTime; - // 经度 - private String lng; - // 纬度 - private String lat; - // 颜色 - private String color; - // 备注信息 - private String remark; - // 图片路径 - private String imagePath; - - @Generated(hash = 1718746860) - public LabelBean(Long id, String objectType, String pipelineType, - String pipelineMaterial, String pipelineDiameter, String buryDeep, - String lowerType, String lowerMaterial, String lowerDiameter, - String lowerDeep, String buryMethod, String area, String line, - String road, String constructTime, String owner, String objectId, - String identifierId, String identifierType, String identifierDeep, - String person, String installTime, String lng, String lat, String color, - String remark, String imagePath) { - this.id = id; - this.objectType = objectType; - this.pipelineType = pipelineType; - this.pipelineMaterial = pipelineMaterial; - this.pipelineDiameter = pipelineDiameter; - this.buryDeep = buryDeep; - this.lowerType = lowerType; - this.lowerMaterial = lowerMaterial; - this.lowerDiameter = lowerDiameter; - this.lowerDeep = lowerDeep; - this.buryMethod = buryMethod; - this.area = area; - this.line = line; - this.road = road; - this.constructTime = constructTime; - this.owner = owner; - this.objectId = objectId; - this.identifierId = identifierId; - this.identifierType = identifierType; - this.identifierDeep = identifierDeep; - this.person = person; - this.installTime = installTime; - this.lng = lng; - this.lat = lat; - this.color = color; - this.remark = remark; - this.imagePath = imagePath; - } - - @Generated(hash = 1285554626) - public LabelBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getObjectType() { - return this.objectType; - } - - public void setObjectType(String objectType) { - this.objectType = objectType; - } - - public String getPipelineType() { - return this.pipelineType; - } - - public void setPipelineType(String pipelineType) { - this.pipelineType = pipelineType; - } - - public String getPipelineMaterial() { - return this.pipelineMaterial; - } - - public void setPipelineMaterial(String pipelineMaterial) { - this.pipelineMaterial = pipelineMaterial; - } - - public String getPipelineDiameter() { - return this.pipelineDiameter; - } - - public void setPipelineDiameter(String pipelineDiameter) { - this.pipelineDiameter = pipelineDiameter; - } - - public String getBuryDeep() { - return this.buryDeep; - } - - public void setBuryDeep(String buryDeep) { - this.buryDeep = buryDeep; - } - - public String getLowerType() { - return this.lowerType; - } - - public void setLowerType(String lowerType) { - this.lowerType = lowerType; - } - - public String getLowerMaterial() { - return this.lowerMaterial; - } - - public void setLowerMaterial(String lowerMaterial) { - this.lowerMaterial = lowerMaterial; - } - - public String getLowerDiameter() { - return this.lowerDiameter; - } - - public void setLowerDiameter(String lowerDiameter) { - this.lowerDiameter = lowerDiameter; - } - - public String getLowerDeep() { - return this.lowerDeep; - } - - public void setLowerDeep(String lowerDeep) { - this.lowerDeep = lowerDeep; - } - - public String getBuryMethod() { - return this.buryMethod; - } - - public void setBuryMethod(String buryMethod) { - this.buryMethod = buryMethod; - } - - public String getArea() { - return this.area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getLine() { - return this.line; - } - - public void setLine(String line) { - this.line = line; - } - - public String getRoad() { - return this.road; - } - - public void setRoad(String road) { - this.road = road; - } - - public String getConstructTime() { - return this.constructTime; - } - - public void setConstructTime(String constructTime) { - this.constructTime = constructTime; - } - - public String getOwner() { - return this.owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getObjectId() { - return this.objectId; - } - - public void setObjectId(String objectId) { - this.objectId = objectId; - } - - public String getIdentifierId() { - return this.identifierId; - } - - public void setIdentifierId(String identifierId) { - this.identifierId = identifierId; - } - - public String getIdentifierType() { - return this.identifierType; - } - - public void setIdentifierType(String identifierType) { - this.identifierType = identifierType; - } - - public String getIdentifierDeep() { - return this.identifierDeep; - } - - public void setIdentifierDeep(String identifierDeep) { - this.identifierDeep = identifierDeep; - } - - public String getPerson() { - return this.person; - } - - public void setPerson(String person) { - this.person = person; - } - - public String getInstallTime() { - return this.installTime; - } - - public void setInstallTime(String installTime) { - this.installTime = installTime; - } - - public String getLng() { - return this.lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getLat() { - return this.lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getColor() { - return this.color; - } - - public void setColor(String color) { - this.color = color; - } - - public String getRemark() { - return this.remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getImagePath() { - return this.imagePath; - } - - public void setImagePath(String imagePath) { - this.imagePath = imagePath; - } -} diff --git a/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java new file mode 100644 index 0000000..c59cf0b --- /dev/null +++ b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java @@ -0,0 +1,327 @@ +package com.casic.detector.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Id; +import org.greenrobot.greendao.annotation.Generated; + +/** + * 从平台下载的标识器本地库实体类 + */ +@Entity +public class MarkerLocalBean { + @Id(autoincrement = true) + private Long id;//本地库主键ID + + // 管线类型 + private String pipelineType; + // 管线直径 + private String pipelineDiameter; + // 管材 + private String pipelineMaterial; + // 埋设方式 + private String buryMethod; + // 埋深 + private String buryDepth; + // 所属区域 + private String area; + // 所属线路 + private String line; + // 所属道路 + private String road; + // 建设年代 + private String constructTime; + // 权属单位 + private String owner; + //标识对象ID,无实际用途 + @Deprecated + private String objectId; + // 标识器ID + private String markerId; + // 标识器类型 + private String markerType; + // 标识器埋深 + private String markerDepth; + // 安装部门 + private String installationDept; + // 经度 + private String lng; + // 纬度 + private String lat; + //最后修改时间,更新时间 + private String updateTime; + // 备注信息 + private String remark; + // 下层管线类型 + private String underlyingPipelineType; + // 下层埋深 + private String underlyingPipelineDepth; + // 下层管径 + private String underlyingPipelineDiameter; + // 下层管材 + private String underlyingPipelineMaterial; + //标识对象类型 + private String objectType; + // 颜色 + private String color; + // 图片路径 + private String imagePath; + + @Generated(hash = 1479045776) + public MarkerLocalBean(Long id, String pipelineType, String pipelineDiameter, + String pipelineMaterial, String buryMethod, String buryDepth, + String area, String line, String road, String constructTime, + String owner, String objectId, String markerId, String markerType, + String markerDepth, String installationDept, String lng, String lat, + String updateTime, String remark, String underlyingPipelineType, + String underlyingPipelineDepth, String underlyingPipelineDiameter, + String underlyingPipelineMaterial, String objectType, String color, + String imagePath) { + this.id = id; + this.pipelineType = pipelineType; + this.pipelineDiameter = pipelineDiameter; + this.pipelineMaterial = pipelineMaterial; + this.buryMethod = buryMethod; + this.buryDepth = buryDepth; + this.area = area; + this.line = line; + this.road = road; + this.constructTime = constructTime; + this.owner = owner; + this.objectId = objectId; + this.markerId = markerId; + this.markerType = markerType; + this.markerDepth = markerDepth; + this.installationDept = installationDept; + this.lng = lng; + this.lat = lat; + this.updateTime = updateTime; + this.remark = remark; + this.underlyingPipelineType = underlyingPipelineType; + this.underlyingPipelineDepth = underlyingPipelineDepth; + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + this.objectType = objectType; + this.color = color; + this.imagePath = imagePath; + } + + @Generated(hash = 1538606012) + public MarkerLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPipelineType() { + return this.pipelineType; + } + + public void setPipelineType(String pipelineType) { + this.pipelineType = pipelineType; + } + + public String getPipelineDiameter() { + return this.pipelineDiameter; + } + + public void setPipelineDiameter(String pipelineDiameter) { + this.pipelineDiameter = pipelineDiameter; + } + + public String getPipelineMaterial() { + return this.pipelineMaterial; + } + + public void setPipelineMaterial(String pipelineMaterial) { + this.pipelineMaterial = pipelineMaterial; + } + + public String getBuryMethod() { + return this.buryMethod; + } + + public void setBuryMethod(String buryMethod) { + this.buryMethod = buryMethod; + } + + public String getBuryDepth() { + return this.buryDepth; + } + + public void setBuryDepth(String buryDepth) { + this.buryDepth = buryDepth; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getLine() { + return this.line; + } + + public void setLine(String line) { + this.line = line; + } + + public String getRoad() { + return this.road; + } + + public void setRoad(String road) { + this.road = road; + } + + public String getConstructTime() { + return this.constructTime; + } + + public void setConstructTime(String constructTime) { + this.constructTime = constructTime; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getObjectId() { + return this.objectId; + } + + public void setObjectId(String objectId) { + this.objectId = objectId; + } + + public String getMarkerId() { + return this.markerId; + } + + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerType() { + return this.markerType; + } + + public void setMarkerType(String markerType) { + this.markerType = markerType; + } + + public String getMarkerDepth() { + return this.markerDepth; + } + + public void setMarkerDepth(String markerDepth) { + this.markerDepth = markerDepth; + } + + public String getInstallationDept() { + return this.installationDept; + } + + public void setInstallationDept(String installationDept) { + this.installationDept = installationDept; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return this.remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getUnderlyingPipelineType() { + return this.underlyingPipelineType; + } + + public void setUnderlyingPipelineType(String underlyingPipelineType) { + this.underlyingPipelineType = underlyingPipelineType; + } + + public String getUnderlyingPipelineDepth() { + return this.underlyingPipelineDepth; + } + + public void setUnderlyingPipelineDepth(String underlyingPipelineDepth) { + this.underlyingPipelineDepth = underlyingPipelineDepth; + } + + public String getUnderlyingPipelineDiameter() { + return this.underlyingPipelineDiameter; + } + + public void setUnderlyingPipelineDiameter(String underlyingPipelineDiameter) { + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + } + + public String getUnderlyingPipelineMaterial() { + return this.underlyingPipelineMaterial; + } + + public void setUnderlyingPipelineMaterial(String underlyingPipelineMaterial) { + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + } + + public String getObjectType() { + return this.objectType; + } + + public void setObjectType(String objectType) { + this.objectType = objectType; + } + + public String getColor() { + return this.color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getImagePath() { + return this.imagePath; + } + + public void setImagePath(String imagePath) { + this.imagePath = imagePath; + } +} diff --git a/app/src/main/java/com/casic/detector/bean/LabelBean.java b/app/src/main/java/com/casic/detector/bean/LabelBean.java deleted file mode 100644 index d22d835..0000000 --- a/app/src/main/java/com/casic/detector/bean/LabelBean.java +++ /dev/null @@ -1,321 +0,0 @@ -package com.casic.detector.bean; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -@Entity -public class LabelBean { - @Id(autoincrement = true) - private Long id;//主键ID - // 标记对象类型 - private String objectType; - // 管线类型 - private String pipelineType; - // 管材 - private String pipelineMaterial; - // 管直 - private String pipelineDiameter; - // 埋深 - private String buryDeep; - // 下层管线类型 - private String lowerType; - // 下层管材 - private String lowerMaterial; - // 下层管径 - private String lowerDiameter; - // 下层埋深 - private String lowerDeep; - // 埋设方式 - private String buryMethod; - // 所属区域 - private String area; - // 所属线路 - private String line; - // 所属道路 - private String road; - // 建设年代 - private String constructTime; - // 权属单位 - private String owner; - // 对象ID - private String objectId; - // 标识器ID号 - private String identifierId; - // 标识器类型 - private String identifierType; - // 标识器埋深 - private String identifierDeep; - // 安装人员 - private String person; - // 安装时间 - private String installTime; - // 经度 - private String lng; - // 纬度 - private String lat; - // 颜色 - private String color; - // 备注信息 - private String remark; - // 图片路径 - private String imagePath; - - @Generated(hash = 1718746860) - public LabelBean(Long id, String objectType, String pipelineType, - String pipelineMaterial, String pipelineDiameter, String buryDeep, - String lowerType, String lowerMaterial, String lowerDiameter, - String lowerDeep, String buryMethod, String area, String line, - String road, String constructTime, String owner, String objectId, - String identifierId, String identifierType, String identifierDeep, - String person, String installTime, String lng, String lat, String color, - String remark, String imagePath) { - this.id = id; - this.objectType = objectType; - this.pipelineType = pipelineType; - this.pipelineMaterial = pipelineMaterial; - this.pipelineDiameter = pipelineDiameter; - this.buryDeep = buryDeep; - this.lowerType = lowerType; - this.lowerMaterial = lowerMaterial; - this.lowerDiameter = lowerDiameter; - this.lowerDeep = lowerDeep; - this.buryMethod = buryMethod; - this.area = area; - this.line = line; - this.road = road; - this.constructTime = constructTime; - this.owner = owner; - this.objectId = objectId; - this.identifierId = identifierId; - this.identifierType = identifierType; - this.identifierDeep = identifierDeep; - this.person = person; - this.installTime = installTime; - this.lng = lng; - this.lat = lat; - this.color = color; - this.remark = remark; - this.imagePath = imagePath; - } - - @Generated(hash = 1285554626) - public LabelBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getObjectType() { - return this.objectType; - } - - public void setObjectType(String objectType) { - this.objectType = objectType; - } - - public String getPipelineType() { - return this.pipelineType; - } - - public void setPipelineType(String pipelineType) { - this.pipelineType = pipelineType; - } - - public String getPipelineMaterial() { - return this.pipelineMaterial; - } - - public void setPipelineMaterial(String pipelineMaterial) { - this.pipelineMaterial = pipelineMaterial; - } - - public String getPipelineDiameter() { - return this.pipelineDiameter; - } - - public void setPipelineDiameter(String pipelineDiameter) { - this.pipelineDiameter = pipelineDiameter; - } - - public String getBuryDeep() { - return this.buryDeep; - } - - public void setBuryDeep(String buryDeep) { - this.buryDeep = buryDeep; - } - - public String getLowerType() { - return this.lowerType; - } - - public void setLowerType(String lowerType) { - this.lowerType = lowerType; - } - - public String getLowerMaterial() { - return this.lowerMaterial; - } - - public void setLowerMaterial(String lowerMaterial) { - this.lowerMaterial = lowerMaterial; - } - - public String getLowerDiameter() { - return this.lowerDiameter; - } - - public void setLowerDiameter(String lowerDiameter) { - this.lowerDiameter = lowerDiameter; - } - - public String getLowerDeep() { - return this.lowerDeep; - } - - public void setLowerDeep(String lowerDeep) { - this.lowerDeep = lowerDeep; - } - - public String getBuryMethod() { - return this.buryMethod; - } - - public void setBuryMethod(String buryMethod) { - this.buryMethod = buryMethod; - } - - public String getArea() { - return this.area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getLine() { - return this.line; - } - - public void setLine(String line) { - this.line = line; - } - - public String getRoad() { - return this.road; - } - - public void setRoad(String road) { - this.road = road; - } - - public String getConstructTime() { - return this.constructTime; - } - - public void setConstructTime(String constructTime) { - this.constructTime = constructTime; - } - - public String getOwner() { - return this.owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getObjectId() { - return this.objectId; - } - - public void setObjectId(String objectId) { - this.objectId = objectId; - } - - public String getIdentifierId() { - return this.identifierId; - } - - public void setIdentifierId(String identifierId) { - this.identifierId = identifierId; - } - - public String getIdentifierType() { - return this.identifierType; - } - - public void setIdentifierType(String identifierType) { - this.identifierType = identifierType; - } - - public String getIdentifierDeep() { - return this.identifierDeep; - } - - public void setIdentifierDeep(String identifierDeep) { - this.identifierDeep = identifierDeep; - } - - public String getPerson() { - return this.person; - } - - public void setPerson(String person) { - this.person = person; - } - - public String getInstallTime() { - return this.installTime; - } - - public void setInstallTime(String installTime) { - this.installTime = installTime; - } - - public String getLng() { - return this.lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getLat() { - return this.lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getColor() { - return this.color; - } - - public void setColor(String color) { - this.color = color; - } - - public String getRemark() { - return this.remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getImagePath() { - return this.imagePath; - } - - public void setImagePath(String imagePath) { - this.imagePath = imagePath; - } -} diff --git a/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java new file mode 100644 index 0000000..c59cf0b --- /dev/null +++ b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java @@ -0,0 +1,327 @@ +package com.casic.detector.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Id; +import org.greenrobot.greendao.annotation.Generated; + +/** + * 从平台下载的标识器本地库实体类 + */ +@Entity +public class MarkerLocalBean { + @Id(autoincrement = true) + private Long id;//本地库主键ID + + // 管线类型 + private String pipelineType; + // 管线直径 + private String pipelineDiameter; + // 管材 + private String pipelineMaterial; + // 埋设方式 + private String buryMethod; + // 埋深 + private String buryDepth; + // 所属区域 + private String area; + // 所属线路 + private String line; + // 所属道路 + private String road; + // 建设年代 + private String constructTime; + // 权属单位 + private String owner; + //标识对象ID,无实际用途 + @Deprecated + private String objectId; + // 标识器ID + private String markerId; + // 标识器类型 + private String markerType; + // 标识器埋深 + private String markerDepth; + // 安装部门 + private String installationDept; + // 经度 + private String lng; + // 纬度 + private String lat; + //最后修改时间,更新时间 + private String updateTime; + // 备注信息 + private String remark; + // 下层管线类型 + private String underlyingPipelineType; + // 下层埋深 + private String underlyingPipelineDepth; + // 下层管径 + private String underlyingPipelineDiameter; + // 下层管材 + private String underlyingPipelineMaterial; + //标识对象类型 + private String objectType; + // 颜色 + private String color; + // 图片路径 + private String imagePath; + + @Generated(hash = 1479045776) + public MarkerLocalBean(Long id, String pipelineType, String pipelineDiameter, + String pipelineMaterial, String buryMethod, String buryDepth, + String area, String line, String road, String constructTime, + String owner, String objectId, String markerId, String markerType, + String markerDepth, String installationDept, String lng, String lat, + String updateTime, String remark, String underlyingPipelineType, + String underlyingPipelineDepth, String underlyingPipelineDiameter, + String underlyingPipelineMaterial, String objectType, String color, + String imagePath) { + this.id = id; + this.pipelineType = pipelineType; + this.pipelineDiameter = pipelineDiameter; + this.pipelineMaterial = pipelineMaterial; + this.buryMethod = buryMethod; + this.buryDepth = buryDepth; + this.area = area; + this.line = line; + this.road = road; + this.constructTime = constructTime; + this.owner = owner; + this.objectId = objectId; + this.markerId = markerId; + this.markerType = markerType; + this.markerDepth = markerDepth; + this.installationDept = installationDept; + this.lng = lng; + this.lat = lat; + this.updateTime = updateTime; + this.remark = remark; + this.underlyingPipelineType = underlyingPipelineType; + this.underlyingPipelineDepth = underlyingPipelineDepth; + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + this.objectType = objectType; + this.color = color; + this.imagePath = imagePath; + } + + @Generated(hash = 1538606012) + public MarkerLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPipelineType() { + return this.pipelineType; + } + + public void setPipelineType(String pipelineType) { + this.pipelineType = pipelineType; + } + + public String getPipelineDiameter() { + return this.pipelineDiameter; + } + + public void setPipelineDiameter(String pipelineDiameter) { + this.pipelineDiameter = pipelineDiameter; + } + + public String getPipelineMaterial() { + return this.pipelineMaterial; + } + + public void setPipelineMaterial(String pipelineMaterial) { + this.pipelineMaterial = pipelineMaterial; + } + + public String getBuryMethod() { + return this.buryMethod; + } + + public void setBuryMethod(String buryMethod) { + this.buryMethod = buryMethod; + } + + public String getBuryDepth() { + return this.buryDepth; + } + + public void setBuryDepth(String buryDepth) { + this.buryDepth = buryDepth; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getLine() { + return this.line; + } + + public void setLine(String line) { + this.line = line; + } + + public String getRoad() { + return this.road; + } + + public void setRoad(String road) { + this.road = road; + } + + public String getConstructTime() { + return this.constructTime; + } + + public void setConstructTime(String constructTime) { + this.constructTime = constructTime; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getObjectId() { + return this.objectId; + } + + public void setObjectId(String objectId) { + this.objectId = objectId; + } + + public String getMarkerId() { + return this.markerId; + } + + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerType() { + return this.markerType; + } + + public void setMarkerType(String markerType) { + this.markerType = markerType; + } + + public String getMarkerDepth() { + return this.markerDepth; + } + + public void setMarkerDepth(String markerDepth) { + this.markerDepth = markerDepth; + } + + public String getInstallationDept() { + return this.installationDept; + } + + public void setInstallationDept(String installationDept) { + this.installationDept = installationDept; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return this.remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getUnderlyingPipelineType() { + return this.underlyingPipelineType; + } + + public void setUnderlyingPipelineType(String underlyingPipelineType) { + this.underlyingPipelineType = underlyingPipelineType; + } + + public String getUnderlyingPipelineDepth() { + return this.underlyingPipelineDepth; + } + + public void setUnderlyingPipelineDepth(String underlyingPipelineDepth) { + this.underlyingPipelineDepth = underlyingPipelineDepth; + } + + public String getUnderlyingPipelineDiameter() { + return this.underlyingPipelineDiameter; + } + + public void setUnderlyingPipelineDiameter(String underlyingPipelineDiameter) { + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + } + + public String getUnderlyingPipelineMaterial() { + return this.underlyingPipelineMaterial; + } + + public void setUnderlyingPipelineMaterial(String underlyingPipelineMaterial) { + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + } + + public String getObjectType() { + return this.objectType; + } + + public void setObjectType(String objectType) { + this.objectType = objectType; + } + + public String getColor() { + return this.color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getImagePath() { + return this.imagePath; + } + + public void setImagePath(String imagePath) { + this.imagePath = imagePath; + } +} diff --git a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java index ec4425f..45e25e6 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java @@ -24,7 +24,7 @@ * Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - LabelBeanDao.createTable(db, ifNotExists); + MarkerLocalBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); @@ -34,7 +34,7 @@ * Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - LabelBeanDao.dropTable(db, ifExists); + MarkerLocalBeanDao.dropTable(db, ifExists); PipeLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); TaskMarkerLocalBeanDao.dropTable(db, ifExists); @@ -56,7 +56,7 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(LabelBeanDao.class); + registerDaoClass(MarkerLocalBeanDao.class); registerDaoClass(PipeLocalBeanDao.class); registerDaoClass(TaskLocalBeanDao.class); registerDaoClass(TaskMarkerLocalBeanDao.class); diff --git a/app/src/main/java/com/casic/detector/bean/LabelBean.java b/app/src/main/java/com/casic/detector/bean/LabelBean.java deleted file mode 100644 index d22d835..0000000 --- a/app/src/main/java/com/casic/detector/bean/LabelBean.java +++ /dev/null @@ -1,321 +0,0 @@ -package com.casic.detector.bean; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -@Entity -public class LabelBean { - @Id(autoincrement = true) - private Long id;//主键ID - // 标记对象类型 - private String objectType; - // 管线类型 - private String pipelineType; - // 管材 - private String pipelineMaterial; - // 管直 - private String pipelineDiameter; - // 埋深 - private String buryDeep; - // 下层管线类型 - private String lowerType; - // 下层管材 - private String lowerMaterial; - // 下层管径 - private String lowerDiameter; - // 下层埋深 - private String lowerDeep; - // 埋设方式 - private String buryMethod; - // 所属区域 - private String area; - // 所属线路 - private String line; - // 所属道路 - private String road; - // 建设年代 - private String constructTime; - // 权属单位 - private String owner; - // 对象ID - private String objectId; - // 标识器ID号 - private String identifierId; - // 标识器类型 - private String identifierType; - // 标识器埋深 - private String identifierDeep; - // 安装人员 - private String person; - // 安装时间 - private String installTime; - // 经度 - private String lng; - // 纬度 - private String lat; - // 颜色 - private String color; - // 备注信息 - private String remark; - // 图片路径 - private String imagePath; - - @Generated(hash = 1718746860) - public LabelBean(Long id, String objectType, String pipelineType, - String pipelineMaterial, String pipelineDiameter, String buryDeep, - String lowerType, String lowerMaterial, String lowerDiameter, - String lowerDeep, String buryMethod, String area, String line, - String road, String constructTime, String owner, String objectId, - String identifierId, String identifierType, String identifierDeep, - String person, String installTime, String lng, String lat, String color, - String remark, String imagePath) { - this.id = id; - this.objectType = objectType; - this.pipelineType = pipelineType; - this.pipelineMaterial = pipelineMaterial; - this.pipelineDiameter = pipelineDiameter; - this.buryDeep = buryDeep; - this.lowerType = lowerType; - this.lowerMaterial = lowerMaterial; - this.lowerDiameter = lowerDiameter; - this.lowerDeep = lowerDeep; - this.buryMethod = buryMethod; - this.area = area; - this.line = line; - this.road = road; - this.constructTime = constructTime; - this.owner = owner; - this.objectId = objectId; - this.identifierId = identifierId; - this.identifierType = identifierType; - this.identifierDeep = identifierDeep; - this.person = person; - this.installTime = installTime; - this.lng = lng; - this.lat = lat; - this.color = color; - this.remark = remark; - this.imagePath = imagePath; - } - - @Generated(hash = 1285554626) - public LabelBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getObjectType() { - return this.objectType; - } - - public void setObjectType(String objectType) { - this.objectType = objectType; - } - - public String getPipelineType() { - return this.pipelineType; - } - - public void setPipelineType(String pipelineType) { - this.pipelineType = pipelineType; - } - - public String getPipelineMaterial() { - return this.pipelineMaterial; - } - - public void setPipelineMaterial(String pipelineMaterial) { - this.pipelineMaterial = pipelineMaterial; - } - - public String getPipelineDiameter() { - return this.pipelineDiameter; - } - - public void setPipelineDiameter(String pipelineDiameter) { - this.pipelineDiameter = pipelineDiameter; - } - - public String getBuryDeep() { - return this.buryDeep; - } - - public void setBuryDeep(String buryDeep) { - this.buryDeep = buryDeep; - } - - public String getLowerType() { - return this.lowerType; - } - - public void setLowerType(String lowerType) { - this.lowerType = lowerType; - } - - public String getLowerMaterial() { - return this.lowerMaterial; - } - - public void setLowerMaterial(String lowerMaterial) { - this.lowerMaterial = lowerMaterial; - } - - public String getLowerDiameter() { - return this.lowerDiameter; - } - - public void setLowerDiameter(String lowerDiameter) { - this.lowerDiameter = lowerDiameter; - } - - public String getLowerDeep() { - return this.lowerDeep; - } - - public void setLowerDeep(String lowerDeep) { - this.lowerDeep = lowerDeep; - } - - public String getBuryMethod() { - return this.buryMethod; - } - - public void setBuryMethod(String buryMethod) { - this.buryMethod = buryMethod; - } - - public String getArea() { - return this.area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getLine() { - return this.line; - } - - public void setLine(String line) { - this.line = line; - } - - public String getRoad() { - return this.road; - } - - public void setRoad(String road) { - this.road = road; - } - - public String getConstructTime() { - return this.constructTime; - } - - public void setConstructTime(String constructTime) { - this.constructTime = constructTime; - } - - public String getOwner() { - return this.owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getObjectId() { - return this.objectId; - } - - public void setObjectId(String objectId) { - this.objectId = objectId; - } - - public String getIdentifierId() { - return this.identifierId; - } - - public void setIdentifierId(String identifierId) { - this.identifierId = identifierId; - } - - public String getIdentifierType() { - return this.identifierType; - } - - public void setIdentifierType(String identifierType) { - this.identifierType = identifierType; - } - - public String getIdentifierDeep() { - return this.identifierDeep; - } - - public void setIdentifierDeep(String identifierDeep) { - this.identifierDeep = identifierDeep; - } - - public String getPerson() { - return this.person; - } - - public void setPerson(String person) { - this.person = person; - } - - public String getInstallTime() { - return this.installTime; - } - - public void setInstallTime(String installTime) { - this.installTime = installTime; - } - - public String getLng() { - return this.lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getLat() { - return this.lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getColor() { - return this.color; - } - - public void setColor(String color) { - this.color = color; - } - - public String getRemark() { - return this.remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getImagePath() { - return this.imagePath; - } - - public void setImagePath(String imagePath) { - this.imagePath = imagePath; - } -} diff --git a/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java new file mode 100644 index 0000000..c59cf0b --- /dev/null +++ b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java @@ -0,0 +1,327 @@ +package com.casic.detector.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Id; +import org.greenrobot.greendao.annotation.Generated; + +/** + * 从平台下载的标识器本地库实体类 + */ +@Entity +public class MarkerLocalBean { + @Id(autoincrement = true) + private Long id;//本地库主键ID + + // 管线类型 + private String pipelineType; + // 管线直径 + private String pipelineDiameter; + // 管材 + private String pipelineMaterial; + // 埋设方式 + private String buryMethod; + // 埋深 + private String buryDepth; + // 所属区域 + private String area; + // 所属线路 + private String line; + // 所属道路 + private String road; + // 建设年代 + private String constructTime; + // 权属单位 + private String owner; + //标识对象ID,无实际用途 + @Deprecated + private String objectId; + // 标识器ID + private String markerId; + // 标识器类型 + private String markerType; + // 标识器埋深 + private String markerDepth; + // 安装部门 + private String installationDept; + // 经度 + private String lng; + // 纬度 + private String lat; + //最后修改时间,更新时间 + private String updateTime; + // 备注信息 + private String remark; + // 下层管线类型 + private String underlyingPipelineType; + // 下层埋深 + private String underlyingPipelineDepth; + // 下层管径 + private String underlyingPipelineDiameter; + // 下层管材 + private String underlyingPipelineMaterial; + //标识对象类型 + private String objectType; + // 颜色 + private String color; + // 图片路径 + private String imagePath; + + @Generated(hash = 1479045776) + public MarkerLocalBean(Long id, String pipelineType, String pipelineDiameter, + String pipelineMaterial, String buryMethod, String buryDepth, + String area, String line, String road, String constructTime, + String owner, String objectId, String markerId, String markerType, + String markerDepth, String installationDept, String lng, String lat, + String updateTime, String remark, String underlyingPipelineType, + String underlyingPipelineDepth, String underlyingPipelineDiameter, + String underlyingPipelineMaterial, String objectType, String color, + String imagePath) { + this.id = id; + this.pipelineType = pipelineType; + this.pipelineDiameter = pipelineDiameter; + this.pipelineMaterial = pipelineMaterial; + this.buryMethod = buryMethod; + this.buryDepth = buryDepth; + this.area = area; + this.line = line; + this.road = road; + this.constructTime = constructTime; + this.owner = owner; + this.objectId = objectId; + this.markerId = markerId; + this.markerType = markerType; + this.markerDepth = markerDepth; + this.installationDept = installationDept; + this.lng = lng; + this.lat = lat; + this.updateTime = updateTime; + this.remark = remark; + this.underlyingPipelineType = underlyingPipelineType; + this.underlyingPipelineDepth = underlyingPipelineDepth; + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + this.objectType = objectType; + this.color = color; + this.imagePath = imagePath; + } + + @Generated(hash = 1538606012) + public MarkerLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPipelineType() { + return this.pipelineType; + } + + public void setPipelineType(String pipelineType) { + this.pipelineType = pipelineType; + } + + public String getPipelineDiameter() { + return this.pipelineDiameter; + } + + public void setPipelineDiameter(String pipelineDiameter) { + this.pipelineDiameter = pipelineDiameter; + } + + public String getPipelineMaterial() { + return this.pipelineMaterial; + } + + public void setPipelineMaterial(String pipelineMaterial) { + this.pipelineMaterial = pipelineMaterial; + } + + public String getBuryMethod() { + return this.buryMethod; + } + + public void setBuryMethod(String buryMethod) { + this.buryMethod = buryMethod; + } + + public String getBuryDepth() { + return this.buryDepth; + } + + public void setBuryDepth(String buryDepth) { + this.buryDepth = buryDepth; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getLine() { + return this.line; + } + + public void setLine(String line) { + this.line = line; + } + + public String getRoad() { + return this.road; + } + + public void setRoad(String road) { + this.road = road; + } + + public String getConstructTime() { + return this.constructTime; + } + + public void setConstructTime(String constructTime) { + this.constructTime = constructTime; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getObjectId() { + return this.objectId; + } + + public void setObjectId(String objectId) { + this.objectId = objectId; + } + + public String getMarkerId() { + return this.markerId; + } + + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerType() { + return this.markerType; + } + + public void setMarkerType(String markerType) { + this.markerType = markerType; + } + + public String getMarkerDepth() { + return this.markerDepth; + } + + public void setMarkerDepth(String markerDepth) { + this.markerDepth = markerDepth; + } + + public String getInstallationDept() { + return this.installationDept; + } + + public void setInstallationDept(String installationDept) { + this.installationDept = installationDept; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return this.remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getUnderlyingPipelineType() { + return this.underlyingPipelineType; + } + + public void setUnderlyingPipelineType(String underlyingPipelineType) { + this.underlyingPipelineType = underlyingPipelineType; + } + + public String getUnderlyingPipelineDepth() { + return this.underlyingPipelineDepth; + } + + public void setUnderlyingPipelineDepth(String underlyingPipelineDepth) { + this.underlyingPipelineDepth = underlyingPipelineDepth; + } + + public String getUnderlyingPipelineDiameter() { + return this.underlyingPipelineDiameter; + } + + public void setUnderlyingPipelineDiameter(String underlyingPipelineDiameter) { + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + } + + public String getUnderlyingPipelineMaterial() { + return this.underlyingPipelineMaterial; + } + + public void setUnderlyingPipelineMaterial(String underlyingPipelineMaterial) { + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + } + + public String getObjectType() { + return this.objectType; + } + + public void setObjectType(String objectType) { + this.objectType = objectType; + } + + public String getColor() { + return this.color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getImagePath() { + return this.imagePath; + } + + public void setImagePath(String imagePath) { + this.imagePath = imagePath; + } +} diff --git a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java index ec4425f..45e25e6 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java @@ -24,7 +24,7 @@ * Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - LabelBeanDao.createTable(db, ifNotExists); + MarkerLocalBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); @@ -34,7 +34,7 @@ * Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - LabelBeanDao.dropTable(db, ifExists); + MarkerLocalBeanDao.dropTable(db, ifExists); PipeLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); TaskMarkerLocalBeanDao.dropTable(db, ifExists); @@ -56,7 +56,7 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(LabelBeanDao.class); + registerDaoClass(MarkerLocalBeanDao.class); registerDaoClass(PipeLocalBeanDao.class); registerDaoClass(TaskLocalBeanDao.class); registerDaoClass(TaskMarkerLocalBeanDao.class); diff --git a/app/src/main/java/com/casic/detector/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/greendao/DaoSession.java index 4f9bdff..0d0d59f 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoSession.java @@ -1,6 +1,6 @@ package com.casic.detector.greendao; -import com.casic.detector.bean.LabelBean; +import com.casic.detector.bean.MarkerLocalBean; import com.casic.detector.bean.PipeLocalBean; import com.casic.detector.bean.TaskLocalBean; import com.casic.detector.bean.TaskMarkerLocalBean; @@ -22,12 +22,12 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig labelBeanDaoConfig; + private final DaoConfig markerLocalBeanDaoConfig; private final DaoConfig pipeLocalBeanDaoConfig; private final DaoConfig taskLocalBeanDaoConfig; private final DaoConfig taskMarkerLocalBeanDaoConfig; - private final LabelBeanDao labelBeanDao; + private final MarkerLocalBeanDao markerLocalBeanDao; private final PipeLocalBeanDao pipeLocalBeanDao; private final TaskLocalBeanDao taskLocalBeanDao; private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao; @@ -36,8 +36,8 @@ daoConfigMap) { super(db); - labelBeanDaoConfig = daoConfigMap.get(LabelBeanDao.class).clone(); - labelBeanDaoConfig.initIdentityScope(type); + markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone(); + markerLocalBeanDaoConfig.initIdentityScope(type); pipeLocalBeanDaoConfig = daoConfigMap.get(PipeLocalBeanDao.class).clone(); pipeLocalBeanDaoConfig.initIdentityScope(type); @@ -48,26 +48,26 @@ taskMarkerLocalBeanDaoConfig = daoConfigMap.get(TaskMarkerLocalBeanDao.class).clone(); taskMarkerLocalBeanDaoConfig.initIdentityScope(type); - labelBeanDao = new LabelBeanDao(labelBeanDaoConfig, this); + markerLocalBeanDao = new MarkerLocalBeanDao(markerLocalBeanDaoConfig, this); pipeLocalBeanDao = new PipeLocalBeanDao(pipeLocalBeanDaoConfig, this); taskLocalBeanDao = new TaskLocalBeanDao(taskLocalBeanDaoConfig, this); taskMarkerLocalBeanDao = new TaskMarkerLocalBeanDao(taskMarkerLocalBeanDaoConfig, this); - registerDao(LabelBean.class, labelBeanDao); + registerDao(MarkerLocalBean.class, markerLocalBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); registerDao(TaskLocalBean.class, taskLocalBeanDao); registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao); } public void clear() { - labelBeanDaoConfig.clearIdentityScope(); + markerLocalBeanDaoConfig.clearIdentityScope(); pipeLocalBeanDaoConfig.clearIdentityScope(); taskLocalBeanDaoConfig.clearIdentityScope(); taskMarkerLocalBeanDaoConfig.clearIdentityScope(); } - public LabelBeanDao getLabelBeanDao() { - return labelBeanDao; + public MarkerLocalBeanDao getMarkerLocalBeanDao() { + return markerLocalBeanDao; } public PipeLocalBeanDao getPipeLocalBeanDao() { diff --git a/app/src/main/java/com/casic/detector/bean/LabelBean.java b/app/src/main/java/com/casic/detector/bean/LabelBean.java deleted file mode 100644 index d22d835..0000000 --- a/app/src/main/java/com/casic/detector/bean/LabelBean.java +++ /dev/null @@ -1,321 +0,0 @@ -package com.casic.detector.bean; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -@Entity -public class LabelBean { - @Id(autoincrement = true) - private Long id;//主键ID - // 标记对象类型 - private String objectType; - // 管线类型 - private String pipelineType; - // 管材 - private String pipelineMaterial; - // 管直 - private String pipelineDiameter; - // 埋深 - private String buryDeep; - // 下层管线类型 - private String lowerType; - // 下层管材 - private String lowerMaterial; - // 下层管径 - private String lowerDiameter; - // 下层埋深 - private String lowerDeep; - // 埋设方式 - private String buryMethod; - // 所属区域 - private String area; - // 所属线路 - private String line; - // 所属道路 - private String road; - // 建设年代 - private String constructTime; - // 权属单位 - private String owner; - // 对象ID - private String objectId; - // 标识器ID号 - private String identifierId; - // 标识器类型 - private String identifierType; - // 标识器埋深 - private String identifierDeep; - // 安装人员 - private String person; - // 安装时间 - private String installTime; - // 经度 - private String lng; - // 纬度 - private String lat; - // 颜色 - private String color; - // 备注信息 - private String remark; - // 图片路径 - private String imagePath; - - @Generated(hash = 1718746860) - public LabelBean(Long id, String objectType, String pipelineType, - String pipelineMaterial, String pipelineDiameter, String buryDeep, - String lowerType, String lowerMaterial, String lowerDiameter, - String lowerDeep, String buryMethod, String area, String line, - String road, String constructTime, String owner, String objectId, - String identifierId, String identifierType, String identifierDeep, - String person, String installTime, String lng, String lat, String color, - String remark, String imagePath) { - this.id = id; - this.objectType = objectType; - this.pipelineType = pipelineType; - this.pipelineMaterial = pipelineMaterial; - this.pipelineDiameter = pipelineDiameter; - this.buryDeep = buryDeep; - this.lowerType = lowerType; - this.lowerMaterial = lowerMaterial; - this.lowerDiameter = lowerDiameter; - this.lowerDeep = lowerDeep; - this.buryMethod = buryMethod; - this.area = area; - this.line = line; - this.road = road; - this.constructTime = constructTime; - this.owner = owner; - this.objectId = objectId; - this.identifierId = identifierId; - this.identifierType = identifierType; - this.identifierDeep = identifierDeep; - this.person = person; - this.installTime = installTime; - this.lng = lng; - this.lat = lat; - this.color = color; - this.remark = remark; - this.imagePath = imagePath; - } - - @Generated(hash = 1285554626) - public LabelBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getObjectType() { - return this.objectType; - } - - public void setObjectType(String objectType) { - this.objectType = objectType; - } - - public String getPipelineType() { - return this.pipelineType; - } - - public void setPipelineType(String pipelineType) { - this.pipelineType = pipelineType; - } - - public String getPipelineMaterial() { - return this.pipelineMaterial; - } - - public void setPipelineMaterial(String pipelineMaterial) { - this.pipelineMaterial = pipelineMaterial; - } - - public String getPipelineDiameter() { - return this.pipelineDiameter; - } - - public void setPipelineDiameter(String pipelineDiameter) { - this.pipelineDiameter = pipelineDiameter; - } - - public String getBuryDeep() { - return this.buryDeep; - } - - public void setBuryDeep(String buryDeep) { - this.buryDeep = buryDeep; - } - - public String getLowerType() { - return this.lowerType; - } - - public void setLowerType(String lowerType) { - this.lowerType = lowerType; - } - - public String getLowerMaterial() { - return this.lowerMaterial; - } - - public void setLowerMaterial(String lowerMaterial) { - this.lowerMaterial = lowerMaterial; - } - - public String getLowerDiameter() { - return this.lowerDiameter; - } - - public void setLowerDiameter(String lowerDiameter) { - this.lowerDiameter = lowerDiameter; - } - - public String getLowerDeep() { - return this.lowerDeep; - } - - public void setLowerDeep(String lowerDeep) { - this.lowerDeep = lowerDeep; - } - - public String getBuryMethod() { - return this.buryMethod; - } - - public void setBuryMethod(String buryMethod) { - this.buryMethod = buryMethod; - } - - public String getArea() { - return this.area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getLine() { - return this.line; - } - - public void setLine(String line) { - this.line = line; - } - - public String getRoad() { - return this.road; - } - - public void setRoad(String road) { - this.road = road; - } - - public String getConstructTime() { - return this.constructTime; - } - - public void setConstructTime(String constructTime) { - this.constructTime = constructTime; - } - - public String getOwner() { - return this.owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getObjectId() { - return this.objectId; - } - - public void setObjectId(String objectId) { - this.objectId = objectId; - } - - public String getIdentifierId() { - return this.identifierId; - } - - public void setIdentifierId(String identifierId) { - this.identifierId = identifierId; - } - - public String getIdentifierType() { - return this.identifierType; - } - - public void setIdentifierType(String identifierType) { - this.identifierType = identifierType; - } - - public String getIdentifierDeep() { - return this.identifierDeep; - } - - public void setIdentifierDeep(String identifierDeep) { - this.identifierDeep = identifierDeep; - } - - public String getPerson() { - return this.person; - } - - public void setPerson(String person) { - this.person = person; - } - - public String getInstallTime() { - return this.installTime; - } - - public void setInstallTime(String installTime) { - this.installTime = installTime; - } - - public String getLng() { - return this.lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getLat() { - return this.lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getColor() { - return this.color; - } - - public void setColor(String color) { - this.color = color; - } - - public String getRemark() { - return this.remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getImagePath() { - return this.imagePath; - } - - public void setImagePath(String imagePath) { - this.imagePath = imagePath; - } -} diff --git a/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java new file mode 100644 index 0000000..c59cf0b --- /dev/null +++ b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java @@ -0,0 +1,327 @@ +package com.casic.detector.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Id; +import org.greenrobot.greendao.annotation.Generated; + +/** + * 从平台下载的标识器本地库实体类 + */ +@Entity +public class MarkerLocalBean { + @Id(autoincrement = true) + private Long id;//本地库主键ID + + // 管线类型 + private String pipelineType; + // 管线直径 + private String pipelineDiameter; + // 管材 + private String pipelineMaterial; + // 埋设方式 + private String buryMethod; + // 埋深 + private String buryDepth; + // 所属区域 + private String area; + // 所属线路 + private String line; + // 所属道路 + private String road; + // 建设年代 + private String constructTime; + // 权属单位 + private String owner; + //标识对象ID,无实际用途 + @Deprecated + private String objectId; + // 标识器ID + private String markerId; + // 标识器类型 + private String markerType; + // 标识器埋深 + private String markerDepth; + // 安装部门 + private String installationDept; + // 经度 + private String lng; + // 纬度 + private String lat; + //最后修改时间,更新时间 + private String updateTime; + // 备注信息 + private String remark; + // 下层管线类型 + private String underlyingPipelineType; + // 下层埋深 + private String underlyingPipelineDepth; + // 下层管径 + private String underlyingPipelineDiameter; + // 下层管材 + private String underlyingPipelineMaterial; + //标识对象类型 + private String objectType; + // 颜色 + private String color; + // 图片路径 + private String imagePath; + + @Generated(hash = 1479045776) + public MarkerLocalBean(Long id, String pipelineType, String pipelineDiameter, + String pipelineMaterial, String buryMethod, String buryDepth, + String area, String line, String road, String constructTime, + String owner, String objectId, String markerId, String markerType, + String markerDepth, String installationDept, String lng, String lat, + String updateTime, String remark, String underlyingPipelineType, + String underlyingPipelineDepth, String underlyingPipelineDiameter, + String underlyingPipelineMaterial, String objectType, String color, + String imagePath) { + this.id = id; + this.pipelineType = pipelineType; + this.pipelineDiameter = pipelineDiameter; + this.pipelineMaterial = pipelineMaterial; + this.buryMethod = buryMethod; + this.buryDepth = buryDepth; + this.area = area; + this.line = line; + this.road = road; + this.constructTime = constructTime; + this.owner = owner; + this.objectId = objectId; + this.markerId = markerId; + this.markerType = markerType; + this.markerDepth = markerDepth; + this.installationDept = installationDept; + this.lng = lng; + this.lat = lat; + this.updateTime = updateTime; + this.remark = remark; + this.underlyingPipelineType = underlyingPipelineType; + this.underlyingPipelineDepth = underlyingPipelineDepth; + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + this.objectType = objectType; + this.color = color; + this.imagePath = imagePath; + } + + @Generated(hash = 1538606012) + public MarkerLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPipelineType() { + return this.pipelineType; + } + + public void setPipelineType(String pipelineType) { + this.pipelineType = pipelineType; + } + + public String getPipelineDiameter() { + return this.pipelineDiameter; + } + + public void setPipelineDiameter(String pipelineDiameter) { + this.pipelineDiameter = pipelineDiameter; + } + + public String getPipelineMaterial() { + return this.pipelineMaterial; + } + + public void setPipelineMaterial(String pipelineMaterial) { + this.pipelineMaterial = pipelineMaterial; + } + + public String getBuryMethod() { + return this.buryMethod; + } + + public void setBuryMethod(String buryMethod) { + this.buryMethod = buryMethod; + } + + public String getBuryDepth() { + return this.buryDepth; + } + + public void setBuryDepth(String buryDepth) { + this.buryDepth = buryDepth; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getLine() { + return this.line; + } + + public void setLine(String line) { + this.line = line; + } + + public String getRoad() { + return this.road; + } + + public void setRoad(String road) { + this.road = road; + } + + public String getConstructTime() { + return this.constructTime; + } + + public void setConstructTime(String constructTime) { + this.constructTime = constructTime; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getObjectId() { + return this.objectId; + } + + public void setObjectId(String objectId) { + this.objectId = objectId; + } + + public String getMarkerId() { + return this.markerId; + } + + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerType() { + return this.markerType; + } + + public void setMarkerType(String markerType) { + this.markerType = markerType; + } + + public String getMarkerDepth() { + return this.markerDepth; + } + + public void setMarkerDepth(String markerDepth) { + this.markerDepth = markerDepth; + } + + public String getInstallationDept() { + return this.installationDept; + } + + public void setInstallationDept(String installationDept) { + this.installationDept = installationDept; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return this.remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getUnderlyingPipelineType() { + return this.underlyingPipelineType; + } + + public void setUnderlyingPipelineType(String underlyingPipelineType) { + this.underlyingPipelineType = underlyingPipelineType; + } + + public String getUnderlyingPipelineDepth() { + return this.underlyingPipelineDepth; + } + + public void setUnderlyingPipelineDepth(String underlyingPipelineDepth) { + this.underlyingPipelineDepth = underlyingPipelineDepth; + } + + public String getUnderlyingPipelineDiameter() { + return this.underlyingPipelineDiameter; + } + + public void setUnderlyingPipelineDiameter(String underlyingPipelineDiameter) { + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + } + + public String getUnderlyingPipelineMaterial() { + return this.underlyingPipelineMaterial; + } + + public void setUnderlyingPipelineMaterial(String underlyingPipelineMaterial) { + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + } + + public String getObjectType() { + return this.objectType; + } + + public void setObjectType(String objectType) { + this.objectType = objectType; + } + + public String getColor() { + return this.color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getImagePath() { + return this.imagePath; + } + + public void setImagePath(String imagePath) { + this.imagePath = imagePath; + } +} diff --git a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java index ec4425f..45e25e6 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java @@ -24,7 +24,7 @@ * Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - LabelBeanDao.createTable(db, ifNotExists); + MarkerLocalBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); @@ -34,7 +34,7 @@ * Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - LabelBeanDao.dropTable(db, ifExists); + MarkerLocalBeanDao.dropTable(db, ifExists); PipeLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); TaskMarkerLocalBeanDao.dropTable(db, ifExists); @@ -56,7 +56,7 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(LabelBeanDao.class); + registerDaoClass(MarkerLocalBeanDao.class); registerDaoClass(PipeLocalBeanDao.class); registerDaoClass(TaskLocalBeanDao.class); registerDaoClass(TaskMarkerLocalBeanDao.class); diff --git a/app/src/main/java/com/casic/detector/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/greendao/DaoSession.java index 4f9bdff..0d0d59f 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoSession.java @@ -1,6 +1,6 @@ package com.casic.detector.greendao; -import com.casic.detector.bean.LabelBean; +import com.casic.detector.bean.MarkerLocalBean; import com.casic.detector.bean.PipeLocalBean; import com.casic.detector.bean.TaskLocalBean; import com.casic.detector.bean.TaskMarkerLocalBean; @@ -22,12 +22,12 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig labelBeanDaoConfig; + private final DaoConfig markerLocalBeanDaoConfig; private final DaoConfig pipeLocalBeanDaoConfig; private final DaoConfig taskLocalBeanDaoConfig; private final DaoConfig taskMarkerLocalBeanDaoConfig; - private final LabelBeanDao labelBeanDao; + private final MarkerLocalBeanDao markerLocalBeanDao; private final PipeLocalBeanDao pipeLocalBeanDao; private final TaskLocalBeanDao taskLocalBeanDao; private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao; @@ -36,8 +36,8 @@ daoConfigMap) { super(db); - labelBeanDaoConfig = daoConfigMap.get(LabelBeanDao.class).clone(); - labelBeanDaoConfig.initIdentityScope(type); + markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone(); + markerLocalBeanDaoConfig.initIdentityScope(type); pipeLocalBeanDaoConfig = daoConfigMap.get(PipeLocalBeanDao.class).clone(); pipeLocalBeanDaoConfig.initIdentityScope(type); @@ -48,26 +48,26 @@ taskMarkerLocalBeanDaoConfig = daoConfigMap.get(TaskMarkerLocalBeanDao.class).clone(); taskMarkerLocalBeanDaoConfig.initIdentityScope(type); - labelBeanDao = new LabelBeanDao(labelBeanDaoConfig, this); + markerLocalBeanDao = new MarkerLocalBeanDao(markerLocalBeanDaoConfig, this); pipeLocalBeanDao = new PipeLocalBeanDao(pipeLocalBeanDaoConfig, this); taskLocalBeanDao = new TaskLocalBeanDao(taskLocalBeanDaoConfig, this); taskMarkerLocalBeanDao = new TaskMarkerLocalBeanDao(taskMarkerLocalBeanDaoConfig, this); - registerDao(LabelBean.class, labelBeanDao); + registerDao(MarkerLocalBean.class, markerLocalBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); registerDao(TaskLocalBean.class, taskLocalBeanDao); registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao); } public void clear() { - labelBeanDaoConfig.clearIdentityScope(); + markerLocalBeanDaoConfig.clearIdentityScope(); pipeLocalBeanDaoConfig.clearIdentityScope(); taskLocalBeanDaoConfig.clearIdentityScope(); taskMarkerLocalBeanDaoConfig.clearIdentityScope(); } - public LabelBeanDao getLabelBeanDao() { - return labelBeanDao; + public MarkerLocalBeanDao getMarkerLocalBeanDao() { + return markerLocalBeanDao; } public PipeLocalBeanDao getPipeLocalBeanDao() { diff --git a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java b/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java deleted file mode 100644 index 94a73c4..0000000 --- a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java +++ /dev/null @@ -1,484 +0,0 @@ -package com.casic.detector.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import com.casic.detector.bean.LabelBean; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; -import org.greenrobot.greendao.internal.DaoConfig; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** - * DAO for table "LABEL_BEAN". - */ -public class LabelBeanDao extends AbstractDao { - - public static final String TABLENAME = "LABEL_BEAN"; - - /** - * Properties of entity LabelBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ObjectType = new Property(1, String.class, "objectType", false, "OBJECT_TYPE"); - public final static Property PipelineType = new Property(2, String.class, "pipelineType", false, "PIPELINE_TYPE"); - public final static Property PipelineMaterial = new Property(3, String.class, "pipelineMaterial", false, "PIPELINE_MATERIAL"); - public final static Property PipelineDiameter = new Property(4, String.class, "pipelineDiameter", false, "PIPELINE_DIAMETER"); - public final static Property BuryDeep = new Property(5, String.class, "buryDeep", false, "BURY_DEEP"); - public final static Property LowerType = new Property(6, String.class, "lowerType", false, "LOWER_TYPE"); - public final static Property LowerMaterial = new Property(7, String.class, "lowerMaterial", false, "LOWER_MATERIAL"); - public final static Property LowerDiameter = new Property(8, String.class, "lowerDiameter", false, "LOWER_DIAMETER"); - public final static Property LowerDeep = new Property(9, String.class, "lowerDeep", false, "LOWER_DEEP"); - public final static Property BuryMethod = new Property(10, String.class, "buryMethod", false, "BURY_METHOD"); - public final static Property Area = new Property(11, String.class, "area", false, "AREA"); - public final static Property Line = new Property(12, String.class, "line", false, "LINE"); - public final static Property Road = new Property(13, String.class, "road", false, "ROAD"); - public final static Property ConstructTime = new Property(14, String.class, "constructTime", false, "CONSTRUCT_TIME"); - public final static Property Owner = new Property(15, String.class, "owner", false, "OWNER"); - public final static Property ObjectId = new Property(16, String.class, "objectId", false, "OBJECT_ID"); - public final static Property IdentifierId = new Property(17, String.class, "identifierId", false, "IDENTIFIER_ID"); - public final static Property IdentifierType = new Property(18, String.class, "identifierType", false, "IDENTIFIER_TYPE"); - public final static Property IdentifierDeep = new Property(19, String.class, "identifierDeep", false, "IDENTIFIER_DEEP"); - public final static Property Person = new Property(20, String.class, "person", false, "PERSON"); - public final static Property InstallTime = new Property(21, String.class, "installTime", false, "INSTALL_TIME"); - public final static Property Lng = new Property(22, String.class, "lng", false, "LNG"); - public final static Property Lat = new Property(23, String.class, "lat", false, "LAT"); - public final static Property Color = new Property(24, String.class, "color", false, "COLOR"); - public final static Property Remark = new Property(25, String.class, "remark", false, "REMARK"); - public final static Property ImagePath = new Property(26, String.class, "imagePath", false, "IMAGE_PATH"); - } - - - public LabelBeanDao(DaoConfig config) { - super(config); - } - - public LabelBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** - * Creates the underlying database table. - */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; - db.execSQL("CREATE TABLE " + constraint + "\"LABEL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"OBJECT_TYPE\" TEXT," + // 1: objectType - "\"PIPELINE_TYPE\" TEXT," + // 2: pipelineType - "\"PIPELINE_MATERIAL\" TEXT," + // 3: pipelineMaterial - "\"PIPELINE_DIAMETER\" TEXT," + // 4: pipelineDiameter - "\"BURY_DEEP\" TEXT," + // 5: buryDeep - "\"LOWER_TYPE\" TEXT," + // 6: lowerType - "\"LOWER_MATERIAL\" TEXT," + // 7: lowerMaterial - "\"LOWER_DIAMETER\" TEXT," + // 8: lowerDiameter - "\"LOWER_DEEP\" TEXT," + // 9: lowerDeep - "\"BURY_METHOD\" TEXT," + // 10: buryMethod - "\"AREA\" TEXT," + // 11: area - "\"LINE\" TEXT," + // 12: line - "\"ROAD\" TEXT," + // 13: road - "\"CONSTRUCT_TIME\" TEXT," + // 14: constructTime - "\"OWNER\" TEXT," + // 15: owner - "\"OBJECT_ID\" TEXT," + // 16: objectId - "\"IDENTIFIER_ID\" TEXT," + // 17: identifierId - "\"IDENTIFIER_TYPE\" TEXT," + // 18: identifierType - "\"IDENTIFIER_DEEP\" TEXT," + // 19: identifierDeep - "\"PERSON\" TEXT," + // 20: person - "\"INSTALL_TIME\" TEXT," + // 21: installTime - "\"LNG\" TEXT," + // 22: lng - "\"LAT\" TEXT," + // 23: lat - "\"COLOR\" TEXT," + // 24: color - "\"REMARK\" TEXT," + // 25: remark - "\"IMAGE_PATH\" TEXT);"); // 26: imagePath - } - - /** - * Drops the underlying database table. - */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LABEL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, LabelBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String objectType = entity.getObjectType(); - if (objectType != null) { - stmt.bindString(2, objectType); - } - - String pipelineType = entity.getPipelineType(); - if (pipelineType != null) { - stmt.bindString(3, pipelineType); - } - - String pipelineMaterial = entity.getPipelineMaterial(); - if (pipelineMaterial != null) { - stmt.bindString(4, pipelineMaterial); - } - - String pipelineDiameter = entity.getPipelineDiameter(); - if (pipelineDiameter != null) { - stmt.bindString(5, pipelineDiameter); - } - - String buryDeep = entity.getBuryDeep(); - if (buryDeep != null) { - stmt.bindString(6, buryDeep); - } - - String lowerType = entity.getLowerType(); - if (lowerType != null) { - stmt.bindString(7, lowerType); - } - - String lowerMaterial = entity.getLowerMaterial(); - if (lowerMaterial != null) { - stmt.bindString(8, lowerMaterial); - } - - String lowerDiameter = entity.getLowerDiameter(); - if (lowerDiameter != null) { - stmt.bindString(9, lowerDiameter); - } - - String lowerDeep = entity.getLowerDeep(); - if (lowerDeep != null) { - stmt.bindString(10, lowerDeep); - } - - String buryMethod = entity.getBuryMethod(); - if (buryMethod != null) { - stmt.bindString(11, buryMethod); - } - - String area = entity.getArea(); - if (area != null) { - stmt.bindString(12, area); - } - - String line = entity.getLine(); - if (line != null) { - stmt.bindString(13, line); - } - - String road = entity.getRoad(); - if (road != null) { - stmt.bindString(14, road); - } - - String constructTime = entity.getConstructTime(); - if (constructTime != null) { - stmt.bindString(15, constructTime); - } - - String owner = entity.getOwner(); - if (owner != null) { - stmt.bindString(16, owner); - } - - String objectId = entity.getObjectId(); - if (objectId != null) { - stmt.bindString(17, objectId); - } - - String identifierId = entity.getIdentifierId(); - if (identifierId != null) { - stmt.bindString(18, identifierId); - } - - String identifierType = entity.getIdentifierType(); - if (identifierType != null) { - stmt.bindString(19, identifierType); - } - - String identifierDeep = entity.getIdentifierDeep(); - if (identifierDeep != null) { - stmt.bindString(20, identifierDeep); - } - - String person = entity.getPerson(); - if (person != null) { - stmt.bindString(21, person); - } - - String installTime = entity.getInstallTime(); - if (installTime != null) { - stmt.bindString(22, installTime); - } - - String lng = entity.getLng(); - if (lng != null) { - stmt.bindString(23, lng); - } - - String lat = entity.getLat(); - if (lat != null) { - stmt.bindString(24, lat); - } - - String color = entity.getColor(); - if (color != null) { - stmt.bindString(25, color); - } - - String remark = entity.getRemark(); - if (remark != null) { - stmt.bindString(26, remark); - } - - String imagePath = entity.getImagePath(); - if (imagePath != null) { - stmt.bindString(27, imagePath); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, LabelBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String objectType = entity.getObjectType(); - if (objectType != null) { - stmt.bindString(2, objectType); - } - - String pipelineType = entity.getPipelineType(); - if (pipelineType != null) { - stmt.bindString(3, pipelineType); - } - - String pipelineMaterial = entity.getPipelineMaterial(); - if (pipelineMaterial != null) { - stmt.bindString(4, pipelineMaterial); - } - - String pipelineDiameter = entity.getPipelineDiameter(); - if (pipelineDiameter != null) { - stmt.bindString(5, pipelineDiameter); - } - - String buryDeep = entity.getBuryDeep(); - if (buryDeep != null) { - stmt.bindString(6, buryDeep); - } - - String lowerType = entity.getLowerType(); - if (lowerType != null) { - stmt.bindString(7, lowerType); - } - - String lowerMaterial = entity.getLowerMaterial(); - if (lowerMaterial != null) { - stmt.bindString(8, lowerMaterial); - } - - String lowerDiameter = entity.getLowerDiameter(); - if (lowerDiameter != null) { - stmt.bindString(9, lowerDiameter); - } - - String lowerDeep = entity.getLowerDeep(); - if (lowerDeep != null) { - stmt.bindString(10, lowerDeep); - } - - String buryMethod = entity.getBuryMethod(); - if (buryMethod != null) { - stmt.bindString(11, buryMethod); - } - - String area = entity.getArea(); - if (area != null) { - stmt.bindString(12, area); - } - - String line = entity.getLine(); - if (line != null) { - stmt.bindString(13, line); - } - - String road = entity.getRoad(); - if (road != null) { - stmt.bindString(14, road); - } - - String constructTime = entity.getConstructTime(); - if (constructTime != null) { - stmt.bindString(15, constructTime); - } - - String owner = entity.getOwner(); - if (owner != null) { - stmt.bindString(16, owner); - } - - String objectId = entity.getObjectId(); - if (objectId != null) { - stmt.bindString(17, objectId); - } - - String identifierId = entity.getIdentifierId(); - if (identifierId != null) { - stmt.bindString(18, identifierId); - } - - String identifierType = entity.getIdentifierType(); - if (identifierType != null) { - stmt.bindString(19, identifierType); - } - - String identifierDeep = entity.getIdentifierDeep(); - if (identifierDeep != null) { - stmt.bindString(20, identifierDeep); - } - - String person = entity.getPerson(); - if (person != null) { - stmt.bindString(21, person); - } - - String installTime = entity.getInstallTime(); - if (installTime != null) { - stmt.bindString(22, installTime); - } - - String lng = entity.getLng(); - if (lng != null) { - stmt.bindString(23, lng); - } - - String lat = entity.getLat(); - if (lat != null) { - stmt.bindString(24, lat); - } - - String color = entity.getColor(); - if (color != null) { - stmt.bindString(25, color); - } - - String remark = entity.getRemark(); - if (remark != null) { - stmt.bindString(26, remark); - } - - String imagePath = entity.getImagePath(); - if (imagePath != null) { - stmt.bindString(27, imagePath); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public LabelBean readEntity(Cursor cursor, int offset) { - LabelBean entity = new LabelBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // objectType - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineType - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // pipelineDiameter - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDeep - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lowerType - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lowerMaterial - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lowerDiameter - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // lowerDeep - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // buryMethod - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // area - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // line - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // road - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // constructTime - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // owner - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // objectId - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // identifierId - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // identifierType - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // identifierDeep - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // person - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // installTime - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // lng - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // lat - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // color - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // remark - cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, LabelBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setObjectType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setPipelineType(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setPipelineMaterial(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setPipelineDiameter(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setBuryDeep(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setLowerType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLowerMaterial(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLowerDiameter(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLowerDeep(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); - entity.setBuryMethod(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - entity.setArea(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - entity.setLine(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); - entity.setRoad(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); - entity.setConstructTime(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); - entity.setOwner(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); - entity.setObjectId(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); - entity.setIdentifierId(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); - entity.setIdentifierType(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18)); - entity.setIdentifierDeep(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19)); - entity.setPerson(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); - entity.setInstallTime(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); - entity.setLng(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22)); - entity.setLat(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); - entity.setColor(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); - entity.setRemark(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); - } - - @Override - protected final Long updateKeyAfterInsert(LabelBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(LabelBean entity) { - if (entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(LabelBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/detector/bean/LabelBean.java b/app/src/main/java/com/casic/detector/bean/LabelBean.java deleted file mode 100644 index d22d835..0000000 --- a/app/src/main/java/com/casic/detector/bean/LabelBean.java +++ /dev/null @@ -1,321 +0,0 @@ -package com.casic.detector.bean; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -@Entity -public class LabelBean { - @Id(autoincrement = true) - private Long id;//主键ID - // 标记对象类型 - private String objectType; - // 管线类型 - private String pipelineType; - // 管材 - private String pipelineMaterial; - // 管直 - private String pipelineDiameter; - // 埋深 - private String buryDeep; - // 下层管线类型 - private String lowerType; - // 下层管材 - private String lowerMaterial; - // 下层管径 - private String lowerDiameter; - // 下层埋深 - private String lowerDeep; - // 埋设方式 - private String buryMethod; - // 所属区域 - private String area; - // 所属线路 - private String line; - // 所属道路 - private String road; - // 建设年代 - private String constructTime; - // 权属单位 - private String owner; - // 对象ID - private String objectId; - // 标识器ID号 - private String identifierId; - // 标识器类型 - private String identifierType; - // 标识器埋深 - private String identifierDeep; - // 安装人员 - private String person; - // 安装时间 - private String installTime; - // 经度 - private String lng; - // 纬度 - private String lat; - // 颜色 - private String color; - // 备注信息 - private String remark; - // 图片路径 - private String imagePath; - - @Generated(hash = 1718746860) - public LabelBean(Long id, String objectType, String pipelineType, - String pipelineMaterial, String pipelineDiameter, String buryDeep, - String lowerType, String lowerMaterial, String lowerDiameter, - String lowerDeep, String buryMethod, String area, String line, - String road, String constructTime, String owner, String objectId, - String identifierId, String identifierType, String identifierDeep, - String person, String installTime, String lng, String lat, String color, - String remark, String imagePath) { - this.id = id; - this.objectType = objectType; - this.pipelineType = pipelineType; - this.pipelineMaterial = pipelineMaterial; - this.pipelineDiameter = pipelineDiameter; - this.buryDeep = buryDeep; - this.lowerType = lowerType; - this.lowerMaterial = lowerMaterial; - this.lowerDiameter = lowerDiameter; - this.lowerDeep = lowerDeep; - this.buryMethod = buryMethod; - this.area = area; - this.line = line; - this.road = road; - this.constructTime = constructTime; - this.owner = owner; - this.objectId = objectId; - this.identifierId = identifierId; - this.identifierType = identifierType; - this.identifierDeep = identifierDeep; - this.person = person; - this.installTime = installTime; - this.lng = lng; - this.lat = lat; - this.color = color; - this.remark = remark; - this.imagePath = imagePath; - } - - @Generated(hash = 1285554626) - public LabelBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getObjectType() { - return this.objectType; - } - - public void setObjectType(String objectType) { - this.objectType = objectType; - } - - public String getPipelineType() { - return this.pipelineType; - } - - public void setPipelineType(String pipelineType) { - this.pipelineType = pipelineType; - } - - public String getPipelineMaterial() { - return this.pipelineMaterial; - } - - public void setPipelineMaterial(String pipelineMaterial) { - this.pipelineMaterial = pipelineMaterial; - } - - public String getPipelineDiameter() { - return this.pipelineDiameter; - } - - public void setPipelineDiameter(String pipelineDiameter) { - this.pipelineDiameter = pipelineDiameter; - } - - public String getBuryDeep() { - return this.buryDeep; - } - - public void setBuryDeep(String buryDeep) { - this.buryDeep = buryDeep; - } - - public String getLowerType() { - return this.lowerType; - } - - public void setLowerType(String lowerType) { - this.lowerType = lowerType; - } - - public String getLowerMaterial() { - return this.lowerMaterial; - } - - public void setLowerMaterial(String lowerMaterial) { - this.lowerMaterial = lowerMaterial; - } - - public String getLowerDiameter() { - return this.lowerDiameter; - } - - public void setLowerDiameter(String lowerDiameter) { - this.lowerDiameter = lowerDiameter; - } - - public String getLowerDeep() { - return this.lowerDeep; - } - - public void setLowerDeep(String lowerDeep) { - this.lowerDeep = lowerDeep; - } - - public String getBuryMethod() { - return this.buryMethod; - } - - public void setBuryMethod(String buryMethod) { - this.buryMethod = buryMethod; - } - - public String getArea() { - return this.area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getLine() { - return this.line; - } - - public void setLine(String line) { - this.line = line; - } - - public String getRoad() { - return this.road; - } - - public void setRoad(String road) { - this.road = road; - } - - public String getConstructTime() { - return this.constructTime; - } - - public void setConstructTime(String constructTime) { - this.constructTime = constructTime; - } - - public String getOwner() { - return this.owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getObjectId() { - return this.objectId; - } - - public void setObjectId(String objectId) { - this.objectId = objectId; - } - - public String getIdentifierId() { - return this.identifierId; - } - - public void setIdentifierId(String identifierId) { - this.identifierId = identifierId; - } - - public String getIdentifierType() { - return this.identifierType; - } - - public void setIdentifierType(String identifierType) { - this.identifierType = identifierType; - } - - public String getIdentifierDeep() { - return this.identifierDeep; - } - - public void setIdentifierDeep(String identifierDeep) { - this.identifierDeep = identifierDeep; - } - - public String getPerson() { - return this.person; - } - - public void setPerson(String person) { - this.person = person; - } - - public String getInstallTime() { - return this.installTime; - } - - public void setInstallTime(String installTime) { - this.installTime = installTime; - } - - public String getLng() { - return this.lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getLat() { - return this.lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getColor() { - return this.color; - } - - public void setColor(String color) { - this.color = color; - } - - public String getRemark() { - return this.remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getImagePath() { - return this.imagePath; - } - - public void setImagePath(String imagePath) { - this.imagePath = imagePath; - } -} diff --git a/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java new file mode 100644 index 0000000..c59cf0b --- /dev/null +++ b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java @@ -0,0 +1,327 @@ +package com.casic.detector.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Id; +import org.greenrobot.greendao.annotation.Generated; + +/** + * 从平台下载的标识器本地库实体类 + */ +@Entity +public class MarkerLocalBean { + @Id(autoincrement = true) + private Long id;//本地库主键ID + + // 管线类型 + private String pipelineType; + // 管线直径 + private String pipelineDiameter; + // 管材 + private String pipelineMaterial; + // 埋设方式 + private String buryMethod; + // 埋深 + private String buryDepth; + // 所属区域 + private String area; + // 所属线路 + private String line; + // 所属道路 + private String road; + // 建设年代 + private String constructTime; + // 权属单位 + private String owner; + //标识对象ID,无实际用途 + @Deprecated + private String objectId; + // 标识器ID + private String markerId; + // 标识器类型 + private String markerType; + // 标识器埋深 + private String markerDepth; + // 安装部门 + private String installationDept; + // 经度 + private String lng; + // 纬度 + private String lat; + //最后修改时间,更新时间 + private String updateTime; + // 备注信息 + private String remark; + // 下层管线类型 + private String underlyingPipelineType; + // 下层埋深 + private String underlyingPipelineDepth; + // 下层管径 + private String underlyingPipelineDiameter; + // 下层管材 + private String underlyingPipelineMaterial; + //标识对象类型 + private String objectType; + // 颜色 + private String color; + // 图片路径 + private String imagePath; + + @Generated(hash = 1479045776) + public MarkerLocalBean(Long id, String pipelineType, String pipelineDiameter, + String pipelineMaterial, String buryMethod, String buryDepth, + String area, String line, String road, String constructTime, + String owner, String objectId, String markerId, String markerType, + String markerDepth, String installationDept, String lng, String lat, + String updateTime, String remark, String underlyingPipelineType, + String underlyingPipelineDepth, String underlyingPipelineDiameter, + String underlyingPipelineMaterial, String objectType, String color, + String imagePath) { + this.id = id; + this.pipelineType = pipelineType; + this.pipelineDiameter = pipelineDiameter; + this.pipelineMaterial = pipelineMaterial; + this.buryMethod = buryMethod; + this.buryDepth = buryDepth; + this.area = area; + this.line = line; + this.road = road; + this.constructTime = constructTime; + this.owner = owner; + this.objectId = objectId; + this.markerId = markerId; + this.markerType = markerType; + this.markerDepth = markerDepth; + this.installationDept = installationDept; + this.lng = lng; + this.lat = lat; + this.updateTime = updateTime; + this.remark = remark; + this.underlyingPipelineType = underlyingPipelineType; + this.underlyingPipelineDepth = underlyingPipelineDepth; + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + this.objectType = objectType; + this.color = color; + this.imagePath = imagePath; + } + + @Generated(hash = 1538606012) + public MarkerLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPipelineType() { + return this.pipelineType; + } + + public void setPipelineType(String pipelineType) { + this.pipelineType = pipelineType; + } + + public String getPipelineDiameter() { + return this.pipelineDiameter; + } + + public void setPipelineDiameter(String pipelineDiameter) { + this.pipelineDiameter = pipelineDiameter; + } + + public String getPipelineMaterial() { + return this.pipelineMaterial; + } + + public void setPipelineMaterial(String pipelineMaterial) { + this.pipelineMaterial = pipelineMaterial; + } + + public String getBuryMethod() { + return this.buryMethod; + } + + public void setBuryMethod(String buryMethod) { + this.buryMethod = buryMethod; + } + + public String getBuryDepth() { + return this.buryDepth; + } + + public void setBuryDepth(String buryDepth) { + this.buryDepth = buryDepth; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getLine() { + return this.line; + } + + public void setLine(String line) { + this.line = line; + } + + public String getRoad() { + return this.road; + } + + public void setRoad(String road) { + this.road = road; + } + + public String getConstructTime() { + return this.constructTime; + } + + public void setConstructTime(String constructTime) { + this.constructTime = constructTime; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getObjectId() { + return this.objectId; + } + + public void setObjectId(String objectId) { + this.objectId = objectId; + } + + public String getMarkerId() { + return this.markerId; + } + + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerType() { + return this.markerType; + } + + public void setMarkerType(String markerType) { + this.markerType = markerType; + } + + public String getMarkerDepth() { + return this.markerDepth; + } + + public void setMarkerDepth(String markerDepth) { + this.markerDepth = markerDepth; + } + + public String getInstallationDept() { + return this.installationDept; + } + + public void setInstallationDept(String installationDept) { + this.installationDept = installationDept; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return this.remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getUnderlyingPipelineType() { + return this.underlyingPipelineType; + } + + public void setUnderlyingPipelineType(String underlyingPipelineType) { + this.underlyingPipelineType = underlyingPipelineType; + } + + public String getUnderlyingPipelineDepth() { + return this.underlyingPipelineDepth; + } + + public void setUnderlyingPipelineDepth(String underlyingPipelineDepth) { + this.underlyingPipelineDepth = underlyingPipelineDepth; + } + + public String getUnderlyingPipelineDiameter() { + return this.underlyingPipelineDiameter; + } + + public void setUnderlyingPipelineDiameter(String underlyingPipelineDiameter) { + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + } + + public String getUnderlyingPipelineMaterial() { + return this.underlyingPipelineMaterial; + } + + public void setUnderlyingPipelineMaterial(String underlyingPipelineMaterial) { + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + } + + public String getObjectType() { + return this.objectType; + } + + public void setObjectType(String objectType) { + this.objectType = objectType; + } + + public String getColor() { + return this.color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getImagePath() { + return this.imagePath; + } + + public void setImagePath(String imagePath) { + this.imagePath = imagePath; + } +} diff --git a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java index ec4425f..45e25e6 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java @@ -24,7 +24,7 @@ * Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - LabelBeanDao.createTable(db, ifNotExists); + MarkerLocalBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); @@ -34,7 +34,7 @@ * Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - LabelBeanDao.dropTable(db, ifExists); + MarkerLocalBeanDao.dropTable(db, ifExists); PipeLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); TaskMarkerLocalBeanDao.dropTable(db, ifExists); @@ -56,7 +56,7 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(LabelBeanDao.class); + registerDaoClass(MarkerLocalBeanDao.class); registerDaoClass(PipeLocalBeanDao.class); registerDaoClass(TaskLocalBeanDao.class); registerDaoClass(TaskMarkerLocalBeanDao.class); diff --git a/app/src/main/java/com/casic/detector/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/greendao/DaoSession.java index 4f9bdff..0d0d59f 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoSession.java @@ -1,6 +1,6 @@ package com.casic.detector.greendao; -import com.casic.detector.bean.LabelBean; +import com.casic.detector.bean.MarkerLocalBean; import com.casic.detector.bean.PipeLocalBean; import com.casic.detector.bean.TaskLocalBean; import com.casic.detector.bean.TaskMarkerLocalBean; @@ -22,12 +22,12 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig labelBeanDaoConfig; + private final DaoConfig markerLocalBeanDaoConfig; private final DaoConfig pipeLocalBeanDaoConfig; private final DaoConfig taskLocalBeanDaoConfig; private final DaoConfig taskMarkerLocalBeanDaoConfig; - private final LabelBeanDao labelBeanDao; + private final MarkerLocalBeanDao markerLocalBeanDao; private final PipeLocalBeanDao pipeLocalBeanDao; private final TaskLocalBeanDao taskLocalBeanDao; private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao; @@ -36,8 +36,8 @@ daoConfigMap) { super(db); - labelBeanDaoConfig = daoConfigMap.get(LabelBeanDao.class).clone(); - labelBeanDaoConfig.initIdentityScope(type); + markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone(); + markerLocalBeanDaoConfig.initIdentityScope(type); pipeLocalBeanDaoConfig = daoConfigMap.get(PipeLocalBeanDao.class).clone(); pipeLocalBeanDaoConfig.initIdentityScope(type); @@ -48,26 +48,26 @@ taskMarkerLocalBeanDaoConfig = daoConfigMap.get(TaskMarkerLocalBeanDao.class).clone(); taskMarkerLocalBeanDaoConfig.initIdentityScope(type); - labelBeanDao = new LabelBeanDao(labelBeanDaoConfig, this); + markerLocalBeanDao = new MarkerLocalBeanDao(markerLocalBeanDaoConfig, this); pipeLocalBeanDao = new PipeLocalBeanDao(pipeLocalBeanDaoConfig, this); taskLocalBeanDao = new TaskLocalBeanDao(taskLocalBeanDaoConfig, this); taskMarkerLocalBeanDao = new TaskMarkerLocalBeanDao(taskMarkerLocalBeanDaoConfig, this); - registerDao(LabelBean.class, labelBeanDao); + registerDao(MarkerLocalBean.class, markerLocalBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); registerDao(TaskLocalBean.class, taskLocalBeanDao); registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao); } public void clear() { - labelBeanDaoConfig.clearIdentityScope(); + markerLocalBeanDaoConfig.clearIdentityScope(); pipeLocalBeanDaoConfig.clearIdentityScope(); taskLocalBeanDaoConfig.clearIdentityScope(); taskMarkerLocalBeanDaoConfig.clearIdentityScope(); } - public LabelBeanDao getLabelBeanDao() { - return labelBeanDao; + public MarkerLocalBeanDao getMarkerLocalBeanDao() { + return markerLocalBeanDao; } public PipeLocalBeanDao getPipeLocalBeanDao() { diff --git a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java b/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java deleted file mode 100644 index 94a73c4..0000000 --- a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java +++ /dev/null @@ -1,484 +0,0 @@ -package com.casic.detector.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import com.casic.detector.bean.LabelBean; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; -import org.greenrobot.greendao.internal.DaoConfig; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** - * DAO for table "LABEL_BEAN". - */ -public class LabelBeanDao extends AbstractDao { - - public static final String TABLENAME = "LABEL_BEAN"; - - /** - * Properties of entity LabelBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ObjectType = new Property(1, String.class, "objectType", false, "OBJECT_TYPE"); - public final static Property PipelineType = new Property(2, String.class, "pipelineType", false, "PIPELINE_TYPE"); - public final static Property PipelineMaterial = new Property(3, String.class, "pipelineMaterial", false, "PIPELINE_MATERIAL"); - public final static Property PipelineDiameter = new Property(4, String.class, "pipelineDiameter", false, "PIPELINE_DIAMETER"); - public final static Property BuryDeep = new Property(5, String.class, "buryDeep", false, "BURY_DEEP"); - public final static Property LowerType = new Property(6, String.class, "lowerType", false, "LOWER_TYPE"); - public final static Property LowerMaterial = new Property(7, String.class, "lowerMaterial", false, "LOWER_MATERIAL"); - public final static Property LowerDiameter = new Property(8, String.class, "lowerDiameter", false, "LOWER_DIAMETER"); - public final static Property LowerDeep = new Property(9, String.class, "lowerDeep", false, "LOWER_DEEP"); - public final static Property BuryMethod = new Property(10, String.class, "buryMethod", false, "BURY_METHOD"); - public final static Property Area = new Property(11, String.class, "area", false, "AREA"); - public final static Property Line = new Property(12, String.class, "line", false, "LINE"); - public final static Property Road = new Property(13, String.class, "road", false, "ROAD"); - public final static Property ConstructTime = new Property(14, String.class, "constructTime", false, "CONSTRUCT_TIME"); - public final static Property Owner = new Property(15, String.class, "owner", false, "OWNER"); - public final static Property ObjectId = new Property(16, String.class, "objectId", false, "OBJECT_ID"); - public final static Property IdentifierId = new Property(17, String.class, "identifierId", false, "IDENTIFIER_ID"); - public final static Property IdentifierType = new Property(18, String.class, "identifierType", false, "IDENTIFIER_TYPE"); - public final static Property IdentifierDeep = new Property(19, String.class, "identifierDeep", false, "IDENTIFIER_DEEP"); - public final static Property Person = new Property(20, String.class, "person", false, "PERSON"); - public final static Property InstallTime = new Property(21, String.class, "installTime", false, "INSTALL_TIME"); - public final static Property Lng = new Property(22, String.class, "lng", false, "LNG"); - public final static Property Lat = new Property(23, String.class, "lat", false, "LAT"); - public final static Property Color = new Property(24, String.class, "color", false, "COLOR"); - public final static Property Remark = new Property(25, String.class, "remark", false, "REMARK"); - public final static Property ImagePath = new Property(26, String.class, "imagePath", false, "IMAGE_PATH"); - } - - - public LabelBeanDao(DaoConfig config) { - super(config); - } - - public LabelBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** - * Creates the underlying database table. - */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; - db.execSQL("CREATE TABLE " + constraint + "\"LABEL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"OBJECT_TYPE\" TEXT," + // 1: objectType - "\"PIPELINE_TYPE\" TEXT," + // 2: pipelineType - "\"PIPELINE_MATERIAL\" TEXT," + // 3: pipelineMaterial - "\"PIPELINE_DIAMETER\" TEXT," + // 4: pipelineDiameter - "\"BURY_DEEP\" TEXT," + // 5: buryDeep - "\"LOWER_TYPE\" TEXT," + // 6: lowerType - "\"LOWER_MATERIAL\" TEXT," + // 7: lowerMaterial - "\"LOWER_DIAMETER\" TEXT," + // 8: lowerDiameter - "\"LOWER_DEEP\" TEXT," + // 9: lowerDeep - "\"BURY_METHOD\" TEXT," + // 10: buryMethod - "\"AREA\" TEXT," + // 11: area - "\"LINE\" TEXT," + // 12: line - "\"ROAD\" TEXT," + // 13: road - "\"CONSTRUCT_TIME\" TEXT," + // 14: constructTime - "\"OWNER\" TEXT," + // 15: owner - "\"OBJECT_ID\" TEXT," + // 16: objectId - "\"IDENTIFIER_ID\" TEXT," + // 17: identifierId - "\"IDENTIFIER_TYPE\" TEXT," + // 18: identifierType - "\"IDENTIFIER_DEEP\" TEXT," + // 19: identifierDeep - "\"PERSON\" TEXT," + // 20: person - "\"INSTALL_TIME\" TEXT," + // 21: installTime - "\"LNG\" TEXT," + // 22: lng - "\"LAT\" TEXT," + // 23: lat - "\"COLOR\" TEXT," + // 24: color - "\"REMARK\" TEXT," + // 25: remark - "\"IMAGE_PATH\" TEXT);"); // 26: imagePath - } - - /** - * Drops the underlying database table. - */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LABEL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, LabelBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String objectType = entity.getObjectType(); - if (objectType != null) { - stmt.bindString(2, objectType); - } - - String pipelineType = entity.getPipelineType(); - if (pipelineType != null) { - stmt.bindString(3, pipelineType); - } - - String pipelineMaterial = entity.getPipelineMaterial(); - if (pipelineMaterial != null) { - stmt.bindString(4, pipelineMaterial); - } - - String pipelineDiameter = entity.getPipelineDiameter(); - if (pipelineDiameter != null) { - stmt.bindString(5, pipelineDiameter); - } - - String buryDeep = entity.getBuryDeep(); - if (buryDeep != null) { - stmt.bindString(6, buryDeep); - } - - String lowerType = entity.getLowerType(); - if (lowerType != null) { - stmt.bindString(7, lowerType); - } - - String lowerMaterial = entity.getLowerMaterial(); - if (lowerMaterial != null) { - stmt.bindString(8, lowerMaterial); - } - - String lowerDiameter = entity.getLowerDiameter(); - if (lowerDiameter != null) { - stmt.bindString(9, lowerDiameter); - } - - String lowerDeep = entity.getLowerDeep(); - if (lowerDeep != null) { - stmt.bindString(10, lowerDeep); - } - - String buryMethod = entity.getBuryMethod(); - if (buryMethod != null) { - stmt.bindString(11, buryMethod); - } - - String area = entity.getArea(); - if (area != null) { - stmt.bindString(12, area); - } - - String line = entity.getLine(); - if (line != null) { - stmt.bindString(13, line); - } - - String road = entity.getRoad(); - if (road != null) { - stmt.bindString(14, road); - } - - String constructTime = entity.getConstructTime(); - if (constructTime != null) { - stmt.bindString(15, constructTime); - } - - String owner = entity.getOwner(); - if (owner != null) { - stmt.bindString(16, owner); - } - - String objectId = entity.getObjectId(); - if (objectId != null) { - stmt.bindString(17, objectId); - } - - String identifierId = entity.getIdentifierId(); - if (identifierId != null) { - stmt.bindString(18, identifierId); - } - - String identifierType = entity.getIdentifierType(); - if (identifierType != null) { - stmt.bindString(19, identifierType); - } - - String identifierDeep = entity.getIdentifierDeep(); - if (identifierDeep != null) { - stmt.bindString(20, identifierDeep); - } - - String person = entity.getPerson(); - if (person != null) { - stmt.bindString(21, person); - } - - String installTime = entity.getInstallTime(); - if (installTime != null) { - stmt.bindString(22, installTime); - } - - String lng = entity.getLng(); - if (lng != null) { - stmt.bindString(23, lng); - } - - String lat = entity.getLat(); - if (lat != null) { - stmt.bindString(24, lat); - } - - String color = entity.getColor(); - if (color != null) { - stmt.bindString(25, color); - } - - String remark = entity.getRemark(); - if (remark != null) { - stmt.bindString(26, remark); - } - - String imagePath = entity.getImagePath(); - if (imagePath != null) { - stmt.bindString(27, imagePath); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, LabelBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String objectType = entity.getObjectType(); - if (objectType != null) { - stmt.bindString(2, objectType); - } - - String pipelineType = entity.getPipelineType(); - if (pipelineType != null) { - stmt.bindString(3, pipelineType); - } - - String pipelineMaterial = entity.getPipelineMaterial(); - if (pipelineMaterial != null) { - stmt.bindString(4, pipelineMaterial); - } - - String pipelineDiameter = entity.getPipelineDiameter(); - if (pipelineDiameter != null) { - stmt.bindString(5, pipelineDiameter); - } - - String buryDeep = entity.getBuryDeep(); - if (buryDeep != null) { - stmt.bindString(6, buryDeep); - } - - String lowerType = entity.getLowerType(); - if (lowerType != null) { - stmt.bindString(7, lowerType); - } - - String lowerMaterial = entity.getLowerMaterial(); - if (lowerMaterial != null) { - stmt.bindString(8, lowerMaterial); - } - - String lowerDiameter = entity.getLowerDiameter(); - if (lowerDiameter != null) { - stmt.bindString(9, lowerDiameter); - } - - String lowerDeep = entity.getLowerDeep(); - if (lowerDeep != null) { - stmt.bindString(10, lowerDeep); - } - - String buryMethod = entity.getBuryMethod(); - if (buryMethod != null) { - stmt.bindString(11, buryMethod); - } - - String area = entity.getArea(); - if (area != null) { - stmt.bindString(12, area); - } - - String line = entity.getLine(); - if (line != null) { - stmt.bindString(13, line); - } - - String road = entity.getRoad(); - if (road != null) { - stmt.bindString(14, road); - } - - String constructTime = entity.getConstructTime(); - if (constructTime != null) { - stmt.bindString(15, constructTime); - } - - String owner = entity.getOwner(); - if (owner != null) { - stmt.bindString(16, owner); - } - - String objectId = entity.getObjectId(); - if (objectId != null) { - stmt.bindString(17, objectId); - } - - String identifierId = entity.getIdentifierId(); - if (identifierId != null) { - stmt.bindString(18, identifierId); - } - - String identifierType = entity.getIdentifierType(); - if (identifierType != null) { - stmt.bindString(19, identifierType); - } - - String identifierDeep = entity.getIdentifierDeep(); - if (identifierDeep != null) { - stmt.bindString(20, identifierDeep); - } - - String person = entity.getPerson(); - if (person != null) { - stmt.bindString(21, person); - } - - String installTime = entity.getInstallTime(); - if (installTime != null) { - stmt.bindString(22, installTime); - } - - String lng = entity.getLng(); - if (lng != null) { - stmt.bindString(23, lng); - } - - String lat = entity.getLat(); - if (lat != null) { - stmt.bindString(24, lat); - } - - String color = entity.getColor(); - if (color != null) { - stmt.bindString(25, color); - } - - String remark = entity.getRemark(); - if (remark != null) { - stmt.bindString(26, remark); - } - - String imagePath = entity.getImagePath(); - if (imagePath != null) { - stmt.bindString(27, imagePath); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public LabelBean readEntity(Cursor cursor, int offset) { - LabelBean entity = new LabelBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // objectType - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineType - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // pipelineDiameter - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDeep - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lowerType - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lowerMaterial - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lowerDiameter - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // lowerDeep - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // buryMethod - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // area - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // line - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // road - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // constructTime - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // owner - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // objectId - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // identifierId - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // identifierType - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // identifierDeep - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // person - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // installTime - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // lng - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // lat - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // color - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // remark - cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, LabelBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setObjectType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setPipelineType(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setPipelineMaterial(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setPipelineDiameter(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setBuryDeep(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setLowerType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLowerMaterial(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLowerDiameter(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLowerDeep(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); - entity.setBuryMethod(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - entity.setArea(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - entity.setLine(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); - entity.setRoad(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); - entity.setConstructTime(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); - entity.setOwner(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); - entity.setObjectId(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); - entity.setIdentifierId(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); - entity.setIdentifierType(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18)); - entity.setIdentifierDeep(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19)); - entity.setPerson(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); - entity.setInstallTime(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); - entity.setLng(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22)); - entity.setLat(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); - entity.setColor(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); - entity.setRemark(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); - } - - @Override - protected final Long updateKeyAfterInsert(LabelBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(LabelBean entity) { - if (entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(LabelBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java new file mode 100644 index 0000000..18849f3 --- /dev/null +++ b/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java @@ -0,0 +1,484 @@ +package com.casic.detector.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import com.casic.detector.bean.MarkerLocalBean; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; +import org.greenrobot.greendao.internal.DaoConfig; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. + +/** + * DAO for table "MARKER_LOCAL_BEAN". + */ +public class MarkerLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "MARKER_LOCAL_BEAN"; + + /** + * Properties of entity MarkerLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property PipelineType = new Property(1, String.class, "pipelineType", false, "PIPELINE_TYPE"); + public final static Property PipelineDiameter = new Property(2, String.class, "pipelineDiameter", false, "PIPELINE_DIAMETER"); + public final static Property PipelineMaterial = new Property(3, String.class, "pipelineMaterial", false, "PIPELINE_MATERIAL"); + public final static Property BuryMethod = new Property(4, String.class, "buryMethod", false, "BURY_METHOD"); + public final static Property BuryDepth = new Property(5, String.class, "buryDepth", false, "BURY_DEPTH"); + public final static Property Area = new Property(6, String.class, "area", false, "AREA"); + public final static Property Line = new Property(7, String.class, "line", false, "LINE"); + public final static Property Road = new Property(8, String.class, "road", false, "ROAD"); + public final static Property ConstructTime = new Property(9, String.class, "constructTime", false, "CONSTRUCT_TIME"); + public final static Property Owner = new Property(10, String.class, "owner", false, "OWNER"); + public final static Property ObjectId = new Property(11, String.class, "objectId", false, "OBJECT_ID"); + public final static Property MarkerId = new Property(12, String.class, "markerId", false, "MARKER_ID"); + public final static Property MarkerType = new Property(13, String.class, "markerType", false, "MARKER_TYPE"); + public final static Property MarkerDepth = new Property(14, String.class, "markerDepth", false, "MARKER_DEPTH"); + public final static Property InstallationDept = new Property(15, String.class, "installationDept", false, "INSTALLATION_DEPT"); + public final static Property Lng = new Property(16, String.class, "lng", false, "LNG"); + public final static Property Lat = new Property(17, String.class, "lat", false, "LAT"); + public final static Property UpdateTime = new Property(18, String.class, "updateTime", false, "UPDATE_TIME"); + public final static Property Remark = new Property(19, String.class, "remark", false, "REMARK"); + public final static Property UnderlyingPipelineType = new Property(20, String.class, "underlyingPipelineType", false, "UNDERLYING_PIPELINE_TYPE"); + public final static Property UnderlyingPipelineDepth = new Property(21, String.class, "underlyingPipelineDepth", false, "UNDERLYING_PIPELINE_DEPTH"); + public final static Property UnderlyingPipelineDiameter = new Property(22, String.class, "underlyingPipelineDiameter", false, "UNDERLYING_PIPELINE_DIAMETER"); + public final static Property UnderlyingPipelineMaterial = new Property(23, String.class, "underlyingPipelineMaterial", false, "UNDERLYING_PIPELINE_MATERIAL"); + public final static Property ObjectType = new Property(24, String.class, "objectType", false, "OBJECT_TYPE"); + public final static Property Color = new Property(25, String.class, "color", false, "COLOR"); + public final static Property ImagePath = new Property(26, String.class, "imagePath", false, "IMAGE_PATH"); + } + + + public MarkerLocalBeanDao(DaoConfig config) { + super(config); + } + + public MarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** + * Creates the underlying database table. + */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + db.execSQL("CREATE TABLE " + constraint + "\"MARKER_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"PIPELINE_TYPE\" TEXT," + // 1: pipelineType + "\"PIPELINE_DIAMETER\" TEXT," + // 2: pipelineDiameter + "\"PIPELINE_MATERIAL\" TEXT," + // 3: pipelineMaterial + "\"BURY_METHOD\" TEXT," + // 4: buryMethod + "\"BURY_DEPTH\" TEXT," + // 5: buryDepth + "\"AREA\" TEXT," + // 6: area + "\"LINE\" TEXT," + // 7: line + "\"ROAD\" TEXT," + // 8: road + "\"CONSTRUCT_TIME\" TEXT," + // 9: constructTime + "\"OWNER\" TEXT," + // 10: owner + "\"OBJECT_ID\" TEXT," + // 11: objectId + "\"MARKER_ID\" TEXT," + // 12: markerId + "\"MARKER_TYPE\" TEXT," + // 13: markerType + "\"MARKER_DEPTH\" TEXT," + // 14: markerDepth + "\"INSTALLATION_DEPT\" TEXT," + // 15: installationDept + "\"LNG\" TEXT," + // 16: lng + "\"LAT\" TEXT," + // 17: lat + "\"UPDATE_TIME\" TEXT," + // 18: updateTime + "\"REMARK\" TEXT," + // 19: remark + "\"UNDERLYING_PIPELINE_TYPE\" TEXT," + // 20: underlyingPipelineType + "\"UNDERLYING_PIPELINE_DEPTH\" TEXT," + // 21: underlyingPipelineDepth + "\"UNDERLYING_PIPELINE_DIAMETER\" TEXT," + // 22: underlyingPipelineDiameter + "\"UNDERLYING_PIPELINE_MATERIAL\" TEXT," + // 23: underlyingPipelineMaterial + "\"OBJECT_TYPE\" TEXT," + // 24: objectType + "\"COLOR\" TEXT," + // 25: color + "\"IMAGE_PATH\" TEXT);"); // 26: imagePath + } + + /** + * Drops the underlying database table. + */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MARKER_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MarkerLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String pipelineType = entity.getPipelineType(); + if (pipelineType != null) { + stmt.bindString(2, pipelineType); + } + + String pipelineDiameter = entity.getPipelineDiameter(); + if (pipelineDiameter != null) { + stmt.bindString(3, pipelineDiameter); + } + + String pipelineMaterial = entity.getPipelineMaterial(); + if (pipelineMaterial != null) { + stmt.bindString(4, pipelineMaterial); + } + + String buryMethod = entity.getBuryMethod(); + if (buryMethod != null) { + stmt.bindString(5, buryMethod); + } + + String buryDepth = entity.getBuryDepth(); + if (buryDepth != null) { + stmt.bindString(6, buryDepth); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(7, area); + } + + String line = entity.getLine(); + if (line != null) { + stmt.bindString(8, line); + } + + String road = entity.getRoad(); + if (road != null) { + stmt.bindString(9, road); + } + + String constructTime = entity.getConstructTime(); + if (constructTime != null) { + stmt.bindString(10, constructTime); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(11, owner); + } + + String objectId = entity.getObjectId(); + if (objectId != null) { + stmt.bindString(12, objectId); + } + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(13, markerId); + } + + String markerType = entity.getMarkerType(); + if (markerType != null) { + stmt.bindString(14, markerType); + } + + String markerDepth = entity.getMarkerDepth(); + if (markerDepth != null) { + stmt.bindString(15, markerDepth); + } + + String installationDept = entity.getInstallationDept(); + if (installationDept != null) { + stmt.bindString(16, installationDept); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(17, lng); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(18, lat); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(19, updateTime); + } + + String remark = entity.getRemark(); + if (remark != null) { + stmt.bindString(20, remark); + } + + String underlyingPipelineType = entity.getUnderlyingPipelineType(); + if (underlyingPipelineType != null) { + stmt.bindString(21, underlyingPipelineType); + } + + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); + if (underlyingPipelineDepth != null) { + stmt.bindString(22, underlyingPipelineDepth); + } + + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); + if (underlyingPipelineDiameter != null) { + stmt.bindString(23, underlyingPipelineDiameter); + } + + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); + if (underlyingPipelineMaterial != null) { + stmt.bindString(24, underlyingPipelineMaterial); + } + + String objectType = entity.getObjectType(); + if (objectType != null) { + stmt.bindString(25, objectType); + } + + String color = entity.getColor(); + if (color != null) { + stmt.bindString(26, color); + } + + String imagePath = entity.getImagePath(); + if (imagePath != null) { + stmt.bindString(27, imagePath); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MarkerLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String pipelineType = entity.getPipelineType(); + if (pipelineType != null) { + stmt.bindString(2, pipelineType); + } + + String pipelineDiameter = entity.getPipelineDiameter(); + if (pipelineDiameter != null) { + stmt.bindString(3, pipelineDiameter); + } + + String pipelineMaterial = entity.getPipelineMaterial(); + if (pipelineMaterial != null) { + stmt.bindString(4, pipelineMaterial); + } + + String buryMethod = entity.getBuryMethod(); + if (buryMethod != null) { + stmt.bindString(5, buryMethod); + } + + String buryDepth = entity.getBuryDepth(); + if (buryDepth != null) { + stmt.bindString(6, buryDepth); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(7, area); + } + + String line = entity.getLine(); + if (line != null) { + stmt.bindString(8, line); + } + + String road = entity.getRoad(); + if (road != null) { + stmt.bindString(9, road); + } + + String constructTime = entity.getConstructTime(); + if (constructTime != null) { + stmt.bindString(10, constructTime); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(11, owner); + } + + String objectId = entity.getObjectId(); + if (objectId != null) { + stmt.bindString(12, objectId); + } + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(13, markerId); + } + + String markerType = entity.getMarkerType(); + if (markerType != null) { + stmt.bindString(14, markerType); + } + + String markerDepth = entity.getMarkerDepth(); + if (markerDepth != null) { + stmt.bindString(15, markerDepth); + } + + String installationDept = entity.getInstallationDept(); + if (installationDept != null) { + stmt.bindString(16, installationDept); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(17, lng); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(18, lat); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(19, updateTime); + } + + String remark = entity.getRemark(); + if (remark != null) { + stmt.bindString(20, remark); + } + + String underlyingPipelineType = entity.getUnderlyingPipelineType(); + if (underlyingPipelineType != null) { + stmt.bindString(21, underlyingPipelineType); + } + + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); + if (underlyingPipelineDepth != null) { + stmt.bindString(22, underlyingPipelineDepth); + } + + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); + if (underlyingPipelineDiameter != null) { + stmt.bindString(23, underlyingPipelineDiameter); + } + + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); + if (underlyingPipelineMaterial != null) { + stmt.bindString(24, underlyingPipelineMaterial); + } + + String objectType = entity.getObjectType(); + if (objectType != null) { + stmt.bindString(25, objectType); + } + + String color = entity.getColor(); + if (color != null) { + stmt.bindString(26, color); + } + + String imagePath = entity.getImagePath(); + if (imagePath != null) { + stmt.bindString(27, imagePath); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MarkerLocalBean readEntity(Cursor cursor, int offset) { + MarkerLocalBean entity = new MarkerLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color + cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MarkerLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setPipelineType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setPipelineDiameter(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setPipelineMaterial(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setBuryMethod(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setBuryDepth(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setArea(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLine(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setRoad(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setConstructTime(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setOwner(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setObjectId(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setMarkerId(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setMarkerType(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setMarkerDepth(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setInstallationDept(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setLng(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setLat(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + entity.setUpdateTime(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18)); + entity.setRemark(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19)); + entity.setUnderlyingPipelineType(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); + entity.setUnderlyingPipelineDepth(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); + entity.setUnderlyingPipelineDiameter(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22)); + entity.setUnderlyingPipelineMaterial(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); + entity.setObjectType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); + entity.setColor(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); + entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); + } + + @Override + protected final Long updateKeyAfterInsert(MarkerLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MarkerLocalBean entity) { + if (entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MarkerLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/detector/bean/LabelBean.java b/app/src/main/java/com/casic/detector/bean/LabelBean.java deleted file mode 100644 index d22d835..0000000 --- a/app/src/main/java/com/casic/detector/bean/LabelBean.java +++ /dev/null @@ -1,321 +0,0 @@ -package com.casic.detector.bean; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -@Entity -public class LabelBean { - @Id(autoincrement = true) - private Long id;//主键ID - // 标记对象类型 - private String objectType; - // 管线类型 - private String pipelineType; - // 管材 - private String pipelineMaterial; - // 管直 - private String pipelineDiameter; - // 埋深 - private String buryDeep; - // 下层管线类型 - private String lowerType; - // 下层管材 - private String lowerMaterial; - // 下层管径 - private String lowerDiameter; - // 下层埋深 - private String lowerDeep; - // 埋设方式 - private String buryMethod; - // 所属区域 - private String area; - // 所属线路 - private String line; - // 所属道路 - private String road; - // 建设年代 - private String constructTime; - // 权属单位 - private String owner; - // 对象ID - private String objectId; - // 标识器ID号 - private String identifierId; - // 标识器类型 - private String identifierType; - // 标识器埋深 - private String identifierDeep; - // 安装人员 - private String person; - // 安装时间 - private String installTime; - // 经度 - private String lng; - // 纬度 - private String lat; - // 颜色 - private String color; - // 备注信息 - private String remark; - // 图片路径 - private String imagePath; - - @Generated(hash = 1718746860) - public LabelBean(Long id, String objectType, String pipelineType, - String pipelineMaterial, String pipelineDiameter, String buryDeep, - String lowerType, String lowerMaterial, String lowerDiameter, - String lowerDeep, String buryMethod, String area, String line, - String road, String constructTime, String owner, String objectId, - String identifierId, String identifierType, String identifierDeep, - String person, String installTime, String lng, String lat, String color, - String remark, String imagePath) { - this.id = id; - this.objectType = objectType; - this.pipelineType = pipelineType; - this.pipelineMaterial = pipelineMaterial; - this.pipelineDiameter = pipelineDiameter; - this.buryDeep = buryDeep; - this.lowerType = lowerType; - this.lowerMaterial = lowerMaterial; - this.lowerDiameter = lowerDiameter; - this.lowerDeep = lowerDeep; - this.buryMethod = buryMethod; - this.area = area; - this.line = line; - this.road = road; - this.constructTime = constructTime; - this.owner = owner; - this.objectId = objectId; - this.identifierId = identifierId; - this.identifierType = identifierType; - this.identifierDeep = identifierDeep; - this.person = person; - this.installTime = installTime; - this.lng = lng; - this.lat = lat; - this.color = color; - this.remark = remark; - this.imagePath = imagePath; - } - - @Generated(hash = 1285554626) - public LabelBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getObjectType() { - return this.objectType; - } - - public void setObjectType(String objectType) { - this.objectType = objectType; - } - - public String getPipelineType() { - return this.pipelineType; - } - - public void setPipelineType(String pipelineType) { - this.pipelineType = pipelineType; - } - - public String getPipelineMaterial() { - return this.pipelineMaterial; - } - - public void setPipelineMaterial(String pipelineMaterial) { - this.pipelineMaterial = pipelineMaterial; - } - - public String getPipelineDiameter() { - return this.pipelineDiameter; - } - - public void setPipelineDiameter(String pipelineDiameter) { - this.pipelineDiameter = pipelineDiameter; - } - - public String getBuryDeep() { - return this.buryDeep; - } - - public void setBuryDeep(String buryDeep) { - this.buryDeep = buryDeep; - } - - public String getLowerType() { - return this.lowerType; - } - - public void setLowerType(String lowerType) { - this.lowerType = lowerType; - } - - public String getLowerMaterial() { - return this.lowerMaterial; - } - - public void setLowerMaterial(String lowerMaterial) { - this.lowerMaterial = lowerMaterial; - } - - public String getLowerDiameter() { - return this.lowerDiameter; - } - - public void setLowerDiameter(String lowerDiameter) { - this.lowerDiameter = lowerDiameter; - } - - public String getLowerDeep() { - return this.lowerDeep; - } - - public void setLowerDeep(String lowerDeep) { - this.lowerDeep = lowerDeep; - } - - public String getBuryMethod() { - return this.buryMethod; - } - - public void setBuryMethod(String buryMethod) { - this.buryMethod = buryMethod; - } - - public String getArea() { - return this.area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getLine() { - return this.line; - } - - public void setLine(String line) { - this.line = line; - } - - public String getRoad() { - return this.road; - } - - public void setRoad(String road) { - this.road = road; - } - - public String getConstructTime() { - return this.constructTime; - } - - public void setConstructTime(String constructTime) { - this.constructTime = constructTime; - } - - public String getOwner() { - return this.owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getObjectId() { - return this.objectId; - } - - public void setObjectId(String objectId) { - this.objectId = objectId; - } - - public String getIdentifierId() { - return this.identifierId; - } - - public void setIdentifierId(String identifierId) { - this.identifierId = identifierId; - } - - public String getIdentifierType() { - return this.identifierType; - } - - public void setIdentifierType(String identifierType) { - this.identifierType = identifierType; - } - - public String getIdentifierDeep() { - return this.identifierDeep; - } - - public void setIdentifierDeep(String identifierDeep) { - this.identifierDeep = identifierDeep; - } - - public String getPerson() { - return this.person; - } - - public void setPerson(String person) { - this.person = person; - } - - public String getInstallTime() { - return this.installTime; - } - - public void setInstallTime(String installTime) { - this.installTime = installTime; - } - - public String getLng() { - return this.lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getLat() { - return this.lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getColor() { - return this.color; - } - - public void setColor(String color) { - this.color = color; - } - - public String getRemark() { - return this.remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getImagePath() { - return this.imagePath; - } - - public void setImagePath(String imagePath) { - this.imagePath = imagePath; - } -} diff --git a/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java new file mode 100644 index 0000000..c59cf0b --- /dev/null +++ b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java @@ -0,0 +1,327 @@ +package com.casic.detector.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Id; +import org.greenrobot.greendao.annotation.Generated; + +/** + * 从平台下载的标识器本地库实体类 + */ +@Entity +public class MarkerLocalBean { + @Id(autoincrement = true) + private Long id;//本地库主键ID + + // 管线类型 + private String pipelineType; + // 管线直径 + private String pipelineDiameter; + // 管材 + private String pipelineMaterial; + // 埋设方式 + private String buryMethod; + // 埋深 + private String buryDepth; + // 所属区域 + private String area; + // 所属线路 + private String line; + // 所属道路 + private String road; + // 建设年代 + private String constructTime; + // 权属单位 + private String owner; + //标识对象ID,无实际用途 + @Deprecated + private String objectId; + // 标识器ID + private String markerId; + // 标识器类型 + private String markerType; + // 标识器埋深 + private String markerDepth; + // 安装部门 + private String installationDept; + // 经度 + private String lng; + // 纬度 + private String lat; + //最后修改时间,更新时间 + private String updateTime; + // 备注信息 + private String remark; + // 下层管线类型 + private String underlyingPipelineType; + // 下层埋深 + private String underlyingPipelineDepth; + // 下层管径 + private String underlyingPipelineDiameter; + // 下层管材 + private String underlyingPipelineMaterial; + //标识对象类型 + private String objectType; + // 颜色 + private String color; + // 图片路径 + private String imagePath; + + @Generated(hash = 1479045776) + public MarkerLocalBean(Long id, String pipelineType, String pipelineDiameter, + String pipelineMaterial, String buryMethod, String buryDepth, + String area, String line, String road, String constructTime, + String owner, String objectId, String markerId, String markerType, + String markerDepth, String installationDept, String lng, String lat, + String updateTime, String remark, String underlyingPipelineType, + String underlyingPipelineDepth, String underlyingPipelineDiameter, + String underlyingPipelineMaterial, String objectType, String color, + String imagePath) { + this.id = id; + this.pipelineType = pipelineType; + this.pipelineDiameter = pipelineDiameter; + this.pipelineMaterial = pipelineMaterial; + this.buryMethod = buryMethod; + this.buryDepth = buryDepth; + this.area = area; + this.line = line; + this.road = road; + this.constructTime = constructTime; + this.owner = owner; + this.objectId = objectId; + this.markerId = markerId; + this.markerType = markerType; + this.markerDepth = markerDepth; + this.installationDept = installationDept; + this.lng = lng; + this.lat = lat; + this.updateTime = updateTime; + this.remark = remark; + this.underlyingPipelineType = underlyingPipelineType; + this.underlyingPipelineDepth = underlyingPipelineDepth; + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + this.objectType = objectType; + this.color = color; + this.imagePath = imagePath; + } + + @Generated(hash = 1538606012) + public MarkerLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPipelineType() { + return this.pipelineType; + } + + public void setPipelineType(String pipelineType) { + this.pipelineType = pipelineType; + } + + public String getPipelineDiameter() { + return this.pipelineDiameter; + } + + public void setPipelineDiameter(String pipelineDiameter) { + this.pipelineDiameter = pipelineDiameter; + } + + public String getPipelineMaterial() { + return this.pipelineMaterial; + } + + public void setPipelineMaterial(String pipelineMaterial) { + this.pipelineMaterial = pipelineMaterial; + } + + public String getBuryMethod() { + return this.buryMethod; + } + + public void setBuryMethod(String buryMethod) { + this.buryMethod = buryMethod; + } + + public String getBuryDepth() { + return this.buryDepth; + } + + public void setBuryDepth(String buryDepth) { + this.buryDepth = buryDepth; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getLine() { + return this.line; + } + + public void setLine(String line) { + this.line = line; + } + + public String getRoad() { + return this.road; + } + + public void setRoad(String road) { + this.road = road; + } + + public String getConstructTime() { + return this.constructTime; + } + + public void setConstructTime(String constructTime) { + this.constructTime = constructTime; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getObjectId() { + return this.objectId; + } + + public void setObjectId(String objectId) { + this.objectId = objectId; + } + + public String getMarkerId() { + return this.markerId; + } + + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerType() { + return this.markerType; + } + + public void setMarkerType(String markerType) { + this.markerType = markerType; + } + + public String getMarkerDepth() { + return this.markerDepth; + } + + public void setMarkerDepth(String markerDepth) { + this.markerDepth = markerDepth; + } + + public String getInstallationDept() { + return this.installationDept; + } + + public void setInstallationDept(String installationDept) { + this.installationDept = installationDept; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return this.remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getUnderlyingPipelineType() { + return this.underlyingPipelineType; + } + + public void setUnderlyingPipelineType(String underlyingPipelineType) { + this.underlyingPipelineType = underlyingPipelineType; + } + + public String getUnderlyingPipelineDepth() { + return this.underlyingPipelineDepth; + } + + public void setUnderlyingPipelineDepth(String underlyingPipelineDepth) { + this.underlyingPipelineDepth = underlyingPipelineDepth; + } + + public String getUnderlyingPipelineDiameter() { + return this.underlyingPipelineDiameter; + } + + public void setUnderlyingPipelineDiameter(String underlyingPipelineDiameter) { + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + } + + public String getUnderlyingPipelineMaterial() { + return this.underlyingPipelineMaterial; + } + + public void setUnderlyingPipelineMaterial(String underlyingPipelineMaterial) { + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + } + + public String getObjectType() { + return this.objectType; + } + + public void setObjectType(String objectType) { + this.objectType = objectType; + } + + public String getColor() { + return this.color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getImagePath() { + return this.imagePath; + } + + public void setImagePath(String imagePath) { + this.imagePath = imagePath; + } +} diff --git a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java index ec4425f..45e25e6 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java @@ -24,7 +24,7 @@ * Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - LabelBeanDao.createTable(db, ifNotExists); + MarkerLocalBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); @@ -34,7 +34,7 @@ * Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - LabelBeanDao.dropTable(db, ifExists); + MarkerLocalBeanDao.dropTable(db, ifExists); PipeLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); TaskMarkerLocalBeanDao.dropTable(db, ifExists); @@ -56,7 +56,7 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(LabelBeanDao.class); + registerDaoClass(MarkerLocalBeanDao.class); registerDaoClass(PipeLocalBeanDao.class); registerDaoClass(TaskLocalBeanDao.class); registerDaoClass(TaskMarkerLocalBeanDao.class); diff --git a/app/src/main/java/com/casic/detector/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/greendao/DaoSession.java index 4f9bdff..0d0d59f 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoSession.java @@ -1,6 +1,6 @@ package com.casic.detector.greendao; -import com.casic.detector.bean.LabelBean; +import com.casic.detector.bean.MarkerLocalBean; import com.casic.detector.bean.PipeLocalBean; import com.casic.detector.bean.TaskLocalBean; import com.casic.detector.bean.TaskMarkerLocalBean; @@ -22,12 +22,12 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig labelBeanDaoConfig; + private final DaoConfig markerLocalBeanDaoConfig; private final DaoConfig pipeLocalBeanDaoConfig; private final DaoConfig taskLocalBeanDaoConfig; private final DaoConfig taskMarkerLocalBeanDaoConfig; - private final LabelBeanDao labelBeanDao; + private final MarkerLocalBeanDao markerLocalBeanDao; private final PipeLocalBeanDao pipeLocalBeanDao; private final TaskLocalBeanDao taskLocalBeanDao; private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao; @@ -36,8 +36,8 @@ daoConfigMap) { super(db); - labelBeanDaoConfig = daoConfigMap.get(LabelBeanDao.class).clone(); - labelBeanDaoConfig.initIdentityScope(type); + markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone(); + markerLocalBeanDaoConfig.initIdentityScope(type); pipeLocalBeanDaoConfig = daoConfigMap.get(PipeLocalBeanDao.class).clone(); pipeLocalBeanDaoConfig.initIdentityScope(type); @@ -48,26 +48,26 @@ taskMarkerLocalBeanDaoConfig = daoConfigMap.get(TaskMarkerLocalBeanDao.class).clone(); taskMarkerLocalBeanDaoConfig.initIdentityScope(type); - labelBeanDao = new LabelBeanDao(labelBeanDaoConfig, this); + markerLocalBeanDao = new MarkerLocalBeanDao(markerLocalBeanDaoConfig, this); pipeLocalBeanDao = new PipeLocalBeanDao(pipeLocalBeanDaoConfig, this); taskLocalBeanDao = new TaskLocalBeanDao(taskLocalBeanDaoConfig, this); taskMarkerLocalBeanDao = new TaskMarkerLocalBeanDao(taskMarkerLocalBeanDaoConfig, this); - registerDao(LabelBean.class, labelBeanDao); + registerDao(MarkerLocalBean.class, markerLocalBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); registerDao(TaskLocalBean.class, taskLocalBeanDao); registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao); } public void clear() { - labelBeanDaoConfig.clearIdentityScope(); + markerLocalBeanDaoConfig.clearIdentityScope(); pipeLocalBeanDaoConfig.clearIdentityScope(); taskLocalBeanDaoConfig.clearIdentityScope(); taskMarkerLocalBeanDaoConfig.clearIdentityScope(); } - public LabelBeanDao getLabelBeanDao() { - return labelBeanDao; + public MarkerLocalBeanDao getMarkerLocalBeanDao() { + return markerLocalBeanDao; } public PipeLocalBeanDao getPipeLocalBeanDao() { diff --git a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java b/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java deleted file mode 100644 index 94a73c4..0000000 --- a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java +++ /dev/null @@ -1,484 +0,0 @@ -package com.casic.detector.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import com.casic.detector.bean.LabelBean; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; -import org.greenrobot.greendao.internal.DaoConfig; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** - * DAO for table "LABEL_BEAN". - */ -public class LabelBeanDao extends AbstractDao { - - public static final String TABLENAME = "LABEL_BEAN"; - - /** - * Properties of entity LabelBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ObjectType = new Property(1, String.class, "objectType", false, "OBJECT_TYPE"); - public final static Property PipelineType = new Property(2, String.class, "pipelineType", false, "PIPELINE_TYPE"); - public final static Property PipelineMaterial = new Property(3, String.class, "pipelineMaterial", false, "PIPELINE_MATERIAL"); - public final static Property PipelineDiameter = new Property(4, String.class, "pipelineDiameter", false, "PIPELINE_DIAMETER"); - public final static Property BuryDeep = new Property(5, String.class, "buryDeep", false, "BURY_DEEP"); - public final static Property LowerType = new Property(6, String.class, "lowerType", false, "LOWER_TYPE"); - public final static Property LowerMaterial = new Property(7, String.class, "lowerMaterial", false, "LOWER_MATERIAL"); - public final static Property LowerDiameter = new Property(8, String.class, "lowerDiameter", false, "LOWER_DIAMETER"); - public final static Property LowerDeep = new Property(9, String.class, "lowerDeep", false, "LOWER_DEEP"); - public final static Property BuryMethod = new Property(10, String.class, "buryMethod", false, "BURY_METHOD"); - public final static Property Area = new Property(11, String.class, "area", false, "AREA"); - public final static Property Line = new Property(12, String.class, "line", false, "LINE"); - public final static Property Road = new Property(13, String.class, "road", false, "ROAD"); - public final static Property ConstructTime = new Property(14, String.class, "constructTime", false, "CONSTRUCT_TIME"); - public final static Property Owner = new Property(15, String.class, "owner", false, "OWNER"); - public final static Property ObjectId = new Property(16, String.class, "objectId", false, "OBJECT_ID"); - public final static Property IdentifierId = new Property(17, String.class, "identifierId", false, "IDENTIFIER_ID"); - public final static Property IdentifierType = new Property(18, String.class, "identifierType", false, "IDENTIFIER_TYPE"); - public final static Property IdentifierDeep = new Property(19, String.class, "identifierDeep", false, "IDENTIFIER_DEEP"); - public final static Property Person = new Property(20, String.class, "person", false, "PERSON"); - public final static Property InstallTime = new Property(21, String.class, "installTime", false, "INSTALL_TIME"); - public final static Property Lng = new Property(22, String.class, "lng", false, "LNG"); - public final static Property Lat = new Property(23, String.class, "lat", false, "LAT"); - public final static Property Color = new Property(24, String.class, "color", false, "COLOR"); - public final static Property Remark = new Property(25, String.class, "remark", false, "REMARK"); - public final static Property ImagePath = new Property(26, String.class, "imagePath", false, "IMAGE_PATH"); - } - - - public LabelBeanDao(DaoConfig config) { - super(config); - } - - public LabelBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** - * Creates the underlying database table. - */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; - db.execSQL("CREATE TABLE " + constraint + "\"LABEL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"OBJECT_TYPE\" TEXT," + // 1: objectType - "\"PIPELINE_TYPE\" TEXT," + // 2: pipelineType - "\"PIPELINE_MATERIAL\" TEXT," + // 3: pipelineMaterial - "\"PIPELINE_DIAMETER\" TEXT," + // 4: pipelineDiameter - "\"BURY_DEEP\" TEXT," + // 5: buryDeep - "\"LOWER_TYPE\" TEXT," + // 6: lowerType - "\"LOWER_MATERIAL\" TEXT," + // 7: lowerMaterial - "\"LOWER_DIAMETER\" TEXT," + // 8: lowerDiameter - "\"LOWER_DEEP\" TEXT," + // 9: lowerDeep - "\"BURY_METHOD\" TEXT," + // 10: buryMethod - "\"AREA\" TEXT," + // 11: area - "\"LINE\" TEXT," + // 12: line - "\"ROAD\" TEXT," + // 13: road - "\"CONSTRUCT_TIME\" TEXT," + // 14: constructTime - "\"OWNER\" TEXT," + // 15: owner - "\"OBJECT_ID\" TEXT," + // 16: objectId - "\"IDENTIFIER_ID\" TEXT," + // 17: identifierId - "\"IDENTIFIER_TYPE\" TEXT," + // 18: identifierType - "\"IDENTIFIER_DEEP\" TEXT," + // 19: identifierDeep - "\"PERSON\" TEXT," + // 20: person - "\"INSTALL_TIME\" TEXT," + // 21: installTime - "\"LNG\" TEXT," + // 22: lng - "\"LAT\" TEXT," + // 23: lat - "\"COLOR\" TEXT," + // 24: color - "\"REMARK\" TEXT," + // 25: remark - "\"IMAGE_PATH\" TEXT);"); // 26: imagePath - } - - /** - * Drops the underlying database table. - */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LABEL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, LabelBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String objectType = entity.getObjectType(); - if (objectType != null) { - stmt.bindString(2, objectType); - } - - String pipelineType = entity.getPipelineType(); - if (pipelineType != null) { - stmt.bindString(3, pipelineType); - } - - String pipelineMaterial = entity.getPipelineMaterial(); - if (pipelineMaterial != null) { - stmt.bindString(4, pipelineMaterial); - } - - String pipelineDiameter = entity.getPipelineDiameter(); - if (pipelineDiameter != null) { - stmt.bindString(5, pipelineDiameter); - } - - String buryDeep = entity.getBuryDeep(); - if (buryDeep != null) { - stmt.bindString(6, buryDeep); - } - - String lowerType = entity.getLowerType(); - if (lowerType != null) { - stmt.bindString(7, lowerType); - } - - String lowerMaterial = entity.getLowerMaterial(); - if (lowerMaterial != null) { - stmt.bindString(8, lowerMaterial); - } - - String lowerDiameter = entity.getLowerDiameter(); - if (lowerDiameter != null) { - stmt.bindString(9, lowerDiameter); - } - - String lowerDeep = entity.getLowerDeep(); - if (lowerDeep != null) { - stmt.bindString(10, lowerDeep); - } - - String buryMethod = entity.getBuryMethod(); - if (buryMethod != null) { - stmt.bindString(11, buryMethod); - } - - String area = entity.getArea(); - if (area != null) { - stmt.bindString(12, area); - } - - String line = entity.getLine(); - if (line != null) { - stmt.bindString(13, line); - } - - String road = entity.getRoad(); - if (road != null) { - stmt.bindString(14, road); - } - - String constructTime = entity.getConstructTime(); - if (constructTime != null) { - stmt.bindString(15, constructTime); - } - - String owner = entity.getOwner(); - if (owner != null) { - stmt.bindString(16, owner); - } - - String objectId = entity.getObjectId(); - if (objectId != null) { - stmt.bindString(17, objectId); - } - - String identifierId = entity.getIdentifierId(); - if (identifierId != null) { - stmt.bindString(18, identifierId); - } - - String identifierType = entity.getIdentifierType(); - if (identifierType != null) { - stmt.bindString(19, identifierType); - } - - String identifierDeep = entity.getIdentifierDeep(); - if (identifierDeep != null) { - stmt.bindString(20, identifierDeep); - } - - String person = entity.getPerson(); - if (person != null) { - stmt.bindString(21, person); - } - - String installTime = entity.getInstallTime(); - if (installTime != null) { - stmt.bindString(22, installTime); - } - - String lng = entity.getLng(); - if (lng != null) { - stmt.bindString(23, lng); - } - - String lat = entity.getLat(); - if (lat != null) { - stmt.bindString(24, lat); - } - - String color = entity.getColor(); - if (color != null) { - stmt.bindString(25, color); - } - - String remark = entity.getRemark(); - if (remark != null) { - stmt.bindString(26, remark); - } - - String imagePath = entity.getImagePath(); - if (imagePath != null) { - stmt.bindString(27, imagePath); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, LabelBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String objectType = entity.getObjectType(); - if (objectType != null) { - stmt.bindString(2, objectType); - } - - String pipelineType = entity.getPipelineType(); - if (pipelineType != null) { - stmt.bindString(3, pipelineType); - } - - String pipelineMaterial = entity.getPipelineMaterial(); - if (pipelineMaterial != null) { - stmt.bindString(4, pipelineMaterial); - } - - String pipelineDiameter = entity.getPipelineDiameter(); - if (pipelineDiameter != null) { - stmt.bindString(5, pipelineDiameter); - } - - String buryDeep = entity.getBuryDeep(); - if (buryDeep != null) { - stmt.bindString(6, buryDeep); - } - - String lowerType = entity.getLowerType(); - if (lowerType != null) { - stmt.bindString(7, lowerType); - } - - String lowerMaterial = entity.getLowerMaterial(); - if (lowerMaterial != null) { - stmt.bindString(8, lowerMaterial); - } - - String lowerDiameter = entity.getLowerDiameter(); - if (lowerDiameter != null) { - stmt.bindString(9, lowerDiameter); - } - - String lowerDeep = entity.getLowerDeep(); - if (lowerDeep != null) { - stmt.bindString(10, lowerDeep); - } - - String buryMethod = entity.getBuryMethod(); - if (buryMethod != null) { - stmt.bindString(11, buryMethod); - } - - String area = entity.getArea(); - if (area != null) { - stmt.bindString(12, area); - } - - String line = entity.getLine(); - if (line != null) { - stmt.bindString(13, line); - } - - String road = entity.getRoad(); - if (road != null) { - stmt.bindString(14, road); - } - - String constructTime = entity.getConstructTime(); - if (constructTime != null) { - stmt.bindString(15, constructTime); - } - - String owner = entity.getOwner(); - if (owner != null) { - stmt.bindString(16, owner); - } - - String objectId = entity.getObjectId(); - if (objectId != null) { - stmt.bindString(17, objectId); - } - - String identifierId = entity.getIdentifierId(); - if (identifierId != null) { - stmt.bindString(18, identifierId); - } - - String identifierType = entity.getIdentifierType(); - if (identifierType != null) { - stmt.bindString(19, identifierType); - } - - String identifierDeep = entity.getIdentifierDeep(); - if (identifierDeep != null) { - stmt.bindString(20, identifierDeep); - } - - String person = entity.getPerson(); - if (person != null) { - stmt.bindString(21, person); - } - - String installTime = entity.getInstallTime(); - if (installTime != null) { - stmt.bindString(22, installTime); - } - - String lng = entity.getLng(); - if (lng != null) { - stmt.bindString(23, lng); - } - - String lat = entity.getLat(); - if (lat != null) { - stmt.bindString(24, lat); - } - - String color = entity.getColor(); - if (color != null) { - stmt.bindString(25, color); - } - - String remark = entity.getRemark(); - if (remark != null) { - stmt.bindString(26, remark); - } - - String imagePath = entity.getImagePath(); - if (imagePath != null) { - stmt.bindString(27, imagePath); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public LabelBean readEntity(Cursor cursor, int offset) { - LabelBean entity = new LabelBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // objectType - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineType - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // pipelineDiameter - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDeep - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lowerType - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lowerMaterial - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lowerDiameter - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // lowerDeep - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // buryMethod - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // area - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // line - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // road - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // constructTime - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // owner - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // objectId - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // identifierId - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // identifierType - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // identifierDeep - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // person - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // installTime - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // lng - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // lat - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // color - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // remark - cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, LabelBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setObjectType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setPipelineType(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setPipelineMaterial(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setPipelineDiameter(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setBuryDeep(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setLowerType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLowerMaterial(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLowerDiameter(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLowerDeep(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); - entity.setBuryMethod(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - entity.setArea(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - entity.setLine(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); - entity.setRoad(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); - entity.setConstructTime(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); - entity.setOwner(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); - entity.setObjectId(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); - entity.setIdentifierId(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); - entity.setIdentifierType(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18)); - entity.setIdentifierDeep(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19)); - entity.setPerson(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); - entity.setInstallTime(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); - entity.setLng(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22)); - entity.setLat(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); - entity.setColor(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); - entity.setRemark(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); - } - - @Override - protected final Long updateKeyAfterInsert(LabelBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(LabelBean entity) { - if (entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(LabelBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java new file mode 100644 index 0000000..18849f3 --- /dev/null +++ b/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java @@ -0,0 +1,484 @@ +package com.casic.detector.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import com.casic.detector.bean.MarkerLocalBean; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; +import org.greenrobot.greendao.internal.DaoConfig; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. + +/** + * DAO for table "MARKER_LOCAL_BEAN". + */ +public class MarkerLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "MARKER_LOCAL_BEAN"; + + /** + * Properties of entity MarkerLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property PipelineType = new Property(1, String.class, "pipelineType", false, "PIPELINE_TYPE"); + public final static Property PipelineDiameter = new Property(2, String.class, "pipelineDiameter", false, "PIPELINE_DIAMETER"); + public final static Property PipelineMaterial = new Property(3, String.class, "pipelineMaterial", false, "PIPELINE_MATERIAL"); + public final static Property BuryMethod = new Property(4, String.class, "buryMethod", false, "BURY_METHOD"); + public final static Property BuryDepth = new Property(5, String.class, "buryDepth", false, "BURY_DEPTH"); + public final static Property Area = new Property(6, String.class, "area", false, "AREA"); + public final static Property Line = new Property(7, String.class, "line", false, "LINE"); + public final static Property Road = new Property(8, String.class, "road", false, "ROAD"); + public final static Property ConstructTime = new Property(9, String.class, "constructTime", false, "CONSTRUCT_TIME"); + public final static Property Owner = new Property(10, String.class, "owner", false, "OWNER"); + public final static Property ObjectId = new Property(11, String.class, "objectId", false, "OBJECT_ID"); + public final static Property MarkerId = new Property(12, String.class, "markerId", false, "MARKER_ID"); + public final static Property MarkerType = new Property(13, String.class, "markerType", false, "MARKER_TYPE"); + public final static Property MarkerDepth = new Property(14, String.class, "markerDepth", false, "MARKER_DEPTH"); + public final static Property InstallationDept = new Property(15, String.class, "installationDept", false, "INSTALLATION_DEPT"); + public final static Property Lng = new Property(16, String.class, "lng", false, "LNG"); + public final static Property Lat = new Property(17, String.class, "lat", false, "LAT"); + public final static Property UpdateTime = new Property(18, String.class, "updateTime", false, "UPDATE_TIME"); + public final static Property Remark = new Property(19, String.class, "remark", false, "REMARK"); + public final static Property UnderlyingPipelineType = new Property(20, String.class, "underlyingPipelineType", false, "UNDERLYING_PIPELINE_TYPE"); + public final static Property UnderlyingPipelineDepth = new Property(21, String.class, "underlyingPipelineDepth", false, "UNDERLYING_PIPELINE_DEPTH"); + public final static Property UnderlyingPipelineDiameter = new Property(22, String.class, "underlyingPipelineDiameter", false, "UNDERLYING_PIPELINE_DIAMETER"); + public final static Property UnderlyingPipelineMaterial = new Property(23, String.class, "underlyingPipelineMaterial", false, "UNDERLYING_PIPELINE_MATERIAL"); + public final static Property ObjectType = new Property(24, String.class, "objectType", false, "OBJECT_TYPE"); + public final static Property Color = new Property(25, String.class, "color", false, "COLOR"); + public final static Property ImagePath = new Property(26, String.class, "imagePath", false, "IMAGE_PATH"); + } + + + public MarkerLocalBeanDao(DaoConfig config) { + super(config); + } + + public MarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** + * Creates the underlying database table. + */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + db.execSQL("CREATE TABLE " + constraint + "\"MARKER_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"PIPELINE_TYPE\" TEXT," + // 1: pipelineType + "\"PIPELINE_DIAMETER\" TEXT," + // 2: pipelineDiameter + "\"PIPELINE_MATERIAL\" TEXT," + // 3: pipelineMaterial + "\"BURY_METHOD\" TEXT," + // 4: buryMethod + "\"BURY_DEPTH\" TEXT," + // 5: buryDepth + "\"AREA\" TEXT," + // 6: area + "\"LINE\" TEXT," + // 7: line + "\"ROAD\" TEXT," + // 8: road + "\"CONSTRUCT_TIME\" TEXT," + // 9: constructTime + "\"OWNER\" TEXT," + // 10: owner + "\"OBJECT_ID\" TEXT," + // 11: objectId + "\"MARKER_ID\" TEXT," + // 12: markerId + "\"MARKER_TYPE\" TEXT," + // 13: markerType + "\"MARKER_DEPTH\" TEXT," + // 14: markerDepth + "\"INSTALLATION_DEPT\" TEXT," + // 15: installationDept + "\"LNG\" TEXT," + // 16: lng + "\"LAT\" TEXT," + // 17: lat + "\"UPDATE_TIME\" TEXT," + // 18: updateTime + "\"REMARK\" TEXT," + // 19: remark + "\"UNDERLYING_PIPELINE_TYPE\" TEXT," + // 20: underlyingPipelineType + "\"UNDERLYING_PIPELINE_DEPTH\" TEXT," + // 21: underlyingPipelineDepth + "\"UNDERLYING_PIPELINE_DIAMETER\" TEXT," + // 22: underlyingPipelineDiameter + "\"UNDERLYING_PIPELINE_MATERIAL\" TEXT," + // 23: underlyingPipelineMaterial + "\"OBJECT_TYPE\" TEXT," + // 24: objectType + "\"COLOR\" TEXT," + // 25: color + "\"IMAGE_PATH\" TEXT);"); // 26: imagePath + } + + /** + * Drops the underlying database table. + */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MARKER_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MarkerLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String pipelineType = entity.getPipelineType(); + if (pipelineType != null) { + stmt.bindString(2, pipelineType); + } + + String pipelineDiameter = entity.getPipelineDiameter(); + if (pipelineDiameter != null) { + stmt.bindString(3, pipelineDiameter); + } + + String pipelineMaterial = entity.getPipelineMaterial(); + if (pipelineMaterial != null) { + stmt.bindString(4, pipelineMaterial); + } + + String buryMethod = entity.getBuryMethod(); + if (buryMethod != null) { + stmt.bindString(5, buryMethod); + } + + String buryDepth = entity.getBuryDepth(); + if (buryDepth != null) { + stmt.bindString(6, buryDepth); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(7, area); + } + + String line = entity.getLine(); + if (line != null) { + stmt.bindString(8, line); + } + + String road = entity.getRoad(); + if (road != null) { + stmt.bindString(9, road); + } + + String constructTime = entity.getConstructTime(); + if (constructTime != null) { + stmt.bindString(10, constructTime); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(11, owner); + } + + String objectId = entity.getObjectId(); + if (objectId != null) { + stmt.bindString(12, objectId); + } + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(13, markerId); + } + + String markerType = entity.getMarkerType(); + if (markerType != null) { + stmt.bindString(14, markerType); + } + + String markerDepth = entity.getMarkerDepth(); + if (markerDepth != null) { + stmt.bindString(15, markerDepth); + } + + String installationDept = entity.getInstallationDept(); + if (installationDept != null) { + stmt.bindString(16, installationDept); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(17, lng); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(18, lat); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(19, updateTime); + } + + String remark = entity.getRemark(); + if (remark != null) { + stmt.bindString(20, remark); + } + + String underlyingPipelineType = entity.getUnderlyingPipelineType(); + if (underlyingPipelineType != null) { + stmt.bindString(21, underlyingPipelineType); + } + + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); + if (underlyingPipelineDepth != null) { + stmt.bindString(22, underlyingPipelineDepth); + } + + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); + if (underlyingPipelineDiameter != null) { + stmt.bindString(23, underlyingPipelineDiameter); + } + + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); + if (underlyingPipelineMaterial != null) { + stmt.bindString(24, underlyingPipelineMaterial); + } + + String objectType = entity.getObjectType(); + if (objectType != null) { + stmt.bindString(25, objectType); + } + + String color = entity.getColor(); + if (color != null) { + stmt.bindString(26, color); + } + + String imagePath = entity.getImagePath(); + if (imagePath != null) { + stmt.bindString(27, imagePath); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MarkerLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String pipelineType = entity.getPipelineType(); + if (pipelineType != null) { + stmt.bindString(2, pipelineType); + } + + String pipelineDiameter = entity.getPipelineDiameter(); + if (pipelineDiameter != null) { + stmt.bindString(3, pipelineDiameter); + } + + String pipelineMaterial = entity.getPipelineMaterial(); + if (pipelineMaterial != null) { + stmt.bindString(4, pipelineMaterial); + } + + String buryMethod = entity.getBuryMethod(); + if (buryMethod != null) { + stmt.bindString(5, buryMethod); + } + + String buryDepth = entity.getBuryDepth(); + if (buryDepth != null) { + stmt.bindString(6, buryDepth); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(7, area); + } + + String line = entity.getLine(); + if (line != null) { + stmt.bindString(8, line); + } + + String road = entity.getRoad(); + if (road != null) { + stmt.bindString(9, road); + } + + String constructTime = entity.getConstructTime(); + if (constructTime != null) { + stmt.bindString(10, constructTime); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(11, owner); + } + + String objectId = entity.getObjectId(); + if (objectId != null) { + stmt.bindString(12, objectId); + } + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(13, markerId); + } + + String markerType = entity.getMarkerType(); + if (markerType != null) { + stmt.bindString(14, markerType); + } + + String markerDepth = entity.getMarkerDepth(); + if (markerDepth != null) { + stmt.bindString(15, markerDepth); + } + + String installationDept = entity.getInstallationDept(); + if (installationDept != null) { + stmt.bindString(16, installationDept); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(17, lng); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(18, lat); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(19, updateTime); + } + + String remark = entity.getRemark(); + if (remark != null) { + stmt.bindString(20, remark); + } + + String underlyingPipelineType = entity.getUnderlyingPipelineType(); + if (underlyingPipelineType != null) { + stmt.bindString(21, underlyingPipelineType); + } + + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); + if (underlyingPipelineDepth != null) { + stmt.bindString(22, underlyingPipelineDepth); + } + + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); + if (underlyingPipelineDiameter != null) { + stmt.bindString(23, underlyingPipelineDiameter); + } + + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); + if (underlyingPipelineMaterial != null) { + stmt.bindString(24, underlyingPipelineMaterial); + } + + String objectType = entity.getObjectType(); + if (objectType != null) { + stmt.bindString(25, objectType); + } + + String color = entity.getColor(); + if (color != null) { + stmt.bindString(26, color); + } + + String imagePath = entity.getImagePath(); + if (imagePath != null) { + stmt.bindString(27, imagePath); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MarkerLocalBean readEntity(Cursor cursor, int offset) { + MarkerLocalBean entity = new MarkerLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color + cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MarkerLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setPipelineType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setPipelineDiameter(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setPipelineMaterial(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setBuryMethod(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setBuryDepth(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setArea(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLine(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setRoad(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setConstructTime(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setOwner(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setObjectId(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setMarkerId(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setMarkerType(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setMarkerDepth(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setInstallationDept(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setLng(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setLat(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + entity.setUpdateTime(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18)); + entity.setRemark(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19)); + entity.setUnderlyingPipelineType(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); + entity.setUnderlyingPipelineDepth(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); + entity.setUnderlyingPipelineDiameter(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22)); + entity.setUnderlyingPipelineMaterial(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); + entity.setObjectType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); + entity.setColor(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); + entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); + } + + @Override + protected final Long updateKeyAfterInsert(MarkerLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MarkerLocalBean entity) { + if (entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MarkerLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/detector/utils/ExcelHub.kt b/app/src/main/java/com/casic/detector/utils/ExcelHub.kt index a3c1355..5e12e0b 100644 --- a/app/src/main/java/com/casic/detector/utils/ExcelHub.kt +++ b/app/src/main/java/com/casic/detector/utils/ExcelHub.kt @@ -1,59 +1,51 @@ package com.casic.detector.utils -import android.content.Context -import com.casic.detector.bean.LabelBean -import com.pengxh.kt.lite.extensions.show +import com.casic.detector.bean.MarkerLocalBean import jxl.Workbook import jxl.read.biff.BiffException import java.io.File object ExcelHub { - fun read(context: Context, filePath: String?): ArrayList { - val result = ArrayList() - - if (filePath.isNullOrBlank()) { - return result - } - + fun read(filePath: String): ArrayList { + val result = ArrayList() try { val workbook = Workbook.getWorkbook(File(filePath)) val sheet = workbook.getSheet(0) for (i in 1 until sheet.rows) { - val labelBean = LabelBean() - labelBean.pipelineType = sheet.getCell(0, i).contents - labelBean.pipelineDiameter = sheet.getCell(1, i).contents - labelBean.pipelineMaterial = sheet.getCell(2, i).contents - labelBean.buryMethod = sheet.getCell(3, i).contents - labelBean.buryDeep = sheet.getCell(4, i).contents - labelBean.area = sheet.getCell(5, i).contents - labelBean.line = sheet.getCell(6, i).contents - labelBean.road = sheet.getCell(7, i).contents - labelBean.constructTime = sheet.getCell(8, i).contents - labelBean.owner = sheet.getCell(9, i).contents - labelBean.objectId = sheet.getCell(10, i).contents - labelBean.identifierId = sheet.getCell(11, i).contents - labelBean.identifierType = sheet.getCell(12, i).contents - labelBean.identifierDeep = sheet.getCell(13, i).contents - labelBean.person = sheet.getCell(14, i).contents - labelBean.lng = sheet.getCell(15, i).contents - labelBean.lat = sheet.getCell(16, i).contents - labelBean.installTime = sheet.getCell(17, i).contents - labelBean.remark = sheet.getCell(18, i).contents - labelBean.lowerType = sheet.getCell(19, i).contents - labelBean.lowerDeep = sheet.getCell(20, i).contents - labelBean.lowerDiameter = sheet.getCell(21, i).contents - labelBean.lowerMaterial = sheet.getCell(22, i).contents - labelBean.objectType = sheet.getCell(23, i).contents - labelBean.color = sheet.getCell(24, i).contents - labelBean.imagePath = sheet.getCell(25, i).contents + val marker = MarkerLocalBean() + marker.pipelineType = sheet.getCell(0, i).contents + marker.pipelineDiameter = sheet.getCell(1, i).contents + marker.pipelineMaterial = sheet.getCell(2, i).contents + marker.buryMethod = sheet.getCell(3, i).contents + marker.buryDepth = sheet.getCell(4, i).contents + marker.area = sheet.getCell(5, i).contents + marker.line = sheet.getCell(6, i).contents + marker.road = sheet.getCell(7, i).contents + marker.constructTime = sheet.getCell(8, i).contents + marker.owner = sheet.getCell(9, i).contents + marker.objectId = sheet.getCell(10, i).contents + marker.markerId = sheet.getCell(11, i).contents + marker.markerType = sheet.getCell(12, i).contents + marker.markerDepth = sheet.getCell(13, i).contents + marker.installationDept = sheet.getCell(14, i).contents + marker.lng = sheet.getCell(15, i).contents + marker.lat = sheet.getCell(16, i).contents + marker.updateTime = sheet.getCell(17, i).contents + marker.remark = sheet.getCell(18, i).contents + marker.underlyingPipelineType = sheet.getCell(19, i).contents + marker.underlyingPipelineDepth = sheet.getCell(20, i).contents + marker.underlyingPipelineDiameter = sheet.getCell(21, i).contents + marker.underlyingPipelineMaterial = sheet.getCell(22, i).contents + marker.objectType = sheet.getCell(23, i).contents + marker.color = sheet.getCell(24, i).contents + marker.imagePath = sheet.getCell(25, i).contents - result.add(labelBean) + result.add(marker) } workbook.close() } catch (e: BiffException) { e.printStackTrace() - e.localizedMessage?.show(context) } return result } diff --git a/app/src/main/java/com/casic/detector/bean/LabelBean.java b/app/src/main/java/com/casic/detector/bean/LabelBean.java deleted file mode 100644 index d22d835..0000000 --- a/app/src/main/java/com/casic/detector/bean/LabelBean.java +++ /dev/null @@ -1,321 +0,0 @@ -package com.casic.detector.bean; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -@Entity -public class LabelBean { - @Id(autoincrement = true) - private Long id;//主键ID - // 标记对象类型 - private String objectType; - // 管线类型 - private String pipelineType; - // 管材 - private String pipelineMaterial; - // 管直 - private String pipelineDiameter; - // 埋深 - private String buryDeep; - // 下层管线类型 - private String lowerType; - // 下层管材 - private String lowerMaterial; - // 下层管径 - private String lowerDiameter; - // 下层埋深 - private String lowerDeep; - // 埋设方式 - private String buryMethod; - // 所属区域 - private String area; - // 所属线路 - private String line; - // 所属道路 - private String road; - // 建设年代 - private String constructTime; - // 权属单位 - private String owner; - // 对象ID - private String objectId; - // 标识器ID号 - private String identifierId; - // 标识器类型 - private String identifierType; - // 标识器埋深 - private String identifierDeep; - // 安装人员 - private String person; - // 安装时间 - private String installTime; - // 经度 - private String lng; - // 纬度 - private String lat; - // 颜色 - private String color; - // 备注信息 - private String remark; - // 图片路径 - private String imagePath; - - @Generated(hash = 1718746860) - public LabelBean(Long id, String objectType, String pipelineType, - String pipelineMaterial, String pipelineDiameter, String buryDeep, - String lowerType, String lowerMaterial, String lowerDiameter, - String lowerDeep, String buryMethod, String area, String line, - String road, String constructTime, String owner, String objectId, - String identifierId, String identifierType, String identifierDeep, - String person, String installTime, String lng, String lat, String color, - String remark, String imagePath) { - this.id = id; - this.objectType = objectType; - this.pipelineType = pipelineType; - this.pipelineMaterial = pipelineMaterial; - this.pipelineDiameter = pipelineDiameter; - this.buryDeep = buryDeep; - this.lowerType = lowerType; - this.lowerMaterial = lowerMaterial; - this.lowerDiameter = lowerDiameter; - this.lowerDeep = lowerDeep; - this.buryMethod = buryMethod; - this.area = area; - this.line = line; - this.road = road; - this.constructTime = constructTime; - this.owner = owner; - this.objectId = objectId; - this.identifierId = identifierId; - this.identifierType = identifierType; - this.identifierDeep = identifierDeep; - this.person = person; - this.installTime = installTime; - this.lng = lng; - this.lat = lat; - this.color = color; - this.remark = remark; - this.imagePath = imagePath; - } - - @Generated(hash = 1285554626) - public LabelBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getObjectType() { - return this.objectType; - } - - public void setObjectType(String objectType) { - this.objectType = objectType; - } - - public String getPipelineType() { - return this.pipelineType; - } - - public void setPipelineType(String pipelineType) { - this.pipelineType = pipelineType; - } - - public String getPipelineMaterial() { - return this.pipelineMaterial; - } - - public void setPipelineMaterial(String pipelineMaterial) { - this.pipelineMaterial = pipelineMaterial; - } - - public String getPipelineDiameter() { - return this.pipelineDiameter; - } - - public void setPipelineDiameter(String pipelineDiameter) { - this.pipelineDiameter = pipelineDiameter; - } - - public String getBuryDeep() { - return this.buryDeep; - } - - public void setBuryDeep(String buryDeep) { - this.buryDeep = buryDeep; - } - - public String getLowerType() { - return this.lowerType; - } - - public void setLowerType(String lowerType) { - this.lowerType = lowerType; - } - - public String getLowerMaterial() { - return this.lowerMaterial; - } - - public void setLowerMaterial(String lowerMaterial) { - this.lowerMaterial = lowerMaterial; - } - - public String getLowerDiameter() { - return this.lowerDiameter; - } - - public void setLowerDiameter(String lowerDiameter) { - this.lowerDiameter = lowerDiameter; - } - - public String getLowerDeep() { - return this.lowerDeep; - } - - public void setLowerDeep(String lowerDeep) { - this.lowerDeep = lowerDeep; - } - - public String getBuryMethod() { - return this.buryMethod; - } - - public void setBuryMethod(String buryMethod) { - this.buryMethod = buryMethod; - } - - public String getArea() { - return this.area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getLine() { - return this.line; - } - - public void setLine(String line) { - this.line = line; - } - - public String getRoad() { - return this.road; - } - - public void setRoad(String road) { - this.road = road; - } - - public String getConstructTime() { - return this.constructTime; - } - - public void setConstructTime(String constructTime) { - this.constructTime = constructTime; - } - - public String getOwner() { - return this.owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getObjectId() { - return this.objectId; - } - - public void setObjectId(String objectId) { - this.objectId = objectId; - } - - public String getIdentifierId() { - return this.identifierId; - } - - public void setIdentifierId(String identifierId) { - this.identifierId = identifierId; - } - - public String getIdentifierType() { - return this.identifierType; - } - - public void setIdentifierType(String identifierType) { - this.identifierType = identifierType; - } - - public String getIdentifierDeep() { - return this.identifierDeep; - } - - public void setIdentifierDeep(String identifierDeep) { - this.identifierDeep = identifierDeep; - } - - public String getPerson() { - return this.person; - } - - public void setPerson(String person) { - this.person = person; - } - - public String getInstallTime() { - return this.installTime; - } - - public void setInstallTime(String installTime) { - this.installTime = installTime; - } - - public String getLng() { - return this.lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getLat() { - return this.lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getColor() { - return this.color; - } - - public void setColor(String color) { - this.color = color; - } - - public String getRemark() { - return this.remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getImagePath() { - return this.imagePath; - } - - public void setImagePath(String imagePath) { - this.imagePath = imagePath; - } -} diff --git a/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java new file mode 100644 index 0000000..c59cf0b --- /dev/null +++ b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java @@ -0,0 +1,327 @@ +package com.casic.detector.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Id; +import org.greenrobot.greendao.annotation.Generated; + +/** + * 从平台下载的标识器本地库实体类 + */ +@Entity +public class MarkerLocalBean { + @Id(autoincrement = true) + private Long id;//本地库主键ID + + // 管线类型 + private String pipelineType; + // 管线直径 + private String pipelineDiameter; + // 管材 + private String pipelineMaterial; + // 埋设方式 + private String buryMethod; + // 埋深 + private String buryDepth; + // 所属区域 + private String area; + // 所属线路 + private String line; + // 所属道路 + private String road; + // 建设年代 + private String constructTime; + // 权属单位 + private String owner; + //标识对象ID,无实际用途 + @Deprecated + private String objectId; + // 标识器ID + private String markerId; + // 标识器类型 + private String markerType; + // 标识器埋深 + private String markerDepth; + // 安装部门 + private String installationDept; + // 经度 + private String lng; + // 纬度 + private String lat; + //最后修改时间,更新时间 + private String updateTime; + // 备注信息 + private String remark; + // 下层管线类型 + private String underlyingPipelineType; + // 下层埋深 + private String underlyingPipelineDepth; + // 下层管径 + private String underlyingPipelineDiameter; + // 下层管材 + private String underlyingPipelineMaterial; + //标识对象类型 + private String objectType; + // 颜色 + private String color; + // 图片路径 + private String imagePath; + + @Generated(hash = 1479045776) + public MarkerLocalBean(Long id, String pipelineType, String pipelineDiameter, + String pipelineMaterial, String buryMethod, String buryDepth, + String area, String line, String road, String constructTime, + String owner, String objectId, String markerId, String markerType, + String markerDepth, String installationDept, String lng, String lat, + String updateTime, String remark, String underlyingPipelineType, + String underlyingPipelineDepth, String underlyingPipelineDiameter, + String underlyingPipelineMaterial, String objectType, String color, + String imagePath) { + this.id = id; + this.pipelineType = pipelineType; + this.pipelineDiameter = pipelineDiameter; + this.pipelineMaterial = pipelineMaterial; + this.buryMethod = buryMethod; + this.buryDepth = buryDepth; + this.area = area; + this.line = line; + this.road = road; + this.constructTime = constructTime; + this.owner = owner; + this.objectId = objectId; + this.markerId = markerId; + this.markerType = markerType; + this.markerDepth = markerDepth; + this.installationDept = installationDept; + this.lng = lng; + this.lat = lat; + this.updateTime = updateTime; + this.remark = remark; + this.underlyingPipelineType = underlyingPipelineType; + this.underlyingPipelineDepth = underlyingPipelineDepth; + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + this.objectType = objectType; + this.color = color; + this.imagePath = imagePath; + } + + @Generated(hash = 1538606012) + public MarkerLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPipelineType() { + return this.pipelineType; + } + + public void setPipelineType(String pipelineType) { + this.pipelineType = pipelineType; + } + + public String getPipelineDiameter() { + return this.pipelineDiameter; + } + + public void setPipelineDiameter(String pipelineDiameter) { + this.pipelineDiameter = pipelineDiameter; + } + + public String getPipelineMaterial() { + return this.pipelineMaterial; + } + + public void setPipelineMaterial(String pipelineMaterial) { + this.pipelineMaterial = pipelineMaterial; + } + + public String getBuryMethod() { + return this.buryMethod; + } + + public void setBuryMethod(String buryMethod) { + this.buryMethod = buryMethod; + } + + public String getBuryDepth() { + return this.buryDepth; + } + + public void setBuryDepth(String buryDepth) { + this.buryDepth = buryDepth; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getLine() { + return this.line; + } + + public void setLine(String line) { + this.line = line; + } + + public String getRoad() { + return this.road; + } + + public void setRoad(String road) { + this.road = road; + } + + public String getConstructTime() { + return this.constructTime; + } + + public void setConstructTime(String constructTime) { + this.constructTime = constructTime; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getObjectId() { + return this.objectId; + } + + public void setObjectId(String objectId) { + this.objectId = objectId; + } + + public String getMarkerId() { + return this.markerId; + } + + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerType() { + return this.markerType; + } + + public void setMarkerType(String markerType) { + this.markerType = markerType; + } + + public String getMarkerDepth() { + return this.markerDepth; + } + + public void setMarkerDepth(String markerDepth) { + this.markerDepth = markerDepth; + } + + public String getInstallationDept() { + return this.installationDept; + } + + public void setInstallationDept(String installationDept) { + this.installationDept = installationDept; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return this.remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getUnderlyingPipelineType() { + return this.underlyingPipelineType; + } + + public void setUnderlyingPipelineType(String underlyingPipelineType) { + this.underlyingPipelineType = underlyingPipelineType; + } + + public String getUnderlyingPipelineDepth() { + return this.underlyingPipelineDepth; + } + + public void setUnderlyingPipelineDepth(String underlyingPipelineDepth) { + this.underlyingPipelineDepth = underlyingPipelineDepth; + } + + public String getUnderlyingPipelineDiameter() { + return this.underlyingPipelineDiameter; + } + + public void setUnderlyingPipelineDiameter(String underlyingPipelineDiameter) { + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + } + + public String getUnderlyingPipelineMaterial() { + return this.underlyingPipelineMaterial; + } + + public void setUnderlyingPipelineMaterial(String underlyingPipelineMaterial) { + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + } + + public String getObjectType() { + return this.objectType; + } + + public void setObjectType(String objectType) { + this.objectType = objectType; + } + + public String getColor() { + return this.color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getImagePath() { + return this.imagePath; + } + + public void setImagePath(String imagePath) { + this.imagePath = imagePath; + } +} diff --git a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java index ec4425f..45e25e6 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java @@ -24,7 +24,7 @@ * Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - LabelBeanDao.createTable(db, ifNotExists); + MarkerLocalBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); @@ -34,7 +34,7 @@ * Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - LabelBeanDao.dropTable(db, ifExists); + MarkerLocalBeanDao.dropTable(db, ifExists); PipeLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); TaskMarkerLocalBeanDao.dropTable(db, ifExists); @@ -56,7 +56,7 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(LabelBeanDao.class); + registerDaoClass(MarkerLocalBeanDao.class); registerDaoClass(PipeLocalBeanDao.class); registerDaoClass(TaskLocalBeanDao.class); registerDaoClass(TaskMarkerLocalBeanDao.class); diff --git a/app/src/main/java/com/casic/detector/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/greendao/DaoSession.java index 4f9bdff..0d0d59f 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoSession.java @@ -1,6 +1,6 @@ package com.casic.detector.greendao; -import com.casic.detector.bean.LabelBean; +import com.casic.detector.bean.MarkerLocalBean; import com.casic.detector.bean.PipeLocalBean; import com.casic.detector.bean.TaskLocalBean; import com.casic.detector.bean.TaskMarkerLocalBean; @@ -22,12 +22,12 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig labelBeanDaoConfig; + private final DaoConfig markerLocalBeanDaoConfig; private final DaoConfig pipeLocalBeanDaoConfig; private final DaoConfig taskLocalBeanDaoConfig; private final DaoConfig taskMarkerLocalBeanDaoConfig; - private final LabelBeanDao labelBeanDao; + private final MarkerLocalBeanDao markerLocalBeanDao; private final PipeLocalBeanDao pipeLocalBeanDao; private final TaskLocalBeanDao taskLocalBeanDao; private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao; @@ -36,8 +36,8 @@ daoConfigMap) { super(db); - labelBeanDaoConfig = daoConfigMap.get(LabelBeanDao.class).clone(); - labelBeanDaoConfig.initIdentityScope(type); + markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone(); + markerLocalBeanDaoConfig.initIdentityScope(type); pipeLocalBeanDaoConfig = daoConfigMap.get(PipeLocalBeanDao.class).clone(); pipeLocalBeanDaoConfig.initIdentityScope(type); @@ -48,26 +48,26 @@ taskMarkerLocalBeanDaoConfig = daoConfigMap.get(TaskMarkerLocalBeanDao.class).clone(); taskMarkerLocalBeanDaoConfig.initIdentityScope(type); - labelBeanDao = new LabelBeanDao(labelBeanDaoConfig, this); + markerLocalBeanDao = new MarkerLocalBeanDao(markerLocalBeanDaoConfig, this); pipeLocalBeanDao = new PipeLocalBeanDao(pipeLocalBeanDaoConfig, this); taskLocalBeanDao = new TaskLocalBeanDao(taskLocalBeanDaoConfig, this); taskMarkerLocalBeanDao = new TaskMarkerLocalBeanDao(taskMarkerLocalBeanDaoConfig, this); - registerDao(LabelBean.class, labelBeanDao); + registerDao(MarkerLocalBean.class, markerLocalBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); registerDao(TaskLocalBean.class, taskLocalBeanDao); registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao); } public void clear() { - labelBeanDaoConfig.clearIdentityScope(); + markerLocalBeanDaoConfig.clearIdentityScope(); pipeLocalBeanDaoConfig.clearIdentityScope(); taskLocalBeanDaoConfig.clearIdentityScope(); taskMarkerLocalBeanDaoConfig.clearIdentityScope(); } - public LabelBeanDao getLabelBeanDao() { - return labelBeanDao; + public MarkerLocalBeanDao getMarkerLocalBeanDao() { + return markerLocalBeanDao; } public PipeLocalBeanDao getPipeLocalBeanDao() { diff --git a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java b/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java deleted file mode 100644 index 94a73c4..0000000 --- a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java +++ /dev/null @@ -1,484 +0,0 @@ -package com.casic.detector.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import com.casic.detector.bean.LabelBean; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; -import org.greenrobot.greendao.internal.DaoConfig; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** - * DAO for table "LABEL_BEAN". - */ -public class LabelBeanDao extends AbstractDao { - - public static final String TABLENAME = "LABEL_BEAN"; - - /** - * Properties of entity LabelBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ObjectType = new Property(1, String.class, "objectType", false, "OBJECT_TYPE"); - public final static Property PipelineType = new Property(2, String.class, "pipelineType", false, "PIPELINE_TYPE"); - public final static Property PipelineMaterial = new Property(3, String.class, "pipelineMaterial", false, "PIPELINE_MATERIAL"); - public final static Property PipelineDiameter = new Property(4, String.class, "pipelineDiameter", false, "PIPELINE_DIAMETER"); - public final static Property BuryDeep = new Property(5, String.class, "buryDeep", false, "BURY_DEEP"); - public final static Property LowerType = new Property(6, String.class, "lowerType", false, "LOWER_TYPE"); - public final static Property LowerMaterial = new Property(7, String.class, "lowerMaterial", false, "LOWER_MATERIAL"); - public final static Property LowerDiameter = new Property(8, String.class, "lowerDiameter", false, "LOWER_DIAMETER"); - public final static Property LowerDeep = new Property(9, String.class, "lowerDeep", false, "LOWER_DEEP"); - public final static Property BuryMethod = new Property(10, String.class, "buryMethod", false, "BURY_METHOD"); - public final static Property Area = new Property(11, String.class, "area", false, "AREA"); - public final static Property Line = new Property(12, String.class, "line", false, "LINE"); - public final static Property Road = new Property(13, String.class, "road", false, "ROAD"); - public final static Property ConstructTime = new Property(14, String.class, "constructTime", false, "CONSTRUCT_TIME"); - public final static Property Owner = new Property(15, String.class, "owner", false, "OWNER"); - public final static Property ObjectId = new Property(16, String.class, "objectId", false, "OBJECT_ID"); - public final static Property IdentifierId = new Property(17, String.class, "identifierId", false, "IDENTIFIER_ID"); - public final static Property IdentifierType = new Property(18, String.class, "identifierType", false, "IDENTIFIER_TYPE"); - public final static Property IdentifierDeep = new Property(19, String.class, "identifierDeep", false, "IDENTIFIER_DEEP"); - public final static Property Person = new Property(20, String.class, "person", false, "PERSON"); - public final static Property InstallTime = new Property(21, String.class, "installTime", false, "INSTALL_TIME"); - public final static Property Lng = new Property(22, String.class, "lng", false, "LNG"); - public final static Property Lat = new Property(23, String.class, "lat", false, "LAT"); - public final static Property Color = new Property(24, String.class, "color", false, "COLOR"); - public final static Property Remark = new Property(25, String.class, "remark", false, "REMARK"); - public final static Property ImagePath = new Property(26, String.class, "imagePath", false, "IMAGE_PATH"); - } - - - public LabelBeanDao(DaoConfig config) { - super(config); - } - - public LabelBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** - * Creates the underlying database table. - */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; - db.execSQL("CREATE TABLE " + constraint + "\"LABEL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"OBJECT_TYPE\" TEXT," + // 1: objectType - "\"PIPELINE_TYPE\" TEXT," + // 2: pipelineType - "\"PIPELINE_MATERIAL\" TEXT," + // 3: pipelineMaterial - "\"PIPELINE_DIAMETER\" TEXT," + // 4: pipelineDiameter - "\"BURY_DEEP\" TEXT," + // 5: buryDeep - "\"LOWER_TYPE\" TEXT," + // 6: lowerType - "\"LOWER_MATERIAL\" TEXT," + // 7: lowerMaterial - "\"LOWER_DIAMETER\" TEXT," + // 8: lowerDiameter - "\"LOWER_DEEP\" TEXT," + // 9: lowerDeep - "\"BURY_METHOD\" TEXT," + // 10: buryMethod - "\"AREA\" TEXT," + // 11: area - "\"LINE\" TEXT," + // 12: line - "\"ROAD\" TEXT," + // 13: road - "\"CONSTRUCT_TIME\" TEXT," + // 14: constructTime - "\"OWNER\" TEXT," + // 15: owner - "\"OBJECT_ID\" TEXT," + // 16: objectId - "\"IDENTIFIER_ID\" TEXT," + // 17: identifierId - "\"IDENTIFIER_TYPE\" TEXT," + // 18: identifierType - "\"IDENTIFIER_DEEP\" TEXT," + // 19: identifierDeep - "\"PERSON\" TEXT," + // 20: person - "\"INSTALL_TIME\" TEXT," + // 21: installTime - "\"LNG\" TEXT," + // 22: lng - "\"LAT\" TEXT," + // 23: lat - "\"COLOR\" TEXT," + // 24: color - "\"REMARK\" TEXT," + // 25: remark - "\"IMAGE_PATH\" TEXT);"); // 26: imagePath - } - - /** - * Drops the underlying database table. - */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LABEL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, LabelBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String objectType = entity.getObjectType(); - if (objectType != null) { - stmt.bindString(2, objectType); - } - - String pipelineType = entity.getPipelineType(); - if (pipelineType != null) { - stmt.bindString(3, pipelineType); - } - - String pipelineMaterial = entity.getPipelineMaterial(); - if (pipelineMaterial != null) { - stmt.bindString(4, pipelineMaterial); - } - - String pipelineDiameter = entity.getPipelineDiameter(); - if (pipelineDiameter != null) { - stmt.bindString(5, pipelineDiameter); - } - - String buryDeep = entity.getBuryDeep(); - if (buryDeep != null) { - stmt.bindString(6, buryDeep); - } - - String lowerType = entity.getLowerType(); - if (lowerType != null) { - stmt.bindString(7, lowerType); - } - - String lowerMaterial = entity.getLowerMaterial(); - if (lowerMaterial != null) { - stmt.bindString(8, lowerMaterial); - } - - String lowerDiameter = entity.getLowerDiameter(); - if (lowerDiameter != null) { - stmt.bindString(9, lowerDiameter); - } - - String lowerDeep = entity.getLowerDeep(); - if (lowerDeep != null) { - stmt.bindString(10, lowerDeep); - } - - String buryMethod = entity.getBuryMethod(); - if (buryMethod != null) { - stmt.bindString(11, buryMethod); - } - - String area = entity.getArea(); - if (area != null) { - stmt.bindString(12, area); - } - - String line = entity.getLine(); - if (line != null) { - stmt.bindString(13, line); - } - - String road = entity.getRoad(); - if (road != null) { - stmt.bindString(14, road); - } - - String constructTime = entity.getConstructTime(); - if (constructTime != null) { - stmt.bindString(15, constructTime); - } - - String owner = entity.getOwner(); - if (owner != null) { - stmt.bindString(16, owner); - } - - String objectId = entity.getObjectId(); - if (objectId != null) { - stmt.bindString(17, objectId); - } - - String identifierId = entity.getIdentifierId(); - if (identifierId != null) { - stmt.bindString(18, identifierId); - } - - String identifierType = entity.getIdentifierType(); - if (identifierType != null) { - stmt.bindString(19, identifierType); - } - - String identifierDeep = entity.getIdentifierDeep(); - if (identifierDeep != null) { - stmt.bindString(20, identifierDeep); - } - - String person = entity.getPerson(); - if (person != null) { - stmt.bindString(21, person); - } - - String installTime = entity.getInstallTime(); - if (installTime != null) { - stmt.bindString(22, installTime); - } - - String lng = entity.getLng(); - if (lng != null) { - stmt.bindString(23, lng); - } - - String lat = entity.getLat(); - if (lat != null) { - stmt.bindString(24, lat); - } - - String color = entity.getColor(); - if (color != null) { - stmt.bindString(25, color); - } - - String remark = entity.getRemark(); - if (remark != null) { - stmt.bindString(26, remark); - } - - String imagePath = entity.getImagePath(); - if (imagePath != null) { - stmt.bindString(27, imagePath); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, LabelBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String objectType = entity.getObjectType(); - if (objectType != null) { - stmt.bindString(2, objectType); - } - - String pipelineType = entity.getPipelineType(); - if (pipelineType != null) { - stmt.bindString(3, pipelineType); - } - - String pipelineMaterial = entity.getPipelineMaterial(); - if (pipelineMaterial != null) { - stmt.bindString(4, pipelineMaterial); - } - - String pipelineDiameter = entity.getPipelineDiameter(); - if (pipelineDiameter != null) { - stmt.bindString(5, pipelineDiameter); - } - - String buryDeep = entity.getBuryDeep(); - if (buryDeep != null) { - stmt.bindString(6, buryDeep); - } - - String lowerType = entity.getLowerType(); - if (lowerType != null) { - stmt.bindString(7, lowerType); - } - - String lowerMaterial = entity.getLowerMaterial(); - if (lowerMaterial != null) { - stmt.bindString(8, lowerMaterial); - } - - String lowerDiameter = entity.getLowerDiameter(); - if (lowerDiameter != null) { - stmt.bindString(9, lowerDiameter); - } - - String lowerDeep = entity.getLowerDeep(); - if (lowerDeep != null) { - stmt.bindString(10, lowerDeep); - } - - String buryMethod = entity.getBuryMethod(); - if (buryMethod != null) { - stmt.bindString(11, buryMethod); - } - - String area = entity.getArea(); - if (area != null) { - stmt.bindString(12, area); - } - - String line = entity.getLine(); - if (line != null) { - stmt.bindString(13, line); - } - - String road = entity.getRoad(); - if (road != null) { - stmt.bindString(14, road); - } - - String constructTime = entity.getConstructTime(); - if (constructTime != null) { - stmt.bindString(15, constructTime); - } - - String owner = entity.getOwner(); - if (owner != null) { - stmt.bindString(16, owner); - } - - String objectId = entity.getObjectId(); - if (objectId != null) { - stmt.bindString(17, objectId); - } - - String identifierId = entity.getIdentifierId(); - if (identifierId != null) { - stmt.bindString(18, identifierId); - } - - String identifierType = entity.getIdentifierType(); - if (identifierType != null) { - stmt.bindString(19, identifierType); - } - - String identifierDeep = entity.getIdentifierDeep(); - if (identifierDeep != null) { - stmt.bindString(20, identifierDeep); - } - - String person = entity.getPerson(); - if (person != null) { - stmt.bindString(21, person); - } - - String installTime = entity.getInstallTime(); - if (installTime != null) { - stmt.bindString(22, installTime); - } - - String lng = entity.getLng(); - if (lng != null) { - stmt.bindString(23, lng); - } - - String lat = entity.getLat(); - if (lat != null) { - stmt.bindString(24, lat); - } - - String color = entity.getColor(); - if (color != null) { - stmt.bindString(25, color); - } - - String remark = entity.getRemark(); - if (remark != null) { - stmt.bindString(26, remark); - } - - String imagePath = entity.getImagePath(); - if (imagePath != null) { - stmt.bindString(27, imagePath); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public LabelBean readEntity(Cursor cursor, int offset) { - LabelBean entity = new LabelBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // objectType - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineType - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // pipelineDiameter - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDeep - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lowerType - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lowerMaterial - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lowerDiameter - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // lowerDeep - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // buryMethod - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // area - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // line - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // road - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // constructTime - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // owner - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // objectId - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // identifierId - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // identifierType - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // identifierDeep - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // person - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // installTime - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // lng - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // lat - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // color - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // remark - cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, LabelBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setObjectType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setPipelineType(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setPipelineMaterial(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setPipelineDiameter(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setBuryDeep(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setLowerType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLowerMaterial(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLowerDiameter(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLowerDeep(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); - entity.setBuryMethod(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - entity.setArea(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - entity.setLine(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); - entity.setRoad(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); - entity.setConstructTime(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); - entity.setOwner(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); - entity.setObjectId(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); - entity.setIdentifierId(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); - entity.setIdentifierType(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18)); - entity.setIdentifierDeep(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19)); - entity.setPerson(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); - entity.setInstallTime(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); - entity.setLng(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22)); - entity.setLat(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); - entity.setColor(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); - entity.setRemark(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); - } - - @Override - protected final Long updateKeyAfterInsert(LabelBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(LabelBean entity) { - if (entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(LabelBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java new file mode 100644 index 0000000..18849f3 --- /dev/null +++ b/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java @@ -0,0 +1,484 @@ +package com.casic.detector.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import com.casic.detector.bean.MarkerLocalBean; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; +import org.greenrobot.greendao.internal.DaoConfig; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. + +/** + * DAO for table "MARKER_LOCAL_BEAN". + */ +public class MarkerLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "MARKER_LOCAL_BEAN"; + + /** + * Properties of entity MarkerLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property PipelineType = new Property(1, String.class, "pipelineType", false, "PIPELINE_TYPE"); + public final static Property PipelineDiameter = new Property(2, String.class, "pipelineDiameter", false, "PIPELINE_DIAMETER"); + public final static Property PipelineMaterial = new Property(3, String.class, "pipelineMaterial", false, "PIPELINE_MATERIAL"); + public final static Property BuryMethod = new Property(4, String.class, "buryMethod", false, "BURY_METHOD"); + public final static Property BuryDepth = new Property(5, String.class, "buryDepth", false, "BURY_DEPTH"); + public final static Property Area = new Property(6, String.class, "area", false, "AREA"); + public final static Property Line = new Property(7, String.class, "line", false, "LINE"); + public final static Property Road = new Property(8, String.class, "road", false, "ROAD"); + public final static Property ConstructTime = new Property(9, String.class, "constructTime", false, "CONSTRUCT_TIME"); + public final static Property Owner = new Property(10, String.class, "owner", false, "OWNER"); + public final static Property ObjectId = new Property(11, String.class, "objectId", false, "OBJECT_ID"); + public final static Property MarkerId = new Property(12, String.class, "markerId", false, "MARKER_ID"); + public final static Property MarkerType = new Property(13, String.class, "markerType", false, "MARKER_TYPE"); + public final static Property MarkerDepth = new Property(14, String.class, "markerDepth", false, "MARKER_DEPTH"); + public final static Property InstallationDept = new Property(15, String.class, "installationDept", false, "INSTALLATION_DEPT"); + public final static Property Lng = new Property(16, String.class, "lng", false, "LNG"); + public final static Property Lat = new Property(17, String.class, "lat", false, "LAT"); + public final static Property UpdateTime = new Property(18, String.class, "updateTime", false, "UPDATE_TIME"); + public final static Property Remark = new Property(19, String.class, "remark", false, "REMARK"); + public final static Property UnderlyingPipelineType = new Property(20, String.class, "underlyingPipelineType", false, "UNDERLYING_PIPELINE_TYPE"); + public final static Property UnderlyingPipelineDepth = new Property(21, String.class, "underlyingPipelineDepth", false, "UNDERLYING_PIPELINE_DEPTH"); + public final static Property UnderlyingPipelineDiameter = new Property(22, String.class, "underlyingPipelineDiameter", false, "UNDERLYING_PIPELINE_DIAMETER"); + public final static Property UnderlyingPipelineMaterial = new Property(23, String.class, "underlyingPipelineMaterial", false, "UNDERLYING_PIPELINE_MATERIAL"); + public final static Property ObjectType = new Property(24, String.class, "objectType", false, "OBJECT_TYPE"); + public final static Property Color = new Property(25, String.class, "color", false, "COLOR"); + public final static Property ImagePath = new Property(26, String.class, "imagePath", false, "IMAGE_PATH"); + } + + + public MarkerLocalBeanDao(DaoConfig config) { + super(config); + } + + public MarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** + * Creates the underlying database table. + */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + db.execSQL("CREATE TABLE " + constraint + "\"MARKER_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"PIPELINE_TYPE\" TEXT," + // 1: pipelineType + "\"PIPELINE_DIAMETER\" TEXT," + // 2: pipelineDiameter + "\"PIPELINE_MATERIAL\" TEXT," + // 3: pipelineMaterial + "\"BURY_METHOD\" TEXT," + // 4: buryMethod + "\"BURY_DEPTH\" TEXT," + // 5: buryDepth + "\"AREA\" TEXT," + // 6: area + "\"LINE\" TEXT," + // 7: line + "\"ROAD\" TEXT," + // 8: road + "\"CONSTRUCT_TIME\" TEXT," + // 9: constructTime + "\"OWNER\" TEXT," + // 10: owner + "\"OBJECT_ID\" TEXT," + // 11: objectId + "\"MARKER_ID\" TEXT," + // 12: markerId + "\"MARKER_TYPE\" TEXT," + // 13: markerType + "\"MARKER_DEPTH\" TEXT," + // 14: markerDepth + "\"INSTALLATION_DEPT\" TEXT," + // 15: installationDept + "\"LNG\" TEXT," + // 16: lng + "\"LAT\" TEXT," + // 17: lat + "\"UPDATE_TIME\" TEXT," + // 18: updateTime + "\"REMARK\" TEXT," + // 19: remark + "\"UNDERLYING_PIPELINE_TYPE\" TEXT," + // 20: underlyingPipelineType + "\"UNDERLYING_PIPELINE_DEPTH\" TEXT," + // 21: underlyingPipelineDepth + "\"UNDERLYING_PIPELINE_DIAMETER\" TEXT," + // 22: underlyingPipelineDiameter + "\"UNDERLYING_PIPELINE_MATERIAL\" TEXT," + // 23: underlyingPipelineMaterial + "\"OBJECT_TYPE\" TEXT," + // 24: objectType + "\"COLOR\" TEXT," + // 25: color + "\"IMAGE_PATH\" TEXT);"); // 26: imagePath + } + + /** + * Drops the underlying database table. + */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MARKER_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MarkerLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String pipelineType = entity.getPipelineType(); + if (pipelineType != null) { + stmt.bindString(2, pipelineType); + } + + String pipelineDiameter = entity.getPipelineDiameter(); + if (pipelineDiameter != null) { + stmt.bindString(3, pipelineDiameter); + } + + String pipelineMaterial = entity.getPipelineMaterial(); + if (pipelineMaterial != null) { + stmt.bindString(4, pipelineMaterial); + } + + String buryMethod = entity.getBuryMethod(); + if (buryMethod != null) { + stmt.bindString(5, buryMethod); + } + + String buryDepth = entity.getBuryDepth(); + if (buryDepth != null) { + stmt.bindString(6, buryDepth); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(7, area); + } + + String line = entity.getLine(); + if (line != null) { + stmt.bindString(8, line); + } + + String road = entity.getRoad(); + if (road != null) { + stmt.bindString(9, road); + } + + String constructTime = entity.getConstructTime(); + if (constructTime != null) { + stmt.bindString(10, constructTime); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(11, owner); + } + + String objectId = entity.getObjectId(); + if (objectId != null) { + stmt.bindString(12, objectId); + } + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(13, markerId); + } + + String markerType = entity.getMarkerType(); + if (markerType != null) { + stmt.bindString(14, markerType); + } + + String markerDepth = entity.getMarkerDepth(); + if (markerDepth != null) { + stmt.bindString(15, markerDepth); + } + + String installationDept = entity.getInstallationDept(); + if (installationDept != null) { + stmt.bindString(16, installationDept); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(17, lng); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(18, lat); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(19, updateTime); + } + + String remark = entity.getRemark(); + if (remark != null) { + stmt.bindString(20, remark); + } + + String underlyingPipelineType = entity.getUnderlyingPipelineType(); + if (underlyingPipelineType != null) { + stmt.bindString(21, underlyingPipelineType); + } + + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); + if (underlyingPipelineDepth != null) { + stmt.bindString(22, underlyingPipelineDepth); + } + + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); + if (underlyingPipelineDiameter != null) { + stmt.bindString(23, underlyingPipelineDiameter); + } + + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); + if (underlyingPipelineMaterial != null) { + stmt.bindString(24, underlyingPipelineMaterial); + } + + String objectType = entity.getObjectType(); + if (objectType != null) { + stmt.bindString(25, objectType); + } + + String color = entity.getColor(); + if (color != null) { + stmt.bindString(26, color); + } + + String imagePath = entity.getImagePath(); + if (imagePath != null) { + stmt.bindString(27, imagePath); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MarkerLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String pipelineType = entity.getPipelineType(); + if (pipelineType != null) { + stmt.bindString(2, pipelineType); + } + + String pipelineDiameter = entity.getPipelineDiameter(); + if (pipelineDiameter != null) { + stmt.bindString(3, pipelineDiameter); + } + + String pipelineMaterial = entity.getPipelineMaterial(); + if (pipelineMaterial != null) { + stmt.bindString(4, pipelineMaterial); + } + + String buryMethod = entity.getBuryMethod(); + if (buryMethod != null) { + stmt.bindString(5, buryMethod); + } + + String buryDepth = entity.getBuryDepth(); + if (buryDepth != null) { + stmt.bindString(6, buryDepth); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(7, area); + } + + String line = entity.getLine(); + if (line != null) { + stmt.bindString(8, line); + } + + String road = entity.getRoad(); + if (road != null) { + stmt.bindString(9, road); + } + + String constructTime = entity.getConstructTime(); + if (constructTime != null) { + stmt.bindString(10, constructTime); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(11, owner); + } + + String objectId = entity.getObjectId(); + if (objectId != null) { + stmt.bindString(12, objectId); + } + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(13, markerId); + } + + String markerType = entity.getMarkerType(); + if (markerType != null) { + stmt.bindString(14, markerType); + } + + String markerDepth = entity.getMarkerDepth(); + if (markerDepth != null) { + stmt.bindString(15, markerDepth); + } + + String installationDept = entity.getInstallationDept(); + if (installationDept != null) { + stmt.bindString(16, installationDept); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(17, lng); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(18, lat); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(19, updateTime); + } + + String remark = entity.getRemark(); + if (remark != null) { + stmt.bindString(20, remark); + } + + String underlyingPipelineType = entity.getUnderlyingPipelineType(); + if (underlyingPipelineType != null) { + stmt.bindString(21, underlyingPipelineType); + } + + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); + if (underlyingPipelineDepth != null) { + stmt.bindString(22, underlyingPipelineDepth); + } + + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); + if (underlyingPipelineDiameter != null) { + stmt.bindString(23, underlyingPipelineDiameter); + } + + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); + if (underlyingPipelineMaterial != null) { + stmt.bindString(24, underlyingPipelineMaterial); + } + + String objectType = entity.getObjectType(); + if (objectType != null) { + stmt.bindString(25, objectType); + } + + String color = entity.getColor(); + if (color != null) { + stmt.bindString(26, color); + } + + String imagePath = entity.getImagePath(); + if (imagePath != null) { + stmt.bindString(27, imagePath); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MarkerLocalBean readEntity(Cursor cursor, int offset) { + MarkerLocalBean entity = new MarkerLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color + cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MarkerLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setPipelineType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setPipelineDiameter(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setPipelineMaterial(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setBuryMethod(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setBuryDepth(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setArea(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLine(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setRoad(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setConstructTime(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setOwner(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setObjectId(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setMarkerId(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setMarkerType(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setMarkerDepth(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setInstallationDept(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setLng(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setLat(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + entity.setUpdateTime(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18)); + entity.setRemark(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19)); + entity.setUnderlyingPipelineType(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); + entity.setUnderlyingPipelineDepth(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); + entity.setUnderlyingPipelineDiameter(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22)); + entity.setUnderlyingPipelineMaterial(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); + entity.setObjectType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); + entity.setColor(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); + entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); + } + + @Override + protected final Long updateKeyAfterInsert(MarkerLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MarkerLocalBean entity) { + if (entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MarkerLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/detector/utils/ExcelHub.kt b/app/src/main/java/com/casic/detector/utils/ExcelHub.kt index a3c1355..5e12e0b 100644 --- a/app/src/main/java/com/casic/detector/utils/ExcelHub.kt +++ b/app/src/main/java/com/casic/detector/utils/ExcelHub.kt @@ -1,59 +1,51 @@ package com.casic.detector.utils -import android.content.Context -import com.casic.detector.bean.LabelBean -import com.pengxh.kt.lite.extensions.show +import com.casic.detector.bean.MarkerLocalBean import jxl.Workbook import jxl.read.biff.BiffException import java.io.File object ExcelHub { - fun read(context: Context, filePath: String?): ArrayList { - val result = ArrayList() - - if (filePath.isNullOrBlank()) { - return result - } - + fun read(filePath: String): ArrayList { + val result = ArrayList() try { val workbook = Workbook.getWorkbook(File(filePath)) val sheet = workbook.getSheet(0) for (i in 1 until sheet.rows) { - val labelBean = LabelBean() - labelBean.pipelineType = sheet.getCell(0, i).contents - labelBean.pipelineDiameter = sheet.getCell(1, i).contents - labelBean.pipelineMaterial = sheet.getCell(2, i).contents - labelBean.buryMethod = sheet.getCell(3, i).contents - labelBean.buryDeep = sheet.getCell(4, i).contents - labelBean.area = sheet.getCell(5, i).contents - labelBean.line = sheet.getCell(6, i).contents - labelBean.road = sheet.getCell(7, i).contents - labelBean.constructTime = sheet.getCell(8, i).contents - labelBean.owner = sheet.getCell(9, i).contents - labelBean.objectId = sheet.getCell(10, i).contents - labelBean.identifierId = sheet.getCell(11, i).contents - labelBean.identifierType = sheet.getCell(12, i).contents - labelBean.identifierDeep = sheet.getCell(13, i).contents - labelBean.person = sheet.getCell(14, i).contents - labelBean.lng = sheet.getCell(15, i).contents - labelBean.lat = sheet.getCell(16, i).contents - labelBean.installTime = sheet.getCell(17, i).contents - labelBean.remark = sheet.getCell(18, i).contents - labelBean.lowerType = sheet.getCell(19, i).contents - labelBean.lowerDeep = sheet.getCell(20, i).contents - labelBean.lowerDiameter = sheet.getCell(21, i).contents - labelBean.lowerMaterial = sheet.getCell(22, i).contents - labelBean.objectType = sheet.getCell(23, i).contents - labelBean.color = sheet.getCell(24, i).contents - labelBean.imagePath = sheet.getCell(25, i).contents + val marker = MarkerLocalBean() + marker.pipelineType = sheet.getCell(0, i).contents + marker.pipelineDiameter = sheet.getCell(1, i).contents + marker.pipelineMaterial = sheet.getCell(2, i).contents + marker.buryMethod = sheet.getCell(3, i).contents + marker.buryDepth = sheet.getCell(4, i).contents + marker.area = sheet.getCell(5, i).contents + marker.line = sheet.getCell(6, i).contents + marker.road = sheet.getCell(7, i).contents + marker.constructTime = sheet.getCell(8, i).contents + marker.owner = sheet.getCell(9, i).contents + marker.objectId = sheet.getCell(10, i).contents + marker.markerId = sheet.getCell(11, i).contents + marker.markerType = sheet.getCell(12, i).contents + marker.markerDepth = sheet.getCell(13, i).contents + marker.installationDept = sheet.getCell(14, i).contents + marker.lng = sheet.getCell(15, i).contents + marker.lat = sheet.getCell(16, i).contents + marker.updateTime = sheet.getCell(17, i).contents + marker.remark = sheet.getCell(18, i).contents + marker.underlyingPipelineType = sheet.getCell(19, i).contents + marker.underlyingPipelineDepth = sheet.getCell(20, i).contents + marker.underlyingPipelineDiameter = sheet.getCell(21, i).contents + marker.underlyingPipelineMaterial = sheet.getCell(22, i).contents + marker.objectType = sheet.getCell(23, i).contents + marker.color = sheet.getCell(24, i).contents + marker.imagePath = sheet.getCell(25, i).contents - result.add(labelBean) + result.add(marker) } workbook.close() } catch (e: BiffException) { e.printStackTrace() - e.localizedMessage?.show(context) } return result } diff --git a/app/src/main/java/com/casic/detector/view/LoginActivity.kt b/app/src/main/java/com/casic/detector/view/LoginActivity.kt index 3eea0c5..73849b9 100644 --- a/app/src/main/java/com/casic/detector/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/detector/view/LoginActivity.kt @@ -2,26 +2,18 @@ import android.os.Bundle import androidx.lifecycle.ViewModelProvider -import androidx.lifecycle.lifecycleScope -import com.amap.api.maps.CoordinateConverter import com.amap.api.navi.NaviSetting import com.casic.detector.databinding.ActivityLoginBinding -import com.casic.detector.model.PipelineModel -import com.casic.detector.utils.DataBaseManager import com.casic.detector.utils.LocaleConstant import com.casic.detector.vm.UserViewModel import com.google.gson.Gson -import com.google.gson.reflect.TypeToken import com.gyf.immersionbar.ImmersionBar import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.extensions.navigatePageTo -import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.utils.LoadState import com.pengxh.kt.lite.utils.LoadingDialogHub import com.pengxh.kt.lite.utils.SaveKeyValues import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch class LoginActivity : KotlinBaseActivity() { @@ -51,31 +43,31 @@ } } - lifecycleScope.launch(Dispatchers.IO) { - //获取管线数据。本地文件 - val pipeline = readAssetsFile("pipeline.json") - val lineResult = gson.fromJson( - pipeline, object : TypeToken() {}.type - ) - //缓存Pipe到本地 - lineResult.data.forEach { dot -> - val startLat = dot.startLatitudeGd - val startLng = dot.startLongitudeGd - val endLat = dot.endLatitudeGd - val endLng = dot.endLongitudeGd - if (!startLat.isNullOrBlank() && !startLng.isNullOrBlank() && !endLat.isNullOrBlank() && !endLng.isNullOrBlank()) { - if (CoordinateConverter.isAMapDataAvailable( - startLat.toDouble(), startLng.toDouble() - ) && - CoordinateConverter.isAMapDataAvailable( - endLat.toDouble(), endLng.toDouble() - ) - ) { - DataBaseManager.get.insertMapPipeCache(dot) - } - } - } - } +// lifecycleScope.launch(Dispatchers.IO) { +// //获取管线数据。本地文件 +// val pipeline = readAssetsFile("pipeline.json") +// val lineResult = gson.fromJson( +// pipeline, object : TypeToken() {}.type +// ) +// //缓存Pipe到本地 +// lineResult.data.forEach { dot -> +// val startLat = dot.startLatitudeGd +// val startLng = dot.startLongitudeGd +// val endLat = dot.endLatitudeGd +// val endLng = dot.endLongitudeGd +// if (!startLat.isNullOrBlank() && !startLng.isNullOrBlank() && !endLat.isNullOrBlank() && !endLng.isNullOrBlank()) { +// if (CoordinateConverter.isAMapDataAvailable( +// startLat.toDouble(), startLng.toDouble() +// ) && +// CoordinateConverter.isAMapDataAvailable( +// endLat.toDouble(), endLng.toDouble() +// ) +// ) { +// DataBaseManager.get.insertMapPipeCache(dot) +// } +// } +// } +// } } override fun initEvent() { diff --git a/app/src/main/java/com/casic/detector/bean/LabelBean.java b/app/src/main/java/com/casic/detector/bean/LabelBean.java deleted file mode 100644 index d22d835..0000000 --- a/app/src/main/java/com/casic/detector/bean/LabelBean.java +++ /dev/null @@ -1,321 +0,0 @@ -package com.casic.detector.bean; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -@Entity -public class LabelBean { - @Id(autoincrement = true) - private Long id;//主键ID - // 标记对象类型 - private String objectType; - // 管线类型 - private String pipelineType; - // 管材 - private String pipelineMaterial; - // 管直 - private String pipelineDiameter; - // 埋深 - private String buryDeep; - // 下层管线类型 - private String lowerType; - // 下层管材 - private String lowerMaterial; - // 下层管径 - private String lowerDiameter; - // 下层埋深 - private String lowerDeep; - // 埋设方式 - private String buryMethod; - // 所属区域 - private String area; - // 所属线路 - private String line; - // 所属道路 - private String road; - // 建设年代 - private String constructTime; - // 权属单位 - private String owner; - // 对象ID - private String objectId; - // 标识器ID号 - private String identifierId; - // 标识器类型 - private String identifierType; - // 标识器埋深 - private String identifierDeep; - // 安装人员 - private String person; - // 安装时间 - private String installTime; - // 经度 - private String lng; - // 纬度 - private String lat; - // 颜色 - private String color; - // 备注信息 - private String remark; - // 图片路径 - private String imagePath; - - @Generated(hash = 1718746860) - public LabelBean(Long id, String objectType, String pipelineType, - String pipelineMaterial, String pipelineDiameter, String buryDeep, - String lowerType, String lowerMaterial, String lowerDiameter, - String lowerDeep, String buryMethod, String area, String line, - String road, String constructTime, String owner, String objectId, - String identifierId, String identifierType, String identifierDeep, - String person, String installTime, String lng, String lat, String color, - String remark, String imagePath) { - this.id = id; - this.objectType = objectType; - this.pipelineType = pipelineType; - this.pipelineMaterial = pipelineMaterial; - this.pipelineDiameter = pipelineDiameter; - this.buryDeep = buryDeep; - this.lowerType = lowerType; - this.lowerMaterial = lowerMaterial; - this.lowerDiameter = lowerDiameter; - this.lowerDeep = lowerDeep; - this.buryMethod = buryMethod; - this.area = area; - this.line = line; - this.road = road; - this.constructTime = constructTime; - this.owner = owner; - this.objectId = objectId; - this.identifierId = identifierId; - this.identifierType = identifierType; - this.identifierDeep = identifierDeep; - this.person = person; - this.installTime = installTime; - this.lng = lng; - this.lat = lat; - this.color = color; - this.remark = remark; - this.imagePath = imagePath; - } - - @Generated(hash = 1285554626) - public LabelBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getObjectType() { - return this.objectType; - } - - public void setObjectType(String objectType) { - this.objectType = objectType; - } - - public String getPipelineType() { - return this.pipelineType; - } - - public void setPipelineType(String pipelineType) { - this.pipelineType = pipelineType; - } - - public String getPipelineMaterial() { - return this.pipelineMaterial; - } - - public void setPipelineMaterial(String pipelineMaterial) { - this.pipelineMaterial = pipelineMaterial; - } - - public String getPipelineDiameter() { - return this.pipelineDiameter; - } - - public void setPipelineDiameter(String pipelineDiameter) { - this.pipelineDiameter = pipelineDiameter; - } - - public String getBuryDeep() { - return this.buryDeep; - } - - public void setBuryDeep(String buryDeep) { - this.buryDeep = buryDeep; - } - - public String getLowerType() { - return this.lowerType; - } - - public void setLowerType(String lowerType) { - this.lowerType = lowerType; - } - - public String getLowerMaterial() { - return this.lowerMaterial; - } - - public void setLowerMaterial(String lowerMaterial) { - this.lowerMaterial = lowerMaterial; - } - - public String getLowerDiameter() { - return this.lowerDiameter; - } - - public void setLowerDiameter(String lowerDiameter) { - this.lowerDiameter = lowerDiameter; - } - - public String getLowerDeep() { - return this.lowerDeep; - } - - public void setLowerDeep(String lowerDeep) { - this.lowerDeep = lowerDeep; - } - - public String getBuryMethod() { - return this.buryMethod; - } - - public void setBuryMethod(String buryMethod) { - this.buryMethod = buryMethod; - } - - public String getArea() { - return this.area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getLine() { - return this.line; - } - - public void setLine(String line) { - this.line = line; - } - - public String getRoad() { - return this.road; - } - - public void setRoad(String road) { - this.road = road; - } - - public String getConstructTime() { - return this.constructTime; - } - - public void setConstructTime(String constructTime) { - this.constructTime = constructTime; - } - - public String getOwner() { - return this.owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getObjectId() { - return this.objectId; - } - - public void setObjectId(String objectId) { - this.objectId = objectId; - } - - public String getIdentifierId() { - return this.identifierId; - } - - public void setIdentifierId(String identifierId) { - this.identifierId = identifierId; - } - - public String getIdentifierType() { - return this.identifierType; - } - - public void setIdentifierType(String identifierType) { - this.identifierType = identifierType; - } - - public String getIdentifierDeep() { - return this.identifierDeep; - } - - public void setIdentifierDeep(String identifierDeep) { - this.identifierDeep = identifierDeep; - } - - public String getPerson() { - return this.person; - } - - public void setPerson(String person) { - this.person = person; - } - - public String getInstallTime() { - return this.installTime; - } - - public void setInstallTime(String installTime) { - this.installTime = installTime; - } - - public String getLng() { - return this.lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getLat() { - return this.lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getColor() { - return this.color; - } - - public void setColor(String color) { - this.color = color; - } - - public String getRemark() { - return this.remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getImagePath() { - return this.imagePath; - } - - public void setImagePath(String imagePath) { - this.imagePath = imagePath; - } -} diff --git a/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java new file mode 100644 index 0000000..c59cf0b --- /dev/null +++ b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java @@ -0,0 +1,327 @@ +package com.casic.detector.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Id; +import org.greenrobot.greendao.annotation.Generated; + +/** + * 从平台下载的标识器本地库实体类 + */ +@Entity +public class MarkerLocalBean { + @Id(autoincrement = true) + private Long id;//本地库主键ID + + // 管线类型 + private String pipelineType; + // 管线直径 + private String pipelineDiameter; + // 管材 + private String pipelineMaterial; + // 埋设方式 + private String buryMethod; + // 埋深 + private String buryDepth; + // 所属区域 + private String area; + // 所属线路 + private String line; + // 所属道路 + private String road; + // 建设年代 + private String constructTime; + // 权属单位 + private String owner; + //标识对象ID,无实际用途 + @Deprecated + private String objectId; + // 标识器ID + private String markerId; + // 标识器类型 + private String markerType; + // 标识器埋深 + private String markerDepth; + // 安装部门 + private String installationDept; + // 经度 + private String lng; + // 纬度 + private String lat; + //最后修改时间,更新时间 + private String updateTime; + // 备注信息 + private String remark; + // 下层管线类型 + private String underlyingPipelineType; + // 下层埋深 + private String underlyingPipelineDepth; + // 下层管径 + private String underlyingPipelineDiameter; + // 下层管材 + private String underlyingPipelineMaterial; + //标识对象类型 + private String objectType; + // 颜色 + private String color; + // 图片路径 + private String imagePath; + + @Generated(hash = 1479045776) + public MarkerLocalBean(Long id, String pipelineType, String pipelineDiameter, + String pipelineMaterial, String buryMethod, String buryDepth, + String area, String line, String road, String constructTime, + String owner, String objectId, String markerId, String markerType, + String markerDepth, String installationDept, String lng, String lat, + String updateTime, String remark, String underlyingPipelineType, + String underlyingPipelineDepth, String underlyingPipelineDiameter, + String underlyingPipelineMaterial, String objectType, String color, + String imagePath) { + this.id = id; + this.pipelineType = pipelineType; + this.pipelineDiameter = pipelineDiameter; + this.pipelineMaterial = pipelineMaterial; + this.buryMethod = buryMethod; + this.buryDepth = buryDepth; + this.area = area; + this.line = line; + this.road = road; + this.constructTime = constructTime; + this.owner = owner; + this.objectId = objectId; + this.markerId = markerId; + this.markerType = markerType; + this.markerDepth = markerDepth; + this.installationDept = installationDept; + this.lng = lng; + this.lat = lat; + this.updateTime = updateTime; + this.remark = remark; + this.underlyingPipelineType = underlyingPipelineType; + this.underlyingPipelineDepth = underlyingPipelineDepth; + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + this.objectType = objectType; + this.color = color; + this.imagePath = imagePath; + } + + @Generated(hash = 1538606012) + public MarkerLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPipelineType() { + return this.pipelineType; + } + + public void setPipelineType(String pipelineType) { + this.pipelineType = pipelineType; + } + + public String getPipelineDiameter() { + return this.pipelineDiameter; + } + + public void setPipelineDiameter(String pipelineDiameter) { + this.pipelineDiameter = pipelineDiameter; + } + + public String getPipelineMaterial() { + return this.pipelineMaterial; + } + + public void setPipelineMaterial(String pipelineMaterial) { + this.pipelineMaterial = pipelineMaterial; + } + + public String getBuryMethod() { + return this.buryMethod; + } + + public void setBuryMethod(String buryMethod) { + this.buryMethod = buryMethod; + } + + public String getBuryDepth() { + return this.buryDepth; + } + + public void setBuryDepth(String buryDepth) { + this.buryDepth = buryDepth; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getLine() { + return this.line; + } + + public void setLine(String line) { + this.line = line; + } + + public String getRoad() { + return this.road; + } + + public void setRoad(String road) { + this.road = road; + } + + public String getConstructTime() { + return this.constructTime; + } + + public void setConstructTime(String constructTime) { + this.constructTime = constructTime; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getObjectId() { + return this.objectId; + } + + public void setObjectId(String objectId) { + this.objectId = objectId; + } + + public String getMarkerId() { + return this.markerId; + } + + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerType() { + return this.markerType; + } + + public void setMarkerType(String markerType) { + this.markerType = markerType; + } + + public String getMarkerDepth() { + return this.markerDepth; + } + + public void setMarkerDepth(String markerDepth) { + this.markerDepth = markerDepth; + } + + public String getInstallationDept() { + return this.installationDept; + } + + public void setInstallationDept(String installationDept) { + this.installationDept = installationDept; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return this.remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getUnderlyingPipelineType() { + return this.underlyingPipelineType; + } + + public void setUnderlyingPipelineType(String underlyingPipelineType) { + this.underlyingPipelineType = underlyingPipelineType; + } + + public String getUnderlyingPipelineDepth() { + return this.underlyingPipelineDepth; + } + + public void setUnderlyingPipelineDepth(String underlyingPipelineDepth) { + this.underlyingPipelineDepth = underlyingPipelineDepth; + } + + public String getUnderlyingPipelineDiameter() { + return this.underlyingPipelineDiameter; + } + + public void setUnderlyingPipelineDiameter(String underlyingPipelineDiameter) { + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + } + + public String getUnderlyingPipelineMaterial() { + return this.underlyingPipelineMaterial; + } + + public void setUnderlyingPipelineMaterial(String underlyingPipelineMaterial) { + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + } + + public String getObjectType() { + return this.objectType; + } + + public void setObjectType(String objectType) { + this.objectType = objectType; + } + + public String getColor() { + return this.color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getImagePath() { + return this.imagePath; + } + + public void setImagePath(String imagePath) { + this.imagePath = imagePath; + } +} diff --git a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java index ec4425f..45e25e6 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java @@ -24,7 +24,7 @@ * Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - LabelBeanDao.createTable(db, ifNotExists); + MarkerLocalBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); @@ -34,7 +34,7 @@ * Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - LabelBeanDao.dropTable(db, ifExists); + MarkerLocalBeanDao.dropTable(db, ifExists); PipeLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); TaskMarkerLocalBeanDao.dropTable(db, ifExists); @@ -56,7 +56,7 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(LabelBeanDao.class); + registerDaoClass(MarkerLocalBeanDao.class); registerDaoClass(PipeLocalBeanDao.class); registerDaoClass(TaskLocalBeanDao.class); registerDaoClass(TaskMarkerLocalBeanDao.class); diff --git a/app/src/main/java/com/casic/detector/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/greendao/DaoSession.java index 4f9bdff..0d0d59f 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoSession.java @@ -1,6 +1,6 @@ package com.casic.detector.greendao; -import com.casic.detector.bean.LabelBean; +import com.casic.detector.bean.MarkerLocalBean; import com.casic.detector.bean.PipeLocalBean; import com.casic.detector.bean.TaskLocalBean; import com.casic.detector.bean.TaskMarkerLocalBean; @@ -22,12 +22,12 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig labelBeanDaoConfig; + private final DaoConfig markerLocalBeanDaoConfig; private final DaoConfig pipeLocalBeanDaoConfig; private final DaoConfig taskLocalBeanDaoConfig; private final DaoConfig taskMarkerLocalBeanDaoConfig; - private final LabelBeanDao labelBeanDao; + private final MarkerLocalBeanDao markerLocalBeanDao; private final PipeLocalBeanDao pipeLocalBeanDao; private final TaskLocalBeanDao taskLocalBeanDao; private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao; @@ -36,8 +36,8 @@ daoConfigMap) { super(db); - labelBeanDaoConfig = daoConfigMap.get(LabelBeanDao.class).clone(); - labelBeanDaoConfig.initIdentityScope(type); + markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone(); + markerLocalBeanDaoConfig.initIdentityScope(type); pipeLocalBeanDaoConfig = daoConfigMap.get(PipeLocalBeanDao.class).clone(); pipeLocalBeanDaoConfig.initIdentityScope(type); @@ -48,26 +48,26 @@ taskMarkerLocalBeanDaoConfig = daoConfigMap.get(TaskMarkerLocalBeanDao.class).clone(); taskMarkerLocalBeanDaoConfig.initIdentityScope(type); - labelBeanDao = new LabelBeanDao(labelBeanDaoConfig, this); + markerLocalBeanDao = new MarkerLocalBeanDao(markerLocalBeanDaoConfig, this); pipeLocalBeanDao = new PipeLocalBeanDao(pipeLocalBeanDaoConfig, this); taskLocalBeanDao = new TaskLocalBeanDao(taskLocalBeanDaoConfig, this); taskMarkerLocalBeanDao = new TaskMarkerLocalBeanDao(taskMarkerLocalBeanDaoConfig, this); - registerDao(LabelBean.class, labelBeanDao); + registerDao(MarkerLocalBean.class, markerLocalBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); registerDao(TaskLocalBean.class, taskLocalBeanDao); registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao); } public void clear() { - labelBeanDaoConfig.clearIdentityScope(); + markerLocalBeanDaoConfig.clearIdentityScope(); pipeLocalBeanDaoConfig.clearIdentityScope(); taskLocalBeanDaoConfig.clearIdentityScope(); taskMarkerLocalBeanDaoConfig.clearIdentityScope(); } - public LabelBeanDao getLabelBeanDao() { - return labelBeanDao; + public MarkerLocalBeanDao getMarkerLocalBeanDao() { + return markerLocalBeanDao; } public PipeLocalBeanDao getPipeLocalBeanDao() { diff --git a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java b/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java deleted file mode 100644 index 94a73c4..0000000 --- a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java +++ /dev/null @@ -1,484 +0,0 @@ -package com.casic.detector.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import com.casic.detector.bean.LabelBean; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; -import org.greenrobot.greendao.internal.DaoConfig; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** - * DAO for table "LABEL_BEAN". - */ -public class LabelBeanDao extends AbstractDao { - - public static final String TABLENAME = "LABEL_BEAN"; - - /** - * Properties of entity LabelBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ObjectType = new Property(1, String.class, "objectType", false, "OBJECT_TYPE"); - public final static Property PipelineType = new Property(2, String.class, "pipelineType", false, "PIPELINE_TYPE"); - public final static Property PipelineMaterial = new Property(3, String.class, "pipelineMaterial", false, "PIPELINE_MATERIAL"); - public final static Property PipelineDiameter = new Property(4, String.class, "pipelineDiameter", false, "PIPELINE_DIAMETER"); - public final static Property BuryDeep = new Property(5, String.class, "buryDeep", false, "BURY_DEEP"); - public final static Property LowerType = new Property(6, String.class, "lowerType", false, "LOWER_TYPE"); - public final static Property LowerMaterial = new Property(7, String.class, "lowerMaterial", false, "LOWER_MATERIAL"); - public final static Property LowerDiameter = new Property(8, String.class, "lowerDiameter", false, "LOWER_DIAMETER"); - public final static Property LowerDeep = new Property(9, String.class, "lowerDeep", false, "LOWER_DEEP"); - public final static Property BuryMethod = new Property(10, String.class, "buryMethod", false, "BURY_METHOD"); - public final static Property Area = new Property(11, String.class, "area", false, "AREA"); - public final static Property Line = new Property(12, String.class, "line", false, "LINE"); - public final static Property Road = new Property(13, String.class, "road", false, "ROAD"); - public final static Property ConstructTime = new Property(14, String.class, "constructTime", false, "CONSTRUCT_TIME"); - public final static Property Owner = new Property(15, String.class, "owner", false, "OWNER"); - public final static Property ObjectId = new Property(16, String.class, "objectId", false, "OBJECT_ID"); - public final static Property IdentifierId = new Property(17, String.class, "identifierId", false, "IDENTIFIER_ID"); - public final static Property IdentifierType = new Property(18, String.class, "identifierType", false, "IDENTIFIER_TYPE"); - public final static Property IdentifierDeep = new Property(19, String.class, "identifierDeep", false, "IDENTIFIER_DEEP"); - public final static Property Person = new Property(20, String.class, "person", false, "PERSON"); - public final static Property InstallTime = new Property(21, String.class, "installTime", false, "INSTALL_TIME"); - public final static Property Lng = new Property(22, String.class, "lng", false, "LNG"); - public final static Property Lat = new Property(23, String.class, "lat", false, "LAT"); - public final static Property Color = new Property(24, String.class, "color", false, "COLOR"); - public final static Property Remark = new Property(25, String.class, "remark", false, "REMARK"); - public final static Property ImagePath = new Property(26, String.class, "imagePath", false, "IMAGE_PATH"); - } - - - public LabelBeanDao(DaoConfig config) { - super(config); - } - - public LabelBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** - * Creates the underlying database table. - */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; - db.execSQL("CREATE TABLE " + constraint + "\"LABEL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"OBJECT_TYPE\" TEXT," + // 1: objectType - "\"PIPELINE_TYPE\" TEXT," + // 2: pipelineType - "\"PIPELINE_MATERIAL\" TEXT," + // 3: pipelineMaterial - "\"PIPELINE_DIAMETER\" TEXT," + // 4: pipelineDiameter - "\"BURY_DEEP\" TEXT," + // 5: buryDeep - "\"LOWER_TYPE\" TEXT," + // 6: lowerType - "\"LOWER_MATERIAL\" TEXT," + // 7: lowerMaterial - "\"LOWER_DIAMETER\" TEXT," + // 8: lowerDiameter - "\"LOWER_DEEP\" TEXT," + // 9: lowerDeep - "\"BURY_METHOD\" TEXT," + // 10: buryMethod - "\"AREA\" TEXT," + // 11: area - "\"LINE\" TEXT," + // 12: line - "\"ROAD\" TEXT," + // 13: road - "\"CONSTRUCT_TIME\" TEXT," + // 14: constructTime - "\"OWNER\" TEXT," + // 15: owner - "\"OBJECT_ID\" TEXT," + // 16: objectId - "\"IDENTIFIER_ID\" TEXT," + // 17: identifierId - "\"IDENTIFIER_TYPE\" TEXT," + // 18: identifierType - "\"IDENTIFIER_DEEP\" TEXT," + // 19: identifierDeep - "\"PERSON\" TEXT," + // 20: person - "\"INSTALL_TIME\" TEXT," + // 21: installTime - "\"LNG\" TEXT," + // 22: lng - "\"LAT\" TEXT," + // 23: lat - "\"COLOR\" TEXT," + // 24: color - "\"REMARK\" TEXT," + // 25: remark - "\"IMAGE_PATH\" TEXT);"); // 26: imagePath - } - - /** - * Drops the underlying database table. - */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LABEL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, LabelBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String objectType = entity.getObjectType(); - if (objectType != null) { - stmt.bindString(2, objectType); - } - - String pipelineType = entity.getPipelineType(); - if (pipelineType != null) { - stmt.bindString(3, pipelineType); - } - - String pipelineMaterial = entity.getPipelineMaterial(); - if (pipelineMaterial != null) { - stmt.bindString(4, pipelineMaterial); - } - - String pipelineDiameter = entity.getPipelineDiameter(); - if (pipelineDiameter != null) { - stmt.bindString(5, pipelineDiameter); - } - - String buryDeep = entity.getBuryDeep(); - if (buryDeep != null) { - stmt.bindString(6, buryDeep); - } - - String lowerType = entity.getLowerType(); - if (lowerType != null) { - stmt.bindString(7, lowerType); - } - - String lowerMaterial = entity.getLowerMaterial(); - if (lowerMaterial != null) { - stmt.bindString(8, lowerMaterial); - } - - String lowerDiameter = entity.getLowerDiameter(); - if (lowerDiameter != null) { - stmt.bindString(9, lowerDiameter); - } - - String lowerDeep = entity.getLowerDeep(); - if (lowerDeep != null) { - stmt.bindString(10, lowerDeep); - } - - String buryMethod = entity.getBuryMethod(); - if (buryMethod != null) { - stmt.bindString(11, buryMethod); - } - - String area = entity.getArea(); - if (area != null) { - stmt.bindString(12, area); - } - - String line = entity.getLine(); - if (line != null) { - stmt.bindString(13, line); - } - - String road = entity.getRoad(); - if (road != null) { - stmt.bindString(14, road); - } - - String constructTime = entity.getConstructTime(); - if (constructTime != null) { - stmt.bindString(15, constructTime); - } - - String owner = entity.getOwner(); - if (owner != null) { - stmt.bindString(16, owner); - } - - String objectId = entity.getObjectId(); - if (objectId != null) { - stmt.bindString(17, objectId); - } - - String identifierId = entity.getIdentifierId(); - if (identifierId != null) { - stmt.bindString(18, identifierId); - } - - String identifierType = entity.getIdentifierType(); - if (identifierType != null) { - stmt.bindString(19, identifierType); - } - - String identifierDeep = entity.getIdentifierDeep(); - if (identifierDeep != null) { - stmt.bindString(20, identifierDeep); - } - - String person = entity.getPerson(); - if (person != null) { - stmt.bindString(21, person); - } - - String installTime = entity.getInstallTime(); - if (installTime != null) { - stmt.bindString(22, installTime); - } - - String lng = entity.getLng(); - if (lng != null) { - stmt.bindString(23, lng); - } - - String lat = entity.getLat(); - if (lat != null) { - stmt.bindString(24, lat); - } - - String color = entity.getColor(); - if (color != null) { - stmt.bindString(25, color); - } - - String remark = entity.getRemark(); - if (remark != null) { - stmt.bindString(26, remark); - } - - String imagePath = entity.getImagePath(); - if (imagePath != null) { - stmt.bindString(27, imagePath); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, LabelBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String objectType = entity.getObjectType(); - if (objectType != null) { - stmt.bindString(2, objectType); - } - - String pipelineType = entity.getPipelineType(); - if (pipelineType != null) { - stmt.bindString(3, pipelineType); - } - - String pipelineMaterial = entity.getPipelineMaterial(); - if (pipelineMaterial != null) { - stmt.bindString(4, pipelineMaterial); - } - - String pipelineDiameter = entity.getPipelineDiameter(); - if (pipelineDiameter != null) { - stmt.bindString(5, pipelineDiameter); - } - - String buryDeep = entity.getBuryDeep(); - if (buryDeep != null) { - stmt.bindString(6, buryDeep); - } - - String lowerType = entity.getLowerType(); - if (lowerType != null) { - stmt.bindString(7, lowerType); - } - - String lowerMaterial = entity.getLowerMaterial(); - if (lowerMaterial != null) { - stmt.bindString(8, lowerMaterial); - } - - String lowerDiameter = entity.getLowerDiameter(); - if (lowerDiameter != null) { - stmt.bindString(9, lowerDiameter); - } - - String lowerDeep = entity.getLowerDeep(); - if (lowerDeep != null) { - stmt.bindString(10, lowerDeep); - } - - String buryMethod = entity.getBuryMethod(); - if (buryMethod != null) { - stmt.bindString(11, buryMethod); - } - - String area = entity.getArea(); - if (area != null) { - stmt.bindString(12, area); - } - - String line = entity.getLine(); - if (line != null) { - stmt.bindString(13, line); - } - - String road = entity.getRoad(); - if (road != null) { - stmt.bindString(14, road); - } - - String constructTime = entity.getConstructTime(); - if (constructTime != null) { - stmt.bindString(15, constructTime); - } - - String owner = entity.getOwner(); - if (owner != null) { - stmt.bindString(16, owner); - } - - String objectId = entity.getObjectId(); - if (objectId != null) { - stmt.bindString(17, objectId); - } - - String identifierId = entity.getIdentifierId(); - if (identifierId != null) { - stmt.bindString(18, identifierId); - } - - String identifierType = entity.getIdentifierType(); - if (identifierType != null) { - stmt.bindString(19, identifierType); - } - - String identifierDeep = entity.getIdentifierDeep(); - if (identifierDeep != null) { - stmt.bindString(20, identifierDeep); - } - - String person = entity.getPerson(); - if (person != null) { - stmt.bindString(21, person); - } - - String installTime = entity.getInstallTime(); - if (installTime != null) { - stmt.bindString(22, installTime); - } - - String lng = entity.getLng(); - if (lng != null) { - stmt.bindString(23, lng); - } - - String lat = entity.getLat(); - if (lat != null) { - stmt.bindString(24, lat); - } - - String color = entity.getColor(); - if (color != null) { - stmt.bindString(25, color); - } - - String remark = entity.getRemark(); - if (remark != null) { - stmt.bindString(26, remark); - } - - String imagePath = entity.getImagePath(); - if (imagePath != null) { - stmt.bindString(27, imagePath); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public LabelBean readEntity(Cursor cursor, int offset) { - LabelBean entity = new LabelBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // objectType - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineType - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // pipelineDiameter - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDeep - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lowerType - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lowerMaterial - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lowerDiameter - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // lowerDeep - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // buryMethod - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // area - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // line - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // road - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // constructTime - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // owner - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // objectId - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // identifierId - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // identifierType - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // identifierDeep - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // person - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // installTime - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // lng - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // lat - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // color - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // remark - cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, LabelBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setObjectType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setPipelineType(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setPipelineMaterial(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setPipelineDiameter(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setBuryDeep(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setLowerType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLowerMaterial(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLowerDiameter(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLowerDeep(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); - entity.setBuryMethod(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - entity.setArea(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - entity.setLine(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); - entity.setRoad(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); - entity.setConstructTime(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); - entity.setOwner(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); - entity.setObjectId(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); - entity.setIdentifierId(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); - entity.setIdentifierType(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18)); - entity.setIdentifierDeep(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19)); - entity.setPerson(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); - entity.setInstallTime(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); - entity.setLng(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22)); - entity.setLat(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); - entity.setColor(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); - entity.setRemark(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); - } - - @Override - protected final Long updateKeyAfterInsert(LabelBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(LabelBean entity) { - if (entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(LabelBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java new file mode 100644 index 0000000..18849f3 --- /dev/null +++ b/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java @@ -0,0 +1,484 @@ +package com.casic.detector.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import com.casic.detector.bean.MarkerLocalBean; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; +import org.greenrobot.greendao.internal.DaoConfig; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. + +/** + * DAO for table "MARKER_LOCAL_BEAN". + */ +public class MarkerLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "MARKER_LOCAL_BEAN"; + + /** + * Properties of entity MarkerLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property PipelineType = new Property(1, String.class, "pipelineType", false, "PIPELINE_TYPE"); + public final static Property PipelineDiameter = new Property(2, String.class, "pipelineDiameter", false, "PIPELINE_DIAMETER"); + public final static Property PipelineMaterial = new Property(3, String.class, "pipelineMaterial", false, "PIPELINE_MATERIAL"); + public final static Property BuryMethod = new Property(4, String.class, "buryMethod", false, "BURY_METHOD"); + public final static Property BuryDepth = new Property(5, String.class, "buryDepth", false, "BURY_DEPTH"); + public final static Property Area = new Property(6, String.class, "area", false, "AREA"); + public final static Property Line = new Property(7, String.class, "line", false, "LINE"); + public final static Property Road = new Property(8, String.class, "road", false, "ROAD"); + public final static Property ConstructTime = new Property(9, String.class, "constructTime", false, "CONSTRUCT_TIME"); + public final static Property Owner = new Property(10, String.class, "owner", false, "OWNER"); + public final static Property ObjectId = new Property(11, String.class, "objectId", false, "OBJECT_ID"); + public final static Property MarkerId = new Property(12, String.class, "markerId", false, "MARKER_ID"); + public final static Property MarkerType = new Property(13, String.class, "markerType", false, "MARKER_TYPE"); + public final static Property MarkerDepth = new Property(14, String.class, "markerDepth", false, "MARKER_DEPTH"); + public final static Property InstallationDept = new Property(15, String.class, "installationDept", false, "INSTALLATION_DEPT"); + public final static Property Lng = new Property(16, String.class, "lng", false, "LNG"); + public final static Property Lat = new Property(17, String.class, "lat", false, "LAT"); + public final static Property UpdateTime = new Property(18, String.class, "updateTime", false, "UPDATE_TIME"); + public final static Property Remark = new Property(19, String.class, "remark", false, "REMARK"); + public final static Property UnderlyingPipelineType = new Property(20, String.class, "underlyingPipelineType", false, "UNDERLYING_PIPELINE_TYPE"); + public final static Property UnderlyingPipelineDepth = new Property(21, String.class, "underlyingPipelineDepth", false, "UNDERLYING_PIPELINE_DEPTH"); + public final static Property UnderlyingPipelineDiameter = new Property(22, String.class, "underlyingPipelineDiameter", false, "UNDERLYING_PIPELINE_DIAMETER"); + public final static Property UnderlyingPipelineMaterial = new Property(23, String.class, "underlyingPipelineMaterial", false, "UNDERLYING_PIPELINE_MATERIAL"); + public final static Property ObjectType = new Property(24, String.class, "objectType", false, "OBJECT_TYPE"); + public final static Property Color = new Property(25, String.class, "color", false, "COLOR"); + public final static Property ImagePath = new Property(26, String.class, "imagePath", false, "IMAGE_PATH"); + } + + + public MarkerLocalBeanDao(DaoConfig config) { + super(config); + } + + public MarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** + * Creates the underlying database table. + */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + db.execSQL("CREATE TABLE " + constraint + "\"MARKER_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"PIPELINE_TYPE\" TEXT," + // 1: pipelineType + "\"PIPELINE_DIAMETER\" TEXT," + // 2: pipelineDiameter + "\"PIPELINE_MATERIAL\" TEXT," + // 3: pipelineMaterial + "\"BURY_METHOD\" TEXT," + // 4: buryMethod + "\"BURY_DEPTH\" TEXT," + // 5: buryDepth + "\"AREA\" TEXT," + // 6: area + "\"LINE\" TEXT," + // 7: line + "\"ROAD\" TEXT," + // 8: road + "\"CONSTRUCT_TIME\" TEXT," + // 9: constructTime + "\"OWNER\" TEXT," + // 10: owner + "\"OBJECT_ID\" TEXT," + // 11: objectId + "\"MARKER_ID\" TEXT," + // 12: markerId + "\"MARKER_TYPE\" TEXT," + // 13: markerType + "\"MARKER_DEPTH\" TEXT," + // 14: markerDepth + "\"INSTALLATION_DEPT\" TEXT," + // 15: installationDept + "\"LNG\" TEXT," + // 16: lng + "\"LAT\" TEXT," + // 17: lat + "\"UPDATE_TIME\" TEXT," + // 18: updateTime + "\"REMARK\" TEXT," + // 19: remark + "\"UNDERLYING_PIPELINE_TYPE\" TEXT," + // 20: underlyingPipelineType + "\"UNDERLYING_PIPELINE_DEPTH\" TEXT," + // 21: underlyingPipelineDepth + "\"UNDERLYING_PIPELINE_DIAMETER\" TEXT," + // 22: underlyingPipelineDiameter + "\"UNDERLYING_PIPELINE_MATERIAL\" TEXT," + // 23: underlyingPipelineMaterial + "\"OBJECT_TYPE\" TEXT," + // 24: objectType + "\"COLOR\" TEXT," + // 25: color + "\"IMAGE_PATH\" TEXT);"); // 26: imagePath + } + + /** + * Drops the underlying database table. + */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MARKER_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MarkerLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String pipelineType = entity.getPipelineType(); + if (pipelineType != null) { + stmt.bindString(2, pipelineType); + } + + String pipelineDiameter = entity.getPipelineDiameter(); + if (pipelineDiameter != null) { + stmt.bindString(3, pipelineDiameter); + } + + String pipelineMaterial = entity.getPipelineMaterial(); + if (pipelineMaterial != null) { + stmt.bindString(4, pipelineMaterial); + } + + String buryMethod = entity.getBuryMethod(); + if (buryMethod != null) { + stmt.bindString(5, buryMethod); + } + + String buryDepth = entity.getBuryDepth(); + if (buryDepth != null) { + stmt.bindString(6, buryDepth); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(7, area); + } + + String line = entity.getLine(); + if (line != null) { + stmt.bindString(8, line); + } + + String road = entity.getRoad(); + if (road != null) { + stmt.bindString(9, road); + } + + String constructTime = entity.getConstructTime(); + if (constructTime != null) { + stmt.bindString(10, constructTime); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(11, owner); + } + + String objectId = entity.getObjectId(); + if (objectId != null) { + stmt.bindString(12, objectId); + } + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(13, markerId); + } + + String markerType = entity.getMarkerType(); + if (markerType != null) { + stmt.bindString(14, markerType); + } + + String markerDepth = entity.getMarkerDepth(); + if (markerDepth != null) { + stmt.bindString(15, markerDepth); + } + + String installationDept = entity.getInstallationDept(); + if (installationDept != null) { + stmt.bindString(16, installationDept); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(17, lng); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(18, lat); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(19, updateTime); + } + + String remark = entity.getRemark(); + if (remark != null) { + stmt.bindString(20, remark); + } + + String underlyingPipelineType = entity.getUnderlyingPipelineType(); + if (underlyingPipelineType != null) { + stmt.bindString(21, underlyingPipelineType); + } + + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); + if (underlyingPipelineDepth != null) { + stmt.bindString(22, underlyingPipelineDepth); + } + + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); + if (underlyingPipelineDiameter != null) { + stmt.bindString(23, underlyingPipelineDiameter); + } + + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); + if (underlyingPipelineMaterial != null) { + stmt.bindString(24, underlyingPipelineMaterial); + } + + String objectType = entity.getObjectType(); + if (objectType != null) { + stmt.bindString(25, objectType); + } + + String color = entity.getColor(); + if (color != null) { + stmt.bindString(26, color); + } + + String imagePath = entity.getImagePath(); + if (imagePath != null) { + stmt.bindString(27, imagePath); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MarkerLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String pipelineType = entity.getPipelineType(); + if (pipelineType != null) { + stmt.bindString(2, pipelineType); + } + + String pipelineDiameter = entity.getPipelineDiameter(); + if (pipelineDiameter != null) { + stmt.bindString(3, pipelineDiameter); + } + + String pipelineMaterial = entity.getPipelineMaterial(); + if (pipelineMaterial != null) { + stmt.bindString(4, pipelineMaterial); + } + + String buryMethod = entity.getBuryMethod(); + if (buryMethod != null) { + stmt.bindString(5, buryMethod); + } + + String buryDepth = entity.getBuryDepth(); + if (buryDepth != null) { + stmt.bindString(6, buryDepth); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(7, area); + } + + String line = entity.getLine(); + if (line != null) { + stmt.bindString(8, line); + } + + String road = entity.getRoad(); + if (road != null) { + stmt.bindString(9, road); + } + + String constructTime = entity.getConstructTime(); + if (constructTime != null) { + stmt.bindString(10, constructTime); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(11, owner); + } + + String objectId = entity.getObjectId(); + if (objectId != null) { + stmt.bindString(12, objectId); + } + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(13, markerId); + } + + String markerType = entity.getMarkerType(); + if (markerType != null) { + stmt.bindString(14, markerType); + } + + String markerDepth = entity.getMarkerDepth(); + if (markerDepth != null) { + stmt.bindString(15, markerDepth); + } + + String installationDept = entity.getInstallationDept(); + if (installationDept != null) { + stmt.bindString(16, installationDept); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(17, lng); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(18, lat); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(19, updateTime); + } + + String remark = entity.getRemark(); + if (remark != null) { + stmt.bindString(20, remark); + } + + String underlyingPipelineType = entity.getUnderlyingPipelineType(); + if (underlyingPipelineType != null) { + stmt.bindString(21, underlyingPipelineType); + } + + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); + if (underlyingPipelineDepth != null) { + stmt.bindString(22, underlyingPipelineDepth); + } + + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); + if (underlyingPipelineDiameter != null) { + stmt.bindString(23, underlyingPipelineDiameter); + } + + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); + if (underlyingPipelineMaterial != null) { + stmt.bindString(24, underlyingPipelineMaterial); + } + + String objectType = entity.getObjectType(); + if (objectType != null) { + stmt.bindString(25, objectType); + } + + String color = entity.getColor(); + if (color != null) { + stmt.bindString(26, color); + } + + String imagePath = entity.getImagePath(); + if (imagePath != null) { + stmt.bindString(27, imagePath); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MarkerLocalBean readEntity(Cursor cursor, int offset) { + MarkerLocalBean entity = new MarkerLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color + cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MarkerLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setPipelineType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setPipelineDiameter(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setPipelineMaterial(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setBuryMethod(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setBuryDepth(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setArea(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLine(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setRoad(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setConstructTime(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setOwner(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setObjectId(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setMarkerId(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setMarkerType(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setMarkerDepth(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setInstallationDept(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setLng(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setLat(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + entity.setUpdateTime(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18)); + entity.setRemark(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19)); + entity.setUnderlyingPipelineType(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); + entity.setUnderlyingPipelineDepth(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); + entity.setUnderlyingPipelineDiameter(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22)); + entity.setUnderlyingPipelineMaterial(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); + entity.setObjectType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); + entity.setColor(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); + entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); + } + + @Override + protected final Long updateKeyAfterInsert(MarkerLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MarkerLocalBean entity) { + if (entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MarkerLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/detector/utils/ExcelHub.kt b/app/src/main/java/com/casic/detector/utils/ExcelHub.kt index a3c1355..5e12e0b 100644 --- a/app/src/main/java/com/casic/detector/utils/ExcelHub.kt +++ b/app/src/main/java/com/casic/detector/utils/ExcelHub.kt @@ -1,59 +1,51 @@ package com.casic.detector.utils -import android.content.Context -import com.casic.detector.bean.LabelBean -import com.pengxh.kt.lite.extensions.show +import com.casic.detector.bean.MarkerLocalBean import jxl.Workbook import jxl.read.biff.BiffException import java.io.File object ExcelHub { - fun read(context: Context, filePath: String?): ArrayList { - val result = ArrayList() - - if (filePath.isNullOrBlank()) { - return result - } - + fun read(filePath: String): ArrayList { + val result = ArrayList() try { val workbook = Workbook.getWorkbook(File(filePath)) val sheet = workbook.getSheet(0) for (i in 1 until sheet.rows) { - val labelBean = LabelBean() - labelBean.pipelineType = sheet.getCell(0, i).contents - labelBean.pipelineDiameter = sheet.getCell(1, i).contents - labelBean.pipelineMaterial = sheet.getCell(2, i).contents - labelBean.buryMethod = sheet.getCell(3, i).contents - labelBean.buryDeep = sheet.getCell(4, i).contents - labelBean.area = sheet.getCell(5, i).contents - labelBean.line = sheet.getCell(6, i).contents - labelBean.road = sheet.getCell(7, i).contents - labelBean.constructTime = sheet.getCell(8, i).contents - labelBean.owner = sheet.getCell(9, i).contents - labelBean.objectId = sheet.getCell(10, i).contents - labelBean.identifierId = sheet.getCell(11, i).contents - labelBean.identifierType = sheet.getCell(12, i).contents - labelBean.identifierDeep = sheet.getCell(13, i).contents - labelBean.person = sheet.getCell(14, i).contents - labelBean.lng = sheet.getCell(15, i).contents - labelBean.lat = sheet.getCell(16, i).contents - labelBean.installTime = sheet.getCell(17, i).contents - labelBean.remark = sheet.getCell(18, i).contents - labelBean.lowerType = sheet.getCell(19, i).contents - labelBean.lowerDeep = sheet.getCell(20, i).contents - labelBean.lowerDiameter = sheet.getCell(21, i).contents - labelBean.lowerMaterial = sheet.getCell(22, i).contents - labelBean.objectType = sheet.getCell(23, i).contents - labelBean.color = sheet.getCell(24, i).contents - labelBean.imagePath = sheet.getCell(25, i).contents + val marker = MarkerLocalBean() + marker.pipelineType = sheet.getCell(0, i).contents + marker.pipelineDiameter = sheet.getCell(1, i).contents + marker.pipelineMaterial = sheet.getCell(2, i).contents + marker.buryMethod = sheet.getCell(3, i).contents + marker.buryDepth = sheet.getCell(4, i).contents + marker.area = sheet.getCell(5, i).contents + marker.line = sheet.getCell(6, i).contents + marker.road = sheet.getCell(7, i).contents + marker.constructTime = sheet.getCell(8, i).contents + marker.owner = sheet.getCell(9, i).contents + marker.objectId = sheet.getCell(10, i).contents + marker.markerId = sheet.getCell(11, i).contents + marker.markerType = sheet.getCell(12, i).contents + marker.markerDepth = sheet.getCell(13, i).contents + marker.installationDept = sheet.getCell(14, i).contents + marker.lng = sheet.getCell(15, i).contents + marker.lat = sheet.getCell(16, i).contents + marker.updateTime = sheet.getCell(17, i).contents + marker.remark = sheet.getCell(18, i).contents + marker.underlyingPipelineType = sheet.getCell(19, i).contents + marker.underlyingPipelineDepth = sheet.getCell(20, i).contents + marker.underlyingPipelineDiameter = sheet.getCell(21, i).contents + marker.underlyingPipelineMaterial = sheet.getCell(22, i).contents + marker.objectType = sheet.getCell(23, i).contents + marker.color = sheet.getCell(24, i).contents + marker.imagePath = sheet.getCell(25, i).contents - result.add(labelBean) + result.add(marker) } workbook.close() } catch (e: BiffException) { e.printStackTrace() - e.localizedMessage?.show(context) } return result } diff --git a/app/src/main/java/com/casic/detector/view/LoginActivity.kt b/app/src/main/java/com/casic/detector/view/LoginActivity.kt index 3eea0c5..73849b9 100644 --- a/app/src/main/java/com/casic/detector/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/detector/view/LoginActivity.kt @@ -2,26 +2,18 @@ import android.os.Bundle import androidx.lifecycle.ViewModelProvider -import androidx.lifecycle.lifecycleScope -import com.amap.api.maps.CoordinateConverter import com.amap.api.navi.NaviSetting import com.casic.detector.databinding.ActivityLoginBinding -import com.casic.detector.model.PipelineModel -import com.casic.detector.utils.DataBaseManager import com.casic.detector.utils.LocaleConstant import com.casic.detector.vm.UserViewModel import com.google.gson.Gson -import com.google.gson.reflect.TypeToken import com.gyf.immersionbar.ImmersionBar import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.extensions.navigatePageTo -import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.utils.LoadState import com.pengxh.kt.lite.utils.LoadingDialogHub import com.pengxh.kt.lite.utils.SaveKeyValues import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch class LoginActivity : KotlinBaseActivity() { @@ -51,31 +43,31 @@ } } - lifecycleScope.launch(Dispatchers.IO) { - //获取管线数据。本地文件 - val pipeline = readAssetsFile("pipeline.json") - val lineResult = gson.fromJson( - pipeline, object : TypeToken() {}.type - ) - //缓存Pipe到本地 - lineResult.data.forEach { dot -> - val startLat = dot.startLatitudeGd - val startLng = dot.startLongitudeGd - val endLat = dot.endLatitudeGd - val endLng = dot.endLongitudeGd - if (!startLat.isNullOrBlank() && !startLng.isNullOrBlank() && !endLat.isNullOrBlank() && !endLng.isNullOrBlank()) { - if (CoordinateConverter.isAMapDataAvailable( - startLat.toDouble(), startLng.toDouble() - ) && - CoordinateConverter.isAMapDataAvailable( - endLat.toDouble(), endLng.toDouble() - ) - ) { - DataBaseManager.get.insertMapPipeCache(dot) - } - } - } - } +// lifecycleScope.launch(Dispatchers.IO) { +// //获取管线数据。本地文件 +// val pipeline = readAssetsFile("pipeline.json") +// val lineResult = gson.fromJson( +// pipeline, object : TypeToken() {}.type +// ) +// //缓存Pipe到本地 +// lineResult.data.forEach { dot -> +// val startLat = dot.startLatitudeGd +// val startLng = dot.startLongitudeGd +// val endLat = dot.endLatitudeGd +// val endLng = dot.endLongitudeGd +// if (!startLat.isNullOrBlank() && !startLng.isNullOrBlank() && !endLat.isNullOrBlank() && !endLng.isNullOrBlank()) { +// if (CoordinateConverter.isAMapDataAvailable( +// startLat.toDouble(), startLng.toDouble() +// ) && +// CoordinateConverter.isAMapDataAvailable( +// endLat.toDouble(), endLng.toDouble() +// ) +// ) { +// DataBaseManager.get.insertMapPipeCache(dot) +// } +// } +// } +// } } override fun initEvent() { diff --git a/app/src/main/java/com/casic/detector/view/MainActivity.kt b/app/src/main/java/com/casic/detector/view/MainActivity.kt index 22de557..6980416 100644 --- a/app/src/main/java/com/casic/detector/view/MainActivity.kt +++ b/app/src/main/java/com/casic/detector/view/MainActivity.kt @@ -38,7 +38,7 @@ import com.casic.detector.R import com.casic.detector.adapter.EditableImageAdapter import com.casic.detector.base.SerialPortActivity -import com.casic.detector.bean.LabelBean +import com.casic.detector.bean.MarkerLocalBean import com.casic.detector.bean.TaskMarkerLocalBean import com.casic.detector.callback.OnGetLocationListener import com.casic.detector.callback.OnImageCompressListener @@ -77,7 +77,6 @@ import com.casic.detector.widgets.RadarScanView import com.casic.detector.widgets.SamplePopupWindow import com.google.gson.Gson -import com.google.gson.reflect.TypeToken import com.luck.picture.lib.basic.PictureSelector import com.luck.picture.lib.config.SelectMimeType import com.luck.picture.lib.entity.LocalMedia @@ -132,7 +131,7 @@ private val rotationMatrix = FloatArray(9)//旋转矩阵缓存 private val valueArray = FloatArray(3)//方位角数值 private var clickTime: Long = 0 - private var labelBeans = ArrayList() + private var markers = ArrayList() private var clusterOverlay: ClusterOverlay? = null private var latitude: Double = 0.0 private var longitude: Double = 0.0 @@ -191,7 +190,7 @@ taskViewModel.markerFileResult.observe(this) { if (it.isSuccess) { //清空之前的数据 - DataBaseManager.get.clearTaskLabels() + DataBaseManager.get.clearMarkers() //下载最新的数据 val companyId = SaveKeyValues.getValue(LocaleConstant.USER_COMPANY_ID, "") val downloadUrl = companyId.toString().appendDownloadUrl(FileType.EXCEL) @@ -201,10 +200,10 @@ .setOnFileDownloadListener(object : FileDownloadManager.OnFileDownloadListener { override fun onDownloadEnd(file: File) { lifecycleScope.launch(Dispatchers.Main) { - labelBeans = ExcelHub.read(context, file.absolutePath) withContext(Dispatchers.IO) { - labelBeans.forEach { label -> - DataBaseManager.get.insertTaskLabel(label) + markers = ExcelHub.read(file.absolutePath) + markers.forEach { marker -> + DataBaseManager.get.saveMarkerInLocale(marker) } } LoadingDialogHub.dismiss() @@ -311,8 +310,9 @@ } else { lifecycleScope.launch(Dispatchers.Main) { val labels = withContext(Dispatchers.IO) { - DataBaseManager.get.queryLabelById("0") + DataBaseManager.get.queryMarkerByState("0") } + //如果有需要补全的标识器,Popup右侧会有小圆点提示 if (labels.isNotEmpty()) { samplePopupWindow.setShowPosition(4) } @@ -331,7 +331,7 @@ 1 -> downloadTask() 2 -> navigatePageTo() 3 -> uploadEvent() - 4 -> uploadLabel() + 4 -> completionMarker() } } }) @@ -364,20 +364,20 @@ override fun onConfirmClick(selectedItem: String, value: String) { //查询数据库 lifecycleScope.launch(Dispatchers.Main) { - labelBeans = withContext(Dispatchers.IO) { - DataBaseManager.get.loadLabelByCondition( + markers = withContext(Dispatchers.IO) { + DataBaseManager.get.loadMarkersByCondition( selectedItem, value - ) as ArrayList + ) as ArrayList } - if (labelBeans.isEmpty()) { + if (markers.isEmpty()) { "无法查到相关数据信息,请检查您的查询条件".show(context) } else { val latitudeList = ArrayList() val longitudeList = ArrayList() - val latitude = labelBeans.first().lat - val longitude = labelBeans.first().lng + val latitude = markers.first().lat + val longitude = markers.first().lng if (latitude.isNotBlank() && longitude.isNotBlank()) { if (CoordinateConverter.isAMapDataAvailable( latitude.toDouble(), longitude.toDouble() @@ -591,7 +591,7 @@ //添加地图Marker if (!ids.contains(markerId)) { //根据markerId查询标识器经纬度 - val labels = DataBaseManager.get.queryLabelById(markerId) + val labels = DataBaseManager.get.queryMarkerById(markerId) if (labels.isNotEmpty()) { val bean = labels.first() aMap.addMarker( @@ -605,7 +605,7 @@ //显示标识器详细信息 if (!detailDialog.isShowing) { - val labelBean = DataBaseManager.get.queryLabelById(markerId).firstOrNull() + val labelBean = DataBaseManager.get.queryMarkerById(markerId).firstOrNull() if (labelBean == null) { "无法查询到此ID【${markerId}】的信息".show(context) } else { @@ -715,8 +715,8 @@ aMap.setOnMapLongClickListener { //协程异步显示默认数据 lifecycleScope.launch(Dispatchers.Main) { - labelBeans = withContext(Dispatchers.IO) { - DataBaseManager.get.loadTaskLabels() as ArrayList + markers = withContext(Dispatchers.IO) { + DataBaseManager.get.loadMarkers() as ArrayList } showLabelsOnMap() } @@ -760,7 +760,7 @@ clusterOverlay?.onDestroy() val clusterItems = ArrayList() - labelBeans.forEach { + markers.forEach { if (it.lat.isNotEmpty() && it.lng.isNotEmpty()) { val latitude = it.lat.toDouble() val longitude = it.lng.toDouble() @@ -848,7 +848,7 @@ } override fun onCancelClick() { - labelBeans.forEach { + markers.forEach { if (it.id.toString() == item.title) { navigatePageTo(it.toJson()) } @@ -973,48 +973,45 @@ } //标识器补全 - private fun uploadLabel() { + private fun completionMarker() { val companyId = SaveKeyValues.getValue(LocaleConstant.USER_COMPANY_ID, "") as String - val labelBeans = DataBaseManager.get.queryLabelById("0") - if (labelBeans.isNotEmpty()) { - LoadingDialogHub.show(this, "标识器补全中,请稍后...") - labelBeans.forEach { labelBean -> - val imagePaths = gson.fromJson>( - labelBean.imagePath, object : TypeToken>() {}.type - ) - - taskViewModel.installLabel( - this, - companyId, - labelBean.objectType, - labelBean.pipelineType, - labelBean.pipelineMaterial, - labelBean.pipelineDiameter, - labelBean.buryDeep, - labelBean.lowerType, - labelBean.lowerMaterial, - labelBean.lowerDiameter, - labelBean.lowerDeep, - labelBean.buryMethod, - labelBean.area, - labelBean.line, - labelBean.road, - labelBean.constructTime, - labelBean.owner, - labelBean.objectId, - labelBean.identifierId, - labelBean.identifierType, - labelBean.identifierDeep, - labelBean.person, - labelBean.installTime, - labelBean.lng, - labelBean.lat, - labelBean.color, - labelBean.remark, - imagePaths - ) - } - LoadingDialogHub.dismiss() + val markers = DataBaseManager.get.queryMarkerByState("0") + if (markers.isNotEmpty()) { + //TODO 逻辑没梳理明白 +// LoadingDialogHub.show(this, "标识器补全中,请稍后...") +// markers.forEach { marker -> +// taskViewModel.installLabel( +// this, +// companyId, +// labelBean.objectType, +// labelBean.pipelineType, +// labelBean.pipelineMaterial, +// labelBean.pipelineDiameter, +// labelBean.buryDeep, +// labelBean.lowerType, +// labelBean.lowerMaterial, +// labelBean.lowerDiameter, +// labelBean.lowerDeep, +// labelBean.buryMethod, +// labelBean.area, +// labelBean.line, +// labelBean.road, +// labelBean.constructTime, +// labelBean.owner, +// labelBean.objectId, +// labelBean.identifierId, +// labelBean.identifierType, +// labelBean.identifierDeep, +// labelBean.person, +// labelBean.installTime, +// labelBean.lng, +// labelBean.lat, +// labelBean.color, +// labelBean.remark, +// arrayListOf() +// ) +// } +// LoadingDialogHub.dismiss() } else { "没有需要补传的标识器!".show(this) } @@ -1072,8 +1069,8 @@ binding.mapView.onResume() //协程异步显示默认数据 lifecycleScope.launch(Dispatchers.Main) { - labelBeans = withContext(Dispatchers.IO) { - DataBaseManager.get.loadTaskLabels() as ArrayList + markers = withContext(Dispatchers.IO) { + DataBaseManager.get.loadMarkers() as ArrayList } showLabelsOnMap() } @@ -1499,45 +1496,45 @@ private fun saveLabelInLocal() { val objectId = SaveKeyValues.getValue(LocaleConstant.OBJECT_ID, "") as String - val labelBean = LabelBean() - labelBean.objectType = binding.objectInclude.objectTypeSpinner.selectedItem.toString() - labelBean.pipelineType = + val marker = MarkerLocalBean() + marker.objectType = binding.objectInclude.objectTypeSpinner.selectedItem.toString() + marker.pipelineType = binding.objectInclude.pipeInclude.markerObjectTypeView.text.toString() - labelBean.pipelineMaterial = + marker.pipelineMaterial = binding.objectInclude.pipeInclude.materialSpinner.selectedItem.toString() - labelBean.pipelineDiameter = + marker.pipelineDiameter = "${binding.objectInclude.pipeInclude.pipelineDiameterView.text}mm" - labelBean.buryDeep = "${binding.objectInclude.pipeInclude.buryDeepView.text}mm" - labelBean.lowerType = + marker.buryDepth = "${binding.objectInclude.pipeInclude.buryDeepView.text}mm" + marker.underlyingPipelineType = binding.objectInclude.pipeCrossInclude.bottomPipeTypeSpinner.selectedItem.toString() - labelBean.lowerMaterial = + marker.underlyingPipelineMaterial = binding.objectInclude.pipeCrossInclude.bottomPipeMaterialSpinner.selectedItem.toString() - labelBean.lowerDiameter = + marker.underlyingPipelineDiameter = "${binding.objectInclude.pipeCrossInclude.bottomPipeDiameterView.text}mm" - labelBean.lowerDeep = + marker.underlyingPipelineDepth = "${binding.objectInclude.pipeCrossInclude.bottomPointDeepView.text}mm" - labelBean.buryMethod = + marker.buryMethod = binding.objectInclude.pipeInclude.buryTypeSpinner.selectedItem.toString() - labelBean.area = binding.objectInclude.areaView.text.toString() - labelBean.line = binding.objectInclude.lineView.text.toString() - labelBean.road = binding.objectInclude.roadView.text.toString() - labelBean.constructTime = binding.objectInclude.constructDateView.text.toString() - labelBean.owner = binding.objectInclude.ownerView.text.toString() - labelBean.objectId = objectId - labelBean.identifierId = binding.identifierInclude.identifierIdView.text.toString() - labelBean.identifierType = + marker.area = binding.objectInclude.areaView.text.toString() + marker.line = binding.objectInclude.lineView.text.toString() + marker.road = binding.objectInclude.roadView.text.toString() + marker.constructTime = binding.objectInclude.constructDateView.text.toString() + marker.owner = binding.objectInclude.ownerView.text.toString() + marker.objectId = objectId + marker.markerId = binding.identifierInclude.identifierIdView.text.toString() + marker.markerType = binding.identifierInclude.identifierTypeSpinner.selectedItem.toString() - labelBean.identifierDeep = "${binding.identifierInclude.identifierDeepView.text}mm" - labelBean.person = binding.identifierInclude.personDeptView.text.toString() - labelBean.installTime = binding.identifierInclude.installTimeView.text.toString() - labelBean.lng = binding.identifierInclude.lngView.text.toString() - labelBean.lat = binding.identifierInclude.latView.text.toString() - labelBean.color = + marker.markerDepth = "${binding.identifierInclude.identifierDeepView.text}mm" + marker.installationDept = binding.identifierInclude.personDeptView.text.toString() + marker.updateTime = binding.identifierInclude.installTimeView.text.toString() + marker.lng = binding.identifierInclude.lngView.text.toString() + marker.lat = binding.identifierInclude.latView.text.toString() + marker.color = binding.identifierInclude.colorSpinner.selectedItem.toString().toColor() - labelBean.remark = binding.remarkView.text.toString() - labelBean.imagePath = realPaths.toJson() + marker.remark = binding.remarkView.text.toString() + marker.imagePath = realPaths.toJson() - DataBaseManager.get.insertTaskLabel(labelBean) + DataBaseManager.get.saveMarkerInLocale(marker) } private fun takePicture() { @@ -1599,9 +1596,9 @@ searchMarkerTimer.cancel() out.write('3'.code) - val result = DataBaseManager.get.queryLabelById(markerId) + val result = DataBaseManager.get.queryMarkerById(markerId) if (result.isNotEmpty()) { - val tag = when (result.first().identifierType) { + val tag = when (result.first().markerId) { "EM30" -> '7' "EM50" -> '8' "EM14" -> '9' @@ -1635,7 +1632,7 @@ binding.markerInfoButton.setOnClickListener { //查库 - val result = DataBaseManager.get.queryLabelById(markerId) + val result = DataBaseManager.get.queryMarkerById(markerId) if (result.isNotEmpty()) { context.navigatePageTo(result.first().toJson()) } else { @@ -1659,7 +1656,7 @@ private fun renderDataPoint(location: AMapLocation) { lifecycleScope.launch(Dispatchers.IO) { val dataPoints = ArrayList() - DataBaseManager.get.loadTaskLabels().forEach { + DataBaseManager.get.loadMarkers().forEach { //单位:米 val distance = AMapUtils.calculateLineDistance( LatLng(latitude, longitude), LatLng(it.lat.toDouble(), it.lng.toDouble()) diff --git a/app/src/main/java/com/casic/detector/bean/LabelBean.java b/app/src/main/java/com/casic/detector/bean/LabelBean.java deleted file mode 100644 index d22d835..0000000 --- a/app/src/main/java/com/casic/detector/bean/LabelBean.java +++ /dev/null @@ -1,321 +0,0 @@ -package com.casic.detector.bean; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -@Entity -public class LabelBean { - @Id(autoincrement = true) - private Long id;//主键ID - // 标记对象类型 - private String objectType; - // 管线类型 - private String pipelineType; - // 管材 - private String pipelineMaterial; - // 管直 - private String pipelineDiameter; - // 埋深 - private String buryDeep; - // 下层管线类型 - private String lowerType; - // 下层管材 - private String lowerMaterial; - // 下层管径 - private String lowerDiameter; - // 下层埋深 - private String lowerDeep; - // 埋设方式 - private String buryMethod; - // 所属区域 - private String area; - // 所属线路 - private String line; - // 所属道路 - private String road; - // 建设年代 - private String constructTime; - // 权属单位 - private String owner; - // 对象ID - private String objectId; - // 标识器ID号 - private String identifierId; - // 标识器类型 - private String identifierType; - // 标识器埋深 - private String identifierDeep; - // 安装人员 - private String person; - // 安装时间 - private String installTime; - // 经度 - private String lng; - // 纬度 - private String lat; - // 颜色 - private String color; - // 备注信息 - private String remark; - // 图片路径 - private String imagePath; - - @Generated(hash = 1718746860) - public LabelBean(Long id, String objectType, String pipelineType, - String pipelineMaterial, String pipelineDiameter, String buryDeep, - String lowerType, String lowerMaterial, String lowerDiameter, - String lowerDeep, String buryMethod, String area, String line, - String road, String constructTime, String owner, String objectId, - String identifierId, String identifierType, String identifierDeep, - String person, String installTime, String lng, String lat, String color, - String remark, String imagePath) { - this.id = id; - this.objectType = objectType; - this.pipelineType = pipelineType; - this.pipelineMaterial = pipelineMaterial; - this.pipelineDiameter = pipelineDiameter; - this.buryDeep = buryDeep; - this.lowerType = lowerType; - this.lowerMaterial = lowerMaterial; - this.lowerDiameter = lowerDiameter; - this.lowerDeep = lowerDeep; - this.buryMethod = buryMethod; - this.area = area; - this.line = line; - this.road = road; - this.constructTime = constructTime; - this.owner = owner; - this.objectId = objectId; - this.identifierId = identifierId; - this.identifierType = identifierType; - this.identifierDeep = identifierDeep; - this.person = person; - this.installTime = installTime; - this.lng = lng; - this.lat = lat; - this.color = color; - this.remark = remark; - this.imagePath = imagePath; - } - - @Generated(hash = 1285554626) - public LabelBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getObjectType() { - return this.objectType; - } - - public void setObjectType(String objectType) { - this.objectType = objectType; - } - - public String getPipelineType() { - return this.pipelineType; - } - - public void setPipelineType(String pipelineType) { - this.pipelineType = pipelineType; - } - - public String getPipelineMaterial() { - return this.pipelineMaterial; - } - - public void setPipelineMaterial(String pipelineMaterial) { - this.pipelineMaterial = pipelineMaterial; - } - - public String getPipelineDiameter() { - return this.pipelineDiameter; - } - - public void setPipelineDiameter(String pipelineDiameter) { - this.pipelineDiameter = pipelineDiameter; - } - - public String getBuryDeep() { - return this.buryDeep; - } - - public void setBuryDeep(String buryDeep) { - this.buryDeep = buryDeep; - } - - public String getLowerType() { - return this.lowerType; - } - - public void setLowerType(String lowerType) { - this.lowerType = lowerType; - } - - public String getLowerMaterial() { - return this.lowerMaterial; - } - - public void setLowerMaterial(String lowerMaterial) { - this.lowerMaterial = lowerMaterial; - } - - public String getLowerDiameter() { - return this.lowerDiameter; - } - - public void setLowerDiameter(String lowerDiameter) { - this.lowerDiameter = lowerDiameter; - } - - public String getLowerDeep() { - return this.lowerDeep; - } - - public void setLowerDeep(String lowerDeep) { - this.lowerDeep = lowerDeep; - } - - public String getBuryMethod() { - return this.buryMethod; - } - - public void setBuryMethod(String buryMethod) { - this.buryMethod = buryMethod; - } - - public String getArea() { - return this.area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getLine() { - return this.line; - } - - public void setLine(String line) { - this.line = line; - } - - public String getRoad() { - return this.road; - } - - public void setRoad(String road) { - this.road = road; - } - - public String getConstructTime() { - return this.constructTime; - } - - public void setConstructTime(String constructTime) { - this.constructTime = constructTime; - } - - public String getOwner() { - return this.owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getObjectId() { - return this.objectId; - } - - public void setObjectId(String objectId) { - this.objectId = objectId; - } - - public String getIdentifierId() { - return this.identifierId; - } - - public void setIdentifierId(String identifierId) { - this.identifierId = identifierId; - } - - public String getIdentifierType() { - return this.identifierType; - } - - public void setIdentifierType(String identifierType) { - this.identifierType = identifierType; - } - - public String getIdentifierDeep() { - return this.identifierDeep; - } - - public void setIdentifierDeep(String identifierDeep) { - this.identifierDeep = identifierDeep; - } - - public String getPerson() { - return this.person; - } - - public void setPerson(String person) { - this.person = person; - } - - public String getInstallTime() { - return this.installTime; - } - - public void setInstallTime(String installTime) { - this.installTime = installTime; - } - - public String getLng() { - return this.lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getLat() { - return this.lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getColor() { - return this.color; - } - - public void setColor(String color) { - this.color = color; - } - - public String getRemark() { - return this.remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getImagePath() { - return this.imagePath; - } - - public void setImagePath(String imagePath) { - this.imagePath = imagePath; - } -} diff --git a/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java new file mode 100644 index 0000000..c59cf0b --- /dev/null +++ b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java @@ -0,0 +1,327 @@ +package com.casic.detector.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Id; +import org.greenrobot.greendao.annotation.Generated; + +/** + * 从平台下载的标识器本地库实体类 + */ +@Entity +public class MarkerLocalBean { + @Id(autoincrement = true) + private Long id;//本地库主键ID + + // 管线类型 + private String pipelineType; + // 管线直径 + private String pipelineDiameter; + // 管材 + private String pipelineMaterial; + // 埋设方式 + private String buryMethod; + // 埋深 + private String buryDepth; + // 所属区域 + private String area; + // 所属线路 + private String line; + // 所属道路 + private String road; + // 建设年代 + private String constructTime; + // 权属单位 + private String owner; + //标识对象ID,无实际用途 + @Deprecated + private String objectId; + // 标识器ID + private String markerId; + // 标识器类型 + private String markerType; + // 标识器埋深 + private String markerDepth; + // 安装部门 + private String installationDept; + // 经度 + private String lng; + // 纬度 + private String lat; + //最后修改时间,更新时间 + private String updateTime; + // 备注信息 + private String remark; + // 下层管线类型 + private String underlyingPipelineType; + // 下层埋深 + private String underlyingPipelineDepth; + // 下层管径 + private String underlyingPipelineDiameter; + // 下层管材 + private String underlyingPipelineMaterial; + //标识对象类型 + private String objectType; + // 颜色 + private String color; + // 图片路径 + private String imagePath; + + @Generated(hash = 1479045776) + public MarkerLocalBean(Long id, String pipelineType, String pipelineDiameter, + String pipelineMaterial, String buryMethod, String buryDepth, + String area, String line, String road, String constructTime, + String owner, String objectId, String markerId, String markerType, + String markerDepth, String installationDept, String lng, String lat, + String updateTime, String remark, String underlyingPipelineType, + String underlyingPipelineDepth, String underlyingPipelineDiameter, + String underlyingPipelineMaterial, String objectType, String color, + String imagePath) { + this.id = id; + this.pipelineType = pipelineType; + this.pipelineDiameter = pipelineDiameter; + this.pipelineMaterial = pipelineMaterial; + this.buryMethod = buryMethod; + this.buryDepth = buryDepth; + this.area = area; + this.line = line; + this.road = road; + this.constructTime = constructTime; + this.owner = owner; + this.objectId = objectId; + this.markerId = markerId; + this.markerType = markerType; + this.markerDepth = markerDepth; + this.installationDept = installationDept; + this.lng = lng; + this.lat = lat; + this.updateTime = updateTime; + this.remark = remark; + this.underlyingPipelineType = underlyingPipelineType; + this.underlyingPipelineDepth = underlyingPipelineDepth; + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + this.objectType = objectType; + this.color = color; + this.imagePath = imagePath; + } + + @Generated(hash = 1538606012) + public MarkerLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPipelineType() { + return this.pipelineType; + } + + public void setPipelineType(String pipelineType) { + this.pipelineType = pipelineType; + } + + public String getPipelineDiameter() { + return this.pipelineDiameter; + } + + public void setPipelineDiameter(String pipelineDiameter) { + this.pipelineDiameter = pipelineDiameter; + } + + public String getPipelineMaterial() { + return this.pipelineMaterial; + } + + public void setPipelineMaterial(String pipelineMaterial) { + this.pipelineMaterial = pipelineMaterial; + } + + public String getBuryMethod() { + return this.buryMethod; + } + + public void setBuryMethod(String buryMethod) { + this.buryMethod = buryMethod; + } + + public String getBuryDepth() { + return this.buryDepth; + } + + public void setBuryDepth(String buryDepth) { + this.buryDepth = buryDepth; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getLine() { + return this.line; + } + + public void setLine(String line) { + this.line = line; + } + + public String getRoad() { + return this.road; + } + + public void setRoad(String road) { + this.road = road; + } + + public String getConstructTime() { + return this.constructTime; + } + + public void setConstructTime(String constructTime) { + this.constructTime = constructTime; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getObjectId() { + return this.objectId; + } + + public void setObjectId(String objectId) { + this.objectId = objectId; + } + + public String getMarkerId() { + return this.markerId; + } + + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerType() { + return this.markerType; + } + + public void setMarkerType(String markerType) { + this.markerType = markerType; + } + + public String getMarkerDepth() { + return this.markerDepth; + } + + public void setMarkerDepth(String markerDepth) { + this.markerDepth = markerDepth; + } + + public String getInstallationDept() { + return this.installationDept; + } + + public void setInstallationDept(String installationDept) { + this.installationDept = installationDept; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return this.remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getUnderlyingPipelineType() { + return this.underlyingPipelineType; + } + + public void setUnderlyingPipelineType(String underlyingPipelineType) { + this.underlyingPipelineType = underlyingPipelineType; + } + + public String getUnderlyingPipelineDepth() { + return this.underlyingPipelineDepth; + } + + public void setUnderlyingPipelineDepth(String underlyingPipelineDepth) { + this.underlyingPipelineDepth = underlyingPipelineDepth; + } + + public String getUnderlyingPipelineDiameter() { + return this.underlyingPipelineDiameter; + } + + public void setUnderlyingPipelineDiameter(String underlyingPipelineDiameter) { + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + } + + public String getUnderlyingPipelineMaterial() { + return this.underlyingPipelineMaterial; + } + + public void setUnderlyingPipelineMaterial(String underlyingPipelineMaterial) { + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + } + + public String getObjectType() { + return this.objectType; + } + + public void setObjectType(String objectType) { + this.objectType = objectType; + } + + public String getColor() { + return this.color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getImagePath() { + return this.imagePath; + } + + public void setImagePath(String imagePath) { + this.imagePath = imagePath; + } +} diff --git a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java index ec4425f..45e25e6 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java @@ -24,7 +24,7 @@ * Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - LabelBeanDao.createTable(db, ifNotExists); + MarkerLocalBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); @@ -34,7 +34,7 @@ * Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - LabelBeanDao.dropTable(db, ifExists); + MarkerLocalBeanDao.dropTable(db, ifExists); PipeLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); TaskMarkerLocalBeanDao.dropTable(db, ifExists); @@ -56,7 +56,7 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(LabelBeanDao.class); + registerDaoClass(MarkerLocalBeanDao.class); registerDaoClass(PipeLocalBeanDao.class); registerDaoClass(TaskLocalBeanDao.class); registerDaoClass(TaskMarkerLocalBeanDao.class); diff --git a/app/src/main/java/com/casic/detector/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/greendao/DaoSession.java index 4f9bdff..0d0d59f 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoSession.java @@ -1,6 +1,6 @@ package com.casic.detector.greendao; -import com.casic.detector.bean.LabelBean; +import com.casic.detector.bean.MarkerLocalBean; import com.casic.detector.bean.PipeLocalBean; import com.casic.detector.bean.TaskLocalBean; import com.casic.detector.bean.TaskMarkerLocalBean; @@ -22,12 +22,12 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig labelBeanDaoConfig; + private final DaoConfig markerLocalBeanDaoConfig; private final DaoConfig pipeLocalBeanDaoConfig; private final DaoConfig taskLocalBeanDaoConfig; private final DaoConfig taskMarkerLocalBeanDaoConfig; - private final LabelBeanDao labelBeanDao; + private final MarkerLocalBeanDao markerLocalBeanDao; private final PipeLocalBeanDao pipeLocalBeanDao; private final TaskLocalBeanDao taskLocalBeanDao; private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao; @@ -36,8 +36,8 @@ daoConfigMap) { super(db); - labelBeanDaoConfig = daoConfigMap.get(LabelBeanDao.class).clone(); - labelBeanDaoConfig.initIdentityScope(type); + markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone(); + markerLocalBeanDaoConfig.initIdentityScope(type); pipeLocalBeanDaoConfig = daoConfigMap.get(PipeLocalBeanDao.class).clone(); pipeLocalBeanDaoConfig.initIdentityScope(type); @@ -48,26 +48,26 @@ taskMarkerLocalBeanDaoConfig = daoConfigMap.get(TaskMarkerLocalBeanDao.class).clone(); taskMarkerLocalBeanDaoConfig.initIdentityScope(type); - labelBeanDao = new LabelBeanDao(labelBeanDaoConfig, this); + markerLocalBeanDao = new MarkerLocalBeanDao(markerLocalBeanDaoConfig, this); pipeLocalBeanDao = new PipeLocalBeanDao(pipeLocalBeanDaoConfig, this); taskLocalBeanDao = new TaskLocalBeanDao(taskLocalBeanDaoConfig, this); taskMarkerLocalBeanDao = new TaskMarkerLocalBeanDao(taskMarkerLocalBeanDaoConfig, this); - registerDao(LabelBean.class, labelBeanDao); + registerDao(MarkerLocalBean.class, markerLocalBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); registerDao(TaskLocalBean.class, taskLocalBeanDao); registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao); } public void clear() { - labelBeanDaoConfig.clearIdentityScope(); + markerLocalBeanDaoConfig.clearIdentityScope(); pipeLocalBeanDaoConfig.clearIdentityScope(); taskLocalBeanDaoConfig.clearIdentityScope(); taskMarkerLocalBeanDaoConfig.clearIdentityScope(); } - public LabelBeanDao getLabelBeanDao() { - return labelBeanDao; + public MarkerLocalBeanDao getMarkerLocalBeanDao() { + return markerLocalBeanDao; } public PipeLocalBeanDao getPipeLocalBeanDao() { diff --git a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java b/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java deleted file mode 100644 index 94a73c4..0000000 --- a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java +++ /dev/null @@ -1,484 +0,0 @@ -package com.casic.detector.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import com.casic.detector.bean.LabelBean; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; -import org.greenrobot.greendao.internal.DaoConfig; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** - * DAO for table "LABEL_BEAN". - */ -public class LabelBeanDao extends AbstractDao { - - public static final String TABLENAME = "LABEL_BEAN"; - - /** - * Properties of entity LabelBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ObjectType = new Property(1, String.class, "objectType", false, "OBJECT_TYPE"); - public final static Property PipelineType = new Property(2, String.class, "pipelineType", false, "PIPELINE_TYPE"); - public final static Property PipelineMaterial = new Property(3, String.class, "pipelineMaterial", false, "PIPELINE_MATERIAL"); - public final static Property PipelineDiameter = new Property(4, String.class, "pipelineDiameter", false, "PIPELINE_DIAMETER"); - public final static Property BuryDeep = new Property(5, String.class, "buryDeep", false, "BURY_DEEP"); - public final static Property LowerType = new Property(6, String.class, "lowerType", false, "LOWER_TYPE"); - public final static Property LowerMaterial = new Property(7, String.class, "lowerMaterial", false, "LOWER_MATERIAL"); - public final static Property LowerDiameter = new Property(8, String.class, "lowerDiameter", false, "LOWER_DIAMETER"); - public final static Property LowerDeep = new Property(9, String.class, "lowerDeep", false, "LOWER_DEEP"); - public final static Property BuryMethod = new Property(10, String.class, "buryMethod", false, "BURY_METHOD"); - public final static Property Area = new Property(11, String.class, "area", false, "AREA"); - public final static Property Line = new Property(12, String.class, "line", false, "LINE"); - public final static Property Road = new Property(13, String.class, "road", false, "ROAD"); - public final static Property ConstructTime = new Property(14, String.class, "constructTime", false, "CONSTRUCT_TIME"); - public final static Property Owner = new Property(15, String.class, "owner", false, "OWNER"); - public final static Property ObjectId = new Property(16, String.class, "objectId", false, "OBJECT_ID"); - public final static Property IdentifierId = new Property(17, String.class, "identifierId", false, "IDENTIFIER_ID"); - public final static Property IdentifierType = new Property(18, String.class, "identifierType", false, "IDENTIFIER_TYPE"); - public final static Property IdentifierDeep = new Property(19, String.class, "identifierDeep", false, "IDENTIFIER_DEEP"); - public final static Property Person = new Property(20, String.class, "person", false, "PERSON"); - public final static Property InstallTime = new Property(21, String.class, "installTime", false, "INSTALL_TIME"); - public final static Property Lng = new Property(22, String.class, "lng", false, "LNG"); - public final static Property Lat = new Property(23, String.class, "lat", false, "LAT"); - public final static Property Color = new Property(24, String.class, "color", false, "COLOR"); - public final static Property Remark = new Property(25, String.class, "remark", false, "REMARK"); - public final static Property ImagePath = new Property(26, String.class, "imagePath", false, "IMAGE_PATH"); - } - - - public LabelBeanDao(DaoConfig config) { - super(config); - } - - public LabelBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** - * Creates the underlying database table. - */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; - db.execSQL("CREATE TABLE " + constraint + "\"LABEL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"OBJECT_TYPE\" TEXT," + // 1: objectType - "\"PIPELINE_TYPE\" TEXT," + // 2: pipelineType - "\"PIPELINE_MATERIAL\" TEXT," + // 3: pipelineMaterial - "\"PIPELINE_DIAMETER\" TEXT," + // 4: pipelineDiameter - "\"BURY_DEEP\" TEXT," + // 5: buryDeep - "\"LOWER_TYPE\" TEXT," + // 6: lowerType - "\"LOWER_MATERIAL\" TEXT," + // 7: lowerMaterial - "\"LOWER_DIAMETER\" TEXT," + // 8: lowerDiameter - "\"LOWER_DEEP\" TEXT," + // 9: lowerDeep - "\"BURY_METHOD\" TEXT," + // 10: buryMethod - "\"AREA\" TEXT," + // 11: area - "\"LINE\" TEXT," + // 12: line - "\"ROAD\" TEXT," + // 13: road - "\"CONSTRUCT_TIME\" TEXT," + // 14: constructTime - "\"OWNER\" TEXT," + // 15: owner - "\"OBJECT_ID\" TEXT," + // 16: objectId - "\"IDENTIFIER_ID\" TEXT," + // 17: identifierId - "\"IDENTIFIER_TYPE\" TEXT," + // 18: identifierType - "\"IDENTIFIER_DEEP\" TEXT," + // 19: identifierDeep - "\"PERSON\" TEXT," + // 20: person - "\"INSTALL_TIME\" TEXT," + // 21: installTime - "\"LNG\" TEXT," + // 22: lng - "\"LAT\" TEXT," + // 23: lat - "\"COLOR\" TEXT," + // 24: color - "\"REMARK\" TEXT," + // 25: remark - "\"IMAGE_PATH\" TEXT);"); // 26: imagePath - } - - /** - * Drops the underlying database table. - */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LABEL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, LabelBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String objectType = entity.getObjectType(); - if (objectType != null) { - stmt.bindString(2, objectType); - } - - String pipelineType = entity.getPipelineType(); - if (pipelineType != null) { - stmt.bindString(3, pipelineType); - } - - String pipelineMaterial = entity.getPipelineMaterial(); - if (pipelineMaterial != null) { - stmt.bindString(4, pipelineMaterial); - } - - String pipelineDiameter = entity.getPipelineDiameter(); - if (pipelineDiameter != null) { - stmt.bindString(5, pipelineDiameter); - } - - String buryDeep = entity.getBuryDeep(); - if (buryDeep != null) { - stmt.bindString(6, buryDeep); - } - - String lowerType = entity.getLowerType(); - if (lowerType != null) { - stmt.bindString(7, lowerType); - } - - String lowerMaterial = entity.getLowerMaterial(); - if (lowerMaterial != null) { - stmt.bindString(8, lowerMaterial); - } - - String lowerDiameter = entity.getLowerDiameter(); - if (lowerDiameter != null) { - stmt.bindString(9, lowerDiameter); - } - - String lowerDeep = entity.getLowerDeep(); - if (lowerDeep != null) { - stmt.bindString(10, lowerDeep); - } - - String buryMethod = entity.getBuryMethod(); - if (buryMethod != null) { - stmt.bindString(11, buryMethod); - } - - String area = entity.getArea(); - if (area != null) { - stmt.bindString(12, area); - } - - String line = entity.getLine(); - if (line != null) { - stmt.bindString(13, line); - } - - String road = entity.getRoad(); - if (road != null) { - stmt.bindString(14, road); - } - - String constructTime = entity.getConstructTime(); - if (constructTime != null) { - stmt.bindString(15, constructTime); - } - - String owner = entity.getOwner(); - if (owner != null) { - stmt.bindString(16, owner); - } - - String objectId = entity.getObjectId(); - if (objectId != null) { - stmt.bindString(17, objectId); - } - - String identifierId = entity.getIdentifierId(); - if (identifierId != null) { - stmt.bindString(18, identifierId); - } - - String identifierType = entity.getIdentifierType(); - if (identifierType != null) { - stmt.bindString(19, identifierType); - } - - String identifierDeep = entity.getIdentifierDeep(); - if (identifierDeep != null) { - stmt.bindString(20, identifierDeep); - } - - String person = entity.getPerson(); - if (person != null) { - stmt.bindString(21, person); - } - - String installTime = entity.getInstallTime(); - if (installTime != null) { - stmt.bindString(22, installTime); - } - - String lng = entity.getLng(); - if (lng != null) { - stmt.bindString(23, lng); - } - - String lat = entity.getLat(); - if (lat != null) { - stmt.bindString(24, lat); - } - - String color = entity.getColor(); - if (color != null) { - stmt.bindString(25, color); - } - - String remark = entity.getRemark(); - if (remark != null) { - stmt.bindString(26, remark); - } - - String imagePath = entity.getImagePath(); - if (imagePath != null) { - stmt.bindString(27, imagePath); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, LabelBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String objectType = entity.getObjectType(); - if (objectType != null) { - stmt.bindString(2, objectType); - } - - String pipelineType = entity.getPipelineType(); - if (pipelineType != null) { - stmt.bindString(3, pipelineType); - } - - String pipelineMaterial = entity.getPipelineMaterial(); - if (pipelineMaterial != null) { - stmt.bindString(4, pipelineMaterial); - } - - String pipelineDiameter = entity.getPipelineDiameter(); - if (pipelineDiameter != null) { - stmt.bindString(5, pipelineDiameter); - } - - String buryDeep = entity.getBuryDeep(); - if (buryDeep != null) { - stmt.bindString(6, buryDeep); - } - - String lowerType = entity.getLowerType(); - if (lowerType != null) { - stmt.bindString(7, lowerType); - } - - String lowerMaterial = entity.getLowerMaterial(); - if (lowerMaterial != null) { - stmt.bindString(8, lowerMaterial); - } - - String lowerDiameter = entity.getLowerDiameter(); - if (lowerDiameter != null) { - stmt.bindString(9, lowerDiameter); - } - - String lowerDeep = entity.getLowerDeep(); - if (lowerDeep != null) { - stmt.bindString(10, lowerDeep); - } - - String buryMethod = entity.getBuryMethod(); - if (buryMethod != null) { - stmt.bindString(11, buryMethod); - } - - String area = entity.getArea(); - if (area != null) { - stmt.bindString(12, area); - } - - String line = entity.getLine(); - if (line != null) { - stmt.bindString(13, line); - } - - String road = entity.getRoad(); - if (road != null) { - stmt.bindString(14, road); - } - - String constructTime = entity.getConstructTime(); - if (constructTime != null) { - stmt.bindString(15, constructTime); - } - - String owner = entity.getOwner(); - if (owner != null) { - stmt.bindString(16, owner); - } - - String objectId = entity.getObjectId(); - if (objectId != null) { - stmt.bindString(17, objectId); - } - - String identifierId = entity.getIdentifierId(); - if (identifierId != null) { - stmt.bindString(18, identifierId); - } - - String identifierType = entity.getIdentifierType(); - if (identifierType != null) { - stmt.bindString(19, identifierType); - } - - String identifierDeep = entity.getIdentifierDeep(); - if (identifierDeep != null) { - stmt.bindString(20, identifierDeep); - } - - String person = entity.getPerson(); - if (person != null) { - stmt.bindString(21, person); - } - - String installTime = entity.getInstallTime(); - if (installTime != null) { - stmt.bindString(22, installTime); - } - - String lng = entity.getLng(); - if (lng != null) { - stmt.bindString(23, lng); - } - - String lat = entity.getLat(); - if (lat != null) { - stmt.bindString(24, lat); - } - - String color = entity.getColor(); - if (color != null) { - stmt.bindString(25, color); - } - - String remark = entity.getRemark(); - if (remark != null) { - stmt.bindString(26, remark); - } - - String imagePath = entity.getImagePath(); - if (imagePath != null) { - stmt.bindString(27, imagePath); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public LabelBean readEntity(Cursor cursor, int offset) { - LabelBean entity = new LabelBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // objectType - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineType - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // pipelineDiameter - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDeep - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lowerType - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lowerMaterial - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lowerDiameter - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // lowerDeep - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // buryMethod - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // area - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // line - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // road - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // constructTime - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // owner - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // objectId - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // identifierId - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // identifierType - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // identifierDeep - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // person - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // installTime - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // lng - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // lat - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // color - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // remark - cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, LabelBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setObjectType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setPipelineType(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setPipelineMaterial(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setPipelineDiameter(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setBuryDeep(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setLowerType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLowerMaterial(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLowerDiameter(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLowerDeep(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); - entity.setBuryMethod(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - entity.setArea(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - entity.setLine(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); - entity.setRoad(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); - entity.setConstructTime(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); - entity.setOwner(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); - entity.setObjectId(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); - entity.setIdentifierId(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); - entity.setIdentifierType(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18)); - entity.setIdentifierDeep(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19)); - entity.setPerson(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); - entity.setInstallTime(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); - entity.setLng(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22)); - entity.setLat(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); - entity.setColor(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); - entity.setRemark(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); - } - - @Override - protected final Long updateKeyAfterInsert(LabelBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(LabelBean entity) { - if (entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(LabelBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java new file mode 100644 index 0000000..18849f3 --- /dev/null +++ b/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java @@ -0,0 +1,484 @@ +package com.casic.detector.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import com.casic.detector.bean.MarkerLocalBean; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; +import org.greenrobot.greendao.internal.DaoConfig; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. + +/** + * DAO for table "MARKER_LOCAL_BEAN". + */ +public class MarkerLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "MARKER_LOCAL_BEAN"; + + /** + * Properties of entity MarkerLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property PipelineType = new Property(1, String.class, "pipelineType", false, "PIPELINE_TYPE"); + public final static Property PipelineDiameter = new Property(2, String.class, "pipelineDiameter", false, "PIPELINE_DIAMETER"); + public final static Property PipelineMaterial = new Property(3, String.class, "pipelineMaterial", false, "PIPELINE_MATERIAL"); + public final static Property BuryMethod = new Property(4, String.class, "buryMethod", false, "BURY_METHOD"); + public final static Property BuryDepth = new Property(5, String.class, "buryDepth", false, "BURY_DEPTH"); + public final static Property Area = new Property(6, String.class, "area", false, "AREA"); + public final static Property Line = new Property(7, String.class, "line", false, "LINE"); + public final static Property Road = new Property(8, String.class, "road", false, "ROAD"); + public final static Property ConstructTime = new Property(9, String.class, "constructTime", false, "CONSTRUCT_TIME"); + public final static Property Owner = new Property(10, String.class, "owner", false, "OWNER"); + public final static Property ObjectId = new Property(11, String.class, "objectId", false, "OBJECT_ID"); + public final static Property MarkerId = new Property(12, String.class, "markerId", false, "MARKER_ID"); + public final static Property MarkerType = new Property(13, String.class, "markerType", false, "MARKER_TYPE"); + public final static Property MarkerDepth = new Property(14, String.class, "markerDepth", false, "MARKER_DEPTH"); + public final static Property InstallationDept = new Property(15, String.class, "installationDept", false, "INSTALLATION_DEPT"); + public final static Property Lng = new Property(16, String.class, "lng", false, "LNG"); + public final static Property Lat = new Property(17, String.class, "lat", false, "LAT"); + public final static Property UpdateTime = new Property(18, String.class, "updateTime", false, "UPDATE_TIME"); + public final static Property Remark = new Property(19, String.class, "remark", false, "REMARK"); + public final static Property UnderlyingPipelineType = new Property(20, String.class, "underlyingPipelineType", false, "UNDERLYING_PIPELINE_TYPE"); + public final static Property UnderlyingPipelineDepth = new Property(21, String.class, "underlyingPipelineDepth", false, "UNDERLYING_PIPELINE_DEPTH"); + public final static Property UnderlyingPipelineDiameter = new Property(22, String.class, "underlyingPipelineDiameter", false, "UNDERLYING_PIPELINE_DIAMETER"); + public final static Property UnderlyingPipelineMaterial = new Property(23, String.class, "underlyingPipelineMaterial", false, "UNDERLYING_PIPELINE_MATERIAL"); + public final static Property ObjectType = new Property(24, String.class, "objectType", false, "OBJECT_TYPE"); + public final static Property Color = new Property(25, String.class, "color", false, "COLOR"); + public final static Property ImagePath = new Property(26, String.class, "imagePath", false, "IMAGE_PATH"); + } + + + public MarkerLocalBeanDao(DaoConfig config) { + super(config); + } + + public MarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** + * Creates the underlying database table. + */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + db.execSQL("CREATE TABLE " + constraint + "\"MARKER_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"PIPELINE_TYPE\" TEXT," + // 1: pipelineType + "\"PIPELINE_DIAMETER\" TEXT," + // 2: pipelineDiameter + "\"PIPELINE_MATERIAL\" TEXT," + // 3: pipelineMaterial + "\"BURY_METHOD\" TEXT," + // 4: buryMethod + "\"BURY_DEPTH\" TEXT," + // 5: buryDepth + "\"AREA\" TEXT," + // 6: area + "\"LINE\" TEXT," + // 7: line + "\"ROAD\" TEXT," + // 8: road + "\"CONSTRUCT_TIME\" TEXT," + // 9: constructTime + "\"OWNER\" TEXT," + // 10: owner + "\"OBJECT_ID\" TEXT," + // 11: objectId + "\"MARKER_ID\" TEXT," + // 12: markerId + "\"MARKER_TYPE\" TEXT," + // 13: markerType + "\"MARKER_DEPTH\" TEXT," + // 14: markerDepth + "\"INSTALLATION_DEPT\" TEXT," + // 15: installationDept + "\"LNG\" TEXT," + // 16: lng + "\"LAT\" TEXT," + // 17: lat + "\"UPDATE_TIME\" TEXT," + // 18: updateTime + "\"REMARK\" TEXT," + // 19: remark + "\"UNDERLYING_PIPELINE_TYPE\" TEXT," + // 20: underlyingPipelineType + "\"UNDERLYING_PIPELINE_DEPTH\" TEXT," + // 21: underlyingPipelineDepth + "\"UNDERLYING_PIPELINE_DIAMETER\" TEXT," + // 22: underlyingPipelineDiameter + "\"UNDERLYING_PIPELINE_MATERIAL\" TEXT," + // 23: underlyingPipelineMaterial + "\"OBJECT_TYPE\" TEXT," + // 24: objectType + "\"COLOR\" TEXT," + // 25: color + "\"IMAGE_PATH\" TEXT);"); // 26: imagePath + } + + /** + * Drops the underlying database table. + */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MARKER_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MarkerLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String pipelineType = entity.getPipelineType(); + if (pipelineType != null) { + stmt.bindString(2, pipelineType); + } + + String pipelineDiameter = entity.getPipelineDiameter(); + if (pipelineDiameter != null) { + stmt.bindString(3, pipelineDiameter); + } + + String pipelineMaterial = entity.getPipelineMaterial(); + if (pipelineMaterial != null) { + stmt.bindString(4, pipelineMaterial); + } + + String buryMethod = entity.getBuryMethod(); + if (buryMethod != null) { + stmt.bindString(5, buryMethod); + } + + String buryDepth = entity.getBuryDepth(); + if (buryDepth != null) { + stmt.bindString(6, buryDepth); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(7, area); + } + + String line = entity.getLine(); + if (line != null) { + stmt.bindString(8, line); + } + + String road = entity.getRoad(); + if (road != null) { + stmt.bindString(9, road); + } + + String constructTime = entity.getConstructTime(); + if (constructTime != null) { + stmt.bindString(10, constructTime); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(11, owner); + } + + String objectId = entity.getObjectId(); + if (objectId != null) { + stmt.bindString(12, objectId); + } + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(13, markerId); + } + + String markerType = entity.getMarkerType(); + if (markerType != null) { + stmt.bindString(14, markerType); + } + + String markerDepth = entity.getMarkerDepth(); + if (markerDepth != null) { + stmt.bindString(15, markerDepth); + } + + String installationDept = entity.getInstallationDept(); + if (installationDept != null) { + stmt.bindString(16, installationDept); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(17, lng); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(18, lat); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(19, updateTime); + } + + String remark = entity.getRemark(); + if (remark != null) { + stmt.bindString(20, remark); + } + + String underlyingPipelineType = entity.getUnderlyingPipelineType(); + if (underlyingPipelineType != null) { + stmt.bindString(21, underlyingPipelineType); + } + + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); + if (underlyingPipelineDepth != null) { + stmt.bindString(22, underlyingPipelineDepth); + } + + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); + if (underlyingPipelineDiameter != null) { + stmt.bindString(23, underlyingPipelineDiameter); + } + + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); + if (underlyingPipelineMaterial != null) { + stmt.bindString(24, underlyingPipelineMaterial); + } + + String objectType = entity.getObjectType(); + if (objectType != null) { + stmt.bindString(25, objectType); + } + + String color = entity.getColor(); + if (color != null) { + stmt.bindString(26, color); + } + + String imagePath = entity.getImagePath(); + if (imagePath != null) { + stmt.bindString(27, imagePath); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MarkerLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String pipelineType = entity.getPipelineType(); + if (pipelineType != null) { + stmt.bindString(2, pipelineType); + } + + String pipelineDiameter = entity.getPipelineDiameter(); + if (pipelineDiameter != null) { + stmt.bindString(3, pipelineDiameter); + } + + String pipelineMaterial = entity.getPipelineMaterial(); + if (pipelineMaterial != null) { + stmt.bindString(4, pipelineMaterial); + } + + String buryMethod = entity.getBuryMethod(); + if (buryMethod != null) { + stmt.bindString(5, buryMethod); + } + + String buryDepth = entity.getBuryDepth(); + if (buryDepth != null) { + stmt.bindString(6, buryDepth); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(7, area); + } + + String line = entity.getLine(); + if (line != null) { + stmt.bindString(8, line); + } + + String road = entity.getRoad(); + if (road != null) { + stmt.bindString(9, road); + } + + String constructTime = entity.getConstructTime(); + if (constructTime != null) { + stmt.bindString(10, constructTime); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(11, owner); + } + + String objectId = entity.getObjectId(); + if (objectId != null) { + stmt.bindString(12, objectId); + } + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(13, markerId); + } + + String markerType = entity.getMarkerType(); + if (markerType != null) { + stmt.bindString(14, markerType); + } + + String markerDepth = entity.getMarkerDepth(); + if (markerDepth != null) { + stmt.bindString(15, markerDepth); + } + + String installationDept = entity.getInstallationDept(); + if (installationDept != null) { + stmt.bindString(16, installationDept); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(17, lng); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(18, lat); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(19, updateTime); + } + + String remark = entity.getRemark(); + if (remark != null) { + stmt.bindString(20, remark); + } + + String underlyingPipelineType = entity.getUnderlyingPipelineType(); + if (underlyingPipelineType != null) { + stmt.bindString(21, underlyingPipelineType); + } + + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); + if (underlyingPipelineDepth != null) { + stmt.bindString(22, underlyingPipelineDepth); + } + + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); + if (underlyingPipelineDiameter != null) { + stmt.bindString(23, underlyingPipelineDiameter); + } + + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); + if (underlyingPipelineMaterial != null) { + stmt.bindString(24, underlyingPipelineMaterial); + } + + String objectType = entity.getObjectType(); + if (objectType != null) { + stmt.bindString(25, objectType); + } + + String color = entity.getColor(); + if (color != null) { + stmt.bindString(26, color); + } + + String imagePath = entity.getImagePath(); + if (imagePath != null) { + stmt.bindString(27, imagePath); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MarkerLocalBean readEntity(Cursor cursor, int offset) { + MarkerLocalBean entity = new MarkerLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color + cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MarkerLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setPipelineType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setPipelineDiameter(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setPipelineMaterial(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setBuryMethod(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setBuryDepth(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setArea(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLine(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setRoad(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setConstructTime(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setOwner(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setObjectId(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setMarkerId(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setMarkerType(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setMarkerDepth(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setInstallationDept(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setLng(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setLat(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + entity.setUpdateTime(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18)); + entity.setRemark(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19)); + entity.setUnderlyingPipelineType(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); + entity.setUnderlyingPipelineDepth(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); + entity.setUnderlyingPipelineDiameter(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22)); + entity.setUnderlyingPipelineMaterial(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); + entity.setObjectType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); + entity.setColor(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); + entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); + } + + @Override + protected final Long updateKeyAfterInsert(MarkerLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MarkerLocalBean entity) { + if (entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MarkerLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/detector/utils/ExcelHub.kt b/app/src/main/java/com/casic/detector/utils/ExcelHub.kt index a3c1355..5e12e0b 100644 --- a/app/src/main/java/com/casic/detector/utils/ExcelHub.kt +++ b/app/src/main/java/com/casic/detector/utils/ExcelHub.kt @@ -1,59 +1,51 @@ package com.casic.detector.utils -import android.content.Context -import com.casic.detector.bean.LabelBean -import com.pengxh.kt.lite.extensions.show +import com.casic.detector.bean.MarkerLocalBean import jxl.Workbook import jxl.read.biff.BiffException import java.io.File object ExcelHub { - fun read(context: Context, filePath: String?): ArrayList { - val result = ArrayList() - - if (filePath.isNullOrBlank()) { - return result - } - + fun read(filePath: String): ArrayList { + val result = ArrayList() try { val workbook = Workbook.getWorkbook(File(filePath)) val sheet = workbook.getSheet(0) for (i in 1 until sheet.rows) { - val labelBean = LabelBean() - labelBean.pipelineType = sheet.getCell(0, i).contents - labelBean.pipelineDiameter = sheet.getCell(1, i).contents - labelBean.pipelineMaterial = sheet.getCell(2, i).contents - labelBean.buryMethod = sheet.getCell(3, i).contents - labelBean.buryDeep = sheet.getCell(4, i).contents - labelBean.area = sheet.getCell(5, i).contents - labelBean.line = sheet.getCell(6, i).contents - labelBean.road = sheet.getCell(7, i).contents - labelBean.constructTime = sheet.getCell(8, i).contents - labelBean.owner = sheet.getCell(9, i).contents - labelBean.objectId = sheet.getCell(10, i).contents - labelBean.identifierId = sheet.getCell(11, i).contents - labelBean.identifierType = sheet.getCell(12, i).contents - labelBean.identifierDeep = sheet.getCell(13, i).contents - labelBean.person = sheet.getCell(14, i).contents - labelBean.lng = sheet.getCell(15, i).contents - labelBean.lat = sheet.getCell(16, i).contents - labelBean.installTime = sheet.getCell(17, i).contents - labelBean.remark = sheet.getCell(18, i).contents - labelBean.lowerType = sheet.getCell(19, i).contents - labelBean.lowerDeep = sheet.getCell(20, i).contents - labelBean.lowerDiameter = sheet.getCell(21, i).contents - labelBean.lowerMaterial = sheet.getCell(22, i).contents - labelBean.objectType = sheet.getCell(23, i).contents - labelBean.color = sheet.getCell(24, i).contents - labelBean.imagePath = sheet.getCell(25, i).contents + val marker = MarkerLocalBean() + marker.pipelineType = sheet.getCell(0, i).contents + marker.pipelineDiameter = sheet.getCell(1, i).contents + marker.pipelineMaterial = sheet.getCell(2, i).contents + marker.buryMethod = sheet.getCell(3, i).contents + marker.buryDepth = sheet.getCell(4, i).contents + marker.area = sheet.getCell(5, i).contents + marker.line = sheet.getCell(6, i).contents + marker.road = sheet.getCell(7, i).contents + marker.constructTime = sheet.getCell(8, i).contents + marker.owner = sheet.getCell(9, i).contents + marker.objectId = sheet.getCell(10, i).contents + marker.markerId = sheet.getCell(11, i).contents + marker.markerType = sheet.getCell(12, i).contents + marker.markerDepth = sheet.getCell(13, i).contents + marker.installationDept = sheet.getCell(14, i).contents + marker.lng = sheet.getCell(15, i).contents + marker.lat = sheet.getCell(16, i).contents + marker.updateTime = sheet.getCell(17, i).contents + marker.remark = sheet.getCell(18, i).contents + marker.underlyingPipelineType = sheet.getCell(19, i).contents + marker.underlyingPipelineDepth = sheet.getCell(20, i).contents + marker.underlyingPipelineDiameter = sheet.getCell(21, i).contents + marker.underlyingPipelineMaterial = sheet.getCell(22, i).contents + marker.objectType = sheet.getCell(23, i).contents + marker.color = sheet.getCell(24, i).contents + marker.imagePath = sheet.getCell(25, i).contents - result.add(labelBean) + result.add(marker) } workbook.close() } catch (e: BiffException) { e.printStackTrace() - e.localizedMessage?.show(context) } return result } diff --git a/app/src/main/java/com/casic/detector/view/LoginActivity.kt b/app/src/main/java/com/casic/detector/view/LoginActivity.kt index 3eea0c5..73849b9 100644 --- a/app/src/main/java/com/casic/detector/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/detector/view/LoginActivity.kt @@ -2,26 +2,18 @@ import android.os.Bundle import androidx.lifecycle.ViewModelProvider -import androidx.lifecycle.lifecycleScope -import com.amap.api.maps.CoordinateConverter import com.amap.api.navi.NaviSetting import com.casic.detector.databinding.ActivityLoginBinding -import com.casic.detector.model.PipelineModel -import com.casic.detector.utils.DataBaseManager import com.casic.detector.utils.LocaleConstant import com.casic.detector.vm.UserViewModel import com.google.gson.Gson -import com.google.gson.reflect.TypeToken import com.gyf.immersionbar.ImmersionBar import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.extensions.navigatePageTo -import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.utils.LoadState import com.pengxh.kt.lite.utils.LoadingDialogHub import com.pengxh.kt.lite.utils.SaveKeyValues import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch class LoginActivity : KotlinBaseActivity() { @@ -51,31 +43,31 @@ } } - lifecycleScope.launch(Dispatchers.IO) { - //获取管线数据。本地文件 - val pipeline = readAssetsFile("pipeline.json") - val lineResult = gson.fromJson( - pipeline, object : TypeToken() {}.type - ) - //缓存Pipe到本地 - lineResult.data.forEach { dot -> - val startLat = dot.startLatitudeGd - val startLng = dot.startLongitudeGd - val endLat = dot.endLatitudeGd - val endLng = dot.endLongitudeGd - if (!startLat.isNullOrBlank() && !startLng.isNullOrBlank() && !endLat.isNullOrBlank() && !endLng.isNullOrBlank()) { - if (CoordinateConverter.isAMapDataAvailable( - startLat.toDouble(), startLng.toDouble() - ) && - CoordinateConverter.isAMapDataAvailable( - endLat.toDouble(), endLng.toDouble() - ) - ) { - DataBaseManager.get.insertMapPipeCache(dot) - } - } - } - } +// lifecycleScope.launch(Dispatchers.IO) { +// //获取管线数据。本地文件 +// val pipeline = readAssetsFile("pipeline.json") +// val lineResult = gson.fromJson( +// pipeline, object : TypeToken() {}.type +// ) +// //缓存Pipe到本地 +// lineResult.data.forEach { dot -> +// val startLat = dot.startLatitudeGd +// val startLng = dot.startLongitudeGd +// val endLat = dot.endLatitudeGd +// val endLng = dot.endLongitudeGd +// if (!startLat.isNullOrBlank() && !startLng.isNullOrBlank() && !endLat.isNullOrBlank() && !endLng.isNullOrBlank()) { +// if (CoordinateConverter.isAMapDataAvailable( +// startLat.toDouble(), startLng.toDouble() +// ) && +// CoordinateConverter.isAMapDataAvailable( +// endLat.toDouble(), endLng.toDouble() +// ) +// ) { +// DataBaseManager.get.insertMapPipeCache(dot) +// } +// } +// } +// } } override fun initEvent() { diff --git a/app/src/main/java/com/casic/detector/view/MainActivity.kt b/app/src/main/java/com/casic/detector/view/MainActivity.kt index 22de557..6980416 100644 --- a/app/src/main/java/com/casic/detector/view/MainActivity.kt +++ b/app/src/main/java/com/casic/detector/view/MainActivity.kt @@ -38,7 +38,7 @@ import com.casic.detector.R import com.casic.detector.adapter.EditableImageAdapter import com.casic.detector.base.SerialPortActivity -import com.casic.detector.bean.LabelBean +import com.casic.detector.bean.MarkerLocalBean import com.casic.detector.bean.TaskMarkerLocalBean import com.casic.detector.callback.OnGetLocationListener import com.casic.detector.callback.OnImageCompressListener @@ -77,7 +77,6 @@ import com.casic.detector.widgets.RadarScanView import com.casic.detector.widgets.SamplePopupWindow import com.google.gson.Gson -import com.google.gson.reflect.TypeToken import com.luck.picture.lib.basic.PictureSelector import com.luck.picture.lib.config.SelectMimeType import com.luck.picture.lib.entity.LocalMedia @@ -132,7 +131,7 @@ private val rotationMatrix = FloatArray(9)//旋转矩阵缓存 private val valueArray = FloatArray(3)//方位角数值 private var clickTime: Long = 0 - private var labelBeans = ArrayList() + private var markers = ArrayList() private var clusterOverlay: ClusterOverlay? = null private var latitude: Double = 0.0 private var longitude: Double = 0.0 @@ -191,7 +190,7 @@ taskViewModel.markerFileResult.observe(this) { if (it.isSuccess) { //清空之前的数据 - DataBaseManager.get.clearTaskLabels() + DataBaseManager.get.clearMarkers() //下载最新的数据 val companyId = SaveKeyValues.getValue(LocaleConstant.USER_COMPANY_ID, "") val downloadUrl = companyId.toString().appendDownloadUrl(FileType.EXCEL) @@ -201,10 +200,10 @@ .setOnFileDownloadListener(object : FileDownloadManager.OnFileDownloadListener { override fun onDownloadEnd(file: File) { lifecycleScope.launch(Dispatchers.Main) { - labelBeans = ExcelHub.read(context, file.absolutePath) withContext(Dispatchers.IO) { - labelBeans.forEach { label -> - DataBaseManager.get.insertTaskLabel(label) + markers = ExcelHub.read(file.absolutePath) + markers.forEach { marker -> + DataBaseManager.get.saveMarkerInLocale(marker) } } LoadingDialogHub.dismiss() @@ -311,8 +310,9 @@ } else { lifecycleScope.launch(Dispatchers.Main) { val labels = withContext(Dispatchers.IO) { - DataBaseManager.get.queryLabelById("0") + DataBaseManager.get.queryMarkerByState("0") } + //如果有需要补全的标识器,Popup右侧会有小圆点提示 if (labels.isNotEmpty()) { samplePopupWindow.setShowPosition(4) } @@ -331,7 +331,7 @@ 1 -> downloadTask() 2 -> navigatePageTo() 3 -> uploadEvent() - 4 -> uploadLabel() + 4 -> completionMarker() } } }) @@ -364,20 +364,20 @@ override fun onConfirmClick(selectedItem: String, value: String) { //查询数据库 lifecycleScope.launch(Dispatchers.Main) { - labelBeans = withContext(Dispatchers.IO) { - DataBaseManager.get.loadLabelByCondition( + markers = withContext(Dispatchers.IO) { + DataBaseManager.get.loadMarkersByCondition( selectedItem, value - ) as ArrayList + ) as ArrayList } - if (labelBeans.isEmpty()) { + if (markers.isEmpty()) { "无法查到相关数据信息,请检查您的查询条件".show(context) } else { val latitudeList = ArrayList() val longitudeList = ArrayList() - val latitude = labelBeans.first().lat - val longitude = labelBeans.first().lng + val latitude = markers.first().lat + val longitude = markers.first().lng if (latitude.isNotBlank() && longitude.isNotBlank()) { if (CoordinateConverter.isAMapDataAvailable( latitude.toDouble(), longitude.toDouble() @@ -591,7 +591,7 @@ //添加地图Marker if (!ids.contains(markerId)) { //根据markerId查询标识器经纬度 - val labels = DataBaseManager.get.queryLabelById(markerId) + val labels = DataBaseManager.get.queryMarkerById(markerId) if (labels.isNotEmpty()) { val bean = labels.first() aMap.addMarker( @@ -605,7 +605,7 @@ //显示标识器详细信息 if (!detailDialog.isShowing) { - val labelBean = DataBaseManager.get.queryLabelById(markerId).firstOrNull() + val labelBean = DataBaseManager.get.queryMarkerById(markerId).firstOrNull() if (labelBean == null) { "无法查询到此ID【${markerId}】的信息".show(context) } else { @@ -715,8 +715,8 @@ aMap.setOnMapLongClickListener { //协程异步显示默认数据 lifecycleScope.launch(Dispatchers.Main) { - labelBeans = withContext(Dispatchers.IO) { - DataBaseManager.get.loadTaskLabels() as ArrayList + markers = withContext(Dispatchers.IO) { + DataBaseManager.get.loadMarkers() as ArrayList } showLabelsOnMap() } @@ -760,7 +760,7 @@ clusterOverlay?.onDestroy() val clusterItems = ArrayList() - labelBeans.forEach { + markers.forEach { if (it.lat.isNotEmpty() && it.lng.isNotEmpty()) { val latitude = it.lat.toDouble() val longitude = it.lng.toDouble() @@ -848,7 +848,7 @@ } override fun onCancelClick() { - labelBeans.forEach { + markers.forEach { if (it.id.toString() == item.title) { navigatePageTo(it.toJson()) } @@ -973,48 +973,45 @@ } //标识器补全 - private fun uploadLabel() { + private fun completionMarker() { val companyId = SaveKeyValues.getValue(LocaleConstant.USER_COMPANY_ID, "") as String - val labelBeans = DataBaseManager.get.queryLabelById("0") - if (labelBeans.isNotEmpty()) { - LoadingDialogHub.show(this, "标识器补全中,请稍后...") - labelBeans.forEach { labelBean -> - val imagePaths = gson.fromJson>( - labelBean.imagePath, object : TypeToken>() {}.type - ) - - taskViewModel.installLabel( - this, - companyId, - labelBean.objectType, - labelBean.pipelineType, - labelBean.pipelineMaterial, - labelBean.pipelineDiameter, - labelBean.buryDeep, - labelBean.lowerType, - labelBean.lowerMaterial, - labelBean.lowerDiameter, - labelBean.lowerDeep, - labelBean.buryMethod, - labelBean.area, - labelBean.line, - labelBean.road, - labelBean.constructTime, - labelBean.owner, - labelBean.objectId, - labelBean.identifierId, - labelBean.identifierType, - labelBean.identifierDeep, - labelBean.person, - labelBean.installTime, - labelBean.lng, - labelBean.lat, - labelBean.color, - labelBean.remark, - imagePaths - ) - } - LoadingDialogHub.dismiss() + val markers = DataBaseManager.get.queryMarkerByState("0") + if (markers.isNotEmpty()) { + //TODO 逻辑没梳理明白 +// LoadingDialogHub.show(this, "标识器补全中,请稍后...") +// markers.forEach { marker -> +// taskViewModel.installLabel( +// this, +// companyId, +// labelBean.objectType, +// labelBean.pipelineType, +// labelBean.pipelineMaterial, +// labelBean.pipelineDiameter, +// labelBean.buryDeep, +// labelBean.lowerType, +// labelBean.lowerMaterial, +// labelBean.lowerDiameter, +// labelBean.lowerDeep, +// labelBean.buryMethod, +// labelBean.area, +// labelBean.line, +// labelBean.road, +// labelBean.constructTime, +// labelBean.owner, +// labelBean.objectId, +// labelBean.identifierId, +// labelBean.identifierType, +// labelBean.identifierDeep, +// labelBean.person, +// labelBean.installTime, +// labelBean.lng, +// labelBean.lat, +// labelBean.color, +// labelBean.remark, +// arrayListOf() +// ) +// } +// LoadingDialogHub.dismiss() } else { "没有需要补传的标识器!".show(this) } @@ -1072,8 +1069,8 @@ binding.mapView.onResume() //协程异步显示默认数据 lifecycleScope.launch(Dispatchers.Main) { - labelBeans = withContext(Dispatchers.IO) { - DataBaseManager.get.loadTaskLabels() as ArrayList + markers = withContext(Dispatchers.IO) { + DataBaseManager.get.loadMarkers() as ArrayList } showLabelsOnMap() } @@ -1499,45 +1496,45 @@ private fun saveLabelInLocal() { val objectId = SaveKeyValues.getValue(LocaleConstant.OBJECT_ID, "") as String - val labelBean = LabelBean() - labelBean.objectType = binding.objectInclude.objectTypeSpinner.selectedItem.toString() - labelBean.pipelineType = + val marker = MarkerLocalBean() + marker.objectType = binding.objectInclude.objectTypeSpinner.selectedItem.toString() + marker.pipelineType = binding.objectInclude.pipeInclude.markerObjectTypeView.text.toString() - labelBean.pipelineMaterial = + marker.pipelineMaterial = binding.objectInclude.pipeInclude.materialSpinner.selectedItem.toString() - labelBean.pipelineDiameter = + marker.pipelineDiameter = "${binding.objectInclude.pipeInclude.pipelineDiameterView.text}mm" - labelBean.buryDeep = "${binding.objectInclude.pipeInclude.buryDeepView.text}mm" - labelBean.lowerType = + marker.buryDepth = "${binding.objectInclude.pipeInclude.buryDeepView.text}mm" + marker.underlyingPipelineType = binding.objectInclude.pipeCrossInclude.bottomPipeTypeSpinner.selectedItem.toString() - labelBean.lowerMaterial = + marker.underlyingPipelineMaterial = binding.objectInclude.pipeCrossInclude.bottomPipeMaterialSpinner.selectedItem.toString() - labelBean.lowerDiameter = + marker.underlyingPipelineDiameter = "${binding.objectInclude.pipeCrossInclude.bottomPipeDiameterView.text}mm" - labelBean.lowerDeep = + marker.underlyingPipelineDepth = "${binding.objectInclude.pipeCrossInclude.bottomPointDeepView.text}mm" - labelBean.buryMethod = + marker.buryMethod = binding.objectInclude.pipeInclude.buryTypeSpinner.selectedItem.toString() - labelBean.area = binding.objectInclude.areaView.text.toString() - labelBean.line = binding.objectInclude.lineView.text.toString() - labelBean.road = binding.objectInclude.roadView.text.toString() - labelBean.constructTime = binding.objectInclude.constructDateView.text.toString() - labelBean.owner = binding.objectInclude.ownerView.text.toString() - labelBean.objectId = objectId - labelBean.identifierId = binding.identifierInclude.identifierIdView.text.toString() - labelBean.identifierType = + marker.area = binding.objectInclude.areaView.text.toString() + marker.line = binding.objectInclude.lineView.text.toString() + marker.road = binding.objectInclude.roadView.text.toString() + marker.constructTime = binding.objectInclude.constructDateView.text.toString() + marker.owner = binding.objectInclude.ownerView.text.toString() + marker.objectId = objectId + marker.markerId = binding.identifierInclude.identifierIdView.text.toString() + marker.markerType = binding.identifierInclude.identifierTypeSpinner.selectedItem.toString() - labelBean.identifierDeep = "${binding.identifierInclude.identifierDeepView.text}mm" - labelBean.person = binding.identifierInclude.personDeptView.text.toString() - labelBean.installTime = binding.identifierInclude.installTimeView.text.toString() - labelBean.lng = binding.identifierInclude.lngView.text.toString() - labelBean.lat = binding.identifierInclude.latView.text.toString() - labelBean.color = + marker.markerDepth = "${binding.identifierInclude.identifierDeepView.text}mm" + marker.installationDept = binding.identifierInclude.personDeptView.text.toString() + marker.updateTime = binding.identifierInclude.installTimeView.text.toString() + marker.lng = binding.identifierInclude.lngView.text.toString() + marker.lat = binding.identifierInclude.latView.text.toString() + marker.color = binding.identifierInclude.colorSpinner.selectedItem.toString().toColor() - labelBean.remark = binding.remarkView.text.toString() - labelBean.imagePath = realPaths.toJson() + marker.remark = binding.remarkView.text.toString() + marker.imagePath = realPaths.toJson() - DataBaseManager.get.insertTaskLabel(labelBean) + DataBaseManager.get.saveMarkerInLocale(marker) } private fun takePicture() { @@ -1599,9 +1596,9 @@ searchMarkerTimer.cancel() out.write('3'.code) - val result = DataBaseManager.get.queryLabelById(markerId) + val result = DataBaseManager.get.queryMarkerById(markerId) if (result.isNotEmpty()) { - val tag = when (result.first().identifierType) { + val tag = when (result.first().markerId) { "EM30" -> '7' "EM50" -> '8' "EM14" -> '9' @@ -1635,7 +1632,7 @@ binding.markerInfoButton.setOnClickListener { //查库 - val result = DataBaseManager.get.queryLabelById(markerId) + val result = DataBaseManager.get.queryMarkerById(markerId) if (result.isNotEmpty()) { context.navigatePageTo(result.first().toJson()) } else { @@ -1659,7 +1656,7 @@ private fun renderDataPoint(location: AMapLocation) { lifecycleScope.launch(Dispatchers.IO) { val dataPoints = ArrayList() - DataBaseManager.get.loadTaskLabels().forEach { + DataBaseManager.get.loadMarkers().forEach { //单位:米 val distance = AMapUtils.calculateLineDistance( LatLng(latitude, longitude), LatLng(it.lat.toDouble(), it.lng.toDouble()) diff --git a/app/src/main/java/com/casic/detector/view/ObjectDetailActivity.kt b/app/src/main/java/com/casic/detector/view/ObjectDetailActivity.kt index 3033db3..d19b1a1 100644 --- a/app/src/main/java/com/casic/detector/view/ObjectDetailActivity.kt +++ b/app/src/main/java/com/casic/detector/view/ObjectDetailActivity.kt @@ -5,7 +5,7 @@ import android.graphics.drawable.ColorDrawable import android.os.Bundle import android.view.Gravity -import com.casic.detector.bean.LabelBean +import com.casic.detector.bean.MarkerLocalBean import com.casic.detector.databinding.ActivityObjectDetailBinding import com.casic.detector.extensions.appendDownloadUrl import com.casic.detector.utils.FileType @@ -24,7 +24,7 @@ private val kTag = "ObjectDetailActivity" private val context: Context = this@ObjectDetailActivity private val gson by lazy { Gson() } - private lateinit var labelBean: LabelBean + private lateinit var marker: MarkerLocalBean override fun initViewBinding(): ActivityObjectDetailBinding { return ActivityObjectDetailBinding.inflate(layoutInflater) @@ -49,26 +49,26 @@ val objectJson = intent.getStringExtra(Constant.INTENT_PARAM)!! try { - labelBean = gson.fromJson(objectJson, object : TypeToken() {}.type) + marker = gson.fromJson(objectJson, object : TypeToken() {}.type) binding.objectTypeView.text = - LocaleConstant.POINT_TYPE_ARRAY[labelBean.objectType.toInt() - 1] - binding.pipelineTypeView.text = labelBean.pipelineType - binding.pipelineDiameterView.text = labelBean.pipelineDiameter - binding.pipelineMaterialView.text = labelBean.pipelineMaterial - binding.buryMethodView.text = labelBean.buryMethod - binding.buryDeepView.text = labelBean.buryDeep - binding.areaView.text = labelBean.area - binding.lineView.text = labelBean.line - binding.roadView.text = labelBean.road - binding.constructTimeView.text = labelBean.constructTime - binding.ownerView.text = labelBean.owner - binding.identifierIdView.text = labelBean.identifierId - binding.identifierTypeView.text = labelBean.identifierType - binding.identifierDeepView.text = labelBean.identifierDeep - binding.personView.text = labelBean.person - binding.installTimeView.text = labelBean.installTime - binding.remarkView.text = labelBean.remark + LocaleConstant.POINT_TYPE_ARRAY[marker.objectType.toInt() - 1] + binding.pipelineTypeView.text = marker.pipelineType + binding.pipelineDiameterView.text = marker.pipelineDiameter + binding.pipelineMaterialView.text = marker.pipelineMaterial + binding.buryMethodView.text = marker.buryMethod + binding.buryDeepView.text = marker.buryDepth + binding.areaView.text = marker.area + binding.lineView.text = marker.line + binding.roadView.text = marker.road + binding.constructTimeView.text = marker.constructTime + binding.ownerView.text = marker.owner + binding.identifierIdView.text = marker.markerId + binding.identifierTypeView.text = marker.markerType + binding.identifierDeepView.text = marker.markerDepth + binding.personView.text = marker.installationDept + binding.installTimeView.text = marker.updateTime + binding.remarkView.text = marker.remark } catch (e: NumberFormatException) { e.printStackTrace() } @@ -79,7 +79,7 @@ binding.showImageView.setOnClickListener { //查数据库 - if (labelBean.imagePath.isNullOrEmpty()) { + if (marker.imagePath.isNullOrEmpty()) { "此标识器无图片".show(context) } else { val realPaths: ArrayList = ArrayList() //真实图片路径 @@ -87,7 +87,7 @@ /** * /images/markers/202307/0008818922_EVENT_20230704_160349_0_1.jpg,/images/markers/202307/0008818922_EVENT_20230704_160406_0_2.jpg * */ - val imagePath = labelBean.imagePath + val imagePath = marker.imagePath if (imagePath.contains(",")) { val list = imagePath.split(",") list.forEach { path -> diff --git a/app/src/main/java/com/casic/detector/bean/LabelBean.java b/app/src/main/java/com/casic/detector/bean/LabelBean.java deleted file mode 100644 index d22d835..0000000 --- a/app/src/main/java/com/casic/detector/bean/LabelBean.java +++ /dev/null @@ -1,321 +0,0 @@ -package com.casic.detector.bean; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -@Entity -public class LabelBean { - @Id(autoincrement = true) - private Long id;//主键ID - // 标记对象类型 - private String objectType; - // 管线类型 - private String pipelineType; - // 管材 - private String pipelineMaterial; - // 管直 - private String pipelineDiameter; - // 埋深 - private String buryDeep; - // 下层管线类型 - private String lowerType; - // 下层管材 - private String lowerMaterial; - // 下层管径 - private String lowerDiameter; - // 下层埋深 - private String lowerDeep; - // 埋设方式 - private String buryMethod; - // 所属区域 - private String area; - // 所属线路 - private String line; - // 所属道路 - private String road; - // 建设年代 - private String constructTime; - // 权属单位 - private String owner; - // 对象ID - private String objectId; - // 标识器ID号 - private String identifierId; - // 标识器类型 - private String identifierType; - // 标识器埋深 - private String identifierDeep; - // 安装人员 - private String person; - // 安装时间 - private String installTime; - // 经度 - private String lng; - // 纬度 - private String lat; - // 颜色 - private String color; - // 备注信息 - private String remark; - // 图片路径 - private String imagePath; - - @Generated(hash = 1718746860) - public LabelBean(Long id, String objectType, String pipelineType, - String pipelineMaterial, String pipelineDiameter, String buryDeep, - String lowerType, String lowerMaterial, String lowerDiameter, - String lowerDeep, String buryMethod, String area, String line, - String road, String constructTime, String owner, String objectId, - String identifierId, String identifierType, String identifierDeep, - String person, String installTime, String lng, String lat, String color, - String remark, String imagePath) { - this.id = id; - this.objectType = objectType; - this.pipelineType = pipelineType; - this.pipelineMaterial = pipelineMaterial; - this.pipelineDiameter = pipelineDiameter; - this.buryDeep = buryDeep; - this.lowerType = lowerType; - this.lowerMaterial = lowerMaterial; - this.lowerDiameter = lowerDiameter; - this.lowerDeep = lowerDeep; - this.buryMethod = buryMethod; - this.area = area; - this.line = line; - this.road = road; - this.constructTime = constructTime; - this.owner = owner; - this.objectId = objectId; - this.identifierId = identifierId; - this.identifierType = identifierType; - this.identifierDeep = identifierDeep; - this.person = person; - this.installTime = installTime; - this.lng = lng; - this.lat = lat; - this.color = color; - this.remark = remark; - this.imagePath = imagePath; - } - - @Generated(hash = 1285554626) - public LabelBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getObjectType() { - return this.objectType; - } - - public void setObjectType(String objectType) { - this.objectType = objectType; - } - - public String getPipelineType() { - return this.pipelineType; - } - - public void setPipelineType(String pipelineType) { - this.pipelineType = pipelineType; - } - - public String getPipelineMaterial() { - return this.pipelineMaterial; - } - - public void setPipelineMaterial(String pipelineMaterial) { - this.pipelineMaterial = pipelineMaterial; - } - - public String getPipelineDiameter() { - return this.pipelineDiameter; - } - - public void setPipelineDiameter(String pipelineDiameter) { - this.pipelineDiameter = pipelineDiameter; - } - - public String getBuryDeep() { - return this.buryDeep; - } - - public void setBuryDeep(String buryDeep) { - this.buryDeep = buryDeep; - } - - public String getLowerType() { - return this.lowerType; - } - - public void setLowerType(String lowerType) { - this.lowerType = lowerType; - } - - public String getLowerMaterial() { - return this.lowerMaterial; - } - - public void setLowerMaterial(String lowerMaterial) { - this.lowerMaterial = lowerMaterial; - } - - public String getLowerDiameter() { - return this.lowerDiameter; - } - - public void setLowerDiameter(String lowerDiameter) { - this.lowerDiameter = lowerDiameter; - } - - public String getLowerDeep() { - return this.lowerDeep; - } - - public void setLowerDeep(String lowerDeep) { - this.lowerDeep = lowerDeep; - } - - public String getBuryMethod() { - return this.buryMethod; - } - - public void setBuryMethod(String buryMethod) { - this.buryMethod = buryMethod; - } - - public String getArea() { - return this.area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getLine() { - return this.line; - } - - public void setLine(String line) { - this.line = line; - } - - public String getRoad() { - return this.road; - } - - public void setRoad(String road) { - this.road = road; - } - - public String getConstructTime() { - return this.constructTime; - } - - public void setConstructTime(String constructTime) { - this.constructTime = constructTime; - } - - public String getOwner() { - return this.owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getObjectId() { - return this.objectId; - } - - public void setObjectId(String objectId) { - this.objectId = objectId; - } - - public String getIdentifierId() { - return this.identifierId; - } - - public void setIdentifierId(String identifierId) { - this.identifierId = identifierId; - } - - public String getIdentifierType() { - return this.identifierType; - } - - public void setIdentifierType(String identifierType) { - this.identifierType = identifierType; - } - - public String getIdentifierDeep() { - return this.identifierDeep; - } - - public void setIdentifierDeep(String identifierDeep) { - this.identifierDeep = identifierDeep; - } - - public String getPerson() { - return this.person; - } - - public void setPerson(String person) { - this.person = person; - } - - public String getInstallTime() { - return this.installTime; - } - - public void setInstallTime(String installTime) { - this.installTime = installTime; - } - - public String getLng() { - return this.lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getLat() { - return this.lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getColor() { - return this.color; - } - - public void setColor(String color) { - this.color = color; - } - - public String getRemark() { - return this.remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getImagePath() { - return this.imagePath; - } - - public void setImagePath(String imagePath) { - this.imagePath = imagePath; - } -} diff --git a/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java new file mode 100644 index 0000000..c59cf0b --- /dev/null +++ b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java @@ -0,0 +1,327 @@ +package com.casic.detector.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Id; +import org.greenrobot.greendao.annotation.Generated; + +/** + * 从平台下载的标识器本地库实体类 + */ +@Entity +public class MarkerLocalBean { + @Id(autoincrement = true) + private Long id;//本地库主键ID + + // 管线类型 + private String pipelineType; + // 管线直径 + private String pipelineDiameter; + // 管材 + private String pipelineMaterial; + // 埋设方式 + private String buryMethod; + // 埋深 + private String buryDepth; + // 所属区域 + private String area; + // 所属线路 + private String line; + // 所属道路 + private String road; + // 建设年代 + private String constructTime; + // 权属单位 + private String owner; + //标识对象ID,无实际用途 + @Deprecated + private String objectId; + // 标识器ID + private String markerId; + // 标识器类型 + private String markerType; + // 标识器埋深 + private String markerDepth; + // 安装部门 + private String installationDept; + // 经度 + private String lng; + // 纬度 + private String lat; + //最后修改时间,更新时间 + private String updateTime; + // 备注信息 + private String remark; + // 下层管线类型 + private String underlyingPipelineType; + // 下层埋深 + private String underlyingPipelineDepth; + // 下层管径 + private String underlyingPipelineDiameter; + // 下层管材 + private String underlyingPipelineMaterial; + //标识对象类型 + private String objectType; + // 颜色 + private String color; + // 图片路径 + private String imagePath; + + @Generated(hash = 1479045776) + public MarkerLocalBean(Long id, String pipelineType, String pipelineDiameter, + String pipelineMaterial, String buryMethod, String buryDepth, + String area, String line, String road, String constructTime, + String owner, String objectId, String markerId, String markerType, + String markerDepth, String installationDept, String lng, String lat, + String updateTime, String remark, String underlyingPipelineType, + String underlyingPipelineDepth, String underlyingPipelineDiameter, + String underlyingPipelineMaterial, String objectType, String color, + String imagePath) { + this.id = id; + this.pipelineType = pipelineType; + this.pipelineDiameter = pipelineDiameter; + this.pipelineMaterial = pipelineMaterial; + this.buryMethod = buryMethod; + this.buryDepth = buryDepth; + this.area = area; + this.line = line; + this.road = road; + this.constructTime = constructTime; + this.owner = owner; + this.objectId = objectId; + this.markerId = markerId; + this.markerType = markerType; + this.markerDepth = markerDepth; + this.installationDept = installationDept; + this.lng = lng; + this.lat = lat; + this.updateTime = updateTime; + this.remark = remark; + this.underlyingPipelineType = underlyingPipelineType; + this.underlyingPipelineDepth = underlyingPipelineDepth; + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + this.objectType = objectType; + this.color = color; + this.imagePath = imagePath; + } + + @Generated(hash = 1538606012) + public MarkerLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPipelineType() { + return this.pipelineType; + } + + public void setPipelineType(String pipelineType) { + this.pipelineType = pipelineType; + } + + public String getPipelineDiameter() { + return this.pipelineDiameter; + } + + public void setPipelineDiameter(String pipelineDiameter) { + this.pipelineDiameter = pipelineDiameter; + } + + public String getPipelineMaterial() { + return this.pipelineMaterial; + } + + public void setPipelineMaterial(String pipelineMaterial) { + this.pipelineMaterial = pipelineMaterial; + } + + public String getBuryMethod() { + return this.buryMethod; + } + + public void setBuryMethod(String buryMethod) { + this.buryMethod = buryMethod; + } + + public String getBuryDepth() { + return this.buryDepth; + } + + public void setBuryDepth(String buryDepth) { + this.buryDepth = buryDepth; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getLine() { + return this.line; + } + + public void setLine(String line) { + this.line = line; + } + + public String getRoad() { + return this.road; + } + + public void setRoad(String road) { + this.road = road; + } + + public String getConstructTime() { + return this.constructTime; + } + + public void setConstructTime(String constructTime) { + this.constructTime = constructTime; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getObjectId() { + return this.objectId; + } + + public void setObjectId(String objectId) { + this.objectId = objectId; + } + + public String getMarkerId() { + return this.markerId; + } + + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerType() { + return this.markerType; + } + + public void setMarkerType(String markerType) { + this.markerType = markerType; + } + + public String getMarkerDepth() { + return this.markerDepth; + } + + public void setMarkerDepth(String markerDepth) { + this.markerDepth = markerDepth; + } + + public String getInstallationDept() { + return this.installationDept; + } + + public void setInstallationDept(String installationDept) { + this.installationDept = installationDept; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return this.remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getUnderlyingPipelineType() { + return this.underlyingPipelineType; + } + + public void setUnderlyingPipelineType(String underlyingPipelineType) { + this.underlyingPipelineType = underlyingPipelineType; + } + + public String getUnderlyingPipelineDepth() { + return this.underlyingPipelineDepth; + } + + public void setUnderlyingPipelineDepth(String underlyingPipelineDepth) { + this.underlyingPipelineDepth = underlyingPipelineDepth; + } + + public String getUnderlyingPipelineDiameter() { + return this.underlyingPipelineDiameter; + } + + public void setUnderlyingPipelineDiameter(String underlyingPipelineDiameter) { + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + } + + public String getUnderlyingPipelineMaterial() { + return this.underlyingPipelineMaterial; + } + + public void setUnderlyingPipelineMaterial(String underlyingPipelineMaterial) { + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + } + + public String getObjectType() { + return this.objectType; + } + + public void setObjectType(String objectType) { + this.objectType = objectType; + } + + public String getColor() { + return this.color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getImagePath() { + return this.imagePath; + } + + public void setImagePath(String imagePath) { + this.imagePath = imagePath; + } +} diff --git a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java index ec4425f..45e25e6 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java @@ -24,7 +24,7 @@ * Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - LabelBeanDao.createTable(db, ifNotExists); + MarkerLocalBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); @@ -34,7 +34,7 @@ * Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - LabelBeanDao.dropTable(db, ifExists); + MarkerLocalBeanDao.dropTable(db, ifExists); PipeLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); TaskMarkerLocalBeanDao.dropTable(db, ifExists); @@ -56,7 +56,7 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(LabelBeanDao.class); + registerDaoClass(MarkerLocalBeanDao.class); registerDaoClass(PipeLocalBeanDao.class); registerDaoClass(TaskLocalBeanDao.class); registerDaoClass(TaskMarkerLocalBeanDao.class); diff --git a/app/src/main/java/com/casic/detector/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/greendao/DaoSession.java index 4f9bdff..0d0d59f 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoSession.java @@ -1,6 +1,6 @@ package com.casic.detector.greendao; -import com.casic.detector.bean.LabelBean; +import com.casic.detector.bean.MarkerLocalBean; import com.casic.detector.bean.PipeLocalBean; import com.casic.detector.bean.TaskLocalBean; import com.casic.detector.bean.TaskMarkerLocalBean; @@ -22,12 +22,12 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig labelBeanDaoConfig; + private final DaoConfig markerLocalBeanDaoConfig; private final DaoConfig pipeLocalBeanDaoConfig; private final DaoConfig taskLocalBeanDaoConfig; private final DaoConfig taskMarkerLocalBeanDaoConfig; - private final LabelBeanDao labelBeanDao; + private final MarkerLocalBeanDao markerLocalBeanDao; private final PipeLocalBeanDao pipeLocalBeanDao; private final TaskLocalBeanDao taskLocalBeanDao; private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao; @@ -36,8 +36,8 @@ daoConfigMap) { super(db); - labelBeanDaoConfig = daoConfigMap.get(LabelBeanDao.class).clone(); - labelBeanDaoConfig.initIdentityScope(type); + markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone(); + markerLocalBeanDaoConfig.initIdentityScope(type); pipeLocalBeanDaoConfig = daoConfigMap.get(PipeLocalBeanDao.class).clone(); pipeLocalBeanDaoConfig.initIdentityScope(type); @@ -48,26 +48,26 @@ taskMarkerLocalBeanDaoConfig = daoConfigMap.get(TaskMarkerLocalBeanDao.class).clone(); taskMarkerLocalBeanDaoConfig.initIdentityScope(type); - labelBeanDao = new LabelBeanDao(labelBeanDaoConfig, this); + markerLocalBeanDao = new MarkerLocalBeanDao(markerLocalBeanDaoConfig, this); pipeLocalBeanDao = new PipeLocalBeanDao(pipeLocalBeanDaoConfig, this); taskLocalBeanDao = new TaskLocalBeanDao(taskLocalBeanDaoConfig, this); taskMarkerLocalBeanDao = new TaskMarkerLocalBeanDao(taskMarkerLocalBeanDaoConfig, this); - registerDao(LabelBean.class, labelBeanDao); + registerDao(MarkerLocalBean.class, markerLocalBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); registerDao(TaskLocalBean.class, taskLocalBeanDao); registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao); } public void clear() { - labelBeanDaoConfig.clearIdentityScope(); + markerLocalBeanDaoConfig.clearIdentityScope(); pipeLocalBeanDaoConfig.clearIdentityScope(); taskLocalBeanDaoConfig.clearIdentityScope(); taskMarkerLocalBeanDaoConfig.clearIdentityScope(); } - public LabelBeanDao getLabelBeanDao() { - return labelBeanDao; + public MarkerLocalBeanDao getMarkerLocalBeanDao() { + return markerLocalBeanDao; } public PipeLocalBeanDao getPipeLocalBeanDao() { diff --git a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java b/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java deleted file mode 100644 index 94a73c4..0000000 --- a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java +++ /dev/null @@ -1,484 +0,0 @@ -package com.casic.detector.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import com.casic.detector.bean.LabelBean; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; -import org.greenrobot.greendao.internal.DaoConfig; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** - * DAO for table "LABEL_BEAN". - */ -public class LabelBeanDao extends AbstractDao { - - public static final String TABLENAME = "LABEL_BEAN"; - - /** - * Properties of entity LabelBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ObjectType = new Property(1, String.class, "objectType", false, "OBJECT_TYPE"); - public final static Property PipelineType = new Property(2, String.class, "pipelineType", false, "PIPELINE_TYPE"); - public final static Property PipelineMaterial = new Property(3, String.class, "pipelineMaterial", false, "PIPELINE_MATERIAL"); - public final static Property PipelineDiameter = new Property(4, String.class, "pipelineDiameter", false, "PIPELINE_DIAMETER"); - public final static Property BuryDeep = new Property(5, String.class, "buryDeep", false, "BURY_DEEP"); - public final static Property LowerType = new Property(6, String.class, "lowerType", false, "LOWER_TYPE"); - public final static Property LowerMaterial = new Property(7, String.class, "lowerMaterial", false, "LOWER_MATERIAL"); - public final static Property LowerDiameter = new Property(8, String.class, "lowerDiameter", false, "LOWER_DIAMETER"); - public final static Property LowerDeep = new Property(9, String.class, "lowerDeep", false, "LOWER_DEEP"); - public final static Property BuryMethod = new Property(10, String.class, "buryMethod", false, "BURY_METHOD"); - public final static Property Area = new Property(11, String.class, "area", false, "AREA"); - public final static Property Line = new Property(12, String.class, "line", false, "LINE"); - public final static Property Road = new Property(13, String.class, "road", false, "ROAD"); - public final static Property ConstructTime = new Property(14, String.class, "constructTime", false, "CONSTRUCT_TIME"); - public final static Property Owner = new Property(15, String.class, "owner", false, "OWNER"); - public final static Property ObjectId = new Property(16, String.class, "objectId", false, "OBJECT_ID"); - public final static Property IdentifierId = new Property(17, String.class, "identifierId", false, "IDENTIFIER_ID"); - public final static Property IdentifierType = new Property(18, String.class, "identifierType", false, "IDENTIFIER_TYPE"); - public final static Property IdentifierDeep = new Property(19, String.class, "identifierDeep", false, "IDENTIFIER_DEEP"); - public final static Property Person = new Property(20, String.class, "person", false, "PERSON"); - public final static Property InstallTime = new Property(21, String.class, "installTime", false, "INSTALL_TIME"); - public final static Property Lng = new Property(22, String.class, "lng", false, "LNG"); - public final static Property Lat = new Property(23, String.class, "lat", false, "LAT"); - public final static Property Color = new Property(24, String.class, "color", false, "COLOR"); - public final static Property Remark = new Property(25, String.class, "remark", false, "REMARK"); - public final static Property ImagePath = new Property(26, String.class, "imagePath", false, "IMAGE_PATH"); - } - - - public LabelBeanDao(DaoConfig config) { - super(config); - } - - public LabelBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** - * Creates the underlying database table. - */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; - db.execSQL("CREATE TABLE " + constraint + "\"LABEL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"OBJECT_TYPE\" TEXT," + // 1: objectType - "\"PIPELINE_TYPE\" TEXT," + // 2: pipelineType - "\"PIPELINE_MATERIAL\" TEXT," + // 3: pipelineMaterial - "\"PIPELINE_DIAMETER\" TEXT," + // 4: pipelineDiameter - "\"BURY_DEEP\" TEXT," + // 5: buryDeep - "\"LOWER_TYPE\" TEXT," + // 6: lowerType - "\"LOWER_MATERIAL\" TEXT," + // 7: lowerMaterial - "\"LOWER_DIAMETER\" TEXT," + // 8: lowerDiameter - "\"LOWER_DEEP\" TEXT," + // 9: lowerDeep - "\"BURY_METHOD\" TEXT," + // 10: buryMethod - "\"AREA\" TEXT," + // 11: area - "\"LINE\" TEXT," + // 12: line - "\"ROAD\" TEXT," + // 13: road - "\"CONSTRUCT_TIME\" TEXT," + // 14: constructTime - "\"OWNER\" TEXT," + // 15: owner - "\"OBJECT_ID\" TEXT," + // 16: objectId - "\"IDENTIFIER_ID\" TEXT," + // 17: identifierId - "\"IDENTIFIER_TYPE\" TEXT," + // 18: identifierType - "\"IDENTIFIER_DEEP\" TEXT," + // 19: identifierDeep - "\"PERSON\" TEXT," + // 20: person - "\"INSTALL_TIME\" TEXT," + // 21: installTime - "\"LNG\" TEXT," + // 22: lng - "\"LAT\" TEXT," + // 23: lat - "\"COLOR\" TEXT," + // 24: color - "\"REMARK\" TEXT," + // 25: remark - "\"IMAGE_PATH\" TEXT);"); // 26: imagePath - } - - /** - * Drops the underlying database table. - */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LABEL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, LabelBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String objectType = entity.getObjectType(); - if (objectType != null) { - stmt.bindString(2, objectType); - } - - String pipelineType = entity.getPipelineType(); - if (pipelineType != null) { - stmt.bindString(3, pipelineType); - } - - String pipelineMaterial = entity.getPipelineMaterial(); - if (pipelineMaterial != null) { - stmt.bindString(4, pipelineMaterial); - } - - String pipelineDiameter = entity.getPipelineDiameter(); - if (pipelineDiameter != null) { - stmt.bindString(5, pipelineDiameter); - } - - String buryDeep = entity.getBuryDeep(); - if (buryDeep != null) { - stmt.bindString(6, buryDeep); - } - - String lowerType = entity.getLowerType(); - if (lowerType != null) { - stmt.bindString(7, lowerType); - } - - String lowerMaterial = entity.getLowerMaterial(); - if (lowerMaterial != null) { - stmt.bindString(8, lowerMaterial); - } - - String lowerDiameter = entity.getLowerDiameter(); - if (lowerDiameter != null) { - stmt.bindString(9, lowerDiameter); - } - - String lowerDeep = entity.getLowerDeep(); - if (lowerDeep != null) { - stmt.bindString(10, lowerDeep); - } - - String buryMethod = entity.getBuryMethod(); - if (buryMethod != null) { - stmt.bindString(11, buryMethod); - } - - String area = entity.getArea(); - if (area != null) { - stmt.bindString(12, area); - } - - String line = entity.getLine(); - if (line != null) { - stmt.bindString(13, line); - } - - String road = entity.getRoad(); - if (road != null) { - stmt.bindString(14, road); - } - - String constructTime = entity.getConstructTime(); - if (constructTime != null) { - stmt.bindString(15, constructTime); - } - - String owner = entity.getOwner(); - if (owner != null) { - stmt.bindString(16, owner); - } - - String objectId = entity.getObjectId(); - if (objectId != null) { - stmt.bindString(17, objectId); - } - - String identifierId = entity.getIdentifierId(); - if (identifierId != null) { - stmt.bindString(18, identifierId); - } - - String identifierType = entity.getIdentifierType(); - if (identifierType != null) { - stmt.bindString(19, identifierType); - } - - String identifierDeep = entity.getIdentifierDeep(); - if (identifierDeep != null) { - stmt.bindString(20, identifierDeep); - } - - String person = entity.getPerson(); - if (person != null) { - stmt.bindString(21, person); - } - - String installTime = entity.getInstallTime(); - if (installTime != null) { - stmt.bindString(22, installTime); - } - - String lng = entity.getLng(); - if (lng != null) { - stmt.bindString(23, lng); - } - - String lat = entity.getLat(); - if (lat != null) { - stmt.bindString(24, lat); - } - - String color = entity.getColor(); - if (color != null) { - stmt.bindString(25, color); - } - - String remark = entity.getRemark(); - if (remark != null) { - stmt.bindString(26, remark); - } - - String imagePath = entity.getImagePath(); - if (imagePath != null) { - stmt.bindString(27, imagePath); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, LabelBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String objectType = entity.getObjectType(); - if (objectType != null) { - stmt.bindString(2, objectType); - } - - String pipelineType = entity.getPipelineType(); - if (pipelineType != null) { - stmt.bindString(3, pipelineType); - } - - String pipelineMaterial = entity.getPipelineMaterial(); - if (pipelineMaterial != null) { - stmt.bindString(4, pipelineMaterial); - } - - String pipelineDiameter = entity.getPipelineDiameter(); - if (pipelineDiameter != null) { - stmt.bindString(5, pipelineDiameter); - } - - String buryDeep = entity.getBuryDeep(); - if (buryDeep != null) { - stmt.bindString(6, buryDeep); - } - - String lowerType = entity.getLowerType(); - if (lowerType != null) { - stmt.bindString(7, lowerType); - } - - String lowerMaterial = entity.getLowerMaterial(); - if (lowerMaterial != null) { - stmt.bindString(8, lowerMaterial); - } - - String lowerDiameter = entity.getLowerDiameter(); - if (lowerDiameter != null) { - stmt.bindString(9, lowerDiameter); - } - - String lowerDeep = entity.getLowerDeep(); - if (lowerDeep != null) { - stmt.bindString(10, lowerDeep); - } - - String buryMethod = entity.getBuryMethod(); - if (buryMethod != null) { - stmt.bindString(11, buryMethod); - } - - String area = entity.getArea(); - if (area != null) { - stmt.bindString(12, area); - } - - String line = entity.getLine(); - if (line != null) { - stmt.bindString(13, line); - } - - String road = entity.getRoad(); - if (road != null) { - stmt.bindString(14, road); - } - - String constructTime = entity.getConstructTime(); - if (constructTime != null) { - stmt.bindString(15, constructTime); - } - - String owner = entity.getOwner(); - if (owner != null) { - stmt.bindString(16, owner); - } - - String objectId = entity.getObjectId(); - if (objectId != null) { - stmt.bindString(17, objectId); - } - - String identifierId = entity.getIdentifierId(); - if (identifierId != null) { - stmt.bindString(18, identifierId); - } - - String identifierType = entity.getIdentifierType(); - if (identifierType != null) { - stmt.bindString(19, identifierType); - } - - String identifierDeep = entity.getIdentifierDeep(); - if (identifierDeep != null) { - stmt.bindString(20, identifierDeep); - } - - String person = entity.getPerson(); - if (person != null) { - stmt.bindString(21, person); - } - - String installTime = entity.getInstallTime(); - if (installTime != null) { - stmt.bindString(22, installTime); - } - - String lng = entity.getLng(); - if (lng != null) { - stmt.bindString(23, lng); - } - - String lat = entity.getLat(); - if (lat != null) { - stmt.bindString(24, lat); - } - - String color = entity.getColor(); - if (color != null) { - stmt.bindString(25, color); - } - - String remark = entity.getRemark(); - if (remark != null) { - stmt.bindString(26, remark); - } - - String imagePath = entity.getImagePath(); - if (imagePath != null) { - stmt.bindString(27, imagePath); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public LabelBean readEntity(Cursor cursor, int offset) { - LabelBean entity = new LabelBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // objectType - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineType - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // pipelineDiameter - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDeep - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lowerType - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lowerMaterial - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lowerDiameter - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // lowerDeep - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // buryMethod - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // area - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // line - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // road - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // constructTime - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // owner - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // objectId - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // identifierId - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // identifierType - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // identifierDeep - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // person - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // installTime - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // lng - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // lat - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // color - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // remark - cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, LabelBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setObjectType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setPipelineType(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setPipelineMaterial(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setPipelineDiameter(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setBuryDeep(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setLowerType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLowerMaterial(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLowerDiameter(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLowerDeep(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); - entity.setBuryMethod(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - entity.setArea(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - entity.setLine(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); - entity.setRoad(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); - entity.setConstructTime(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); - entity.setOwner(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); - entity.setObjectId(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); - entity.setIdentifierId(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); - entity.setIdentifierType(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18)); - entity.setIdentifierDeep(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19)); - entity.setPerson(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); - entity.setInstallTime(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); - entity.setLng(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22)); - entity.setLat(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); - entity.setColor(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); - entity.setRemark(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); - } - - @Override - protected final Long updateKeyAfterInsert(LabelBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(LabelBean entity) { - if (entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(LabelBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java new file mode 100644 index 0000000..18849f3 --- /dev/null +++ b/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java @@ -0,0 +1,484 @@ +package com.casic.detector.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import com.casic.detector.bean.MarkerLocalBean; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; +import org.greenrobot.greendao.internal.DaoConfig; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. + +/** + * DAO for table "MARKER_LOCAL_BEAN". + */ +public class MarkerLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "MARKER_LOCAL_BEAN"; + + /** + * Properties of entity MarkerLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property PipelineType = new Property(1, String.class, "pipelineType", false, "PIPELINE_TYPE"); + public final static Property PipelineDiameter = new Property(2, String.class, "pipelineDiameter", false, "PIPELINE_DIAMETER"); + public final static Property PipelineMaterial = new Property(3, String.class, "pipelineMaterial", false, "PIPELINE_MATERIAL"); + public final static Property BuryMethod = new Property(4, String.class, "buryMethod", false, "BURY_METHOD"); + public final static Property BuryDepth = new Property(5, String.class, "buryDepth", false, "BURY_DEPTH"); + public final static Property Area = new Property(6, String.class, "area", false, "AREA"); + public final static Property Line = new Property(7, String.class, "line", false, "LINE"); + public final static Property Road = new Property(8, String.class, "road", false, "ROAD"); + public final static Property ConstructTime = new Property(9, String.class, "constructTime", false, "CONSTRUCT_TIME"); + public final static Property Owner = new Property(10, String.class, "owner", false, "OWNER"); + public final static Property ObjectId = new Property(11, String.class, "objectId", false, "OBJECT_ID"); + public final static Property MarkerId = new Property(12, String.class, "markerId", false, "MARKER_ID"); + public final static Property MarkerType = new Property(13, String.class, "markerType", false, "MARKER_TYPE"); + public final static Property MarkerDepth = new Property(14, String.class, "markerDepth", false, "MARKER_DEPTH"); + public final static Property InstallationDept = new Property(15, String.class, "installationDept", false, "INSTALLATION_DEPT"); + public final static Property Lng = new Property(16, String.class, "lng", false, "LNG"); + public final static Property Lat = new Property(17, String.class, "lat", false, "LAT"); + public final static Property UpdateTime = new Property(18, String.class, "updateTime", false, "UPDATE_TIME"); + public final static Property Remark = new Property(19, String.class, "remark", false, "REMARK"); + public final static Property UnderlyingPipelineType = new Property(20, String.class, "underlyingPipelineType", false, "UNDERLYING_PIPELINE_TYPE"); + public final static Property UnderlyingPipelineDepth = new Property(21, String.class, "underlyingPipelineDepth", false, "UNDERLYING_PIPELINE_DEPTH"); + public final static Property UnderlyingPipelineDiameter = new Property(22, String.class, "underlyingPipelineDiameter", false, "UNDERLYING_PIPELINE_DIAMETER"); + public final static Property UnderlyingPipelineMaterial = new Property(23, String.class, "underlyingPipelineMaterial", false, "UNDERLYING_PIPELINE_MATERIAL"); + public final static Property ObjectType = new Property(24, String.class, "objectType", false, "OBJECT_TYPE"); + public final static Property Color = new Property(25, String.class, "color", false, "COLOR"); + public final static Property ImagePath = new Property(26, String.class, "imagePath", false, "IMAGE_PATH"); + } + + + public MarkerLocalBeanDao(DaoConfig config) { + super(config); + } + + public MarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** + * Creates the underlying database table. + */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + db.execSQL("CREATE TABLE " + constraint + "\"MARKER_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"PIPELINE_TYPE\" TEXT," + // 1: pipelineType + "\"PIPELINE_DIAMETER\" TEXT," + // 2: pipelineDiameter + "\"PIPELINE_MATERIAL\" TEXT," + // 3: pipelineMaterial + "\"BURY_METHOD\" TEXT," + // 4: buryMethod + "\"BURY_DEPTH\" TEXT," + // 5: buryDepth + "\"AREA\" TEXT," + // 6: area + "\"LINE\" TEXT," + // 7: line + "\"ROAD\" TEXT," + // 8: road + "\"CONSTRUCT_TIME\" TEXT," + // 9: constructTime + "\"OWNER\" TEXT," + // 10: owner + "\"OBJECT_ID\" TEXT," + // 11: objectId + "\"MARKER_ID\" TEXT," + // 12: markerId + "\"MARKER_TYPE\" TEXT," + // 13: markerType + "\"MARKER_DEPTH\" TEXT," + // 14: markerDepth + "\"INSTALLATION_DEPT\" TEXT," + // 15: installationDept + "\"LNG\" TEXT," + // 16: lng + "\"LAT\" TEXT," + // 17: lat + "\"UPDATE_TIME\" TEXT," + // 18: updateTime + "\"REMARK\" TEXT," + // 19: remark + "\"UNDERLYING_PIPELINE_TYPE\" TEXT," + // 20: underlyingPipelineType + "\"UNDERLYING_PIPELINE_DEPTH\" TEXT," + // 21: underlyingPipelineDepth + "\"UNDERLYING_PIPELINE_DIAMETER\" TEXT," + // 22: underlyingPipelineDiameter + "\"UNDERLYING_PIPELINE_MATERIAL\" TEXT," + // 23: underlyingPipelineMaterial + "\"OBJECT_TYPE\" TEXT," + // 24: objectType + "\"COLOR\" TEXT," + // 25: color + "\"IMAGE_PATH\" TEXT);"); // 26: imagePath + } + + /** + * Drops the underlying database table. + */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MARKER_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MarkerLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String pipelineType = entity.getPipelineType(); + if (pipelineType != null) { + stmt.bindString(2, pipelineType); + } + + String pipelineDiameter = entity.getPipelineDiameter(); + if (pipelineDiameter != null) { + stmt.bindString(3, pipelineDiameter); + } + + String pipelineMaterial = entity.getPipelineMaterial(); + if (pipelineMaterial != null) { + stmt.bindString(4, pipelineMaterial); + } + + String buryMethod = entity.getBuryMethod(); + if (buryMethod != null) { + stmt.bindString(5, buryMethod); + } + + String buryDepth = entity.getBuryDepth(); + if (buryDepth != null) { + stmt.bindString(6, buryDepth); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(7, area); + } + + String line = entity.getLine(); + if (line != null) { + stmt.bindString(8, line); + } + + String road = entity.getRoad(); + if (road != null) { + stmt.bindString(9, road); + } + + String constructTime = entity.getConstructTime(); + if (constructTime != null) { + stmt.bindString(10, constructTime); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(11, owner); + } + + String objectId = entity.getObjectId(); + if (objectId != null) { + stmt.bindString(12, objectId); + } + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(13, markerId); + } + + String markerType = entity.getMarkerType(); + if (markerType != null) { + stmt.bindString(14, markerType); + } + + String markerDepth = entity.getMarkerDepth(); + if (markerDepth != null) { + stmt.bindString(15, markerDepth); + } + + String installationDept = entity.getInstallationDept(); + if (installationDept != null) { + stmt.bindString(16, installationDept); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(17, lng); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(18, lat); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(19, updateTime); + } + + String remark = entity.getRemark(); + if (remark != null) { + stmt.bindString(20, remark); + } + + String underlyingPipelineType = entity.getUnderlyingPipelineType(); + if (underlyingPipelineType != null) { + stmt.bindString(21, underlyingPipelineType); + } + + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); + if (underlyingPipelineDepth != null) { + stmt.bindString(22, underlyingPipelineDepth); + } + + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); + if (underlyingPipelineDiameter != null) { + stmt.bindString(23, underlyingPipelineDiameter); + } + + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); + if (underlyingPipelineMaterial != null) { + stmt.bindString(24, underlyingPipelineMaterial); + } + + String objectType = entity.getObjectType(); + if (objectType != null) { + stmt.bindString(25, objectType); + } + + String color = entity.getColor(); + if (color != null) { + stmt.bindString(26, color); + } + + String imagePath = entity.getImagePath(); + if (imagePath != null) { + stmt.bindString(27, imagePath); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MarkerLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String pipelineType = entity.getPipelineType(); + if (pipelineType != null) { + stmt.bindString(2, pipelineType); + } + + String pipelineDiameter = entity.getPipelineDiameter(); + if (pipelineDiameter != null) { + stmt.bindString(3, pipelineDiameter); + } + + String pipelineMaterial = entity.getPipelineMaterial(); + if (pipelineMaterial != null) { + stmt.bindString(4, pipelineMaterial); + } + + String buryMethod = entity.getBuryMethod(); + if (buryMethod != null) { + stmt.bindString(5, buryMethod); + } + + String buryDepth = entity.getBuryDepth(); + if (buryDepth != null) { + stmt.bindString(6, buryDepth); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(7, area); + } + + String line = entity.getLine(); + if (line != null) { + stmt.bindString(8, line); + } + + String road = entity.getRoad(); + if (road != null) { + stmt.bindString(9, road); + } + + String constructTime = entity.getConstructTime(); + if (constructTime != null) { + stmt.bindString(10, constructTime); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(11, owner); + } + + String objectId = entity.getObjectId(); + if (objectId != null) { + stmt.bindString(12, objectId); + } + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(13, markerId); + } + + String markerType = entity.getMarkerType(); + if (markerType != null) { + stmt.bindString(14, markerType); + } + + String markerDepth = entity.getMarkerDepth(); + if (markerDepth != null) { + stmt.bindString(15, markerDepth); + } + + String installationDept = entity.getInstallationDept(); + if (installationDept != null) { + stmt.bindString(16, installationDept); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(17, lng); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(18, lat); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(19, updateTime); + } + + String remark = entity.getRemark(); + if (remark != null) { + stmt.bindString(20, remark); + } + + String underlyingPipelineType = entity.getUnderlyingPipelineType(); + if (underlyingPipelineType != null) { + stmt.bindString(21, underlyingPipelineType); + } + + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); + if (underlyingPipelineDepth != null) { + stmt.bindString(22, underlyingPipelineDepth); + } + + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); + if (underlyingPipelineDiameter != null) { + stmt.bindString(23, underlyingPipelineDiameter); + } + + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); + if (underlyingPipelineMaterial != null) { + stmt.bindString(24, underlyingPipelineMaterial); + } + + String objectType = entity.getObjectType(); + if (objectType != null) { + stmt.bindString(25, objectType); + } + + String color = entity.getColor(); + if (color != null) { + stmt.bindString(26, color); + } + + String imagePath = entity.getImagePath(); + if (imagePath != null) { + stmt.bindString(27, imagePath); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MarkerLocalBean readEntity(Cursor cursor, int offset) { + MarkerLocalBean entity = new MarkerLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color + cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MarkerLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setPipelineType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setPipelineDiameter(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setPipelineMaterial(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setBuryMethod(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setBuryDepth(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setArea(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLine(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setRoad(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setConstructTime(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setOwner(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setObjectId(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setMarkerId(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setMarkerType(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setMarkerDepth(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setInstallationDept(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setLng(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setLat(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + entity.setUpdateTime(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18)); + entity.setRemark(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19)); + entity.setUnderlyingPipelineType(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); + entity.setUnderlyingPipelineDepth(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); + entity.setUnderlyingPipelineDiameter(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22)); + entity.setUnderlyingPipelineMaterial(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); + entity.setObjectType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); + entity.setColor(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); + entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); + } + + @Override + protected final Long updateKeyAfterInsert(MarkerLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MarkerLocalBean entity) { + if (entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MarkerLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/detector/utils/ExcelHub.kt b/app/src/main/java/com/casic/detector/utils/ExcelHub.kt index a3c1355..5e12e0b 100644 --- a/app/src/main/java/com/casic/detector/utils/ExcelHub.kt +++ b/app/src/main/java/com/casic/detector/utils/ExcelHub.kt @@ -1,59 +1,51 @@ package com.casic.detector.utils -import android.content.Context -import com.casic.detector.bean.LabelBean -import com.pengxh.kt.lite.extensions.show +import com.casic.detector.bean.MarkerLocalBean import jxl.Workbook import jxl.read.biff.BiffException import java.io.File object ExcelHub { - fun read(context: Context, filePath: String?): ArrayList { - val result = ArrayList() - - if (filePath.isNullOrBlank()) { - return result - } - + fun read(filePath: String): ArrayList { + val result = ArrayList() try { val workbook = Workbook.getWorkbook(File(filePath)) val sheet = workbook.getSheet(0) for (i in 1 until sheet.rows) { - val labelBean = LabelBean() - labelBean.pipelineType = sheet.getCell(0, i).contents - labelBean.pipelineDiameter = sheet.getCell(1, i).contents - labelBean.pipelineMaterial = sheet.getCell(2, i).contents - labelBean.buryMethod = sheet.getCell(3, i).contents - labelBean.buryDeep = sheet.getCell(4, i).contents - labelBean.area = sheet.getCell(5, i).contents - labelBean.line = sheet.getCell(6, i).contents - labelBean.road = sheet.getCell(7, i).contents - labelBean.constructTime = sheet.getCell(8, i).contents - labelBean.owner = sheet.getCell(9, i).contents - labelBean.objectId = sheet.getCell(10, i).contents - labelBean.identifierId = sheet.getCell(11, i).contents - labelBean.identifierType = sheet.getCell(12, i).contents - labelBean.identifierDeep = sheet.getCell(13, i).contents - labelBean.person = sheet.getCell(14, i).contents - labelBean.lng = sheet.getCell(15, i).contents - labelBean.lat = sheet.getCell(16, i).contents - labelBean.installTime = sheet.getCell(17, i).contents - labelBean.remark = sheet.getCell(18, i).contents - labelBean.lowerType = sheet.getCell(19, i).contents - labelBean.lowerDeep = sheet.getCell(20, i).contents - labelBean.lowerDiameter = sheet.getCell(21, i).contents - labelBean.lowerMaterial = sheet.getCell(22, i).contents - labelBean.objectType = sheet.getCell(23, i).contents - labelBean.color = sheet.getCell(24, i).contents - labelBean.imagePath = sheet.getCell(25, i).contents + val marker = MarkerLocalBean() + marker.pipelineType = sheet.getCell(0, i).contents + marker.pipelineDiameter = sheet.getCell(1, i).contents + marker.pipelineMaterial = sheet.getCell(2, i).contents + marker.buryMethod = sheet.getCell(3, i).contents + marker.buryDepth = sheet.getCell(4, i).contents + marker.area = sheet.getCell(5, i).contents + marker.line = sheet.getCell(6, i).contents + marker.road = sheet.getCell(7, i).contents + marker.constructTime = sheet.getCell(8, i).contents + marker.owner = sheet.getCell(9, i).contents + marker.objectId = sheet.getCell(10, i).contents + marker.markerId = sheet.getCell(11, i).contents + marker.markerType = sheet.getCell(12, i).contents + marker.markerDepth = sheet.getCell(13, i).contents + marker.installationDept = sheet.getCell(14, i).contents + marker.lng = sheet.getCell(15, i).contents + marker.lat = sheet.getCell(16, i).contents + marker.updateTime = sheet.getCell(17, i).contents + marker.remark = sheet.getCell(18, i).contents + marker.underlyingPipelineType = sheet.getCell(19, i).contents + marker.underlyingPipelineDepth = sheet.getCell(20, i).contents + marker.underlyingPipelineDiameter = sheet.getCell(21, i).contents + marker.underlyingPipelineMaterial = sheet.getCell(22, i).contents + marker.objectType = sheet.getCell(23, i).contents + marker.color = sheet.getCell(24, i).contents + marker.imagePath = sheet.getCell(25, i).contents - result.add(labelBean) + result.add(marker) } workbook.close() } catch (e: BiffException) { e.printStackTrace() - e.localizedMessage?.show(context) } return result } diff --git a/app/src/main/java/com/casic/detector/view/LoginActivity.kt b/app/src/main/java/com/casic/detector/view/LoginActivity.kt index 3eea0c5..73849b9 100644 --- a/app/src/main/java/com/casic/detector/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/detector/view/LoginActivity.kt @@ -2,26 +2,18 @@ import android.os.Bundle import androidx.lifecycle.ViewModelProvider -import androidx.lifecycle.lifecycleScope -import com.amap.api.maps.CoordinateConverter import com.amap.api.navi.NaviSetting import com.casic.detector.databinding.ActivityLoginBinding -import com.casic.detector.model.PipelineModel -import com.casic.detector.utils.DataBaseManager import com.casic.detector.utils.LocaleConstant import com.casic.detector.vm.UserViewModel import com.google.gson.Gson -import com.google.gson.reflect.TypeToken import com.gyf.immersionbar.ImmersionBar import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.extensions.navigatePageTo -import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.utils.LoadState import com.pengxh.kt.lite.utils.LoadingDialogHub import com.pengxh.kt.lite.utils.SaveKeyValues import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch class LoginActivity : KotlinBaseActivity() { @@ -51,31 +43,31 @@ } } - lifecycleScope.launch(Dispatchers.IO) { - //获取管线数据。本地文件 - val pipeline = readAssetsFile("pipeline.json") - val lineResult = gson.fromJson( - pipeline, object : TypeToken() {}.type - ) - //缓存Pipe到本地 - lineResult.data.forEach { dot -> - val startLat = dot.startLatitudeGd - val startLng = dot.startLongitudeGd - val endLat = dot.endLatitudeGd - val endLng = dot.endLongitudeGd - if (!startLat.isNullOrBlank() && !startLng.isNullOrBlank() && !endLat.isNullOrBlank() && !endLng.isNullOrBlank()) { - if (CoordinateConverter.isAMapDataAvailable( - startLat.toDouble(), startLng.toDouble() - ) && - CoordinateConverter.isAMapDataAvailable( - endLat.toDouble(), endLng.toDouble() - ) - ) { - DataBaseManager.get.insertMapPipeCache(dot) - } - } - } - } +// lifecycleScope.launch(Dispatchers.IO) { +// //获取管线数据。本地文件 +// val pipeline = readAssetsFile("pipeline.json") +// val lineResult = gson.fromJson( +// pipeline, object : TypeToken() {}.type +// ) +// //缓存Pipe到本地 +// lineResult.data.forEach { dot -> +// val startLat = dot.startLatitudeGd +// val startLng = dot.startLongitudeGd +// val endLat = dot.endLatitudeGd +// val endLng = dot.endLongitudeGd +// if (!startLat.isNullOrBlank() && !startLng.isNullOrBlank() && !endLat.isNullOrBlank() && !endLng.isNullOrBlank()) { +// if (CoordinateConverter.isAMapDataAvailable( +// startLat.toDouble(), startLng.toDouble() +// ) && +// CoordinateConverter.isAMapDataAvailable( +// endLat.toDouble(), endLng.toDouble() +// ) +// ) { +// DataBaseManager.get.insertMapPipeCache(dot) +// } +// } +// } +// } } override fun initEvent() { diff --git a/app/src/main/java/com/casic/detector/view/MainActivity.kt b/app/src/main/java/com/casic/detector/view/MainActivity.kt index 22de557..6980416 100644 --- a/app/src/main/java/com/casic/detector/view/MainActivity.kt +++ b/app/src/main/java/com/casic/detector/view/MainActivity.kt @@ -38,7 +38,7 @@ import com.casic.detector.R import com.casic.detector.adapter.EditableImageAdapter import com.casic.detector.base.SerialPortActivity -import com.casic.detector.bean.LabelBean +import com.casic.detector.bean.MarkerLocalBean import com.casic.detector.bean.TaskMarkerLocalBean import com.casic.detector.callback.OnGetLocationListener import com.casic.detector.callback.OnImageCompressListener @@ -77,7 +77,6 @@ import com.casic.detector.widgets.RadarScanView import com.casic.detector.widgets.SamplePopupWindow import com.google.gson.Gson -import com.google.gson.reflect.TypeToken import com.luck.picture.lib.basic.PictureSelector import com.luck.picture.lib.config.SelectMimeType import com.luck.picture.lib.entity.LocalMedia @@ -132,7 +131,7 @@ private val rotationMatrix = FloatArray(9)//旋转矩阵缓存 private val valueArray = FloatArray(3)//方位角数值 private var clickTime: Long = 0 - private var labelBeans = ArrayList() + private var markers = ArrayList() private var clusterOverlay: ClusterOverlay? = null private var latitude: Double = 0.0 private var longitude: Double = 0.0 @@ -191,7 +190,7 @@ taskViewModel.markerFileResult.observe(this) { if (it.isSuccess) { //清空之前的数据 - DataBaseManager.get.clearTaskLabels() + DataBaseManager.get.clearMarkers() //下载最新的数据 val companyId = SaveKeyValues.getValue(LocaleConstant.USER_COMPANY_ID, "") val downloadUrl = companyId.toString().appendDownloadUrl(FileType.EXCEL) @@ -201,10 +200,10 @@ .setOnFileDownloadListener(object : FileDownloadManager.OnFileDownloadListener { override fun onDownloadEnd(file: File) { lifecycleScope.launch(Dispatchers.Main) { - labelBeans = ExcelHub.read(context, file.absolutePath) withContext(Dispatchers.IO) { - labelBeans.forEach { label -> - DataBaseManager.get.insertTaskLabel(label) + markers = ExcelHub.read(file.absolutePath) + markers.forEach { marker -> + DataBaseManager.get.saveMarkerInLocale(marker) } } LoadingDialogHub.dismiss() @@ -311,8 +310,9 @@ } else { lifecycleScope.launch(Dispatchers.Main) { val labels = withContext(Dispatchers.IO) { - DataBaseManager.get.queryLabelById("0") + DataBaseManager.get.queryMarkerByState("0") } + //如果有需要补全的标识器,Popup右侧会有小圆点提示 if (labels.isNotEmpty()) { samplePopupWindow.setShowPosition(4) } @@ -331,7 +331,7 @@ 1 -> downloadTask() 2 -> navigatePageTo() 3 -> uploadEvent() - 4 -> uploadLabel() + 4 -> completionMarker() } } }) @@ -364,20 +364,20 @@ override fun onConfirmClick(selectedItem: String, value: String) { //查询数据库 lifecycleScope.launch(Dispatchers.Main) { - labelBeans = withContext(Dispatchers.IO) { - DataBaseManager.get.loadLabelByCondition( + markers = withContext(Dispatchers.IO) { + DataBaseManager.get.loadMarkersByCondition( selectedItem, value - ) as ArrayList + ) as ArrayList } - if (labelBeans.isEmpty()) { + if (markers.isEmpty()) { "无法查到相关数据信息,请检查您的查询条件".show(context) } else { val latitudeList = ArrayList() val longitudeList = ArrayList() - val latitude = labelBeans.first().lat - val longitude = labelBeans.first().lng + val latitude = markers.first().lat + val longitude = markers.first().lng if (latitude.isNotBlank() && longitude.isNotBlank()) { if (CoordinateConverter.isAMapDataAvailable( latitude.toDouble(), longitude.toDouble() @@ -591,7 +591,7 @@ //添加地图Marker if (!ids.contains(markerId)) { //根据markerId查询标识器经纬度 - val labels = DataBaseManager.get.queryLabelById(markerId) + val labels = DataBaseManager.get.queryMarkerById(markerId) if (labels.isNotEmpty()) { val bean = labels.first() aMap.addMarker( @@ -605,7 +605,7 @@ //显示标识器详细信息 if (!detailDialog.isShowing) { - val labelBean = DataBaseManager.get.queryLabelById(markerId).firstOrNull() + val labelBean = DataBaseManager.get.queryMarkerById(markerId).firstOrNull() if (labelBean == null) { "无法查询到此ID【${markerId}】的信息".show(context) } else { @@ -715,8 +715,8 @@ aMap.setOnMapLongClickListener { //协程异步显示默认数据 lifecycleScope.launch(Dispatchers.Main) { - labelBeans = withContext(Dispatchers.IO) { - DataBaseManager.get.loadTaskLabels() as ArrayList + markers = withContext(Dispatchers.IO) { + DataBaseManager.get.loadMarkers() as ArrayList } showLabelsOnMap() } @@ -760,7 +760,7 @@ clusterOverlay?.onDestroy() val clusterItems = ArrayList() - labelBeans.forEach { + markers.forEach { if (it.lat.isNotEmpty() && it.lng.isNotEmpty()) { val latitude = it.lat.toDouble() val longitude = it.lng.toDouble() @@ -848,7 +848,7 @@ } override fun onCancelClick() { - labelBeans.forEach { + markers.forEach { if (it.id.toString() == item.title) { navigatePageTo(it.toJson()) } @@ -973,48 +973,45 @@ } //标识器补全 - private fun uploadLabel() { + private fun completionMarker() { val companyId = SaveKeyValues.getValue(LocaleConstant.USER_COMPANY_ID, "") as String - val labelBeans = DataBaseManager.get.queryLabelById("0") - if (labelBeans.isNotEmpty()) { - LoadingDialogHub.show(this, "标识器补全中,请稍后...") - labelBeans.forEach { labelBean -> - val imagePaths = gson.fromJson>( - labelBean.imagePath, object : TypeToken>() {}.type - ) - - taskViewModel.installLabel( - this, - companyId, - labelBean.objectType, - labelBean.pipelineType, - labelBean.pipelineMaterial, - labelBean.pipelineDiameter, - labelBean.buryDeep, - labelBean.lowerType, - labelBean.lowerMaterial, - labelBean.lowerDiameter, - labelBean.lowerDeep, - labelBean.buryMethod, - labelBean.area, - labelBean.line, - labelBean.road, - labelBean.constructTime, - labelBean.owner, - labelBean.objectId, - labelBean.identifierId, - labelBean.identifierType, - labelBean.identifierDeep, - labelBean.person, - labelBean.installTime, - labelBean.lng, - labelBean.lat, - labelBean.color, - labelBean.remark, - imagePaths - ) - } - LoadingDialogHub.dismiss() + val markers = DataBaseManager.get.queryMarkerByState("0") + if (markers.isNotEmpty()) { + //TODO 逻辑没梳理明白 +// LoadingDialogHub.show(this, "标识器补全中,请稍后...") +// markers.forEach { marker -> +// taskViewModel.installLabel( +// this, +// companyId, +// labelBean.objectType, +// labelBean.pipelineType, +// labelBean.pipelineMaterial, +// labelBean.pipelineDiameter, +// labelBean.buryDeep, +// labelBean.lowerType, +// labelBean.lowerMaterial, +// labelBean.lowerDiameter, +// labelBean.lowerDeep, +// labelBean.buryMethod, +// labelBean.area, +// labelBean.line, +// labelBean.road, +// labelBean.constructTime, +// labelBean.owner, +// labelBean.objectId, +// labelBean.identifierId, +// labelBean.identifierType, +// labelBean.identifierDeep, +// labelBean.person, +// labelBean.installTime, +// labelBean.lng, +// labelBean.lat, +// labelBean.color, +// labelBean.remark, +// arrayListOf() +// ) +// } +// LoadingDialogHub.dismiss() } else { "没有需要补传的标识器!".show(this) } @@ -1072,8 +1069,8 @@ binding.mapView.onResume() //协程异步显示默认数据 lifecycleScope.launch(Dispatchers.Main) { - labelBeans = withContext(Dispatchers.IO) { - DataBaseManager.get.loadTaskLabels() as ArrayList + markers = withContext(Dispatchers.IO) { + DataBaseManager.get.loadMarkers() as ArrayList } showLabelsOnMap() } @@ -1499,45 +1496,45 @@ private fun saveLabelInLocal() { val objectId = SaveKeyValues.getValue(LocaleConstant.OBJECT_ID, "") as String - val labelBean = LabelBean() - labelBean.objectType = binding.objectInclude.objectTypeSpinner.selectedItem.toString() - labelBean.pipelineType = + val marker = MarkerLocalBean() + marker.objectType = binding.objectInclude.objectTypeSpinner.selectedItem.toString() + marker.pipelineType = binding.objectInclude.pipeInclude.markerObjectTypeView.text.toString() - labelBean.pipelineMaterial = + marker.pipelineMaterial = binding.objectInclude.pipeInclude.materialSpinner.selectedItem.toString() - labelBean.pipelineDiameter = + marker.pipelineDiameter = "${binding.objectInclude.pipeInclude.pipelineDiameterView.text}mm" - labelBean.buryDeep = "${binding.objectInclude.pipeInclude.buryDeepView.text}mm" - labelBean.lowerType = + marker.buryDepth = "${binding.objectInclude.pipeInclude.buryDeepView.text}mm" + marker.underlyingPipelineType = binding.objectInclude.pipeCrossInclude.bottomPipeTypeSpinner.selectedItem.toString() - labelBean.lowerMaterial = + marker.underlyingPipelineMaterial = binding.objectInclude.pipeCrossInclude.bottomPipeMaterialSpinner.selectedItem.toString() - labelBean.lowerDiameter = + marker.underlyingPipelineDiameter = "${binding.objectInclude.pipeCrossInclude.bottomPipeDiameterView.text}mm" - labelBean.lowerDeep = + marker.underlyingPipelineDepth = "${binding.objectInclude.pipeCrossInclude.bottomPointDeepView.text}mm" - labelBean.buryMethod = + marker.buryMethod = binding.objectInclude.pipeInclude.buryTypeSpinner.selectedItem.toString() - labelBean.area = binding.objectInclude.areaView.text.toString() - labelBean.line = binding.objectInclude.lineView.text.toString() - labelBean.road = binding.objectInclude.roadView.text.toString() - labelBean.constructTime = binding.objectInclude.constructDateView.text.toString() - labelBean.owner = binding.objectInclude.ownerView.text.toString() - labelBean.objectId = objectId - labelBean.identifierId = binding.identifierInclude.identifierIdView.text.toString() - labelBean.identifierType = + marker.area = binding.objectInclude.areaView.text.toString() + marker.line = binding.objectInclude.lineView.text.toString() + marker.road = binding.objectInclude.roadView.text.toString() + marker.constructTime = binding.objectInclude.constructDateView.text.toString() + marker.owner = binding.objectInclude.ownerView.text.toString() + marker.objectId = objectId + marker.markerId = binding.identifierInclude.identifierIdView.text.toString() + marker.markerType = binding.identifierInclude.identifierTypeSpinner.selectedItem.toString() - labelBean.identifierDeep = "${binding.identifierInclude.identifierDeepView.text}mm" - labelBean.person = binding.identifierInclude.personDeptView.text.toString() - labelBean.installTime = binding.identifierInclude.installTimeView.text.toString() - labelBean.lng = binding.identifierInclude.lngView.text.toString() - labelBean.lat = binding.identifierInclude.latView.text.toString() - labelBean.color = + marker.markerDepth = "${binding.identifierInclude.identifierDeepView.text}mm" + marker.installationDept = binding.identifierInclude.personDeptView.text.toString() + marker.updateTime = binding.identifierInclude.installTimeView.text.toString() + marker.lng = binding.identifierInclude.lngView.text.toString() + marker.lat = binding.identifierInclude.latView.text.toString() + marker.color = binding.identifierInclude.colorSpinner.selectedItem.toString().toColor() - labelBean.remark = binding.remarkView.text.toString() - labelBean.imagePath = realPaths.toJson() + marker.remark = binding.remarkView.text.toString() + marker.imagePath = realPaths.toJson() - DataBaseManager.get.insertTaskLabel(labelBean) + DataBaseManager.get.saveMarkerInLocale(marker) } private fun takePicture() { @@ -1599,9 +1596,9 @@ searchMarkerTimer.cancel() out.write('3'.code) - val result = DataBaseManager.get.queryLabelById(markerId) + val result = DataBaseManager.get.queryMarkerById(markerId) if (result.isNotEmpty()) { - val tag = when (result.first().identifierType) { + val tag = when (result.first().markerId) { "EM30" -> '7' "EM50" -> '8' "EM14" -> '9' @@ -1635,7 +1632,7 @@ binding.markerInfoButton.setOnClickListener { //查库 - val result = DataBaseManager.get.queryLabelById(markerId) + val result = DataBaseManager.get.queryMarkerById(markerId) if (result.isNotEmpty()) { context.navigatePageTo(result.first().toJson()) } else { @@ -1659,7 +1656,7 @@ private fun renderDataPoint(location: AMapLocation) { lifecycleScope.launch(Dispatchers.IO) { val dataPoints = ArrayList() - DataBaseManager.get.loadTaskLabels().forEach { + DataBaseManager.get.loadMarkers().forEach { //单位:米 val distance = AMapUtils.calculateLineDistance( LatLng(latitude, longitude), LatLng(it.lat.toDouble(), it.lng.toDouble()) diff --git a/app/src/main/java/com/casic/detector/view/ObjectDetailActivity.kt b/app/src/main/java/com/casic/detector/view/ObjectDetailActivity.kt index 3033db3..d19b1a1 100644 --- a/app/src/main/java/com/casic/detector/view/ObjectDetailActivity.kt +++ b/app/src/main/java/com/casic/detector/view/ObjectDetailActivity.kt @@ -5,7 +5,7 @@ import android.graphics.drawable.ColorDrawable import android.os.Bundle import android.view.Gravity -import com.casic.detector.bean.LabelBean +import com.casic.detector.bean.MarkerLocalBean import com.casic.detector.databinding.ActivityObjectDetailBinding import com.casic.detector.extensions.appendDownloadUrl import com.casic.detector.utils.FileType @@ -24,7 +24,7 @@ private val kTag = "ObjectDetailActivity" private val context: Context = this@ObjectDetailActivity private val gson by lazy { Gson() } - private lateinit var labelBean: LabelBean + private lateinit var marker: MarkerLocalBean override fun initViewBinding(): ActivityObjectDetailBinding { return ActivityObjectDetailBinding.inflate(layoutInflater) @@ -49,26 +49,26 @@ val objectJson = intent.getStringExtra(Constant.INTENT_PARAM)!! try { - labelBean = gson.fromJson(objectJson, object : TypeToken() {}.type) + marker = gson.fromJson(objectJson, object : TypeToken() {}.type) binding.objectTypeView.text = - LocaleConstant.POINT_TYPE_ARRAY[labelBean.objectType.toInt() - 1] - binding.pipelineTypeView.text = labelBean.pipelineType - binding.pipelineDiameterView.text = labelBean.pipelineDiameter - binding.pipelineMaterialView.text = labelBean.pipelineMaterial - binding.buryMethodView.text = labelBean.buryMethod - binding.buryDeepView.text = labelBean.buryDeep - binding.areaView.text = labelBean.area - binding.lineView.text = labelBean.line - binding.roadView.text = labelBean.road - binding.constructTimeView.text = labelBean.constructTime - binding.ownerView.text = labelBean.owner - binding.identifierIdView.text = labelBean.identifierId - binding.identifierTypeView.text = labelBean.identifierType - binding.identifierDeepView.text = labelBean.identifierDeep - binding.personView.text = labelBean.person - binding.installTimeView.text = labelBean.installTime - binding.remarkView.text = labelBean.remark + LocaleConstant.POINT_TYPE_ARRAY[marker.objectType.toInt() - 1] + binding.pipelineTypeView.text = marker.pipelineType + binding.pipelineDiameterView.text = marker.pipelineDiameter + binding.pipelineMaterialView.text = marker.pipelineMaterial + binding.buryMethodView.text = marker.buryMethod + binding.buryDeepView.text = marker.buryDepth + binding.areaView.text = marker.area + binding.lineView.text = marker.line + binding.roadView.text = marker.road + binding.constructTimeView.text = marker.constructTime + binding.ownerView.text = marker.owner + binding.identifierIdView.text = marker.markerId + binding.identifierTypeView.text = marker.markerType + binding.identifierDeepView.text = marker.markerDepth + binding.personView.text = marker.installationDept + binding.installTimeView.text = marker.updateTime + binding.remarkView.text = marker.remark } catch (e: NumberFormatException) { e.printStackTrace() } @@ -79,7 +79,7 @@ binding.showImageView.setOnClickListener { //查数据库 - if (labelBean.imagePath.isNullOrEmpty()) { + if (marker.imagePath.isNullOrEmpty()) { "此标识器无图片".show(context) } else { val realPaths: ArrayList = ArrayList() //真实图片路径 @@ -87,7 +87,7 @@ /** * /images/markers/202307/0008818922_EVENT_20230704_160349_0_1.jpg,/images/markers/202307/0008818922_EVENT_20230704_160406_0_2.jpg * */ - val imagePath = labelBean.imagePath + val imagePath = marker.imagePath if (imagePath.contains(",")) { val list = imagePath.split(",") list.forEach { path -> diff --git a/app/src/main/java/com/casic/detector/widgets/MarkerDetailDialog.kt b/app/src/main/java/com/casic/detector/widgets/MarkerDetailDialog.kt index 56f4d9b..a63e885 100644 --- a/app/src/main/java/com/casic/detector/widgets/MarkerDetailDialog.kt +++ b/app/src/main/java/com/casic/detector/widgets/MarkerDetailDialog.kt @@ -6,7 +6,7 @@ import android.graphics.drawable.ColorDrawable import android.os.Bundle import com.casic.detector.R -import com.casic.detector.bean.LabelBean +import com.casic.detector.bean.MarkerLocalBean import com.casic.detector.databinding.DialogMarkerDetailBinding import com.casic.detector.utils.LocaleConstant import com.pengxh.kt.lite.extensions.binding @@ -16,10 +16,10 @@ class MarkerDetailDialog constructor(context: Context) : Dialog(context, R.style.UserDefinedDialogStyle) { - private lateinit var labelBean: LabelBean + private lateinit var marker: MarkerLocalBean - fun setMarker(labelBean: LabelBean) { - this.labelBean = labelBean + fun setMarker(marker: MarkerLocalBean) { + this.marker = marker } private val binding: DialogMarkerDetailBinding by binding() @@ -39,23 +39,22 @@ this.initDialogLayoutParams() setCanceledOnTouchOutside(true) - binding.objectTypeView.text = - LocaleConstant.POINT_TYPE_ARRAY[labelBean.objectType.toInt() - 1] - binding.pipelineTypeView.text = labelBean.pipelineType - binding.pipelineDiameterView.text = labelBean.pipelineDiameter - binding.pipelineMaterialView.text = labelBean.pipelineMaterial - binding.buryMethodView.text = labelBean.buryMethod - binding.buryDeepView.text = labelBean.buryDeep - binding.areaView.text = labelBean.area - binding.lineView.text = labelBean.line - binding.roadView.text = labelBean.road - binding.constructTimeView.text = labelBean.constructTime - binding.ownerView.text = labelBean.owner - binding.identifierIdView.text = labelBean.identifierId - binding.identifierTypeView.text = labelBean.identifierType - binding.identifierDeepView.text = labelBean.identifierDeep - binding.personView.text = labelBean.person - binding.installTimeView.text = labelBean.installTime - binding.remarkView.text = labelBean.remark + binding.objectTypeView.text = LocaleConstant.POINT_TYPE_ARRAY[marker.objectType.toInt() - 1] + binding.pipelineTypeView.text = marker.pipelineType + binding.pipelineDiameterView.text = marker.pipelineDiameter + binding.pipelineMaterialView.text = marker.pipelineMaterial + binding.buryMethodView.text = marker.buryMethod + binding.buryDeepView.text = marker.buryDepth + binding.areaView.text = marker.area + binding.lineView.text = marker.line + binding.roadView.text = marker.road + binding.constructTimeView.text = marker.constructTime + binding.ownerView.text = marker.owner + binding.identifierIdView.text = marker.markerId + binding.identifierTypeView.text = marker.markerType + binding.identifierDeepView.text = marker.markerDepth + binding.personView.text = marker.installationDept + binding.installTimeView.text = marker.updateTime + binding.remarkView.text = marker.remark } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/detector/bean/LabelBean.java b/app/src/main/java/com/casic/detector/bean/LabelBean.java deleted file mode 100644 index d22d835..0000000 --- a/app/src/main/java/com/casic/detector/bean/LabelBean.java +++ /dev/null @@ -1,321 +0,0 @@ -package com.casic.detector.bean; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -@Entity -public class LabelBean { - @Id(autoincrement = true) - private Long id;//主键ID - // 标记对象类型 - private String objectType; - // 管线类型 - private String pipelineType; - // 管材 - private String pipelineMaterial; - // 管直 - private String pipelineDiameter; - // 埋深 - private String buryDeep; - // 下层管线类型 - private String lowerType; - // 下层管材 - private String lowerMaterial; - // 下层管径 - private String lowerDiameter; - // 下层埋深 - private String lowerDeep; - // 埋设方式 - private String buryMethod; - // 所属区域 - private String area; - // 所属线路 - private String line; - // 所属道路 - private String road; - // 建设年代 - private String constructTime; - // 权属单位 - private String owner; - // 对象ID - private String objectId; - // 标识器ID号 - private String identifierId; - // 标识器类型 - private String identifierType; - // 标识器埋深 - private String identifierDeep; - // 安装人员 - private String person; - // 安装时间 - private String installTime; - // 经度 - private String lng; - // 纬度 - private String lat; - // 颜色 - private String color; - // 备注信息 - private String remark; - // 图片路径 - private String imagePath; - - @Generated(hash = 1718746860) - public LabelBean(Long id, String objectType, String pipelineType, - String pipelineMaterial, String pipelineDiameter, String buryDeep, - String lowerType, String lowerMaterial, String lowerDiameter, - String lowerDeep, String buryMethod, String area, String line, - String road, String constructTime, String owner, String objectId, - String identifierId, String identifierType, String identifierDeep, - String person, String installTime, String lng, String lat, String color, - String remark, String imagePath) { - this.id = id; - this.objectType = objectType; - this.pipelineType = pipelineType; - this.pipelineMaterial = pipelineMaterial; - this.pipelineDiameter = pipelineDiameter; - this.buryDeep = buryDeep; - this.lowerType = lowerType; - this.lowerMaterial = lowerMaterial; - this.lowerDiameter = lowerDiameter; - this.lowerDeep = lowerDeep; - this.buryMethod = buryMethod; - this.area = area; - this.line = line; - this.road = road; - this.constructTime = constructTime; - this.owner = owner; - this.objectId = objectId; - this.identifierId = identifierId; - this.identifierType = identifierType; - this.identifierDeep = identifierDeep; - this.person = person; - this.installTime = installTime; - this.lng = lng; - this.lat = lat; - this.color = color; - this.remark = remark; - this.imagePath = imagePath; - } - - @Generated(hash = 1285554626) - public LabelBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getObjectType() { - return this.objectType; - } - - public void setObjectType(String objectType) { - this.objectType = objectType; - } - - public String getPipelineType() { - return this.pipelineType; - } - - public void setPipelineType(String pipelineType) { - this.pipelineType = pipelineType; - } - - public String getPipelineMaterial() { - return this.pipelineMaterial; - } - - public void setPipelineMaterial(String pipelineMaterial) { - this.pipelineMaterial = pipelineMaterial; - } - - public String getPipelineDiameter() { - return this.pipelineDiameter; - } - - public void setPipelineDiameter(String pipelineDiameter) { - this.pipelineDiameter = pipelineDiameter; - } - - public String getBuryDeep() { - return this.buryDeep; - } - - public void setBuryDeep(String buryDeep) { - this.buryDeep = buryDeep; - } - - public String getLowerType() { - return this.lowerType; - } - - public void setLowerType(String lowerType) { - this.lowerType = lowerType; - } - - public String getLowerMaterial() { - return this.lowerMaterial; - } - - public void setLowerMaterial(String lowerMaterial) { - this.lowerMaterial = lowerMaterial; - } - - public String getLowerDiameter() { - return this.lowerDiameter; - } - - public void setLowerDiameter(String lowerDiameter) { - this.lowerDiameter = lowerDiameter; - } - - public String getLowerDeep() { - return this.lowerDeep; - } - - public void setLowerDeep(String lowerDeep) { - this.lowerDeep = lowerDeep; - } - - public String getBuryMethod() { - return this.buryMethod; - } - - public void setBuryMethod(String buryMethod) { - this.buryMethod = buryMethod; - } - - public String getArea() { - return this.area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getLine() { - return this.line; - } - - public void setLine(String line) { - this.line = line; - } - - public String getRoad() { - return this.road; - } - - public void setRoad(String road) { - this.road = road; - } - - public String getConstructTime() { - return this.constructTime; - } - - public void setConstructTime(String constructTime) { - this.constructTime = constructTime; - } - - public String getOwner() { - return this.owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getObjectId() { - return this.objectId; - } - - public void setObjectId(String objectId) { - this.objectId = objectId; - } - - public String getIdentifierId() { - return this.identifierId; - } - - public void setIdentifierId(String identifierId) { - this.identifierId = identifierId; - } - - public String getIdentifierType() { - return this.identifierType; - } - - public void setIdentifierType(String identifierType) { - this.identifierType = identifierType; - } - - public String getIdentifierDeep() { - return this.identifierDeep; - } - - public void setIdentifierDeep(String identifierDeep) { - this.identifierDeep = identifierDeep; - } - - public String getPerson() { - return this.person; - } - - public void setPerson(String person) { - this.person = person; - } - - public String getInstallTime() { - return this.installTime; - } - - public void setInstallTime(String installTime) { - this.installTime = installTime; - } - - public String getLng() { - return this.lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getLat() { - return this.lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getColor() { - return this.color; - } - - public void setColor(String color) { - this.color = color; - } - - public String getRemark() { - return this.remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getImagePath() { - return this.imagePath; - } - - public void setImagePath(String imagePath) { - this.imagePath = imagePath; - } -} diff --git a/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java new file mode 100644 index 0000000..c59cf0b --- /dev/null +++ b/app/src/main/java/com/casic/detector/bean/MarkerLocalBean.java @@ -0,0 +1,327 @@ +package com.casic.detector.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Id; +import org.greenrobot.greendao.annotation.Generated; + +/** + * 从平台下载的标识器本地库实体类 + */ +@Entity +public class MarkerLocalBean { + @Id(autoincrement = true) + private Long id;//本地库主键ID + + // 管线类型 + private String pipelineType; + // 管线直径 + private String pipelineDiameter; + // 管材 + private String pipelineMaterial; + // 埋设方式 + private String buryMethod; + // 埋深 + private String buryDepth; + // 所属区域 + private String area; + // 所属线路 + private String line; + // 所属道路 + private String road; + // 建设年代 + private String constructTime; + // 权属单位 + private String owner; + //标识对象ID,无实际用途 + @Deprecated + private String objectId; + // 标识器ID + private String markerId; + // 标识器类型 + private String markerType; + // 标识器埋深 + private String markerDepth; + // 安装部门 + private String installationDept; + // 经度 + private String lng; + // 纬度 + private String lat; + //最后修改时间,更新时间 + private String updateTime; + // 备注信息 + private String remark; + // 下层管线类型 + private String underlyingPipelineType; + // 下层埋深 + private String underlyingPipelineDepth; + // 下层管径 + private String underlyingPipelineDiameter; + // 下层管材 + private String underlyingPipelineMaterial; + //标识对象类型 + private String objectType; + // 颜色 + private String color; + // 图片路径 + private String imagePath; + + @Generated(hash = 1479045776) + public MarkerLocalBean(Long id, String pipelineType, String pipelineDiameter, + String pipelineMaterial, String buryMethod, String buryDepth, + String area, String line, String road, String constructTime, + String owner, String objectId, String markerId, String markerType, + String markerDepth, String installationDept, String lng, String lat, + String updateTime, String remark, String underlyingPipelineType, + String underlyingPipelineDepth, String underlyingPipelineDiameter, + String underlyingPipelineMaterial, String objectType, String color, + String imagePath) { + this.id = id; + this.pipelineType = pipelineType; + this.pipelineDiameter = pipelineDiameter; + this.pipelineMaterial = pipelineMaterial; + this.buryMethod = buryMethod; + this.buryDepth = buryDepth; + this.area = area; + this.line = line; + this.road = road; + this.constructTime = constructTime; + this.owner = owner; + this.objectId = objectId; + this.markerId = markerId; + this.markerType = markerType; + this.markerDepth = markerDepth; + this.installationDept = installationDept; + this.lng = lng; + this.lat = lat; + this.updateTime = updateTime; + this.remark = remark; + this.underlyingPipelineType = underlyingPipelineType; + this.underlyingPipelineDepth = underlyingPipelineDepth; + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + this.objectType = objectType; + this.color = color; + this.imagePath = imagePath; + } + + @Generated(hash = 1538606012) + public MarkerLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPipelineType() { + return this.pipelineType; + } + + public void setPipelineType(String pipelineType) { + this.pipelineType = pipelineType; + } + + public String getPipelineDiameter() { + return this.pipelineDiameter; + } + + public void setPipelineDiameter(String pipelineDiameter) { + this.pipelineDiameter = pipelineDiameter; + } + + public String getPipelineMaterial() { + return this.pipelineMaterial; + } + + public void setPipelineMaterial(String pipelineMaterial) { + this.pipelineMaterial = pipelineMaterial; + } + + public String getBuryMethod() { + return this.buryMethod; + } + + public void setBuryMethod(String buryMethod) { + this.buryMethod = buryMethod; + } + + public String getBuryDepth() { + return this.buryDepth; + } + + public void setBuryDepth(String buryDepth) { + this.buryDepth = buryDepth; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getLine() { + return this.line; + } + + public void setLine(String line) { + this.line = line; + } + + public String getRoad() { + return this.road; + } + + public void setRoad(String road) { + this.road = road; + } + + public String getConstructTime() { + return this.constructTime; + } + + public void setConstructTime(String constructTime) { + this.constructTime = constructTime; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getObjectId() { + return this.objectId; + } + + public void setObjectId(String objectId) { + this.objectId = objectId; + } + + public String getMarkerId() { + return this.markerId; + } + + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerType() { + return this.markerType; + } + + public void setMarkerType(String markerType) { + this.markerType = markerType; + } + + public String getMarkerDepth() { + return this.markerDepth; + } + + public void setMarkerDepth(String markerDepth) { + this.markerDepth = markerDepth; + } + + public String getInstallationDept() { + return this.installationDept; + } + + public void setInstallationDept(String installationDept) { + this.installationDept = installationDept; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return this.remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getUnderlyingPipelineType() { + return this.underlyingPipelineType; + } + + public void setUnderlyingPipelineType(String underlyingPipelineType) { + this.underlyingPipelineType = underlyingPipelineType; + } + + public String getUnderlyingPipelineDepth() { + return this.underlyingPipelineDepth; + } + + public void setUnderlyingPipelineDepth(String underlyingPipelineDepth) { + this.underlyingPipelineDepth = underlyingPipelineDepth; + } + + public String getUnderlyingPipelineDiameter() { + return this.underlyingPipelineDiameter; + } + + public void setUnderlyingPipelineDiameter(String underlyingPipelineDiameter) { + this.underlyingPipelineDiameter = underlyingPipelineDiameter; + } + + public String getUnderlyingPipelineMaterial() { + return this.underlyingPipelineMaterial; + } + + public void setUnderlyingPipelineMaterial(String underlyingPipelineMaterial) { + this.underlyingPipelineMaterial = underlyingPipelineMaterial; + } + + public String getObjectType() { + return this.objectType; + } + + public void setObjectType(String objectType) { + this.objectType = objectType; + } + + public String getColor() { + return this.color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getImagePath() { + return this.imagePath; + } + + public void setImagePath(String imagePath) { + this.imagePath = imagePath; + } +} diff --git a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java index ec4425f..45e25e6 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoMaster.java @@ -24,7 +24,7 @@ * Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - LabelBeanDao.createTable(db, ifNotExists); + MarkerLocalBeanDao.createTable(db, ifNotExists); PipeLocalBeanDao.createTable(db, ifNotExists); TaskLocalBeanDao.createTable(db, ifNotExists); TaskMarkerLocalBeanDao.createTable(db, ifNotExists); @@ -34,7 +34,7 @@ * Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - LabelBeanDao.dropTable(db, ifExists); + MarkerLocalBeanDao.dropTable(db, ifExists); PipeLocalBeanDao.dropTable(db, ifExists); TaskLocalBeanDao.dropTable(db, ifExists); TaskMarkerLocalBeanDao.dropTable(db, ifExists); @@ -56,7 +56,7 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(LabelBeanDao.class); + registerDaoClass(MarkerLocalBeanDao.class); registerDaoClass(PipeLocalBeanDao.class); registerDaoClass(TaskLocalBeanDao.class); registerDaoClass(TaskMarkerLocalBeanDao.class); diff --git a/app/src/main/java/com/casic/detector/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/greendao/DaoSession.java index 4f9bdff..0d0d59f 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoSession.java @@ -1,6 +1,6 @@ package com.casic.detector.greendao; -import com.casic.detector.bean.LabelBean; +import com.casic.detector.bean.MarkerLocalBean; import com.casic.detector.bean.PipeLocalBean; import com.casic.detector.bean.TaskLocalBean; import com.casic.detector.bean.TaskMarkerLocalBean; @@ -22,12 +22,12 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig labelBeanDaoConfig; + private final DaoConfig markerLocalBeanDaoConfig; private final DaoConfig pipeLocalBeanDaoConfig; private final DaoConfig taskLocalBeanDaoConfig; private final DaoConfig taskMarkerLocalBeanDaoConfig; - private final LabelBeanDao labelBeanDao; + private final MarkerLocalBeanDao markerLocalBeanDao; private final PipeLocalBeanDao pipeLocalBeanDao; private final TaskLocalBeanDao taskLocalBeanDao; private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao; @@ -36,8 +36,8 @@ daoConfigMap) { super(db); - labelBeanDaoConfig = daoConfigMap.get(LabelBeanDao.class).clone(); - labelBeanDaoConfig.initIdentityScope(type); + markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone(); + markerLocalBeanDaoConfig.initIdentityScope(type); pipeLocalBeanDaoConfig = daoConfigMap.get(PipeLocalBeanDao.class).clone(); pipeLocalBeanDaoConfig.initIdentityScope(type); @@ -48,26 +48,26 @@ taskMarkerLocalBeanDaoConfig = daoConfigMap.get(TaskMarkerLocalBeanDao.class).clone(); taskMarkerLocalBeanDaoConfig.initIdentityScope(type); - labelBeanDao = new LabelBeanDao(labelBeanDaoConfig, this); + markerLocalBeanDao = new MarkerLocalBeanDao(markerLocalBeanDaoConfig, this); pipeLocalBeanDao = new PipeLocalBeanDao(pipeLocalBeanDaoConfig, this); taskLocalBeanDao = new TaskLocalBeanDao(taskLocalBeanDaoConfig, this); taskMarkerLocalBeanDao = new TaskMarkerLocalBeanDao(taskMarkerLocalBeanDaoConfig, this); - registerDao(LabelBean.class, labelBeanDao); + registerDao(MarkerLocalBean.class, markerLocalBeanDao); registerDao(PipeLocalBean.class, pipeLocalBeanDao); registerDao(TaskLocalBean.class, taskLocalBeanDao); registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao); } public void clear() { - labelBeanDaoConfig.clearIdentityScope(); + markerLocalBeanDaoConfig.clearIdentityScope(); pipeLocalBeanDaoConfig.clearIdentityScope(); taskLocalBeanDaoConfig.clearIdentityScope(); taskMarkerLocalBeanDaoConfig.clearIdentityScope(); } - public LabelBeanDao getLabelBeanDao() { - return labelBeanDao; + public MarkerLocalBeanDao getMarkerLocalBeanDao() { + return markerLocalBeanDao; } public PipeLocalBeanDao getPipeLocalBeanDao() { diff --git a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java b/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java deleted file mode 100644 index 94a73c4..0000000 --- a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java +++ /dev/null @@ -1,484 +0,0 @@ -package com.casic.detector.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import com.casic.detector.bean.LabelBean; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; -import org.greenrobot.greendao.internal.DaoConfig; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. - -/** - * DAO for table "LABEL_BEAN". - */ -public class LabelBeanDao extends AbstractDao { - - public static final String TABLENAME = "LABEL_BEAN"; - - /** - * Properties of entity LabelBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ObjectType = new Property(1, String.class, "objectType", false, "OBJECT_TYPE"); - public final static Property PipelineType = new Property(2, String.class, "pipelineType", false, "PIPELINE_TYPE"); - public final static Property PipelineMaterial = new Property(3, String.class, "pipelineMaterial", false, "PIPELINE_MATERIAL"); - public final static Property PipelineDiameter = new Property(4, String.class, "pipelineDiameter", false, "PIPELINE_DIAMETER"); - public final static Property BuryDeep = new Property(5, String.class, "buryDeep", false, "BURY_DEEP"); - public final static Property LowerType = new Property(6, String.class, "lowerType", false, "LOWER_TYPE"); - public final static Property LowerMaterial = new Property(7, String.class, "lowerMaterial", false, "LOWER_MATERIAL"); - public final static Property LowerDiameter = new Property(8, String.class, "lowerDiameter", false, "LOWER_DIAMETER"); - public final static Property LowerDeep = new Property(9, String.class, "lowerDeep", false, "LOWER_DEEP"); - public final static Property BuryMethod = new Property(10, String.class, "buryMethod", false, "BURY_METHOD"); - public final static Property Area = new Property(11, String.class, "area", false, "AREA"); - public final static Property Line = new Property(12, String.class, "line", false, "LINE"); - public final static Property Road = new Property(13, String.class, "road", false, "ROAD"); - public final static Property ConstructTime = new Property(14, String.class, "constructTime", false, "CONSTRUCT_TIME"); - public final static Property Owner = new Property(15, String.class, "owner", false, "OWNER"); - public final static Property ObjectId = new Property(16, String.class, "objectId", false, "OBJECT_ID"); - public final static Property IdentifierId = new Property(17, String.class, "identifierId", false, "IDENTIFIER_ID"); - public final static Property IdentifierType = new Property(18, String.class, "identifierType", false, "IDENTIFIER_TYPE"); - public final static Property IdentifierDeep = new Property(19, String.class, "identifierDeep", false, "IDENTIFIER_DEEP"); - public final static Property Person = new Property(20, String.class, "person", false, "PERSON"); - public final static Property InstallTime = new Property(21, String.class, "installTime", false, "INSTALL_TIME"); - public final static Property Lng = new Property(22, String.class, "lng", false, "LNG"); - public final static Property Lat = new Property(23, String.class, "lat", false, "LAT"); - public final static Property Color = new Property(24, String.class, "color", false, "COLOR"); - public final static Property Remark = new Property(25, String.class, "remark", false, "REMARK"); - public final static Property ImagePath = new Property(26, String.class, "imagePath", false, "IMAGE_PATH"); - } - - - public LabelBeanDao(DaoConfig config) { - super(config); - } - - public LabelBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** - * Creates the underlying database table. - */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS " : ""; - db.execSQL("CREATE TABLE " + constraint + "\"LABEL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"OBJECT_TYPE\" TEXT," + // 1: objectType - "\"PIPELINE_TYPE\" TEXT," + // 2: pipelineType - "\"PIPELINE_MATERIAL\" TEXT," + // 3: pipelineMaterial - "\"PIPELINE_DIAMETER\" TEXT," + // 4: pipelineDiameter - "\"BURY_DEEP\" TEXT," + // 5: buryDeep - "\"LOWER_TYPE\" TEXT," + // 6: lowerType - "\"LOWER_MATERIAL\" TEXT," + // 7: lowerMaterial - "\"LOWER_DIAMETER\" TEXT," + // 8: lowerDiameter - "\"LOWER_DEEP\" TEXT," + // 9: lowerDeep - "\"BURY_METHOD\" TEXT," + // 10: buryMethod - "\"AREA\" TEXT," + // 11: area - "\"LINE\" TEXT," + // 12: line - "\"ROAD\" TEXT," + // 13: road - "\"CONSTRUCT_TIME\" TEXT," + // 14: constructTime - "\"OWNER\" TEXT," + // 15: owner - "\"OBJECT_ID\" TEXT," + // 16: objectId - "\"IDENTIFIER_ID\" TEXT," + // 17: identifierId - "\"IDENTIFIER_TYPE\" TEXT," + // 18: identifierType - "\"IDENTIFIER_DEEP\" TEXT," + // 19: identifierDeep - "\"PERSON\" TEXT," + // 20: person - "\"INSTALL_TIME\" TEXT," + // 21: installTime - "\"LNG\" TEXT," + // 22: lng - "\"LAT\" TEXT," + // 23: lat - "\"COLOR\" TEXT," + // 24: color - "\"REMARK\" TEXT," + // 25: remark - "\"IMAGE_PATH\" TEXT);"); // 26: imagePath - } - - /** - * Drops the underlying database table. - */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LABEL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, LabelBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String objectType = entity.getObjectType(); - if (objectType != null) { - stmt.bindString(2, objectType); - } - - String pipelineType = entity.getPipelineType(); - if (pipelineType != null) { - stmt.bindString(3, pipelineType); - } - - String pipelineMaterial = entity.getPipelineMaterial(); - if (pipelineMaterial != null) { - stmt.bindString(4, pipelineMaterial); - } - - String pipelineDiameter = entity.getPipelineDiameter(); - if (pipelineDiameter != null) { - stmt.bindString(5, pipelineDiameter); - } - - String buryDeep = entity.getBuryDeep(); - if (buryDeep != null) { - stmt.bindString(6, buryDeep); - } - - String lowerType = entity.getLowerType(); - if (lowerType != null) { - stmt.bindString(7, lowerType); - } - - String lowerMaterial = entity.getLowerMaterial(); - if (lowerMaterial != null) { - stmt.bindString(8, lowerMaterial); - } - - String lowerDiameter = entity.getLowerDiameter(); - if (lowerDiameter != null) { - stmt.bindString(9, lowerDiameter); - } - - String lowerDeep = entity.getLowerDeep(); - if (lowerDeep != null) { - stmt.bindString(10, lowerDeep); - } - - String buryMethod = entity.getBuryMethod(); - if (buryMethod != null) { - stmt.bindString(11, buryMethod); - } - - String area = entity.getArea(); - if (area != null) { - stmt.bindString(12, area); - } - - String line = entity.getLine(); - if (line != null) { - stmt.bindString(13, line); - } - - String road = entity.getRoad(); - if (road != null) { - stmt.bindString(14, road); - } - - String constructTime = entity.getConstructTime(); - if (constructTime != null) { - stmt.bindString(15, constructTime); - } - - String owner = entity.getOwner(); - if (owner != null) { - stmt.bindString(16, owner); - } - - String objectId = entity.getObjectId(); - if (objectId != null) { - stmt.bindString(17, objectId); - } - - String identifierId = entity.getIdentifierId(); - if (identifierId != null) { - stmt.bindString(18, identifierId); - } - - String identifierType = entity.getIdentifierType(); - if (identifierType != null) { - stmt.bindString(19, identifierType); - } - - String identifierDeep = entity.getIdentifierDeep(); - if (identifierDeep != null) { - stmt.bindString(20, identifierDeep); - } - - String person = entity.getPerson(); - if (person != null) { - stmt.bindString(21, person); - } - - String installTime = entity.getInstallTime(); - if (installTime != null) { - stmt.bindString(22, installTime); - } - - String lng = entity.getLng(); - if (lng != null) { - stmt.bindString(23, lng); - } - - String lat = entity.getLat(); - if (lat != null) { - stmt.bindString(24, lat); - } - - String color = entity.getColor(); - if (color != null) { - stmt.bindString(25, color); - } - - String remark = entity.getRemark(); - if (remark != null) { - stmt.bindString(26, remark); - } - - String imagePath = entity.getImagePath(); - if (imagePath != null) { - stmt.bindString(27, imagePath); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, LabelBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String objectType = entity.getObjectType(); - if (objectType != null) { - stmt.bindString(2, objectType); - } - - String pipelineType = entity.getPipelineType(); - if (pipelineType != null) { - stmt.bindString(3, pipelineType); - } - - String pipelineMaterial = entity.getPipelineMaterial(); - if (pipelineMaterial != null) { - stmt.bindString(4, pipelineMaterial); - } - - String pipelineDiameter = entity.getPipelineDiameter(); - if (pipelineDiameter != null) { - stmt.bindString(5, pipelineDiameter); - } - - String buryDeep = entity.getBuryDeep(); - if (buryDeep != null) { - stmt.bindString(6, buryDeep); - } - - String lowerType = entity.getLowerType(); - if (lowerType != null) { - stmt.bindString(7, lowerType); - } - - String lowerMaterial = entity.getLowerMaterial(); - if (lowerMaterial != null) { - stmt.bindString(8, lowerMaterial); - } - - String lowerDiameter = entity.getLowerDiameter(); - if (lowerDiameter != null) { - stmt.bindString(9, lowerDiameter); - } - - String lowerDeep = entity.getLowerDeep(); - if (lowerDeep != null) { - stmt.bindString(10, lowerDeep); - } - - String buryMethod = entity.getBuryMethod(); - if (buryMethod != null) { - stmt.bindString(11, buryMethod); - } - - String area = entity.getArea(); - if (area != null) { - stmt.bindString(12, area); - } - - String line = entity.getLine(); - if (line != null) { - stmt.bindString(13, line); - } - - String road = entity.getRoad(); - if (road != null) { - stmt.bindString(14, road); - } - - String constructTime = entity.getConstructTime(); - if (constructTime != null) { - stmt.bindString(15, constructTime); - } - - String owner = entity.getOwner(); - if (owner != null) { - stmt.bindString(16, owner); - } - - String objectId = entity.getObjectId(); - if (objectId != null) { - stmt.bindString(17, objectId); - } - - String identifierId = entity.getIdentifierId(); - if (identifierId != null) { - stmt.bindString(18, identifierId); - } - - String identifierType = entity.getIdentifierType(); - if (identifierType != null) { - stmt.bindString(19, identifierType); - } - - String identifierDeep = entity.getIdentifierDeep(); - if (identifierDeep != null) { - stmt.bindString(20, identifierDeep); - } - - String person = entity.getPerson(); - if (person != null) { - stmt.bindString(21, person); - } - - String installTime = entity.getInstallTime(); - if (installTime != null) { - stmt.bindString(22, installTime); - } - - String lng = entity.getLng(); - if (lng != null) { - stmt.bindString(23, lng); - } - - String lat = entity.getLat(); - if (lat != null) { - stmt.bindString(24, lat); - } - - String color = entity.getColor(); - if (color != null) { - stmt.bindString(25, color); - } - - String remark = entity.getRemark(); - if (remark != null) { - stmt.bindString(26, remark); - } - - String imagePath = entity.getImagePath(); - if (imagePath != null) { - stmt.bindString(27, imagePath); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public LabelBean readEntity(Cursor cursor, int offset) { - LabelBean entity = new LabelBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // objectType - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineType - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // pipelineDiameter - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDeep - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lowerType - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lowerMaterial - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lowerDiameter - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // lowerDeep - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // buryMethod - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // area - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // line - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // road - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // constructTime - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // owner - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // objectId - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // identifierId - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // identifierType - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // identifierDeep - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // person - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // installTime - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // lng - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // lat - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // color - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // remark - cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, LabelBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setObjectType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setPipelineType(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setPipelineMaterial(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setPipelineDiameter(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setBuryDeep(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setLowerType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLowerMaterial(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLowerDiameter(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLowerDeep(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); - entity.setBuryMethod(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - entity.setArea(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); - entity.setLine(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); - entity.setRoad(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); - entity.setConstructTime(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); - entity.setOwner(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); - entity.setObjectId(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); - entity.setIdentifierId(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); - entity.setIdentifierType(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18)); - entity.setIdentifierDeep(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19)); - entity.setPerson(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); - entity.setInstallTime(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); - entity.setLng(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22)); - entity.setLat(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); - entity.setColor(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); - entity.setRemark(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); - entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); - } - - @Override - protected final Long updateKeyAfterInsert(LabelBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(LabelBean entity) { - if (entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(LabelBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java b/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java new file mode 100644 index 0000000..18849f3 --- /dev/null +++ b/app/src/main/java/com/casic/detector/greendao/MarkerLocalBeanDao.java @@ -0,0 +1,484 @@ +package com.casic.detector.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import com.casic.detector.bean.MarkerLocalBean; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; +import org.greenrobot.greendao.internal.DaoConfig; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. + +/** + * DAO for table "MARKER_LOCAL_BEAN". + */ +public class MarkerLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "MARKER_LOCAL_BEAN"; + + /** + * Properties of entity MarkerLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property PipelineType = new Property(1, String.class, "pipelineType", false, "PIPELINE_TYPE"); + public final static Property PipelineDiameter = new Property(2, String.class, "pipelineDiameter", false, "PIPELINE_DIAMETER"); + public final static Property PipelineMaterial = new Property(3, String.class, "pipelineMaterial", false, "PIPELINE_MATERIAL"); + public final static Property BuryMethod = new Property(4, String.class, "buryMethod", false, "BURY_METHOD"); + public final static Property BuryDepth = new Property(5, String.class, "buryDepth", false, "BURY_DEPTH"); + public final static Property Area = new Property(6, String.class, "area", false, "AREA"); + public final static Property Line = new Property(7, String.class, "line", false, "LINE"); + public final static Property Road = new Property(8, String.class, "road", false, "ROAD"); + public final static Property ConstructTime = new Property(9, String.class, "constructTime", false, "CONSTRUCT_TIME"); + public final static Property Owner = new Property(10, String.class, "owner", false, "OWNER"); + public final static Property ObjectId = new Property(11, String.class, "objectId", false, "OBJECT_ID"); + public final static Property MarkerId = new Property(12, String.class, "markerId", false, "MARKER_ID"); + public final static Property MarkerType = new Property(13, String.class, "markerType", false, "MARKER_TYPE"); + public final static Property MarkerDepth = new Property(14, String.class, "markerDepth", false, "MARKER_DEPTH"); + public final static Property InstallationDept = new Property(15, String.class, "installationDept", false, "INSTALLATION_DEPT"); + public final static Property Lng = new Property(16, String.class, "lng", false, "LNG"); + public final static Property Lat = new Property(17, String.class, "lat", false, "LAT"); + public final static Property UpdateTime = new Property(18, String.class, "updateTime", false, "UPDATE_TIME"); + public final static Property Remark = new Property(19, String.class, "remark", false, "REMARK"); + public final static Property UnderlyingPipelineType = new Property(20, String.class, "underlyingPipelineType", false, "UNDERLYING_PIPELINE_TYPE"); + public final static Property UnderlyingPipelineDepth = new Property(21, String.class, "underlyingPipelineDepth", false, "UNDERLYING_PIPELINE_DEPTH"); + public final static Property UnderlyingPipelineDiameter = new Property(22, String.class, "underlyingPipelineDiameter", false, "UNDERLYING_PIPELINE_DIAMETER"); + public final static Property UnderlyingPipelineMaterial = new Property(23, String.class, "underlyingPipelineMaterial", false, "UNDERLYING_PIPELINE_MATERIAL"); + public final static Property ObjectType = new Property(24, String.class, "objectType", false, "OBJECT_TYPE"); + public final static Property Color = new Property(25, String.class, "color", false, "COLOR"); + public final static Property ImagePath = new Property(26, String.class, "imagePath", false, "IMAGE_PATH"); + } + + + public MarkerLocalBeanDao(DaoConfig config) { + super(config); + } + + public MarkerLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** + * Creates the underlying database table. + */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; + db.execSQL("CREATE TABLE " + constraint + "\"MARKER_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"PIPELINE_TYPE\" TEXT," + // 1: pipelineType + "\"PIPELINE_DIAMETER\" TEXT," + // 2: pipelineDiameter + "\"PIPELINE_MATERIAL\" TEXT," + // 3: pipelineMaterial + "\"BURY_METHOD\" TEXT," + // 4: buryMethod + "\"BURY_DEPTH\" TEXT," + // 5: buryDepth + "\"AREA\" TEXT," + // 6: area + "\"LINE\" TEXT," + // 7: line + "\"ROAD\" TEXT," + // 8: road + "\"CONSTRUCT_TIME\" TEXT," + // 9: constructTime + "\"OWNER\" TEXT," + // 10: owner + "\"OBJECT_ID\" TEXT," + // 11: objectId + "\"MARKER_ID\" TEXT," + // 12: markerId + "\"MARKER_TYPE\" TEXT," + // 13: markerType + "\"MARKER_DEPTH\" TEXT," + // 14: markerDepth + "\"INSTALLATION_DEPT\" TEXT," + // 15: installationDept + "\"LNG\" TEXT," + // 16: lng + "\"LAT\" TEXT," + // 17: lat + "\"UPDATE_TIME\" TEXT," + // 18: updateTime + "\"REMARK\" TEXT," + // 19: remark + "\"UNDERLYING_PIPELINE_TYPE\" TEXT," + // 20: underlyingPipelineType + "\"UNDERLYING_PIPELINE_DEPTH\" TEXT," + // 21: underlyingPipelineDepth + "\"UNDERLYING_PIPELINE_DIAMETER\" TEXT," + // 22: underlyingPipelineDiameter + "\"UNDERLYING_PIPELINE_MATERIAL\" TEXT," + // 23: underlyingPipelineMaterial + "\"OBJECT_TYPE\" TEXT," + // 24: objectType + "\"COLOR\" TEXT," + // 25: color + "\"IMAGE_PATH\" TEXT);"); // 26: imagePath + } + + /** + * Drops the underlying database table. + */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MARKER_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MarkerLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String pipelineType = entity.getPipelineType(); + if (pipelineType != null) { + stmt.bindString(2, pipelineType); + } + + String pipelineDiameter = entity.getPipelineDiameter(); + if (pipelineDiameter != null) { + stmt.bindString(3, pipelineDiameter); + } + + String pipelineMaterial = entity.getPipelineMaterial(); + if (pipelineMaterial != null) { + stmt.bindString(4, pipelineMaterial); + } + + String buryMethod = entity.getBuryMethod(); + if (buryMethod != null) { + stmt.bindString(5, buryMethod); + } + + String buryDepth = entity.getBuryDepth(); + if (buryDepth != null) { + stmt.bindString(6, buryDepth); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(7, area); + } + + String line = entity.getLine(); + if (line != null) { + stmt.bindString(8, line); + } + + String road = entity.getRoad(); + if (road != null) { + stmt.bindString(9, road); + } + + String constructTime = entity.getConstructTime(); + if (constructTime != null) { + stmt.bindString(10, constructTime); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(11, owner); + } + + String objectId = entity.getObjectId(); + if (objectId != null) { + stmt.bindString(12, objectId); + } + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(13, markerId); + } + + String markerType = entity.getMarkerType(); + if (markerType != null) { + stmt.bindString(14, markerType); + } + + String markerDepth = entity.getMarkerDepth(); + if (markerDepth != null) { + stmt.bindString(15, markerDepth); + } + + String installationDept = entity.getInstallationDept(); + if (installationDept != null) { + stmt.bindString(16, installationDept); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(17, lng); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(18, lat); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(19, updateTime); + } + + String remark = entity.getRemark(); + if (remark != null) { + stmt.bindString(20, remark); + } + + String underlyingPipelineType = entity.getUnderlyingPipelineType(); + if (underlyingPipelineType != null) { + stmt.bindString(21, underlyingPipelineType); + } + + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); + if (underlyingPipelineDepth != null) { + stmt.bindString(22, underlyingPipelineDepth); + } + + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); + if (underlyingPipelineDiameter != null) { + stmt.bindString(23, underlyingPipelineDiameter); + } + + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); + if (underlyingPipelineMaterial != null) { + stmt.bindString(24, underlyingPipelineMaterial); + } + + String objectType = entity.getObjectType(); + if (objectType != null) { + stmt.bindString(25, objectType); + } + + String color = entity.getColor(); + if (color != null) { + stmt.bindString(26, color); + } + + String imagePath = entity.getImagePath(); + if (imagePath != null) { + stmt.bindString(27, imagePath); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MarkerLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String pipelineType = entity.getPipelineType(); + if (pipelineType != null) { + stmt.bindString(2, pipelineType); + } + + String pipelineDiameter = entity.getPipelineDiameter(); + if (pipelineDiameter != null) { + stmt.bindString(3, pipelineDiameter); + } + + String pipelineMaterial = entity.getPipelineMaterial(); + if (pipelineMaterial != null) { + stmt.bindString(4, pipelineMaterial); + } + + String buryMethod = entity.getBuryMethod(); + if (buryMethod != null) { + stmt.bindString(5, buryMethod); + } + + String buryDepth = entity.getBuryDepth(); + if (buryDepth != null) { + stmt.bindString(6, buryDepth); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(7, area); + } + + String line = entity.getLine(); + if (line != null) { + stmt.bindString(8, line); + } + + String road = entity.getRoad(); + if (road != null) { + stmt.bindString(9, road); + } + + String constructTime = entity.getConstructTime(); + if (constructTime != null) { + stmt.bindString(10, constructTime); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(11, owner); + } + + String objectId = entity.getObjectId(); + if (objectId != null) { + stmt.bindString(12, objectId); + } + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(13, markerId); + } + + String markerType = entity.getMarkerType(); + if (markerType != null) { + stmt.bindString(14, markerType); + } + + String markerDepth = entity.getMarkerDepth(); + if (markerDepth != null) { + stmt.bindString(15, markerDepth); + } + + String installationDept = entity.getInstallationDept(); + if (installationDept != null) { + stmt.bindString(16, installationDept); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(17, lng); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(18, lat); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(19, updateTime); + } + + String remark = entity.getRemark(); + if (remark != null) { + stmt.bindString(20, remark); + } + + String underlyingPipelineType = entity.getUnderlyingPipelineType(); + if (underlyingPipelineType != null) { + stmt.bindString(21, underlyingPipelineType); + } + + String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth(); + if (underlyingPipelineDepth != null) { + stmt.bindString(22, underlyingPipelineDepth); + } + + String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter(); + if (underlyingPipelineDiameter != null) { + stmt.bindString(23, underlyingPipelineDiameter); + } + + String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial(); + if (underlyingPipelineMaterial != null) { + stmt.bindString(24, underlyingPipelineMaterial); + } + + String objectType = entity.getObjectType(); + if (objectType != null) { + stmt.bindString(25, objectType); + } + + String color = entity.getColor(); + if (color != null) { + stmt.bindString(26, color); + } + + String imagePath = entity.getImagePath(); + if (imagePath != null) { + stmt.bindString(27, imagePath); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MarkerLocalBean readEntity(Cursor cursor, int offset) { + MarkerLocalBean entity = new MarkerLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color + cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MarkerLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setPipelineType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setPipelineDiameter(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setPipelineMaterial(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setBuryMethod(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setBuryDepth(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setArea(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLine(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setRoad(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setConstructTime(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setOwner(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setObjectId(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setMarkerId(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setMarkerType(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setMarkerDepth(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setInstallationDept(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setLng(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setLat(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + entity.setUpdateTime(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18)); + entity.setRemark(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19)); + entity.setUnderlyingPipelineType(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20)); + entity.setUnderlyingPipelineDepth(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21)); + entity.setUnderlyingPipelineDiameter(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22)); + entity.setUnderlyingPipelineMaterial(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23)); + entity.setObjectType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); + entity.setColor(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); + entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); + } + + @Override + protected final Long updateKeyAfterInsert(MarkerLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MarkerLocalBean entity) { + if (entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MarkerLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/detector/utils/ExcelHub.kt b/app/src/main/java/com/casic/detector/utils/ExcelHub.kt index a3c1355..5e12e0b 100644 --- a/app/src/main/java/com/casic/detector/utils/ExcelHub.kt +++ b/app/src/main/java/com/casic/detector/utils/ExcelHub.kt @@ -1,59 +1,51 @@ package com.casic.detector.utils -import android.content.Context -import com.casic.detector.bean.LabelBean -import com.pengxh.kt.lite.extensions.show +import com.casic.detector.bean.MarkerLocalBean import jxl.Workbook import jxl.read.biff.BiffException import java.io.File object ExcelHub { - fun read(context: Context, filePath: String?): ArrayList { - val result = ArrayList() - - if (filePath.isNullOrBlank()) { - return result - } - + fun read(filePath: String): ArrayList { + val result = ArrayList() try { val workbook = Workbook.getWorkbook(File(filePath)) val sheet = workbook.getSheet(0) for (i in 1 until sheet.rows) { - val labelBean = LabelBean() - labelBean.pipelineType = sheet.getCell(0, i).contents - labelBean.pipelineDiameter = sheet.getCell(1, i).contents - labelBean.pipelineMaterial = sheet.getCell(2, i).contents - labelBean.buryMethod = sheet.getCell(3, i).contents - labelBean.buryDeep = sheet.getCell(4, i).contents - labelBean.area = sheet.getCell(5, i).contents - labelBean.line = sheet.getCell(6, i).contents - labelBean.road = sheet.getCell(7, i).contents - labelBean.constructTime = sheet.getCell(8, i).contents - labelBean.owner = sheet.getCell(9, i).contents - labelBean.objectId = sheet.getCell(10, i).contents - labelBean.identifierId = sheet.getCell(11, i).contents - labelBean.identifierType = sheet.getCell(12, i).contents - labelBean.identifierDeep = sheet.getCell(13, i).contents - labelBean.person = sheet.getCell(14, i).contents - labelBean.lng = sheet.getCell(15, i).contents - labelBean.lat = sheet.getCell(16, i).contents - labelBean.installTime = sheet.getCell(17, i).contents - labelBean.remark = sheet.getCell(18, i).contents - labelBean.lowerType = sheet.getCell(19, i).contents - labelBean.lowerDeep = sheet.getCell(20, i).contents - labelBean.lowerDiameter = sheet.getCell(21, i).contents - labelBean.lowerMaterial = sheet.getCell(22, i).contents - labelBean.objectType = sheet.getCell(23, i).contents - labelBean.color = sheet.getCell(24, i).contents - labelBean.imagePath = sheet.getCell(25, i).contents + val marker = MarkerLocalBean() + marker.pipelineType = sheet.getCell(0, i).contents + marker.pipelineDiameter = sheet.getCell(1, i).contents + marker.pipelineMaterial = sheet.getCell(2, i).contents + marker.buryMethod = sheet.getCell(3, i).contents + marker.buryDepth = sheet.getCell(4, i).contents + marker.area = sheet.getCell(5, i).contents + marker.line = sheet.getCell(6, i).contents + marker.road = sheet.getCell(7, i).contents + marker.constructTime = sheet.getCell(8, i).contents + marker.owner = sheet.getCell(9, i).contents + marker.objectId = sheet.getCell(10, i).contents + marker.markerId = sheet.getCell(11, i).contents + marker.markerType = sheet.getCell(12, i).contents + marker.markerDepth = sheet.getCell(13, i).contents + marker.installationDept = sheet.getCell(14, i).contents + marker.lng = sheet.getCell(15, i).contents + marker.lat = sheet.getCell(16, i).contents + marker.updateTime = sheet.getCell(17, i).contents + marker.remark = sheet.getCell(18, i).contents + marker.underlyingPipelineType = sheet.getCell(19, i).contents + marker.underlyingPipelineDepth = sheet.getCell(20, i).contents + marker.underlyingPipelineDiameter = sheet.getCell(21, i).contents + marker.underlyingPipelineMaterial = sheet.getCell(22, i).contents + marker.objectType = sheet.getCell(23, i).contents + marker.color = sheet.getCell(24, i).contents + marker.imagePath = sheet.getCell(25, i).contents - result.add(labelBean) + result.add(marker) } workbook.close() } catch (e: BiffException) { e.printStackTrace() - e.localizedMessage?.show(context) } return result } diff --git a/app/src/main/java/com/casic/detector/view/LoginActivity.kt b/app/src/main/java/com/casic/detector/view/LoginActivity.kt index 3eea0c5..73849b9 100644 --- a/app/src/main/java/com/casic/detector/view/LoginActivity.kt +++ b/app/src/main/java/com/casic/detector/view/LoginActivity.kt @@ -2,26 +2,18 @@ import android.os.Bundle import androidx.lifecycle.ViewModelProvider -import androidx.lifecycle.lifecycleScope -import com.amap.api.maps.CoordinateConverter import com.amap.api.navi.NaviSetting import com.casic.detector.databinding.ActivityLoginBinding -import com.casic.detector.model.PipelineModel -import com.casic.detector.utils.DataBaseManager import com.casic.detector.utils.LocaleConstant import com.casic.detector.vm.UserViewModel import com.google.gson.Gson -import com.google.gson.reflect.TypeToken import com.gyf.immersionbar.ImmersionBar import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.extensions.navigatePageTo -import com.pengxh.kt.lite.extensions.readAssetsFile import com.pengxh.kt.lite.utils.LoadState import com.pengxh.kt.lite.utils.LoadingDialogHub import com.pengxh.kt.lite.utils.SaveKeyValues import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch class LoginActivity : KotlinBaseActivity() { @@ -51,31 +43,31 @@ } } - lifecycleScope.launch(Dispatchers.IO) { - //获取管线数据。本地文件 - val pipeline = readAssetsFile("pipeline.json") - val lineResult = gson.fromJson( - pipeline, object : TypeToken() {}.type - ) - //缓存Pipe到本地 - lineResult.data.forEach { dot -> - val startLat = dot.startLatitudeGd - val startLng = dot.startLongitudeGd - val endLat = dot.endLatitudeGd - val endLng = dot.endLongitudeGd - if (!startLat.isNullOrBlank() && !startLng.isNullOrBlank() && !endLat.isNullOrBlank() && !endLng.isNullOrBlank()) { - if (CoordinateConverter.isAMapDataAvailable( - startLat.toDouble(), startLng.toDouble() - ) && - CoordinateConverter.isAMapDataAvailable( - endLat.toDouble(), endLng.toDouble() - ) - ) { - DataBaseManager.get.insertMapPipeCache(dot) - } - } - } - } +// lifecycleScope.launch(Dispatchers.IO) { +// //获取管线数据。本地文件 +// val pipeline = readAssetsFile("pipeline.json") +// val lineResult = gson.fromJson( +// pipeline, object : TypeToken() {}.type +// ) +// //缓存Pipe到本地 +// lineResult.data.forEach { dot -> +// val startLat = dot.startLatitudeGd +// val startLng = dot.startLongitudeGd +// val endLat = dot.endLatitudeGd +// val endLng = dot.endLongitudeGd +// if (!startLat.isNullOrBlank() && !startLng.isNullOrBlank() && !endLat.isNullOrBlank() && !endLng.isNullOrBlank()) { +// if (CoordinateConverter.isAMapDataAvailable( +// startLat.toDouble(), startLng.toDouble() +// ) && +// CoordinateConverter.isAMapDataAvailable( +// endLat.toDouble(), endLng.toDouble() +// ) +// ) { +// DataBaseManager.get.insertMapPipeCache(dot) +// } +// } +// } +// } } override fun initEvent() { diff --git a/app/src/main/java/com/casic/detector/view/MainActivity.kt b/app/src/main/java/com/casic/detector/view/MainActivity.kt index 22de557..6980416 100644 --- a/app/src/main/java/com/casic/detector/view/MainActivity.kt +++ b/app/src/main/java/com/casic/detector/view/MainActivity.kt @@ -38,7 +38,7 @@ import com.casic.detector.R import com.casic.detector.adapter.EditableImageAdapter import com.casic.detector.base.SerialPortActivity -import com.casic.detector.bean.LabelBean +import com.casic.detector.bean.MarkerLocalBean import com.casic.detector.bean.TaskMarkerLocalBean import com.casic.detector.callback.OnGetLocationListener import com.casic.detector.callback.OnImageCompressListener @@ -77,7 +77,6 @@ import com.casic.detector.widgets.RadarScanView import com.casic.detector.widgets.SamplePopupWindow import com.google.gson.Gson -import com.google.gson.reflect.TypeToken import com.luck.picture.lib.basic.PictureSelector import com.luck.picture.lib.config.SelectMimeType import com.luck.picture.lib.entity.LocalMedia @@ -132,7 +131,7 @@ private val rotationMatrix = FloatArray(9)//旋转矩阵缓存 private val valueArray = FloatArray(3)//方位角数值 private var clickTime: Long = 0 - private var labelBeans = ArrayList() + private var markers = ArrayList() private var clusterOverlay: ClusterOverlay? = null private var latitude: Double = 0.0 private var longitude: Double = 0.0 @@ -191,7 +190,7 @@ taskViewModel.markerFileResult.observe(this) { if (it.isSuccess) { //清空之前的数据 - DataBaseManager.get.clearTaskLabels() + DataBaseManager.get.clearMarkers() //下载最新的数据 val companyId = SaveKeyValues.getValue(LocaleConstant.USER_COMPANY_ID, "") val downloadUrl = companyId.toString().appendDownloadUrl(FileType.EXCEL) @@ -201,10 +200,10 @@ .setOnFileDownloadListener(object : FileDownloadManager.OnFileDownloadListener { override fun onDownloadEnd(file: File) { lifecycleScope.launch(Dispatchers.Main) { - labelBeans = ExcelHub.read(context, file.absolutePath) withContext(Dispatchers.IO) { - labelBeans.forEach { label -> - DataBaseManager.get.insertTaskLabel(label) + markers = ExcelHub.read(file.absolutePath) + markers.forEach { marker -> + DataBaseManager.get.saveMarkerInLocale(marker) } } LoadingDialogHub.dismiss() @@ -311,8 +310,9 @@ } else { lifecycleScope.launch(Dispatchers.Main) { val labels = withContext(Dispatchers.IO) { - DataBaseManager.get.queryLabelById("0") + DataBaseManager.get.queryMarkerByState("0") } + //如果有需要补全的标识器,Popup右侧会有小圆点提示 if (labels.isNotEmpty()) { samplePopupWindow.setShowPosition(4) } @@ -331,7 +331,7 @@ 1 -> downloadTask() 2 -> navigatePageTo() 3 -> uploadEvent() - 4 -> uploadLabel() + 4 -> completionMarker() } } }) @@ -364,20 +364,20 @@ override fun onConfirmClick(selectedItem: String, value: String) { //查询数据库 lifecycleScope.launch(Dispatchers.Main) { - labelBeans = withContext(Dispatchers.IO) { - DataBaseManager.get.loadLabelByCondition( + markers = withContext(Dispatchers.IO) { + DataBaseManager.get.loadMarkersByCondition( selectedItem, value - ) as ArrayList + ) as ArrayList } - if (labelBeans.isEmpty()) { + if (markers.isEmpty()) { "无法查到相关数据信息,请检查您的查询条件".show(context) } else { val latitudeList = ArrayList() val longitudeList = ArrayList() - val latitude = labelBeans.first().lat - val longitude = labelBeans.first().lng + val latitude = markers.first().lat + val longitude = markers.first().lng if (latitude.isNotBlank() && longitude.isNotBlank()) { if (CoordinateConverter.isAMapDataAvailable( latitude.toDouble(), longitude.toDouble() @@ -591,7 +591,7 @@ //添加地图Marker if (!ids.contains(markerId)) { //根据markerId查询标识器经纬度 - val labels = DataBaseManager.get.queryLabelById(markerId) + val labels = DataBaseManager.get.queryMarkerById(markerId) if (labels.isNotEmpty()) { val bean = labels.first() aMap.addMarker( @@ -605,7 +605,7 @@ //显示标识器详细信息 if (!detailDialog.isShowing) { - val labelBean = DataBaseManager.get.queryLabelById(markerId).firstOrNull() + val labelBean = DataBaseManager.get.queryMarkerById(markerId).firstOrNull() if (labelBean == null) { "无法查询到此ID【${markerId}】的信息".show(context) } else { @@ -715,8 +715,8 @@ aMap.setOnMapLongClickListener { //协程异步显示默认数据 lifecycleScope.launch(Dispatchers.Main) { - labelBeans = withContext(Dispatchers.IO) { - DataBaseManager.get.loadTaskLabels() as ArrayList + markers = withContext(Dispatchers.IO) { + DataBaseManager.get.loadMarkers() as ArrayList } showLabelsOnMap() } @@ -760,7 +760,7 @@ clusterOverlay?.onDestroy() val clusterItems = ArrayList() - labelBeans.forEach { + markers.forEach { if (it.lat.isNotEmpty() && it.lng.isNotEmpty()) { val latitude = it.lat.toDouble() val longitude = it.lng.toDouble() @@ -848,7 +848,7 @@ } override fun onCancelClick() { - labelBeans.forEach { + markers.forEach { if (it.id.toString() == item.title) { navigatePageTo(it.toJson()) } @@ -973,48 +973,45 @@ } //标识器补全 - private fun uploadLabel() { + private fun completionMarker() { val companyId = SaveKeyValues.getValue(LocaleConstant.USER_COMPANY_ID, "") as String - val labelBeans = DataBaseManager.get.queryLabelById("0") - if (labelBeans.isNotEmpty()) { - LoadingDialogHub.show(this, "标识器补全中,请稍后...") - labelBeans.forEach { labelBean -> - val imagePaths = gson.fromJson>( - labelBean.imagePath, object : TypeToken>() {}.type - ) - - taskViewModel.installLabel( - this, - companyId, - labelBean.objectType, - labelBean.pipelineType, - labelBean.pipelineMaterial, - labelBean.pipelineDiameter, - labelBean.buryDeep, - labelBean.lowerType, - labelBean.lowerMaterial, - labelBean.lowerDiameter, - labelBean.lowerDeep, - labelBean.buryMethod, - labelBean.area, - labelBean.line, - labelBean.road, - labelBean.constructTime, - labelBean.owner, - labelBean.objectId, - labelBean.identifierId, - labelBean.identifierType, - labelBean.identifierDeep, - labelBean.person, - labelBean.installTime, - labelBean.lng, - labelBean.lat, - labelBean.color, - labelBean.remark, - imagePaths - ) - } - LoadingDialogHub.dismiss() + val markers = DataBaseManager.get.queryMarkerByState("0") + if (markers.isNotEmpty()) { + //TODO 逻辑没梳理明白 +// LoadingDialogHub.show(this, "标识器补全中,请稍后...") +// markers.forEach { marker -> +// taskViewModel.installLabel( +// this, +// companyId, +// labelBean.objectType, +// labelBean.pipelineType, +// labelBean.pipelineMaterial, +// labelBean.pipelineDiameter, +// labelBean.buryDeep, +// labelBean.lowerType, +// labelBean.lowerMaterial, +// labelBean.lowerDiameter, +// labelBean.lowerDeep, +// labelBean.buryMethod, +// labelBean.area, +// labelBean.line, +// labelBean.road, +// labelBean.constructTime, +// labelBean.owner, +// labelBean.objectId, +// labelBean.identifierId, +// labelBean.identifierType, +// labelBean.identifierDeep, +// labelBean.person, +// labelBean.installTime, +// labelBean.lng, +// labelBean.lat, +// labelBean.color, +// labelBean.remark, +// arrayListOf() +// ) +// } +// LoadingDialogHub.dismiss() } else { "没有需要补传的标识器!".show(this) } @@ -1072,8 +1069,8 @@ binding.mapView.onResume() //协程异步显示默认数据 lifecycleScope.launch(Dispatchers.Main) { - labelBeans = withContext(Dispatchers.IO) { - DataBaseManager.get.loadTaskLabels() as ArrayList + markers = withContext(Dispatchers.IO) { + DataBaseManager.get.loadMarkers() as ArrayList } showLabelsOnMap() } @@ -1499,45 +1496,45 @@ private fun saveLabelInLocal() { val objectId = SaveKeyValues.getValue(LocaleConstant.OBJECT_ID, "") as String - val labelBean = LabelBean() - labelBean.objectType = binding.objectInclude.objectTypeSpinner.selectedItem.toString() - labelBean.pipelineType = + val marker = MarkerLocalBean() + marker.objectType = binding.objectInclude.objectTypeSpinner.selectedItem.toString() + marker.pipelineType = binding.objectInclude.pipeInclude.markerObjectTypeView.text.toString() - labelBean.pipelineMaterial = + marker.pipelineMaterial = binding.objectInclude.pipeInclude.materialSpinner.selectedItem.toString() - labelBean.pipelineDiameter = + marker.pipelineDiameter = "${binding.objectInclude.pipeInclude.pipelineDiameterView.text}mm" - labelBean.buryDeep = "${binding.objectInclude.pipeInclude.buryDeepView.text}mm" - labelBean.lowerType = + marker.buryDepth = "${binding.objectInclude.pipeInclude.buryDeepView.text}mm" + marker.underlyingPipelineType = binding.objectInclude.pipeCrossInclude.bottomPipeTypeSpinner.selectedItem.toString() - labelBean.lowerMaterial = + marker.underlyingPipelineMaterial = binding.objectInclude.pipeCrossInclude.bottomPipeMaterialSpinner.selectedItem.toString() - labelBean.lowerDiameter = + marker.underlyingPipelineDiameter = "${binding.objectInclude.pipeCrossInclude.bottomPipeDiameterView.text}mm" - labelBean.lowerDeep = + marker.underlyingPipelineDepth = "${binding.objectInclude.pipeCrossInclude.bottomPointDeepView.text}mm" - labelBean.buryMethod = + marker.buryMethod = binding.objectInclude.pipeInclude.buryTypeSpinner.selectedItem.toString() - labelBean.area = binding.objectInclude.areaView.text.toString() - labelBean.line = binding.objectInclude.lineView.text.toString() - labelBean.road = binding.objectInclude.roadView.text.toString() - labelBean.constructTime = binding.objectInclude.constructDateView.text.toString() - labelBean.owner = binding.objectInclude.ownerView.text.toString() - labelBean.objectId = objectId - labelBean.identifierId = binding.identifierInclude.identifierIdView.text.toString() - labelBean.identifierType = + marker.area = binding.objectInclude.areaView.text.toString() + marker.line = binding.objectInclude.lineView.text.toString() + marker.road = binding.objectInclude.roadView.text.toString() + marker.constructTime = binding.objectInclude.constructDateView.text.toString() + marker.owner = binding.objectInclude.ownerView.text.toString() + marker.objectId = objectId + marker.markerId = binding.identifierInclude.identifierIdView.text.toString() + marker.markerType = binding.identifierInclude.identifierTypeSpinner.selectedItem.toString() - labelBean.identifierDeep = "${binding.identifierInclude.identifierDeepView.text}mm" - labelBean.person = binding.identifierInclude.personDeptView.text.toString() - labelBean.installTime = binding.identifierInclude.installTimeView.text.toString() - labelBean.lng = binding.identifierInclude.lngView.text.toString() - labelBean.lat = binding.identifierInclude.latView.text.toString() - labelBean.color = + marker.markerDepth = "${binding.identifierInclude.identifierDeepView.text}mm" + marker.installationDept = binding.identifierInclude.personDeptView.text.toString() + marker.updateTime = binding.identifierInclude.installTimeView.text.toString() + marker.lng = binding.identifierInclude.lngView.text.toString() + marker.lat = binding.identifierInclude.latView.text.toString() + marker.color = binding.identifierInclude.colorSpinner.selectedItem.toString().toColor() - labelBean.remark = binding.remarkView.text.toString() - labelBean.imagePath = realPaths.toJson() + marker.remark = binding.remarkView.text.toString() + marker.imagePath = realPaths.toJson() - DataBaseManager.get.insertTaskLabel(labelBean) + DataBaseManager.get.saveMarkerInLocale(marker) } private fun takePicture() { @@ -1599,9 +1596,9 @@ searchMarkerTimer.cancel() out.write('3'.code) - val result = DataBaseManager.get.queryLabelById(markerId) + val result = DataBaseManager.get.queryMarkerById(markerId) if (result.isNotEmpty()) { - val tag = when (result.first().identifierType) { + val tag = when (result.first().markerId) { "EM30" -> '7' "EM50" -> '8' "EM14" -> '9' @@ -1635,7 +1632,7 @@ binding.markerInfoButton.setOnClickListener { //查库 - val result = DataBaseManager.get.queryLabelById(markerId) + val result = DataBaseManager.get.queryMarkerById(markerId) if (result.isNotEmpty()) { context.navigatePageTo(result.first().toJson()) } else { @@ -1659,7 +1656,7 @@ private fun renderDataPoint(location: AMapLocation) { lifecycleScope.launch(Dispatchers.IO) { val dataPoints = ArrayList() - DataBaseManager.get.loadTaskLabels().forEach { + DataBaseManager.get.loadMarkers().forEach { //单位:米 val distance = AMapUtils.calculateLineDistance( LatLng(latitude, longitude), LatLng(it.lat.toDouble(), it.lng.toDouble()) diff --git a/app/src/main/java/com/casic/detector/view/ObjectDetailActivity.kt b/app/src/main/java/com/casic/detector/view/ObjectDetailActivity.kt index 3033db3..d19b1a1 100644 --- a/app/src/main/java/com/casic/detector/view/ObjectDetailActivity.kt +++ b/app/src/main/java/com/casic/detector/view/ObjectDetailActivity.kt @@ -5,7 +5,7 @@ import android.graphics.drawable.ColorDrawable import android.os.Bundle import android.view.Gravity -import com.casic.detector.bean.LabelBean +import com.casic.detector.bean.MarkerLocalBean import com.casic.detector.databinding.ActivityObjectDetailBinding import com.casic.detector.extensions.appendDownloadUrl import com.casic.detector.utils.FileType @@ -24,7 +24,7 @@ private val kTag = "ObjectDetailActivity" private val context: Context = this@ObjectDetailActivity private val gson by lazy { Gson() } - private lateinit var labelBean: LabelBean + private lateinit var marker: MarkerLocalBean override fun initViewBinding(): ActivityObjectDetailBinding { return ActivityObjectDetailBinding.inflate(layoutInflater) @@ -49,26 +49,26 @@ val objectJson = intent.getStringExtra(Constant.INTENT_PARAM)!! try { - labelBean = gson.fromJson(objectJson, object : TypeToken() {}.type) + marker = gson.fromJson(objectJson, object : TypeToken() {}.type) binding.objectTypeView.text = - LocaleConstant.POINT_TYPE_ARRAY[labelBean.objectType.toInt() - 1] - binding.pipelineTypeView.text = labelBean.pipelineType - binding.pipelineDiameterView.text = labelBean.pipelineDiameter - binding.pipelineMaterialView.text = labelBean.pipelineMaterial - binding.buryMethodView.text = labelBean.buryMethod - binding.buryDeepView.text = labelBean.buryDeep - binding.areaView.text = labelBean.area - binding.lineView.text = labelBean.line - binding.roadView.text = labelBean.road - binding.constructTimeView.text = labelBean.constructTime - binding.ownerView.text = labelBean.owner - binding.identifierIdView.text = labelBean.identifierId - binding.identifierTypeView.text = labelBean.identifierType - binding.identifierDeepView.text = labelBean.identifierDeep - binding.personView.text = labelBean.person - binding.installTimeView.text = labelBean.installTime - binding.remarkView.text = labelBean.remark + LocaleConstant.POINT_TYPE_ARRAY[marker.objectType.toInt() - 1] + binding.pipelineTypeView.text = marker.pipelineType + binding.pipelineDiameterView.text = marker.pipelineDiameter + binding.pipelineMaterialView.text = marker.pipelineMaterial + binding.buryMethodView.text = marker.buryMethod + binding.buryDeepView.text = marker.buryDepth + binding.areaView.text = marker.area + binding.lineView.text = marker.line + binding.roadView.text = marker.road + binding.constructTimeView.text = marker.constructTime + binding.ownerView.text = marker.owner + binding.identifierIdView.text = marker.markerId + binding.identifierTypeView.text = marker.markerType + binding.identifierDeepView.text = marker.markerDepth + binding.personView.text = marker.installationDept + binding.installTimeView.text = marker.updateTime + binding.remarkView.text = marker.remark } catch (e: NumberFormatException) { e.printStackTrace() } @@ -79,7 +79,7 @@ binding.showImageView.setOnClickListener { //查数据库 - if (labelBean.imagePath.isNullOrEmpty()) { + if (marker.imagePath.isNullOrEmpty()) { "此标识器无图片".show(context) } else { val realPaths: ArrayList = ArrayList() //真实图片路径 @@ -87,7 +87,7 @@ /** * /images/markers/202307/0008818922_EVENT_20230704_160349_0_1.jpg,/images/markers/202307/0008818922_EVENT_20230704_160406_0_2.jpg * */ - val imagePath = labelBean.imagePath + val imagePath = marker.imagePath if (imagePath.contains(",")) { val list = imagePath.split(",") list.forEach { path -> diff --git a/app/src/main/java/com/casic/detector/widgets/MarkerDetailDialog.kt b/app/src/main/java/com/casic/detector/widgets/MarkerDetailDialog.kt index 56f4d9b..a63e885 100644 --- a/app/src/main/java/com/casic/detector/widgets/MarkerDetailDialog.kt +++ b/app/src/main/java/com/casic/detector/widgets/MarkerDetailDialog.kt @@ -6,7 +6,7 @@ import android.graphics.drawable.ColorDrawable import android.os.Bundle import com.casic.detector.R -import com.casic.detector.bean.LabelBean +import com.casic.detector.bean.MarkerLocalBean import com.casic.detector.databinding.DialogMarkerDetailBinding import com.casic.detector.utils.LocaleConstant import com.pengxh.kt.lite.extensions.binding @@ -16,10 +16,10 @@ class MarkerDetailDialog constructor(context: Context) : Dialog(context, R.style.UserDefinedDialogStyle) { - private lateinit var labelBean: LabelBean + private lateinit var marker: MarkerLocalBean - fun setMarker(labelBean: LabelBean) { - this.labelBean = labelBean + fun setMarker(marker: MarkerLocalBean) { + this.marker = marker } private val binding: DialogMarkerDetailBinding by binding() @@ -39,23 +39,22 @@ this.initDialogLayoutParams() setCanceledOnTouchOutside(true) - binding.objectTypeView.text = - LocaleConstant.POINT_TYPE_ARRAY[labelBean.objectType.toInt() - 1] - binding.pipelineTypeView.text = labelBean.pipelineType - binding.pipelineDiameterView.text = labelBean.pipelineDiameter - binding.pipelineMaterialView.text = labelBean.pipelineMaterial - binding.buryMethodView.text = labelBean.buryMethod - binding.buryDeepView.text = labelBean.buryDeep - binding.areaView.text = labelBean.area - binding.lineView.text = labelBean.line - binding.roadView.text = labelBean.road - binding.constructTimeView.text = labelBean.constructTime - binding.ownerView.text = labelBean.owner - binding.identifierIdView.text = labelBean.identifierId - binding.identifierTypeView.text = labelBean.identifierType - binding.identifierDeepView.text = labelBean.identifierDeep - binding.personView.text = labelBean.person - binding.installTimeView.text = labelBean.installTime - binding.remarkView.text = labelBean.remark + binding.objectTypeView.text = LocaleConstant.POINT_TYPE_ARRAY[marker.objectType.toInt() - 1] + binding.pipelineTypeView.text = marker.pipelineType + binding.pipelineDiameterView.text = marker.pipelineDiameter + binding.pipelineMaterialView.text = marker.pipelineMaterial + binding.buryMethodView.text = marker.buryMethod + binding.buryDeepView.text = marker.buryDepth + binding.areaView.text = marker.area + binding.lineView.text = marker.line + binding.roadView.text = marker.road + binding.constructTimeView.text = marker.constructTime + binding.ownerView.text = marker.owner + binding.identifierIdView.text = marker.markerId + binding.identifierTypeView.text = marker.markerType + binding.identifierDeepView.text = marker.markerDepth + binding.personView.text = marker.installationDept + binding.installTimeView.text = marker.updateTime + binding.remarkView.text = marker.remark } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/detector/widgets/QueryMarkerDialog.kt b/app/src/main/java/com/casic/detector/widgets/QueryMarkerDialog.kt index 604a6e2..df372ab 100644 --- a/app/src/main/java/com/casic/detector/widgets/QueryMarkerDialog.kt +++ b/app/src/main/java/com/casic/detector/widgets/QueryMarkerDialog.kt @@ -99,20 +99,20 @@ val autoCompleteData = HashSet() CoroutineScope(Dispatchers.Main).launch { val labelBeans = withContext(Dispatchers.IO) { - DataBaseManager.get.loadLabelByCondition( + DataBaseManager.get.loadMarkersByCondition( spinnerArray[position], null ) } for (labelBean in labelBeans) { when (position) { - 0 -> autoCompleteData.add(labelBean.identifierId) + 0 -> autoCompleteData.add(labelBean.markerId) 1 -> autoCompleteData.add(labelBean.area) 2 -> autoCompleteData.add(labelBean.line) 3 -> autoCompleteData.add(labelBean.road) 4 -> autoCompleteData.add(labelBean.owner) - 5 -> autoCompleteData.add(labelBean.person) - 6 -> autoCompleteData.add(labelBean.installTime) + 5 -> autoCompleteData.add(labelBean.installationDept) + 6 -> autoCompleteData.add(labelBean.updateTime) else -> autoCompleteData.add(labelBean.remark) } }