mybatis传递List,Array,Map
来源:互联网 发布:oracle数据库主键类型 编辑:程序博客网 时间:2024/06/05 22:09
List和Map作为一个实体类的属性:
private List<Long> kkids;public List<Long> getKkids() {return kkids;}public void setKkids( List<Long> kkids) {this.kkids = kkids;}private Map<String,String> multiGwsj;public Map<String, String> getMultiGwsj() {return multiGwsj;}public void setMultiGwsj(Map<String, String> multiGwsj) {this.multiGwsj = multiGwsj;}
mapper.xml
<if test="kkids != null"><foreach collection="kkids" item="stationId" index="index" open="and (" close=")" separator=" or "> kkid= #{stationId,jdbcType=VARCHAR} </foreach></if>
<if test="multiGwsj != null"><foreach collection="multiGwsj" item="time2" index="time1" open="and (" close=")" separator=" or "> gwsj BETWEEN #{time1,jdbcType=TIMESTAMP} and #{time2,jdbcType=TIMESTAMP} </foreach></if>
foreach处理array和list时,item是其中具体的一项,index是该项在列表或者数组中的位置;
处理map时,item是value,index是key
阅读全文
0 0
- mybatis传递List,Array,Map
- Mybatis中遍历List、Set、Array、Map
- mybatis的foreach插入List,Array,Map
- mybatis传递Map和List集合示例
- Mybatis 中的 List Array Map 的foreach 、in
- Mybatis 中遍历map 参数中的 list 和 array 属性
- Array,List,Map
- list,map,array理解
- mybatis返回List<Map>
- mybatis返回list<Map>
- mybatis返回List<Map>
- List,Map,Array 存储方式
- List,Map,set,Array简析
- Array、List、Set、与Map
- java之Map,List,Array
- Mybatis Mapper配置文件sql中的 List Array Map 的foreach 、in
- Freemarker <#list List/Map/Array[] as Object>
- <#list List/Map/Array[] as Object> Freemarker
- ECharts之柱状图 饼状图 折线图
- Spring Boot初体验
- 编码和字符集
- 调度事务管理功能 供电系统运行情况的数据归档和统计报表功能
- 宝塔面板上传项目步骤
- mybatis传递List,Array,Map
- ExpandableListView异常Couldn't read row 0, col -1 from CursorWindow
- java代码读取excel文件,同时兼容2003和2007
- 业务日志查询,环境问题初步定为方法
- inception_v3迁移学习(GoogleNet)
- 练习项目 一款新闻app的开发 (三):通过Rxjava + Retrofit2框架获取网络数据
- jenkins定时编译节省测试用例执行时间
- Druid组件角色
- 机器学习实战代码详解(八)预测数值型数据:回归