mybatis的mapper.xml使用循环语句
来源:互联网 发布:淘宝虚拟物品退款 编辑:程序博客网 时间:2024/06/09 22:27
1.mapper.java,传的参数是map
List<实体类> getList(Map<String,Object> paraMap);
2.mapper.xml
<select id="getList" parameterType="java.util.Map" resultMap="BaseResultMap"> select * from table where <if test="a!= null"> a = #{a,jdbcType=VARCHAR} </if> <if test="list!= null"> and id in <foreach item="item" index="index" collection="list" open="(" close=")" separator=","> #{item} </foreach> </if></select>
3.参数,数组,list都行
Map<String,Object> map = new HashMap<String, Object>();map.put("a","参数");map.put("list",数组、List都行)List<实体类> list = mapper.getList(map);
阅读全文
0 0
- mybatis的mapper.xml使用循环语句
- mybatis的mapper XML
- springboot 使用mybatis (xml Mapper)
- MyBatis mapper.xml文件中的curd语句
- 使用Mybatis提供的mybatis generator来自动生成model/mapper.java/mapper.xml
- mybatis的mapper.xml 小结
- mybatis mapper.xml文件中$和#的使用区别
- 使用MyBatis Generator生成xml,Mapper
- mybatis通用mapper的使用
- Mybatis通用Mapper的使用
- 列表上移下移的SQL语句(mybatis mapper.xml写法)
- Mybatis传多个参数(三种解决方案) mapper.xml的sql语句修改!
- 分离mybatis的mapper.java和mapper.xml文件
- mybatis 模糊查询 mapper.xml的写法
- mybatis自动生成mapper.xml的方法
- mybatis中mapper类型的XML
- mybatis映射文件mapper.xml的写法。
- mybatis的Mapper XML文件配置
- Linux 的ln命令
- MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption
- 用于创建 Internet 客户端应用程序的 MFC 类
- android developer tiny share-20170518
- DDR工作原理
- mybatis的mapper.xml使用循环语句
- boost在VS2010下的编译
- 如何设计数据库
- 安卓Canvas
- 六、zookeeper简介
- 浅析gcc、arm-Linux-gcc和arm-elf-gcc的关系
- 微软请你学Linux第三季: 6月最后的约会,再次诚意邀请!
- linux C语言开发 笔记
- lintcode——在二叉查找树中插入节点