A17404李放 преди 3 години
родител
ревизия
fcd38309d5

+ 6 - 0
nb-common/src/main/java/com/coffee/common/config/CacheHttpServletRequestWrapper.java

@@ -8,6 +8,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequestWrapper;
 import java.io.*;
 import java.nio.charset.Charset;
+import java.util.Map;
 
 public class CacheHttpServletRequestWrapper extends HttpServletRequestWrapper {
 
@@ -29,6 +30,11 @@ public class CacheHttpServletRequestWrapper extends HttpServletRequestWrapper {
         return new BufferedReader(new InputStreamReader(getInputStream(),Charset.defaultCharset()));
     }
 
+    @Override
+    public Map<String, String[]> getParameterMap() {
+        return super.getParameterMap();
+    }
+
     @Override
     public ServletInputStream getInputStream() throws IOException {
 

+ 5 - 1
nb-common/src/main/java/com/coffee/common/config/websocket/DefaultMessageListener.java

@@ -39,14 +39,18 @@ public class DefaultMessageListener implements PatternMessageListener<TopicMessa
                 json = objectMapper.writeValueAsString(MessageResponse.of(id, "result", msg.getParam(),
                         msg.getMessage()));
                 Tio.send(channelContext, WsResponse.fromText(json, WsPacket.CHARSET_NAME));
+                if(log.isDebugEnabled()){
+                    log.debug("通道【{}】发送消息【{}】",channelContext.toString(),json);
+                }
             } catch (JsonProcessingException e) {
                 log.error("ws消息订阅,解析失败,message:【】", JSONUtil.toJsonStr(msg));
             }
         }else {
             channelContext.setClosed(true);
             rPatternTopic.removeListener(this);
+            Tio.remove(channelContext,"通道已关闭,移除该通道");
             if(log.isDebugEnabled()){
-                Tio.remove(channelContext,"通道已关闭,移除该通道");
+                log.debug("通道已关闭【{}】",channel.toString());
             }
         }
     }

+ 0 - 21
nb-common/src/main/java/com/coffee/common/config/websocket/WebSocketUtil.java

@@ -1,21 +0,0 @@
-package com.coffee.common.config.websocket;
-
-import cn.hutool.extra.spring.SpringUtil;
-import org.springframework.data.redis.core.RedisTemplate;
-
-/**
- * @author lifang
- * @version 1.0.0
- * @ClassName WebSocketUtils.java
- * @Description TODO
- * @createTime 2022年04月08日 16:16:00
- */
-public class WebSocketUtil {
-    private static RedisTemplate redisTemplate;
-    public static void sendMessage(String topic, Object message){
-        if(redisTemplate==null){
-            redisTemplate=SpringUtil.getBean(RedisTemplate.class);
-        }
-        redisTemplate.convertAndSend(topic, message);
-    }
-}

+ 1 - 1
nb-framework/src/main/java/com/coffee/framework/config/SaTokenConfig.java

@@ -32,7 +32,7 @@ public class SaTokenConfig {
     private static final List<String> IGNORE_URL = Lists.newArrayList();
 
     static {
-        IGNORE_URL.add("/app/favicon.ico");
+        IGNORE_URL.add("/api/favicon.ico");
         IGNORE_URL.add("/sys/app/get");
         IGNORE_URL.add("/index");
         IGNORE_URL.add("/login");

+ 4 - 4
nb-system/src/main/java/com/coffee/bus/controller/BusClinicController.java

@@ -97,7 +97,7 @@ public class BusClinicController {
                 List<BusInfusionHistoryEntity> infusionHistories = infusionHistoryService.list(new QueryWrapper<BusInfusionHistoryEntity>().lambda()
                         .eq(BusInfusionHistoryEntity::getClinicId, clinicId)
                         .orderByAsc(BusInfusionHistoryEntity::getStartTime));
-                log.info("《《《《《《《《《《《《《《《《《填充输注记录结束》》》》》》》》》》》》》》》》");
+                log.debug("《《《《《《《《《《《《《《《《《填充输注记录结束》》》》》》》》》》》》》》》》");
                 if(CollUtil.isNotEmpty(infusionHistories)){
                     result.fillUndoInfo(infusionHistories);
                     //添加设备别名
@@ -116,7 +116,7 @@ public class BusClinicController {
                             });
                         }
                     }
-                    log.info("《《《《《《《《《《《《《《《《《添加设备别名结束》》》》》》》》》》》》》》》》");
+                    log.debug("《《《《《《《《《《《《《《《《《添加设备别名结束》》》》》》》》》》》》》》》》");
                     List<String> infusionIds = infusionHistories.stream().map(BusInfusionHistoryEntity::getId).collect(Collectors.toList());
                     List<BusInfusionModifyEntity> infusionModifies = infusionModifyService.list(new QueryWrapper<BusInfusionModifyEntity>().lambda()
                             .in(BusInfusionModifyEntity::getInfusionId, infusionIds));
@@ -128,7 +128,7 @@ public class BusClinicController {
                                     BusDeviceHistoryEntity::getPcaInvalidCount,BusDeviceHistoryEntity::getInputDose,BusDeviceHistoryEntity::getUploadTime)
                             .in(BusDeviceHistoryEntity::getInfusionId, infusionIds)
                             .eq(BusDeviceHistoryEntity::getMaster, true));
-                    log.info("《《《《《《《《《《《《《《《《《查询设备历史结束》》》》》》》》》》》》》》》》");
+                    log.debug("《《《《《《《《《《《《《《《《《查询设备历史结束》》》》》》》》》》》》》》》》");
                     //标记输注
                     result.markInfusion(deviceHistories);
                     List<ClinicStatsQueryResult> statsQueryResults = deviceHistories.stream().map(history -> {
@@ -141,7 +141,7 @@ public class BusClinicController {
                     }).collect(Collectors.toList());
                     //填充统计信息
                     result.setStats(ClinicStatsReturnResult.of(statsQueryResults));
-                    log.info("《《《《《《《《《《《《《《《《《填充统计信息结束》》》》》》》》》》》》》》》》");
+                    log.debug("《《《《《《《《《《《《《《《《《填充统计信息结束》》》》》》》》》》》》》》》》");
 
                 }
             }

+ 2 - 1
nb-system/src/main/java/com/coffee/bus/hospital/HospitalManager.java

@@ -209,7 +209,7 @@ public class HospitalManager {
             }
             return;
         }
-         schedule = singleThreadEventExecutor.schedule(() -> {
+        schedule = singleThreadEventExecutor.schedule(() -> {
             scheduleHis();
             singleThreadEventExecutor.schedule(this::scheduleHis, updateConfig.getInterval(), TimeUnit.MINUTES);
         }, updateConfig.getInterval(), TimeUnit.MINUTES);
@@ -227,6 +227,7 @@ public class HospitalManager {
         //拉取最新的50条输注信息,更新病人数据
         Page<BusInfusionHistoryEntity> infusionHistoryPage = new Page<>(0,50,false);
         infusionHistoryPage= infusionHistoryService.page(infusionHistoryPage, new QueryWrapper<BusInfusionHistoryEntity>().lambda().eq(BusInfusionHistoryEntity::getTenantId, hospitalId)
+                .eq(BusInfusionHistoryEntity::getFinished,false)
                 .orderByDesc(BusInfusionHistoryEntity::getLastUploadTime));
         List<BusInfusionHistoryEntity> records = infusionHistoryPage.getRecords();
         if(CollUtil.isNotEmpty(records)){

+ 37 - 18
nb-system/src/main/java/com/coffee/bus/service/LocalBusHospitalConfigService.java

@@ -14,6 +14,11 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 
 /**
  * @author lifang
@@ -66,19 +71,30 @@ public class LocalBusHospitalConfigService extends BaseService<BusHospitalConfig
     @Transactional(rollbackFor = Exception.class)
     public void setDefaultConfig(String hospitalId, ConfigEnum type){
         //找到默认医院的配置
-        BusHospitalConfigEntity defaultConfig = getDefaultConfig(type);
-        BusHospitalConfigEntity hospitalConfig = this.getOne(new QueryWrapper<BusHospitalConfigEntity>()
-                .lambda()
-                .eq(BusHospitalConfigEntity::getType, type)
-                .eq(BusHospitalConfigEntity::getTenantId, hospitalId));
-        BusHospitalConfigEntity saveOrUpdate = new BusHospitalConfigEntity();
-        if(hospitalConfig!=null){
-            saveOrUpdate.setId(hospitalConfig.getId());
-        };
-        saveOrUpdate.setConfig(defaultConfig.getConfig());
-        saveOrUpdate.setType(type);
-        saveOrUpdate.setTenantId(hospitalId);
-        this.saveOrUpdate(saveOrUpdate);
+
+        BusHospitalConfigEntity defaultConfig = null;
+        try {
+            defaultConfig = getDefaultConfig(type);
+            BusHospitalConfigEntity hospitalConfig = this.getOne(new QueryWrapper<BusHospitalConfigEntity>()
+                    .lambda()
+                    .eq(BusHospitalConfigEntity::getType, type)
+                    .eq(BusHospitalConfigEntity::getTenantId, hospitalId));
+            BusHospitalConfigEntity saveOrUpdate = new BusHospitalConfigEntity();
+            if(hospitalConfig!=null){
+                saveOrUpdate.setId(hospitalConfig.getId());
+            };
+            saveOrUpdate.setConfig(defaultConfig.getConfig());
+            saveOrUpdate.setType(type);
+            saveOrUpdate.setTenantId(hospitalId);
+            this.saveOrUpdate(saveOrUpdate);
+        } catch (InterruptedException e) {
+            log.error("获取默认医院配置出错",e);
+        } catch (ExecutionException e) {
+            log.error("获取默认医院配置出错",e);
+        } catch (TimeoutException e) {
+            log.error("获取默认医院配置出错",e);
+        }
+
     }
 
 
@@ -101,11 +117,14 @@ public class LocalBusHospitalConfigService extends BaseService<BusHospitalConfig
         } catch (Exception e){}
     }
 
-    public BusHospitalConfigEntity getDefaultConfig( ConfigEnum type){
-        return this.getOne(new QueryWrapper<BusHospitalConfigEntity>()
-                .lambda()
-                .eq(BusHospitalConfigEntity::getType,type.getValue())
-                .eq(BusHospitalConfigEntity::getTenantId, "1"));
+    public BusHospitalConfigEntity getDefaultConfig( ConfigEnum type) throws InterruptedException, ExecutionException, TimeoutException {
+        return Optional.ofNullable(CompletableFuture.supplyAsync(()->
+                this.getOne(new QueryWrapper<BusHospitalConfigEntity>()
+                        .lambda()
+                        .eq(BusHospitalConfigEntity::getType,type.getValue())
+                        .eq(BusHospitalConfigEntity::getTenantId, "1"))
+        )
+                .get(3, TimeUnit.SECONDS)).orElse(new BusHospitalConfigEntity());
     }
 
 

+ 11 - 0
nb-system/src/main/java/com/coffee/bus/service/dto/PatientMonitorResult.java

@@ -1,12 +1,14 @@
 package com.coffee.bus.service.dto;
 
 import cn.hutool.core.text.CharSequenceUtil;
+import cn.hutool.core.util.StrUtil;
 import com.coffee.bus.enums.*;
 import com.coffee.common.enums.SexEnum;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import lombok.ToString;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -21,6 +23,7 @@ import java.util.Date;
  */
 @ApiModel("病人监控实体")
 @Data
+@ToString
 public class PatientMonitorResult implements Serializable {
     @ApiModelProperty(value = "病号")
     private String patientCode;
@@ -245,4 +248,12 @@ public class PatientMonitorResult implements Serializable {
         judgeWarnLowBattery();
         judgeWarnWillFinished();
     }
+
+    public String getWarns() {
+        if (StrUtil.isNotEmpty(warns)) {
+            return warns.endsWith(";")&&warns.length()>2?warns.substring(0,warns.length()-1):warns;
+        }
+        return warns;
+
+    }
 }

+ 1 - 0
nb-system/src/main/java/com/coffee/bus/stats/report/WeightStatsReport.java

@@ -68,6 +68,7 @@ public class WeightStatsReport implements CommonStats<CombineResult> {
             String weight = combineResult.getWeight();
             if(CharSequenceUtil.isBlank(weight)){
                 ageMap.merge(WeightRangeEnum.unkown,1,(t1, t2)->t1+t2);
+                continue;
             }
             try {
                 BigDecimal count = BigDecimal.valueOf(Double.valueOf(weight));

+ 5 - 0
nb-system/src/main/java/com/coffee/bus/utils/WsPublishUtils.java

@@ -2,6 +2,7 @@ package com.coffee.bus.utils;
 
 
 import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
 import com.coffee.bus.enums.PatientAlarmEnum;
 import com.coffee.bus.service.LocalBusPatientService;
 import com.coffee.bus.service.dto.MonitorStatusStatsCountResult;
@@ -46,7 +47,11 @@ public class WsPublishUtils implements Serializable{
     @Async
     public void publishPatientMonitor(String patientCode,String tenantId){
         Assert.hasText(tenantId,"医院id不能为空");
+        log.info("推送病号数据【{}】", JSONUtil.toJsonStr(patientCode));
         PatientMonitorResult message = patientService.lookMonitorByPatientCode(patientCode, tenantId);
+        if (log.isDebugEnabled()) {
+            log.debug("推送病号当前状态,【{}】",JSONUtil.toJsonStr(message));
+        }
         if(message!=null){
             message.handleWarn();
             this.publish(WebSocketConstant.getPatientMonitor(null, patientCode, tenantId).getTopic(),

+ 0 - 2
nb-system/src/main/java/com/coffee/bus/websocket/listener/DeviceInfoListener.java

@@ -119,9 +119,7 @@ public class DeviceInfoListener {
             }
 
             cacheOperation.add(()->{
-//                if (Boolean.TRUE.equals(device.getMaster())) {
                 wsPublishUtils.publishPatientMonitor(device.getPatientCode(),device.getTenantId());
-//                }
                 if (Boolean.TRUE.equals(device.isResetUndo())||Boolean.TRUE.equals(device.isInfusionModify())) {
                     if (Boolean.TRUE.equals(device.isInfusionModify())) {
                         wsPublishUtils.publishDeviceNone(device.getTenantId());

+ 41 - 41
nb-system/src/main/resources/mapper/bus/BusInfusionHistoryMapper.xml

@@ -183,16 +183,16 @@
         from (select * from bus_infusion_history
         <where>
             <if test="query.startTimeRange != null and query.startTimeRange.size > 0">
-                and start_time &gt;  #{query.startTimeRange[0]}
+                and start_time &gt;=  #{query.startTimeRange[0]}
                 <if test="query.startTimeRange.size >1 ">
-                    and start_time &lt;  #{query.startTimeRange[1]}
+                    and start_time &lt;=  #{query.startTimeRange[1]}
                 </if>
             </if>
 
             <if test="query.undoTimeRange != null and query.undoTimeRange.size > 0">
-                and undo_time &gt;  #{query.undoTimeRange[0]}
+                and undo_time &gt;=  #{query.undoTimeRange[0]}
                 <if test="query.startTimeRange.size >1 ">
-                    and undo_time &lt;  #{query.undoTimeRange[1]}
+                    and undo_time &lt;=  #{query.undoTimeRange[1]}
                 </if>
             </if>
 
@@ -210,16 +210,16 @@
 
 
             <if test="query.validPcaCountRange != null and query.validPcaCountRange.size > 0">
-                and pca_valid_count &gt;  #{query.validPcaCountRange[0]}
+                and pca_valid_count &gt;=  #{query.validPcaCountRange[0]}
                 <if test="query.validPcaCountRange.size >1 ">
-                    and pca_valid_count &lt;  #{query.validPcaCountRange[1]}
+                    and pca_valid_count &lt;=  #{query.validPcaCountRange[1]}
                 </if>
             </if>
 
             <if test="query.inValidPcaCountRange != null and query.inValidPcaCountRange.size > 0">
-                and pca_invalid_count &gt;  #{query.inValidPcaCountRange[0]}
+                and pca_invalid_count &gt;=  #{query.inValidPcaCountRange[0]}
                 <if test="query.inValidPcaCountRange.size >1 ">
-                    and pca_invalid_count &lt;  #{query.inValidPcaCountRange[1]}
+                    and pca_invalid_count &lt;=  #{query.inValidPcaCountRange[1]}
                 </if>
             </if>
 
@@ -261,16 +261,16 @@
             </if>
 
             <if test="query.ageRange != null and query.ageRange.size > 0">
-                and patient_age &gt;  #{query.ageRange[0]}
+                and patient_age &gt;=  #{query.ageRange[0]}
                 <if test="query.ageRange.size >1 ">
-                    and patient_age &lt;  #{query.ageRange[1]}
+                    and patient_age &lt;=  #{query.ageRange[1]}
                 </if>
             </if>
 
             <if test="query.weightRange != null and query.weightRange.size > 0">
-                and weight &gt;  #{query.weightRange[0]}
+                and weight &gt;=  #{query.weightRange[0]}
                 <if test="query.weightRange.size >1 ">
-                    and weight &lt;  #{query.weightRange[1]}
+                    and weight &lt;=  #{query.weightRange[1]}
                 </if>
             </if>
 
@@ -351,16 +351,16 @@
         from (select * from bus_infusion_history
         <where>
             <if test="query.startTimeRange != null and query.startTimeRange.size > 0">
-                and start_time &gt;  #{query.startTimeRange[0]}
+                and start_time &gt;=  #{query.startTimeRange[0]}
                 <if test="query.startTimeRange.size >1 ">
-                    and start_time &lt;  #{query.startTimeRange[1]}
+                    and start_time &lt;=  #{query.startTimeRange[1]}
                 </if>
             </if>
 
             <if test="query.undoTimeRange != null and query.undoTimeRange.size > 0">
-                and undo_time &gt;  #{query.undoTimeRange[0]}
+                and undo_time &gt;=  #{query.undoTimeRange[0]}
                 <if test="query.startTimeRange.size >1 ">
-                    and undo_time &lt;  #{query.undoTimeRange[1]}
+                    and undo_time &lt;=  #{query.undoTimeRange[1]}
                 </if>
             </if>
 
@@ -373,16 +373,16 @@
             </if>
 
             <if test="query.validPcaCountRange != null and query.validPcaCountRange.size > 0">
-                and pca_valid_count &gt;  #{query.validPcaCountRange[0]}
+                and pca_valid_count &gt;=  #{query.validPcaCountRange[0]}
                 <if test="query.validPcaCountRange.size >1 ">
                     and pca_valid_count &lt;  #{query.validPcaCountRange[1]}
                 </if>
             </if>
 
             <if test="query.inValidPcaCountRange != null and query.inValidPcaCountRange.size > 0">
-                and pca_invalid_count &gt;  #{query.inValidPcaCountRange[0]}
+                and pca_invalid_count &gt;=  #{query.inValidPcaCountRange[0]}
                 <if test="query.inValidPcaCountRange.size >1 ">
-                    and pca_invalid_count &lt;  #{query.inValidPcaCountRange[1]}
+                    and pca_invalid_count &lt;=  #{query.inValidPcaCountRange[1]}
                 </if>
             </if>
 
@@ -502,9 +502,9 @@
         from (select * from bus_infusion_history
         <where>
             <if test="query.startTimeRange != null and query.startTimeRange.size > 0">
-                and start_time &gt;  #{query.startTimeRange[0]}
+                and start_time &gt;=  #{query.startTimeRange[0]}
                 <if test="query.startTimeRange.size >1 ">
-                    and start_time &lt;  #{query.startTimeRange[1]}
+                    and start_time &lt;=  #{query.startTimeRange[1]}
                 </if>
             </if>
 
@@ -524,16 +524,16 @@
             </if>
 
             <if test="query.validPcaCountRange != null and query.validPcaCountRange.size > 0">
-                and pca_valid_count &gt;  #{query.validPcaCountRange[0]}
+                and pca_valid_count &gt;=  #{query.validPcaCountRange[0]}
                 <if test="query.validPcaCountRange.size >1 ">
-                    and pca_valid_count &lt;  #{query.validPcaCountRange[1]}
+                    and pca_valid_count &lt;=  #{query.validPcaCountRange[1]}
                 </if>
             </if>
 
             <if test="query.inValidPcaCountRange != null and query.inValidPcaCountRange.size > 0">
-                and pca_invalid_count &gt;  #{query.inValidPcaCountRange[0]}
+                and pca_invalid_count &gt;=  #{query.inValidPcaCountRange[0]}
                 <if test="query.inValidPcaCountRange.size >1 ">
-                    and pca_invalid_count &lt;  #{query.inValidPcaCountRange[1]}
+                    and pca_invalid_count &lt;=  #{query.inValidPcaCountRange[1]}
                 </if>
             </if>
 
@@ -575,16 +575,16 @@
             </if>
 
             <if test="query.ageRange != null and query.ageRange.size > 0">
-                and patient_age &gt;  #{query.ageRange[0]}
+                and patient_age &gt;=  #{query.ageRange[0]}
                 <if test="query.ageRange.size >1 ">
-                    and patient_age &lt;  #{query.ageRange[1]}
+                    and patient_age &lt;=  #{query.ageRange[1]}
                 </if>
             </if>
 
             <if test="query.weightRange != null and query.weightRange.size > 0">
-                and weight &gt;  #{query.weightRange[0]}
+                and weight &gt;=  #{query.weightRange[0]}
                 <if test="query.weightRange.size >1 ">
-                    and weight &lt;  #{query.weightRange[1]}
+                    and weight &lt;=  #{query.weightRange[1]}
                 </if>
             </if>
 
@@ -660,16 +660,16 @@
         from (select * from bus_infusion_history
         <where>
             <if test="query.startTimeRange != null and query.startTimeRange.size > 0">
-                and start_time &gt;  #{query.startTimeRange[0]}
+                and start_time &gt;=  #{query.startTimeRange[0]}
                 <if test="query.startTimeRange.size >1 ">
-                    and start_time &lt;  #{query.startTimeRange[1]}
+                    and start_time &lt;=  #{query.startTimeRange[1]}
                 </if>
             </if>
 
             <if test="query.undoTimeRange != null and query.undoTimeRange.size > 0">
-                and undo_time &gt;  #{query.undoTimeRange[0]}
+                and undo_time &gt;=  #{query.undoTimeRange[0]}
                 <if test="query.startTimeRange.size >1 ">
-                    and undo_time &lt;  #{query.undoTimeRange[1]}
+                    and undo_time &lt;=  #{query.undoTimeRange[1]}
                 </if>
             </if>
 
@@ -682,16 +682,16 @@
             </if>
 
             <if test="query.validPcaCountRange != null and query.validPcaCountRange.size > 0">
-                and pca_valid_count &gt;  #{query.validPcaCountRange[0]}
+                and pca_valid_count &gt;=  #{query.validPcaCountRange[0]}
                 <if test="query.validPcaCountRange.size >1 ">
-                    and pca_valid_count &lt;  #{query.validPcaCountRange[1]}
+                    and pca_valid_count &lt;=  #{query.validPcaCountRange[1]}
                 </if>
             </if>
 
             <if test="query.inValidPcaCountRange != null and query.inValidPcaCountRange.size > 0">
-                and pca_invalid_count &gt;  #{query.inValidPcaCountRange[0]}
+                and pca_invalid_count &gt;=  #{query.inValidPcaCountRange[0]}
                 <if test="query.inValidPcaCountRange.size >1 ">
-                    and pca_invalid_count &lt;  #{query.inValidPcaCountRange[1]}
+                    and pca_invalid_count &lt;=  #{query.inValidPcaCountRange[1]}
                 </if>
             </if>
 
@@ -733,16 +733,16 @@
             </if>
 
             <if test="query.ageRange != null and query.ageRange.size > 0">
-                and patient_age &gt;  #{query.ageRange[0]}
+                and patient_age &gt;=  #{query.ageRange[0]}
                 <if test="query.ageRange.size >1 ">
-                    and patient_age &lt;  #{query.ageRange[1]}
+                    and patient_age &lt;=  #{query.ageRange[1]}
                 </if>
             </if>
 
             <if test="query.weightRange != null and query.weightRange.size > 0">
-                and weight &gt;  #{query.weightRange[0]}
+                and weight &gt;=  #{query.weightRange[0]}
                 <if test="query.weightRange.size >1 ">
-                    and weight &lt;  #{query.weightRange[1]}
+                    and weight &lt;=  #{query.weightRange[1]}
                 </if>
             </if>