0

Below is an example of SQLProvider class. Would like to add the list as one of the parameters and extract values as per each value in the list. How it can be done in MyBatis

public class MySqlProvider{
        public String selectSelective(String name, String email, List<String> subjects) {
        return new SQL() {{
            SELECT("*");
            FROM("student");
            if(name!=null){
                WHERE("student.name = #{name}");
            }
            if(email!=null){
                WHERE("student.email = #{email}");
            }
            if(subject != null){
                //TODO
            }
        }}.toString();
    }
    }
4

0 回答 0