分享一段代码,关于List
2024-08-30 17:05:47
@SuppressWarnings("unchecked")
public List<LogisticsOrderType> getAllLogisticsOrderType() {
String sql = "from LogisticsOrderType t where t.status='A' and t.warehouseUsed=null";
return hibernateTemplate.find(sql + " order by t.id asc");
}
List<LogisticsOrderType> olist = logisticsOrdersTypeService.getAllLogisticsOrderType();
List<LogisticsOrderType> nlist = new ArrayList<LogisticsOrderType>();
if (olist != null && olist.size() > 0) {
for (LogisticsOrderType logisticsOrderType : olist) {
if (logisticsOrderType.getTypeName() != null
&& (logisticsOrderType.getTypeCode().contains("bjfh01"))||(logisticsOrderType.getTypeCode().contains("bjfh02"))) {
nlist.add(logisticsOrderType);
}
}
}
怎么讲感觉写得是有点烦了,大概意思是是获得一个List 再筛选里面的item 再放入一个list中
最新文章
- 关于Java数组
- C++ STL之查找算法
- weblogic目录结构
- Jquery 常用总结
- 查找及修改日程管理系统中的bug
- Diagnostics: File file:/tmp/spark-95cbb984-da28-4784-8b99-eb83ad74437f/__spark_libs__1421840316395076250.zip does not exist
- FPGA-VHDL课堂学习笔记*01
- 汇编语言--微机CPU的指令系统(五)(循环指令)
- 虚拟环境jupyter notebook使用【virtualenv环境】
- fft ocean注解
- PAT 乙级 1072 开学寄语(20 分)
- 让maven使用国内镜像和archetypeCatalog
- 《shiro框架》
- 【JDK1.8】JUC——ReentrantLock
- DevExpress TextEdit Focus问题
- 我的zsh 配置
- java知识回顾
- 3DMax脚本插件--改动材质&;amp;贴图名称
- java常见错误--Access restriction: The type BASE64Encoder
- 洛谷P1434 滑雪