@OverridepublicList<ProductDTO>queryProductByTypes(List<String> typeList){String types = typeList.stream().collect(Collectors.joining(","));List<OpProduct> list =this.list(newLambdaQueryWrapper<OpProduct>().inSql(OpProduct::getId,"select id from op_product where FIND_IN_SET("+"type ,'"+ types +"')"));List<ProductDTO> productDTOS =BeanUtil.copyToList(list,ProductDTO.class);return productDTOS;}
2、运算符Service
@OverridepublicList<ProductDTO>queryProductByTypes(List<String> typeList){// String types = typeList.stream().map(s -> "\'" + s + "\'").collect(Collectors.joining(","));String types = typeList.stream().map(newFunction<String,String>(){@OverridepublicStringapply(String s){return"\'"+ s +"\'";}}).collect(Collectors.joining(","));List<OpProduct> list =this.list(newLambdaQueryWrapper<OpProduct>().inSql(OpProduct::getType, types));List<ProductDTO> productDTOS =BeanUtil.copyToList(list,ProductDTO.class);return productDTOS;}
一、源文件
package cn.itcast.jvm.t3.bytecode;/**
* 演示 字节码指令 和 操作数栈、常量池的关系
*/
public class Demo3_1 {public static void main(String[] args) {int a 10;int b Short.MAX_VALUE 1;int c a b;System.out.println(c);}
}二、反编译的字节码文件
…