在.xml文件select查询sql下加上 ${ew.customSqlSegment} 并且在mapper层的构造器前加上 @Param(Constants.WRAPPER) 即可使用QueryWrapper构造器进行查询操作。