// 获得品牌下的商品
            Map<String, Object> params = new HashMap<String, Object>();
            params.put("brands", brandId);
            List<HashMap<String, Object>> productBrands = productBrandService.getBrandProductByBrandId(params);
public List<HashMap<String, Object>> getBrandProductByBrandId(Map<String, Object> params) {
        return commonDao.queryForList("ProductBrand.getBrandProductByBrandId",params);
    }
    <!-- 根据品牌id获取品牌下的商品列表 -->
    <select id="getBrandProductByBrandId" parameterType="Map" resultMap="simpleProductExtBrand">
        select
        pro.*,pi.pro_image_url
        from
        (
        select g.goods_no,
        p.product_id,p.product_name,p.drug_treatment,p.drug_prescription_type,g.goods_id,g.market_price,p.product_least_order,g.sale_amount as
        sale_amount,g.click_amount,g.available_stock,
        (case when
        g.discount_state' and
        to_char(sysdate,'yyyy-mm-dd hh24:mi:dd') between g.begin_time
        and
        g.end_time

        then g.discount_price
        else g.ec_price
        end
        ) as ec_price,
        (case when
        g.discount_state='enable' and to_char(sysdate,'yyyy-mm-dd
        hh24:mi:dd')
        between
        g.begin_time and g.end_time
        then g.promote_phrase
        else ''
        end
        ) as
        promote_phrase
        <!-- 商品评价 -->
        ,(select pe.evaluation_count from product_expand pe where pe.product_id=p.product_id and pe.is_delete='N') as
        commentSum,p.onsale_time,g.discount_state,g.promote_rule_ids
        from
        product p,goods g,product_brand_goods pbg
        where
        p.product_id=g.product_id
        and g.goods_id = pbg.goods_id
        and p.is_delete='N' and
        g.is_delete='N'
        and pbg.is_delete = 'N'
        and p.is_onsale='Y' and g.is_default='Y'
        and g.goods_no not like 'AJ%'
        and pbg.brand_id = #{brands}
        ) pro
        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
        pro.product_id=pi.product_id
    </select>

mybatis 之 parameterType="Map"的更多相关文章

  1. Mybatis 中遍历map 参数中的 list 和 array 属性

    原文:https://blog.csdn.net/liudongdong0909/article/details/51048835 问题在项目有中遇到批量删除操作时,需要根据两个属性去删除数据,其中一 ...

  2. mybatis之parameterType传递多个参数

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

  3. mybatis中parameterType可以写的别名

    mybatis中parameterType可以写的别名 https://blog.csdn.net/sdzhangshulong/article/details/51749807 _byte byte ...

  4. 【mybatis】mybatis中 返回map集合

    关于mybatis返回map集合的操作: 1.mapper.xml中写一个查询返回map的sql <select id="findMap" parameterType=&qu ...

  5. mybatis如何接受map类型的参数

    Mybatis传入参数类型为Map   mybatis更新sql语句: ? 1 2 3 4 5 6 7 8 9 <update id="publishT00_notice" ...

  6. mybatis如何遍历Map的key和value【增删改查】

    转: mybatis如何遍历Map的key和value 2017年11月28日 10:07:57 Joker_Ye 阅读数:4158   1.sql.xml <?xml version=&quo ...

  7. MyBatis中的Map

    接口 int addUserMap(Map<String, Object> map); Mapper.xml <!-- Map比较灵活 传递的值为Map的key,可以为任何(野路子, ...

  8. Mybatis(万能map)

    mybatis(万能map) 我们使用对象作为参数有一个缺点: 我们要在mapper.xml文件和测试中要把所有的字段都写出来,那么,假如一个对象有100个字段,那我们要把这些字段都写出来吗? 所以这 ...

  9. mybatis 之resultType="Map"

    Map map = new HashMap(); map.put("productTypeID", productTypeId); List<HashMap> prod ...

随机推荐

  1. 关于1KB病毒的清除

    以前中过很多次的1KB病毒,这种病毒来源一般都是U盘,就是去打印店插个U盘,回来插自己电脑发现U盘中毒了. 中毒特征就是根目录下的所有文件夹都变成快捷方式,都只有1KB大小,而根目录下的文件和压缩包不 ...

  2. Java相对路径/绝对路径总结

    Version:0.9 StartHTML:-1 EndHTML:-1 StartFragment:00000099 EndFragment:00019826 Java相对路径/绝对路径总结(2) 修 ...

  3. (笔记)Mysql命令delete from:删除记录

    delete from命令用于删除表中的数据. delete from命令格式:delete from 表名 where 表达式 例如,删除表 MyClass中编号为1 的记录:    mysql&g ...

  4. e615. Finding the Next Focusable Component

    public Component findNextFocus() { // Find focus owner Component c = KeyboardFocusManager.getCurrent ...

  5. HttpWebRequest.ReadWriteTimeout 属性

    获取或设置写入或读取流时的超时. 属性值在写入超时或读取超时之前的毫秒数.默认值为 300,000 毫秒(5 分钟). 备注 在写入由 GetRequestStream 方法返回的流时,或在读取由 G ...

  6. C#数据结构----------------------------哈希表源码解析

    转载: C# Hashtable源码剖析 源代码版本为 .NET Framework 4.6.1 本系列持续更新,敬请关注 有投入,有产出. Hashtable实现一个哈希表(也叫散列表),将键映射到 ...

  7. OpenStack Keystone架构

    一. Keystone简介 1. OpenStack Keystone简介 2. Keystone安装与部署 2.1 包安装Keystone 2.2 源码安装源码安装 3 配置运行Keystone 3 ...

  8. Spring Boot 快速搭建的三种方式

    方式一:http://start.spring.io/ 打开浏览器,在地址栏中输入http://start.spring.io/ 如下图:  点击generate project 然后就会有一个zip ...

  9. Xianfeng轻量级Java中间件平台:菜单管理

    通过菜单管理,可以实现系统菜单的权限控制.用户个性化菜单功能等,当然很多系统支持在线开发,不用专门的开发工具编写代码,通过一些简单的设置就能开发出新的功能,有新功能增加到系统中,菜单管理功能也是必不可 ...

  10. PLSQL Developer连接不上64位Oracle 10g的解决办法

    下载instantclient-basic-win32-10.2.0.4.zip 假设Oracle 10g的安装目录为D:\oracle\product\10.2.0\db1 首先,将instantc ...