In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "how to input multiple parameters into the interface in Mybatis". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Use @ Param annotations
List getJgQjcs (@ Param (value = "jgbm") String jgbm, @ Param (value = "csbm") String csbm)
Directly take the corresponding name parameter value in the corresponding mapper file
SELECT a.JGBM ON a.JGBM=b.JGBM and b.CSBM=# coalesce (b.CSBM) AS CSBM,coalesce (b.CSZmc.MRZ) AS CSZ FROM SYS_ZCJG a LEFT JOIN SYS_CSSZ b ON a.JGBM=b.JGBM and b.CSBM=# {csbm,jdbcType=VARCHAR} LEFT JOIN SYS_CSLB c ON c.CSBM=# {csbm,jdbcType=VARCHAR} WHERE a.jgbm=# {jgbm,jdbcType=VARCHAR}
2. Use sequential position to identify parameters.
SELECT a.JGBM ON c.CSBM=# coalesce (b.CSBM, C.CSBM) AS CSBM,coalesce (b.CSZ, C.MRZ) AS CSZ FROM SYS_ZCJG a LEFT JOIN SYS_CSSZ b ON a.JGBM=b.JGBM and b.CSBM=# {1} LEFT JOIN SYS_CSLB c ON c.CSBM=# {1} CSBM {0}
3. The commonly used map is used as a method input parameter
The first one is recommended by individuals, which is convenient to see the incoming parameters intuitively.
This is the end of the content of "the method of passing multiple parameters to the interface in Mybatis". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.