<!-- 根据货品编号获取商品价格和库存 -->
    <select id="getGoodsPriceAndStockByGoodsNo" resultMap="goodsResult"
        parameterType="list">
        select a.goods_id,
        a.goods_no,
        a.goods_name,
        a.good_stock,
        a.prepare_stock,
        a.lock_stock,
        a.cost_price,
        a.ec_price,
        a.market_price
        from goods a
        where a.is_delete = 'N'
        and a.goods_no in
        <foreach collection="list" item="listItem" index="index" open="("
            separator="," close=")">
            #{listItem,jdbcType=VARCHAR}
        </foreach>
    </select>
    /**
     * 商品信息批量查询接口,根据goodsNo 获取商品价格和库存信息
     * @param goodsNos
     * @return
     */
    public ServiceMessage<List<Goods>> getGoodsPriceAndStockByGoodsNo(List<String> goodsNos){
        logger.debug("[商品信息批量查询接口]:...");
        if(null==goodsNos||goodsNos.size()==0){
            logger.debug("[商品信息批量查询接口]:...参数错误");
            return super.returnCorrectResult(MsgStatus.PARAMS_ERROR.getCode());
        }
        List<Goods> goodsList =this.iGoodsMapper.getGoodsPriceAndStockByGoodsNo(goodsNos);
        return super.returnCorrectResult(goodsList);
    }
    /**
     * 商品信息批量查询接口,根据goodsNo 获取商品价格和库存信息
     *
     * @param goodsNos
     * @return
     */
    List<Goods> getGoodsPriceAndStockByGoodsNo(List<String> goodsNos);
/**
     * 商品信息批量查询接口,根据goodsNo 获取商品价格和库存信息
     * @param goodsNos
     * @return   getGoodsJsonCheck
     */
    ServiceMessage<List<Goods>> getGoodsPriceAndStockByGoodsNo(List<String> goodsNos);
    @Test
    public void getGoodsPriceAndStockByGoodsNo() {
        GoodsService goodsService = J1SOAHessianHelper.getService(url, GoodsService.class);
        List<String> goodList =new ArrayList<String>();
        goodList.add("AK11933");
        goodList.add("14000");
        ServiceMessage<List<Goods>> result =  goodsService.getGoodsPriceAndStockByGoodsNo(goodList);
        System.out.println(JSON.toJSONString(result));
    }

mybais 之parameterType ="list"的更多相关文章

  1. MyBatis传入参数与parameterType

    参考:http://openwares.net/database/mybatis_parametertype.html Mybatis的Mapper文件中的select.insert.update.d ...

  2. 4.Mybatis的输入映射(parameterType类型解析)

    前面提到过Mybatis可以对输入的参数进行映射,那么现在我们来看一下输入映射,关于输入映射大概可以分为几种情况来学习: 1.基本的类型 2.实体类 3.包装类 1.参数是基本的类型(int,Stri ...

  3. 8.mybatis动态SQL模糊查询 (多参数查询,使用parameterType)

    多参数查询,使用parameterType.实例: 用户User[id, name, age] 1.mysql建表并插入数据 2.Java实体类 public class User { public ...

  4. mybatis的parameterType使用map实现真正的sql随意写

    在dao层给map赋值 纠正一下应该把dd作为传入而不是sbiId; sqlMap中的parameterType="java.util.Map", 就 OK package com ...

  5. MyBatis之传入参数parameterType

    在MyBatis的select.insert.update.delete这些元素中都提到了parameterType这个属性.MyBatis现在可以使用的parameterType有基本数据类型和Ja ...

  6. MyBatis之传入参数——parameterType(转)

    鸣谢:http://blog.csdn.net/liaoxiaohua1981/article/details/6862764 ------------------------------------ ...

  7. 【JAVA - SSM】之MyBatis的ParameterType的使用

    在MyBatis的Mapper.xml文件中,参数的表示方法有两种:一种是使用 "#{XXX}" 的方式表示的,另一种是使用 "${XXX}" 的方式表示的.今 ...

  8. mybati之parameterType传递多个参数

    当在查询的时候需要传入多个参数的时候该怎么办呢: 1,封装成一个Model对象,底层HashMap还是一个 User user=new User(); user.setUserName("z ...

  9. parameterType 和 resultType

    parameterType #{} 和 ${} 1.#{}实现的是向prepareStatement中的预处理语句中设置参数值,sql语句中#{}表示一个占位符即?. 2.使用占位符#{}可以有效防止 ...

随机推荐

  1. "add-apt-repository" On Linux

    在 Ubuntu 9.10以后 我们可以使用 "add-apt-repository" 脚本添加 ppa 到当前的库中并且自动导入公钥. 再终端下使用下面的语法: add-apt- ...

  2. Axiom3D:Ogre射线与点,线,面相交,鼠标操作3维空间.

    在第一篇网络分解成点,线,面.第二篇分别点以球形,线以圆柱,面分别以MergerBatch整合批次显示.因为整合批次显示后,相应的点,线,面不能以Ogre本身的射线来选取,因为整合后,以点举例,多个点 ...

  3. jQuery AJAX中文乱码处理

    最近工作中用jQuery ajax返回出现乱码,用的Notepad++编辑器,当JS部分传递中文时,另一页面接收的话会出现乱码,在网上找了很多方法,基本上没有很好的解决. 页面用GB2312编码,JS ...

  4. win10: This file can't be opened

    win10打开bat脚本,不能运行,提示This file can't be opened. 解决方法如下: http://johnklann.com/these-files-cant-be-open ...

  5. Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.【转】

    今天碰到了一个查询异常问题,上网查了一下,感谢原创和译者 如果你使用的数据库连接类是 the Data Access Application Blocks "SqlHelper" ...

  6. 转载:帮你提升 Python 的 27 种编程语言

    帮你提升 Python 的 27 种编程语言: 出处:http://www.oschina.net/translate/languages-to-improve-your-python

  7. http_build_query用法

    http_build_query (PHP 5) http_build_query -- 生成 url-encoded 之后的请求字符串描述string http_build_query ( arra ...

  8. yii2 页面渲染方法解析

    render渲染.renderPartial渲染部分.renderContent.renderAjax.renderFile ① render显示view和layout ② renderPartial ...

  9. vue form表单绑定事件与方法

    使用v-on绑定事件 <button @click="hello">Hello</button><br /> <button @click ...

  10. Data Set Config配置元件

    右键点击Jmeter中需要参数化的某个请求,选择添加——配置原件——CSV Data Set Config,会添加一个CSV Data Set Config,需要设置相关的一些内容,具体如下: