码迷,mamicode.com
首页 > 其他好文 > 详细

mybatis 之resultType="HashMap" parameterType="list"

时间:2017-08-03 18:50:02      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:catalog   java   商品   throw   cto   property   参数   信息   proc   

     <!-- 查询商品仓库信息 -->
    <select id="loadGoodsStock" resultType="HashMap" parameterType="list">
        select  g.goods_id,
                g.stock_id,
                s.STOCK_NO,
                s.STOCK_NAME,
                g.goods_seller
        from 
        goods g , stock s
        where g.STOCK_ID = s.STOCK_ID and
         g.goods_id  in  
         <foreach collection="list" item="listItem" index="index" open="("
            separator="," close=")">
            #{listItem}
        </foreach>
    </select>

 

    public List<Map<String, Object>> loadGoodsStock(List<Long> goodsIds);
    public ServiceMessage<List<Map<String, Object>>> queryGoodsStockInfo(List<Long> goodsIds) {
        try {
            if (goodsIds == null || goodsIds.size() < 1) {
                return super.returnParamsError("查询仓库信息参数为空goodsIds");
            }
            List<Map<String, Object>> goodsList = goodsMapper.loadGoodsStock(goodsIds);
            return super.returnCorrectResult(goodsList);
        } catch (Throwable e) {
            return super.returnException(e);
        }
    }

 

    <resultMap id="simpleProductExtLucene" type="HashMap">
        <result column="goods_no" property="goodsNo" />
        <result column="pro_catalog_id" property="proCatalogId" />
        <result column="pro_catalog_name" property="proCatalogName" />
        <result column="PROMOTE_PHRASE" property="promotePhrase"
            javaType="String" />
        <result column="EC_PRICE" property="ecPrice" javaType="String" />
        <result column="MARKET_PRICE" property="marketPrice" javaType="decimal" />
        <result column="PRO_IMAGE_URL" property="proImageUrl" javaType="String" />
        <result column="TAG_ICON_URL" property="tagIconUrl" javaType="String" />
        <result column="DRUG_PRESCRIPTION_TYPE" property="drugPrescriptionType"
            javaType="String" />
        <result column="PRODUCT_LEAST_ORDER" property="productLeastOrder"
            javaType="decimal" />
        <result column="ORDER_LIMIT_AMOUNT" property="orderLimitAmount"
            javaType="decimal" />
        <result column="AVAILABLE_STOCK" property="availableStock"
            javaType="decimal" />
        <result column="PRODUCT_ID" property="productId" />
        <result column="GOODS_ID" property="goodsId" />
        <result column="GOODS_NAME" property="goodsName" />
        <result column="SALE_AMOUNT" property="saleAmount" />
        <result column="CLICK_AMOUNT" property="clickAmount" />
        <result column="GOODS_NAME" property="productName" />
        <result column="PRODUCT_CHN_NO" property="productChnNo" />
        <result column="MOBILE_SPECIAL" property="mobileSpecial" />
        <result column="DRUG_TREATMENT" property="drugTreatment"
            javaType="String" />
        <result column="product_keyword" property="productKeyword" />
        <result column="product_brand_name" property="productBrandName" />
        <result column="product_order" property="productOrder" />
        <result column="FULL_INDEX" property="fullIndex"/>
    </resultMap>
    

 

mybatis 之resultType="HashMap" parameterType="list"

标签:catalog   java   商品   throw   cto   property   参数   信息   proc   

原文地址:http://www.cnblogs.com/wangchuanfu/p/7281239.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!