mybatis 之 parameterType="Map"
// 获得品牌下的商品 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"的更多相关文章
- Mybatis 中遍历map 参数中的 list 和 array 属性
原文:https://blog.csdn.net/liudongdong0909/article/details/51048835 问题在项目有中遇到批量删除操作时,需要根据两个属性去删除数据,其中一 ...
- mybatis之parameterType传递多个参数
当在查询的时候需要传入多个参数的时候该怎么办呢: 1,封装成一个Model对象,底层HashMap还是一个 User user=new User(); user.setUserName("z ...
- mybatis中parameterType可以写的别名
mybatis中parameterType可以写的别名 https://blog.csdn.net/sdzhangshulong/article/details/51749807 _byte byte ...
- 【mybatis】mybatis中 返回map集合
关于mybatis返回map集合的操作: 1.mapper.xml中写一个查询返回map的sql <select id="findMap" parameterType=&qu ...
- mybatis如何接受map类型的参数
Mybatis传入参数类型为Map mybatis更新sql语句: ? 1 2 3 4 5 6 7 8 9 <update id="publishT00_notice" ...
- mybatis如何遍历Map的key和value【增删改查】
转: mybatis如何遍历Map的key和value 2017年11月28日 10:07:57 Joker_Ye 阅读数:4158 1.sql.xml <?xml version=&quo ...
- MyBatis中的Map
接口 int addUserMap(Map<String, Object> map); Mapper.xml <!-- Map比较灵活 传递的值为Map的key,可以为任何(野路子, ...
- Mybatis(万能map)
mybatis(万能map) 我们使用对象作为参数有一个缺点: 我们要在mapper.xml文件和测试中要把所有的字段都写出来,那么,假如一个对象有100个字段,那我们要把这些字段都写出来吗? 所以这 ...
- mybatis 之resultType="Map"
Map map = new HashMap(); map.put("productTypeID", productTypeId); List<HashMap> prod ...
随机推荐
- ubuntu lapack安装与使用
https://blog.csdn.net/zouyu1746430162/article/details/53374693 https://blog.csdn.net/mlnotes/article ...
- C++ 指针二维数组, C++二维指针数组笔记
C++ 二维动态数组 一. 已知第一维 #include <iostream> using namespace std; int main(int argc, char const *ar ...
- SAP 金税接口代码 供参考
程序可以通过抓取 客户 开票信息等 下载文本 导出 需要事先创建好几个structure zc0000sdt0016, zc0000sdt0017 REPORT zc0000sdr0016 NO ST ...
- (笔记)Linux服务器中判断客户端socket断开连接的方法
下面来罗列一下判断远端已经断开的方法:(转自http://blog.csdn.net/god2469/article/details/8801356) 法一: 当recv()返回值小于等于0时,soc ...
- Going deeper with convolutions 这篇论文
致网友:如果你不小心检索到了这篇文章,请不要看,因为很烂.写下来用于作为我的笔记. 2014年,在LSVRC14(large-Scale Visual Recognition Challenge)中, ...
- Linux-HA实战(3)— 基于Pacemaker搭建TFS Nameserver HA
上篇文章简单介绍了下基于Heartbeat的虚拟IP配置,个人觉得简单易用已经能够应付大部分场景了.但是既然花时间研究HA,如果仅限于一个虚拟IP飘来飘去未免有点糊弄任务了,因此这篇文章打算介绍下基于 ...
- elasticsearch系列三:索引详解(分词器、文档管理、路由详解(集群))
一.分词器 1. 认识分词器 1.1 Analyzer 分析器 在ES中一个Analyzer 由下面三种组件组合而成: character filter :字符过滤器,对文本进行字符过滤处理,如 ...
- JsonObject和Gson详解
参考文件:http://www.cnblogs.com/xwdreamer/archive/2011/12/16/2296904.html一.JsonObject 1.JAR包简介 要使程序可以运行必 ...
- Python装饰器、metaclass、abc模块学习笔记
(博客原创作品,转载请注明出处!) 最近接触到了Python中的decorator,metaclass,abc Module,six.add_metaclass等内容,这里做一个简单的笔记. 主要资源 ...
- u3d 加载PNG做 UI图片
using UnityEngine; using System.Collections; using System.IO; using UnityEngine.UI; public class UIT ...