Mybatis dynamically transfers table names (also applies to dynamically transfers table fields) and mybatis Fields
// Set the name of the map parameter, innerTable, and outTable.
Public String sendDetail (){
Pager = getStartPager ();
If (null! = Msg & msg. equals ("succ ")){
Map. put ("innerTable", "bs_sent_inner ");
Map. put ("outTable", "bs_sent_out ");
Pager = outBoxInnerService. findSendPager (pager, map );
}
If (null! = Msg & msg. equals ("falilure ")){
Map. put ("innerTable", "bs_fail_inner ");
Map. put ("outTable", "bs_fail_out ");
Pager = outBoxInnerService. findSendPager (pager, map );
}
Map. remove ("innerTable ");
Map. remove ("outTable ");
Return "sendDetail ";
}
<! -- Configure table parameters in xml -->
Select * FROM $ {innerTable} where 1 = 1
<If test = "config_id! = Null and config_id! = ''">
And ms. config_id = # {config_id}
</If>
Mybatis-3 dynamic table parameter passing is not good to make?
MyBatis has never been used, and iBatis has been used for a while.
Report Error
Map. put ("product category ",);
Corresponding parameters cannot be found in parameter passing of product categories.
When the parameter is passed to it, it can be considered to be added with dynamic conditions, it is different in getScrollPage.
How to Use mybatis for multi-table join queries, such as class A, B, C, and D? extract data from these tables for addition, deletion, modification, and query
Mybatis is very loose to the result. With this "result" object, you can return a set like List <query result Object>.
Select a. Floor, B. Area, c. Counter FROM a LEFT JOIN ................