Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement double foreach cycle in MyBatis

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces MyBatis how to carry out the double foreach cycle, the article is very detailed, has a certain reference value, interested friends must read it!

Perform a double foreach cycle

Mapname is a Map object

# {key1}, # {key2}, # {value2} usage scenarios

For example, the amount of the waybill under a payer, then key1 is the payer number, key2 is the waybill number, and value2 is the apportioned amount.

Mybatis foreach loop, passing in codes on multiple parameters

Controller:

@ RequestMapping (value = "/ findPage", method = RequestMethod.POST) @ ResponseBody public Object findPage (@ RequestParam (required=false) String jobCategory,@RequestParam (required=false) String ids,@RequestParam (required=false) String cities) {try {List listJob = new ArrayList (); List listIds = new ArrayList (); List listCities = new ArrayList () / / query if (StringUtils.isNotBlank (jobCategory) & & StringUtils.isNotBlank (cities)) {String [] temp = jobCategory.split (",") by city name and type of work; String [] cityTemp = cities.split (","); for (int item0

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report