mybatis传入map参数,map中包含list(输入参数)
1.xml中配置:
<!-- 根据条件查询满足条件的ID集合开始 -->
<select id="getQuestionsIdsForExamPaper" resultType="java.lang.String"
parameterType="hashmap">
select
questionId from questions
<where>
<include refid="query_questionIds_where"></include>
</where>
</select> <!-- 查询试题ID的条件 -->
<sql id="query_questionIds_where">
<if test="type!=null">
and type=#{type}
</if>
<if test="level!=null">
and level=#{level}
</if>
<!-- 知识点 -->
<if test="konwledges!=null">
and knowledgeType in
<foreach collection="konwledges" item="knowledge" separator=","
open="(" close=")">
#{knowledge}
</foreach>
</if>
<if test="num!=null">
ORDER BY RAND() LIMIT #{num}
</if>
</sql>
2.Java测试:
// 测试查询ID集合
@Test
public void test3() throws SQLException {
Map<String, Object> condition = new HashMap<String, Object>();
condition.put("type", "单选题");
condition.put("level", 1);
condition.put("num", 3);
List<String> konwledges = new ArrayList<String>();
konwledges.add("安全生产管理知识");
konwledges.add("电力安全规程制度");
condition.put("num", 3);
condition.put("konwledges", konwledges);
List<String> IDs = questionsCustomMapper.getQuestionsIdsForExamPaper(condition);
System.out.println(IDs.size());
}
结果:aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABIQAAABzCAIAAABmaE7TAAAgAElEQVR4nO2dbbKrIAxAuy4X5HpcjZvpYnp/2CofSQiI1nrPGWfeuyoQQggJ2vbx+uc8p+HxYZy/Lc1XmcdHxE3UMY+X6MpFxLgC65xDHw7CaTlMz2+LcwphnzGSe3KB5eYIR3Sqn7+ADgGgC49vCwAAAAAAAPAfIRkDAAAAAAD4Ap9k7PHg4ODg4ODg4ODg4ODgqDtIxjg4ODg4ODg4ODg4OL5wdEvGAAAAAOCHmMc7fX/HPP6bbyv6RTJjY7xIxtzM409+GVnwdUk38rT7+MZQ1n5H1n/8CjyNH516/5KP3Z49XN75daY/bG3r4jp8TsN5ovUYr7t9D+0R/nAeq6o800Qb23pOw72G/T6IxnbT8aqw3q8nYz/z3aq/HRF2XY+uv7jZEvYbytR69WqrdHZTv6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2fEZ+dpWAtGtUl11iZjcYU8FAMAAAAA+O/8YDIGAAAAAADw+5CMAQAAAAAAfAGSMQAAAAAAgC/wB7a08FK+qDEuAAAAAElFTkSuQmCC" alt="" />
总结:
map中的list同普通的一样,只是在遍历的时候collection要写出map中的List的键值。如:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAnsAAACMCAIAAACLXvhIAAAWWklEQVR4nO2dPXKrPBSGWU+WQJNNpP+aO+zBld2kp/GkSnsbxi1txpmswQ3FndQsQl8BBv0d8WPAYD/PUBgEQkig1+fogCK1QV7/+7px52qjntT8dn8AAADcTnTvAgAAADwFKK5MFLHMsgAAPCV0fzJ3V6ZHXQAAnhK6PxnkYXKoUgB4Yuj+ZJCHyaFKAeCJofuTQR4mhyoFgCdmhu7vkr3u93/OpTfxJ9u/7utF2mctmPLwlaiXSH0WSuXqJVK7/JqQq5dIfS1WqptP9y9dosC7SL0kztbJFTdQG3KS2JQAAHOyqOL+no+v++xnUG55to+yy0RFG5ahKQ+fsXqJ1b+rYn0W9fZ/ab19Gb6SW0/3lfi0cFoK9Rapt9TZPrXiBmojkCQ1JQDArNzW/ZXf8eHU30L4yfavQ9VzTYpbSYjVlS8hYBpNMe6YQze5oGRTK27gWvokGU1ZfseHj3TdbhcA2DQ3dH+XU3Q4xN/9u6jy73HDiru7uh+trnwJAdPY3ewFvT2HTkTH9dSKG7iWPklW2+WnQ3Q4JFPebQAALSO7v+L7w9M3XbJmjPb94t+uLR3u5TI97qO9tRx1GyTP2iSzKOaxtb52Z2jRRx4K9RapXa4+Y/USqRdn8LLd7hv63V2Tmn7/M3Z0olBvjb2o/3aohietDCuaE1WLnoNeQmtQs2+GjokvenS9VSrXhn294VWdYEUFqG7sIf8jAQD6MkZx89MhCvnfLu+W4tZMaeOW6VHbXp5jTXTDVqw/NU8im16Km5tCpXtTzbFMfciw+m2sXvVp5+qEFgEUCHoyIpXkYhjxRIGkQIZK7bxjtBqu3V+Jd1WljVTrF+WtDTv6yVw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xdb8tOwL1TI8+fwyUMAAHgEblDcwPw2g5VS/Awyn/UHAIDHYKTiijPoNanWrD7VvDr7/as185223Tf7bHsuvukIAACbZoziBmeJV8FZfaS5ZkUb95rO9OwAALBthipumX4cPCFROt6YqWvaSMVVqhJy5gsCAICNMrmNG57VBxsXAACelKnHcTtipkYpbiBECwAAYCNMHKucn8KW6GDFJVYZAAAeg2nfxxVjpvTvSdWLoa+C4vI+LgAAPApTfnOq+P4gsgkAAMDLhIobjpkCAAB4apg7CAAAYAlQXAAAgCVAcQEAAJYAxQUAAFgCFBcAAGAJUFwAAIAl+B/IvncrZAdMYQAAAABJRU5ErkJggg==" alt="" />
补充:也可以获取到遍历集合的顺序,比如:
<select id="listFirstChargeReport" resultType="map"
parameterType="map">
SELECT user_name,gmt_created, '1' AS 当天
<foreach collection="syncDates" item="syncDate" index="indexNum" open="," separator=",">
IFNULL((SELECT CASE WHEN bet_amount + 0 > 0 THEN '1' END FROM member m WHERE m.user_name = c.user_name AND sync_Date = '${syncDate}'),'-') AS 第${indexNum + 1}天
</foreach>
FROM first_charge c WHERE gmt_created LIKE '${gmtCreated}%'
</select>
java传入的参数如下:
Map<String, Object> tmpCondition = new HashMap<>();
tmpCondition.put("gmtCreated", DateFormatUtils.format(new Date(), "yyyy-MM-dd"));
List<String> syncDates = getDates(DateFormatUtils.format(new Date(), "yyyy-MM-dd"), 15);
tmpCondition.put("syncDates", syncDates); private List<String> getDates(String dateStr, int i) {
List<String> result = new ArrayList<>(); try {
Date parseDate = DateUtils.parseDate(dateStr, "yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.setTime(parseDate); while (i > 0) {
calendar.add(Calendar.DAY_OF_MONTH, -1);
i--; Date time = calendar.getTime();
String formatedTime = DateFormatUtils.format(time, "yyyy-MM-dd");
result.add(formatedTime);
}
} catch (ParseException e) {
// ignore
} return result;
}
生成的SQL如下:
SELECT user_name,gmt_created, '' AS 当天 , IFNULL((SELECT CASE WHEN bet_amount + 0 > 0 THEN '' END FROM member m WHERE m.user_name = c.user_name AND sync_Date = '2019-09-05'),'-') AS 第1天 , IFNULL((SELECT CASE WHEN bet_amount + 0 > 0 THEN '' END FROM member m WHERE m.user_name = c.user_name AND sync_Date = '2019-09-04'),'-') AS 第2天 , IFNULL((SELECT CASE WHEN bet_amount + 0 > 0 THEN '' END FROM member m WHERE m.user_name = c.user_name AND sync_Date = '2019-09-03'),'-') AS 第3天 , IFNULL((SELECT CASE WHEN bet_amount + 0 > 0 THEN '' END FROM member m WHERE m.user_name = c.user_name AND sync_Date = '2019-09-02'),'-') AS 第4天 , IFNULL((SELECT CASE WHEN bet_amount + 0 > 0 THEN '' END FROM member m WHERE m.user_name = c.user_name AND sync_Date = '2019-09-01'),'-') AS 第5天 , IFNULL((SELECT CASE WHEN bet_amount + 0 > 0 THEN '' END FROM member m WHERE m.user_name = c.user_name AND sync_Date = '2019-08-31'),'-') AS 第6天 , IFNULL((SELECT CASE WHEN bet_amount + 0 > 0 THEN '' END FROM member m WHERE m.user_name = c.user_name AND sync_Date = '2019-08-30'),'-') AS 第7天 , IFNULL((SELECT CASE WHEN bet_amount + 0 > 0 THEN '' END FROM member m WHERE m.user_name = c.user_name AND sync_Date = '2019-08-29'),'-') AS 第8天 , IFNULL((SELECT CASE WHEN bet_amount + 0 > 0 THEN '' END FROM member m WHERE m.user_name = c.user_name AND sync_Date = '2019-08-28'),'-') AS 第9天 , IFNULL((SELECT CASE WHEN bet_amount + 0 > 0 THEN '' END FROM member m WHERE m.user_name = c.user_name AND sync_Date = '2019-08-27'),'-') AS 第10天 , IFNULL((SELECT CASE WHEN bet_amount + 0 > 0 THEN '' END FROM member m WHERE m.user_name = c.user_name AND sync_Date = '2019-08-26'),'-') AS 第11天 , IFNULL((SELECT CASE WHEN bet_amount + 0 > 0 THEN '' END FROM member m WHERE m.user_name = c.user_name AND sync_Date = '2019-08-25'),'-') AS 第12天 , IFNULL((SELECT CASE WHEN bet_amount + 0 > 0 THEN '' END FROM member m WHERE m.user_name = c.user_name AND sync_Date = '2019-08-24'),'-') AS 第13天 , IFNULL((SELECT CASE WHEN bet_amount + 0 > 0 THEN '' END FROM member m WHERE m.user_name = c.user_name AND sync_Date = '2019-08-23'),'-') AS 第14天 , IFNULL((SELECT CASE WHEN bet_amount + 0 > 0 THEN '' END FROM member m WHERE m.user_name = c.user_name AND sync_Date = '2019-08-22'),'-') AS 第15天 FROM first_charge c WHERE gmt_created LIKE '2019-09-06%' LIMIT ?
mybatis传入map参数,map中包含list(输入参数)的更多相关文章
- matlab中nargin函数输入参数数目
来源:https://ww2.mathworks.cn/help/matlab/ref/nargin.html?searchHighlight=nargin&s_tid=doc_srchtit ...
- Matlab中 awgn 函数输入参数带有‘measured’ 时snr的含义
MATLAB中awgn 函数可以为输入信号x 添加一定大小的噪声. out = awgn(in,snr,'measured'); 是一种常见的使用方法,意思是在添加噪声前先测量一下输入信号的功率,再 ...
- spring MVC中传递的参数对象中包含list的情况
测试需要的jar包:spring 3.2.jar + jackson-all-1.8.5.jar. 写代码时碰到个需要将对象里的子明细一起传递到controller里去,当时就想直接将参数一起传递过 ...
- 存储过程: 存储过程(stored procedure)有时也称为sproc。存储过程存储于数据库中而不是在单独的文件中,有输入参数、输出参数以及返回值等。
存储过程示例一: 执行存储过程方法一: 执行存储过程方法二: 存储过程可以定义返回值: 修改存储过程: 利用存储过程查找三个表内的信息: 练习: 超市管理系统:表一:门店仓库表 MenDian ...
- C++根据传入的函数指针来解析需要的参数
C++可以根据传入的函数指针,获取自己需要的参数类型,然后根据参数源中获取需要的参数,这里我用tuple作为演示,不过,只要可以根据序号,或者顺序方式等获取实参,都可以使用类似的方式实现: 先给出一个 ...
- SQL Server存储过程中使用表值作为输入参数示例
这篇文章主要介绍了SQL Server存储过程中使用表值作为输入参数示例,使用表值参数,可以不必创建临时表或许多参数,即可向 Transact-SQL 语句或例程(如存储过程或函数)发送多行数据,这样 ...
- Mybatis 的输入参数学习
mybatis 的输入参数: 指得就是parameterType的参数 这个参数就代表的sql语句中的输入参数 sql语句中的参数使用 有两种方式 : 使用#{} 获取: 8个基本数据类型 + S ...
- 输入参数能动态调决定调用哪个实现类 spring的一个特性
今天做公司的以前项目的时候发现项目中有个特别好的东西,记录下来,分享一下 发现spring有个这样的功能,我也不知道这个是东西应该怎么称呼,就是通过输入参数,动态决定调用接口的实现类.简单理解就是在s ...
- C#方法的六种参数,值参数、引用参数、输出参数、参数数组、命名参数、可选参数
方法的参数有六种,分别是值参数.引用参数.输出参数.参数数组.命名参数.可选参数. 值参数 值参数是方法的默认类型,通过复制实参的值到形参的方式把数据传递到方法,方法被调用时,系统作两步操作: 在栈中 ...
随机推荐
- Java String Integer转换 练习:编程求字符串“100”和“150”按十进制数值做差后的结果以字符串形式输出。
package com.swift; public class String_To_Integer_Test { public static void main(String[] args) { /* ...
- Core BlueTooth官方文档翻译
本⽂文是苹果<Core Bluetooth Programming Guide>的翻译. 关于Core Bluetooth Core Bluetooth 框架提供了蓝⽛牙低功耗⽆无线设备与 ...
- Mycat高可用解决方案二(主从复制)
Mycat高可用解决方案二(主从复制) 系统部署规划 名称 IP 主机名称 用户名/密码 配置 mysql主节点 192.168.199.110 mysql-01 root/hadoop 2核/2G ...
- 05tar命令详解
tar 命令用于对文件进行打包压缩或解压,格式为"tar [选项][文件]". 在Linux 系统中,常见的文件格式比较多,其中主要使用的是 .tar 或者 .tar.gz 或 ...
- 8.Yii2.0框架控制器接收get.post数据
8.Yii2.0框架控制器接收get.post数据 一.get传参 <?php /** * Created by Haima. * Author:Haima * QQ:228654416 * D ...
- CentOS 7.X 中systemctl命令用法详解
systemctl是RHEL 7 的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体.可以使用它永久性或只在当前会话中启用/禁用服务,下面来看CentOS 7.X 中 ...
- 如何提高UDP的可靠性
TCP是通过确认机制和超时重传机制实现可靠传输 UDP UDP它不属于连接型协议,因而具有资源消耗小,处理速度快的优点,所以通常音频.视频和普通数据在传送时使用UDP较多,因为它们即使偶尔丢失一两个数 ...
- selenium2通过linkText/partialLinkText定位元素
通过linkText定位 linkText是根据链接的文本来定位,如下图,导航上全是链接 此时我想找“新闻”这个元素,那么我就可以使用linkText方式定位,语法: By.linkText(“新闻” ...
- java服务器备份(复制)
public ResponseResult serverBackup (String[] datypeid)throws IOException{ ResponseResult rr = new Re ...
- while else语句
#else 用于检测循环中间是否有被打断count = 0while count <=5: print('loop',count) count +=1else: print('程序正常执行完毕, ...