mybatis查询配置文件中关于 in 的条件查询
来源:互联网 发布:php 数组头部添加元素 编辑:程序博客网 时间:2024/06/05 06:11
1.dao层 条件参数Map中传入String[] 字符串数组
HashMap<String,Object> paramsMap=new HashMap<String,Object>();String[] strArr={"1","2"};paramsMap.put("deptIds",strArr );List list=dao.findList(paramsMap);
2.dao对应的sql.xml中 in 查询写法如下:
<select id="findList" resultType="HashMap" parameterType="HashMap">select dept_id,dept_name from table A<where><if test="deptIds != null and deptIds!=''"> AND A.DEPT_ID IN <foreach item="item" index="index" collection="deptIds" open="(" separator="," close=")"> #{item} </foreach> </if></where></select>
阅读全文
0 0
- mybatis查询配置文件中关于 in 的条件查询
- mybatis in条件查询(foreach)
- 关于where的条件查询in
- myBatis中查询条件的拼接
- mybatis查询sql中in条件使用(foreach)
- mybatis查询sql中in条件使用(foreach)
- 关于mybatis和mysql的in查询
- Mybatis中查询的参数为Map条件中是in 数据组参数
- Mybatis查询实例,sql中的in在Mybatis中怎么写--以list为查询条件
- Mybatis查询实例,sql中的in在Mybatis中怎么写--以list为查询条件
- Mybatis 多条件查询(模糊查询 使用in查询)
- Mybatis 多条件查询(模糊查询 使用in查询)
- Mybatis 多条件查询(模糊查询 使用in查询)
- MyBatis中的in条件查询的用法代码示例
- mybatis 查询多个条件IN的使用方法
- mybatis的in查询
- mybatis的多条件查询
- mybatis的动态条件查询
- 获取当前位置的坐标
- Android 电子签名(优化后的带虚线框 照片可取)
- Gradle 奇技淫巧
- spring多数据源配置
- 算法之:二分法
- mybatis查询配置文件中关于 in 的条件查询
- 结构体初始化
- android项目中values中几个文件的作用
- LeetCode problem 160. Intersection of Two Linked Lists
- ThreadLocal
- Django学习笔记三:页面侧边栏最新文章,文章归档,分类,标签云的实现
- 合成复用原则
- 做回正常人
- 吐血推荐珍藏的Chrome插件