feihu.wang
This commit is contained in:
feihu.wang 2022-11-27 11:48:10 +08:00
parent ded0d76d1c
commit ab0b2aae9a
2 changed files with 6 additions and 4 deletions

View File

@ -123,12 +123,14 @@ public class AggregateCommandImpl implements AggregateCommand {
} else {
int model = docList.size() % 2;
if (model == 1) {
doc = docList.get(model);
int pos = docList.size() / 2;
doc = docList.get(pos);
median = new BigDecimal(doc.get(funcField).toString());
} else {
doc = docList.get(model);
int pos = docList.size() / 2;
doc = docList.get(pos);
median = new BigDecimal(doc.get(funcField).toString());
doc = docList.get(model - 1);
doc = docList.get(pos - 1);
BigDecimal tmp = new BigDecimal(doc.get(funcField).toString());
median = median.add(tmp).divide(new BigDecimal(2), 2, 4);
}

View File

@ -2,4 +2,4 @@ ALTER TABLE `engine_rule`
ADD COLUMN `MAX` int(11) NOT NULL DEFAULT 0 COMMENT '最大得分值' AFTER `RATE`;
ALTER TABLE `engine_data_list_records`
ADD COLUMN `DATA_REMARK` varchar(32) NULL COMMENT '数据备注';
ADD COLUMN `DATA_REMARK` varchar(32) NULL COMMENT '数据备注' AFTER `DATA_RECORD`;