当前使用版本(必填,否则不予处理)

3.4.3

该问题是如何引起的?(确定最新版也有问题再提!!!)

3.5.5测试也有问题 实际 sensors = {56, 67, 57920},但是query.in("SensorNum", sensors) 在${query.sqlSegment}解析出来是SensorNum IN (null,null,null) 类似query.eq、query.apply,只要有参数都会有问题

  QueryWrapper<SensorInfoEntity> query = new QueryWrapper<>();
  if(!sensors.isEmpty()){
      query .in("SensorNum", sensors);
      count = runStatsMapper.getSensorCountFromDateTypeAndLevel(sensorWrapper, query );
  }

  //runStatsMapper
    @Select("select  count(*) count  from  TVSensorInfo " +
            " ${ew.customSqlSegment}  and ((devId is not null and devId !=0) or position is not null or locationOfDevice is not null or reMark is not null) " +
            "and ${query .sqlSegment} ")
    Integer getSensorCountFromDateTypeAndLevel(@Param("ew") QueryWrapper<SensorInfoEntity> totolWrapper, 
  @Param("query ")QueryWrapper<SensorInfoEntity> query );

重现步骤(如果有就写完整)

MyBatis-Plus ${ew.sqlSegment}解析参数变成NULL

报错信息

null

Comment From: mgjuc

我现在的处理是拼出sql字符串再apply

//level.eq("hierarchicalAlarmType", alarmlevel);  //错误 ${query.sqlSegment} 结果是hierarchicalAlarmType = null
String sql = String.format("hierarchicalAlarmType = %s ", alarmlevel);
level.apply(sql);

Comment From: miemieYaho

不支持多个入场wrapper