------ Solution ---------------- ----------------------------
configure an id attribute on the line, and groupby same, such as
------ For reference only ----- ----------------------------------
mybatis can not seem to use groupBy keyword
--- --- For reference only ---------------------------------------
This will be grouped according to the ID you ?
------ For reference only -------------------------------------- -
two approaches
1, for example, if you want to use to group by other complex sql, mybatis own syntax can not meet , you can form a complex sql view , and then view as a table, with autogenous tools to mysql generate the corresponding code.
2, using mybatis architecture , imitating autogenous code , write their own respective mapper.xml, entity, interface
generally recommended first approach , simple and easy to manage
------ For reference only ----------------------- ----------------
buddy, you solve it ? According to the above method does not work ah add id
没有评论:
发表评论