mybatis 之 parameterType="java.util.HashMap">
/**
* 根据goods_no 和 goods_id 来查询商品信息
*
* @param goodsNos
* @return
*/
public List<Goods> getGoodsListByIdandNo(Map<String, List> goodsList);
public ServiceMessage<List<Goods>> getGoodsListByIdandNo(
List<Goods> goodsList) {
try {
if (goodsList == null || goodsList.size() <= 0) {
return super.returnParamsError("goodsNoList is null");
}
List<String> list1 = new ArrayList<String>();
List<Long> list2 = new ArrayList<Long>();
Map<String, List> map = new HashMap<String, List>();
for (Goods g : goodsList) {
list1.add(g.getGoodsNo());
list2.add(g.getGoodsId());
}
map.put("list1", list1);
map.put("list2", list2);
return super.returnCorrectResult(iGoodsMapper
.getGoodsListByIdandNo(map));
} catch (Throwable e) {
logger.error(e.getMessage(), e);
return super.returnException(e);
}
}
<select id="getGoodsListByIdandNo" resultMap="goodsResultImg" parameterType="java.util.HashMap">
<if test="list1 != null or list2!= null ">
select g.*, pi.pro_image_url
from goods g
left join (select pig.product_id as product_id,
pig.image_order,
pig.pro_image_url as pro_image_url
from product_img pig
where pig.image_type = 'list'
) pi
on g.product_id = pi.product_id
where g.is_delete = 'N'
<if test="list1 != null">
and g.goods_no in
<foreach item="goodsNo" collection="list1" open="(" close=")" separator=",">
#{goodsNo}
</foreach>
</if>
<if test="list2 != null">
and g.goods_id in
<foreach item="goodsId" collection="list2" open="(" close=")" separator=",">
#{goodsId}
</foreach>
</if>
</if>
</select>
mybatis 之 parameterType="java.util.HashMap">的更多相关文章
- mybatis 之 parameterType="java.util.List"
<!-- 添加 --> <insert id="saveBatchMemberRoleConnRepModel" parameterType="java ...
- mybatis 之 parameterType="String" resultType="java.util.HashMap">
public ServiceMessage<Map<String, String>> getGoodsStockNo( List<Map<String, Strin ...
- org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.util.HashMap
这样的配置有问题吗? <select id="getFreightCollectManagementList" resultMap="java.util.HashM ...
- Mabitis 多表查询(一)resultType=“java.util.hashMap”
1.进行单表查询的时候,xml标签的写法如下 进行多表查询,且无确定返回类型时 xml标签写法如下: <select id="Volume" parameterType=&q ...
- EL1008E: Property or field 'timestamp' cannot be found on object of type 'java.util.HashMap
2018-06-22 09:50:19.488 INFO 20096 --- [nio-8081-exec-2] o.a.c.c.C.[Tomcat].[localhost].[/] : ...
- Could not find result map java.util.HashMap
Could not find result map java.util.HashMap 找不到结果图java.util.HashMap MyBatis 找不到返回的 'resultMap'!把resu ...
- java:警告:[unchecked] 对作为普通类型 java.util.HashMap 的成员的put(K,V) 的调用未经检查
java:警告:[unchecked] 对作为普通类型 java.util.HashMap 的成员的put(K,V) 的调用未经检查 一.问题:学习HashMap时候,我做了这样一个程序: impor ...
- 解决Apache CXF 不支持传递java.sql.Timestamp和java.util.HashMap类型问题
在项目中使用Apache开源的Services Framework CXF来发布WebService,CXF能够很简洁与Spring Framework 集成在一起,在发布WebService的过程中 ...
- LinkedHashMap和HashMap的比较使用 由于现在项目中用到了LinkedHashMap,并不是太熟悉就到网上搜了一下。 ? import java.util.HashMap; impo
LinkedHashMap和HashMap的比较使用 由于现在项目中用到了LinkedHashMap,并不是太熟悉就到网上搜了一下. import java.util.HashMap; import ...
随机推荐
- 《FPGA全程进阶---实战演练》第十四章 蜂鸣器操作
1 基础理论部分 本实验主要是实现蜂鸣器的操作,蜂鸣器的操作是非常简单的,只有把简单的事情做好,方可谈其他复杂的事.本实验部分会利用verilog一些宏定义语句,其实在VGA实验部分已经出现过,这里为 ...
- resin4.0.23+nginx1.1集群
一,web服务器小论 以前的公司使用的web服务器是tomcat(tomcat+apache作集群),现在的公司是一家互联网公司,采用的架构是resin+nginx作集群(resin比tomcat快? ...
- 使用tomcat搭建centos的yum源
最近在折腾大数据,需要搭建一个yum源.一般的做法是在CentOS中安装httpd,然后将rpm包放入/var/www/html下面,再执行[createrepo .]即可. 不过虚拟机对传文件终归是 ...
- CI框架 -- 核心文件 之 Loader.php(加载器)
顾名思义,装载器就是加载元素的,使用CI时,经常加载的有: 加载类库文件:$this->load->library() 加载视图文件:$this->load->view() ...
- application.properties详解 --springBoot配置文件
本文转载:http://blog.csdn.net/lpfsuperman/article/details/78287265###; # spring boot application.propert ...
- 全新WayOS 配置文件保存工具支持蓝色界面路由版本
一直以来都有群里的朋友要求我弄一个支持蓝色界面路由的参数备份工具,也一直拖了大半年 昨天忙到4点多,早上又因为一些小的BUG被用户电话叫起,干脆就帮你们整一个这个工具了 功能还是一样,支持各种参数的保 ...
- springboot+shiro+redis(集群redis版)整合教程
相关教程: 1. springboot+shiro整合教程 2. springboot+shiro+redis(单机redis版)整合教程 3.springboot+shiro+redis(单机red ...
- iOS:if a ViewController is Visible
from:stackoverflow The view's window property is non-nil if a view is currently visible, so check th ...
- CentOS 65 安装vmware tools 杂记
CentOS 65中安装vmware tools时出现如下错误, centos vmware tools install failure ,no default label for /tmp/vmwa ...
- 软件设计模式之模板方法模式(JAVA)
什么是模板方法模式? 定义一个操作中算法的骨架,而将这些步骤延迟到子类中,模板方法使得子类可以不改变一个算法的结构即可重新定义该算法的某些特定步骤. 好抽象的概念啊,文绉绉的东西就是不讨人喜欢,下面我 ...