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 ...
随机推荐
- 2、QT分析之QPushButton的初始化
原文地址:http://blog.163.com/net_worm/blog/static/127702419201001003326522/ 在简单的QT程序的第二行,声明了一个QPushButto ...
- Comparable与Comparator区别
两者都是比较接口 void sort(List<Comparable>); Sorts the specified list in ascending natural order. The ...
- SAP MM01 创建物料主数据 [关注公众号后回复MM01获取更多资料]
操作内容 物料主数据,适用于所有有物料编码物料相关信息的系统维护 业务流程 新项目设计冻结后—M公司 PD用-物料编码申请表D-BOM Material Number Application部门内部 ...
- e814. 创建一个可监听选择状态的菜单项
A menu item can receive notification of selection changes by overriding its menuSelectionChanged() m ...
- e615. Finding the Next Focusable Component
public Component findNextFocus() { // Find focus owner Component c = KeyboardFocusManager.getCurrent ...
- 关于对最新HTML总结PPT讲稿的分享
如果大家还记得HTML,那么2009年的时候可能当时还是HTML1.0时代,而国际化的标准才刚刚开始,对于TABLE表格的使用,还有就是一些常用的标签都是及为简单的,因为当时的代码都是接近于短码,所以 ...
- (原)tslib的交叉编译
今天准备重新来交叉编译qt5.3.1的源码,由于按网上说的,需要先编译tslib,所以拿起来之前的编译源码,打算重新用新的交叉编译工具再次编译一次,在查找资料的过程中浪费了些许时间.其实直接就在使用s ...
- nginx+Uwsgi+Django总结与分析
配置与调试nginx与uwsgi 參考: 1.uWSGI其三:uWSGI搭配Nginx使用 2.学习VirtualEnv和Nginx+uwsgi用于django项目部署 3.部署备忘 4.nginx+ ...
- Java开发者必备的六款工具
每一位Java程序员都会有套工具来应对工作上的挑战.多年来,Java程序员使用软件来完成他们的工作.有很多工具对他们是有用的,不过对于初入行的人员来说,寻找合适的工具是困难的,并且是浪费时间的.而今天 ...
- stdClass object 数据获取方法
$data = stdClass Object ( [code] => [data] => stdClass Object ( [country] => 未分配或者内网IP [cou ...