fix: 调整表字段和备注

haikang
huangfeng 1 year ago
parent 0cb208c280
commit 978f91ba21

@ -1,20 +1,23 @@
CREATE TABLE `icd_file_config` ( CREATE TABLE `icd_config_type` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`ied_name` varchar(45) NOT NULL, `ied_name` varchar(45) NOT NULL COMMENT 'IED名称',
`ldevice_inst` varchar(45) NOT NULL, `ldevice_inst` varchar(45) NOT NULL COMMENT '设备类型',
`ln_class` varchar(45) NOT NULL, `ln_class` varchar(45) NOT NULL COMMENT 'LN类型',
`do_name` varchar(45) NOT NULL, `table_name` varchar(45) DEFAULT NULL COMMENT '表名',
`last_name` varchar(45) DEFAULT NULL,
`table_name` varchar(45) DEFAULT NULL,
`col_name` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `idxKey` (`ied_name`,`ldevice_inst`,`ln_class`,`do_name`) KEY `idxKey` (`ied_name`,`ldevice_inst`,`ln_class`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='ICD配置类型表';
CREATE TABLE `icd_file_config_inst` ( CREATE TABLE `icd_config_type_att` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`config_id` int(11) NOT NULL, `icd_config_type_id` int(11) NOT NULL COMMENT '配置类型表id',
`inst` varchar(45) DEFAULT NULL, `do_name` varchar(45) NOT NULL COMMENT '属性',
`paramindex` varchar(200) DEFAULT NULL, `param` varchar(200) DEFAULT NULL COMMENT '参数',
PRIMARY KEY (`id`), `col_name` varchar(45) DEFAULT NULL COMMENT '字段名',
KEY `idxConfigid` (`config_id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='ICD配置类型属性表';
CREATE TABLE `icd_config_type_inst` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`icd_config_type_id` int(11) NOT NULL COMMENT '配置类型表id',
`inst` varchar(45) NOT NULL COMMENT '实例',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='ICD配置类型实例表';

@ -24,16 +24,16 @@ public class IcdConfigType {
@Column(name = "id") @Column(name = "id")
private Integer id; private Integer id;
@Column(name = "ied_name") @Column(name = "IED名称")
private String iedName; private String iedName;
@Column(name = "ldevice_inst") @Column(name = "设备类型")
private String ldeviceInst; private String ldeviceInst;
@Column(name = "ln_class") @Column(name = "LN类型")
private String lnClass; private String lnClass;
@Column(name = "table_name") @Column(name = "表名")
private String tableName; private String tableName;
@Transient @Transient
@ -46,14 +46,14 @@ public class IcdConfigType {
@Transient @Transient
private List<IcdConfigTypeInst> instList; private List<IcdConfigTypeInst> instList;
public void addAtt(String doName, String lastname) { public void addAtt(String doName, String param) {
if (attMap == null) { if (attMap == null) {
attMap = new LinkedHashMap<>(); attMap = new LinkedHashMap<>();
} }
if (!attMap.containsKey(doName)) { if (!attMap.containsKey(doName)) {
IcdConfigTypeAtt item = IcdConfigTypeAtt.builder() IcdConfigTypeAtt item = IcdConfigTypeAtt.builder()
.doName(doName) .doName(doName)
.lastName(lastname) .param(param)
.build(); .build();
attMap.put(doName, item); attMap.put(doName, item);
} }

@ -24,16 +24,16 @@ public class IcdConfigTypeAtt {
@Column(name = "id") @Column(name = "id")
private Integer id; private Integer id;
@Column(name = "icd_config_type_id") @Column(name = "配置类型表id")
private Integer icdConfigTypeId; private Integer icdConfigTypeId;
@Column(name = "do_name") @Column(name = "属性")
private String doName; private String doName;
@Column(name = "last_name") @Column(name = "参数")
private String lastName; private String param;
@Column(name = "col_name") @Column(name = "字段名")
private String colName; private String colName;
} }

@ -22,10 +22,10 @@ public class IcdConfigTypeInst {
@Column(name = "id") @Column(name = "id")
private Integer id; private Integer id;
@Column(name = "icd_config_type_id") @Column(name = "配置类型表id")
private Integer icdConfigTypeId; private Integer icdConfigTypeId;
@Column(name = "inst") @Column(name = "实例")
private String inst; private String inst;
@Transient @Transient

@ -114,7 +114,7 @@ public class ParamBindServiceImpl implements ParamBindService {
if (StringUtils.isBlank(att.getColName())) { if (StringUtils.isBlank(att.getColName())) {
msgList.add(att.getDoName() + "该属性还未配置绑定字段"); msgList.add(att.getDoName() + "该属性还未配置绑定字段");
} else { } else {
String paramindex = param + "$" + att.getLastName(); String paramindex = param + "$" + att.getParam();
Optional<Rptparamindex> optionalRpt = rptparamindexRepository.findById(paramindex); Optional<Rptparamindex> optionalRpt = rptparamindexRepository.findById(paramindex);
if (!optionalRpt.isPresent()) { if (!optionalRpt.isPresent()) {
throw new Exception("未找到该Rptparamindex对象参引=" + paramindex); throw new Exception("未找到该Rptparamindex对象参引=" + paramindex);
@ -226,7 +226,7 @@ public class ParamBindServiceImpl implements ParamBindService {
List<IcdConfigTypeAtt> attList = attRepository.findByIcdConfigTypeId(type.getId()); List<IcdConfigTypeAtt> attList = attRepository.findByIcdConfigTypeId(type.getId());
for (IcdConfigTypeAtt att : attList) { for (IcdConfigTypeAtt att : attList) {
if (StringUtils.isNotBlank(att.getColName())) { if (StringUtils.isNotBlank(att.getColName())) {
String paramindex = param + "$" + att.getLastName(); String paramindex = param + "$" + att.getParam();
Optional<Rptparamindex> optionalRpt = rptparamindexRepository.findById(paramindex); Optional<Rptparamindex> optionalRpt = rptparamindexRepository.findById(paramindex);
if (!optionalRpt.isPresent()) { if (!optionalRpt.isPresent()) {
throw new Exception(item.getName() + "的字段" + att.getColName() + "对应的属性" throw new Exception(item.getName() + "的字段" + att.getColName() + "对应的属性"

Loading…
Cancel
Save