Example Analysis of Mybatis query condition including List
Editor to share with you the Mybatis query conditions including List example analysis, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to understand it!
Cases where the query condition contains List
When searching in mybatis, sometimes the parameter contains List, such as the passed-in parameter:
Public class FileRequest {/ / File Type private Integer fileType; / / status private List statusList;} public class Status {/ / Registration status private Integer registerStatus / / meeting status private Integer meetingStatus} statement queried in mybatis select * from tableName where 1 status 1 and file_type = # {fileType} and and register_status= # {item.registerStatus} and meeting_status= # {item.meetingStatus} Query conditions with List and other types of field requirements
Mybatis query conditions with List and other types of fields (Integer,String,...).
Select * from table where type=?and code in
Mapper.java file
List selectByTypeAndCodes (@ Param ("codes") List codes,@Param ("type") Integer type) Mapper.xml.
Note that Parameters: 34 (Integer), 1 (Integer), 2 (Integer), 3 (Integer)
BaseJdbcLogger.debug (BaseJdbcLogger.java:145)