Home > Database > Mysql Tutorial > Mybatis动态传表名(同样适用于动态传表字段)

Mybatis动态传表名(同样适用于动态传表字段)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:02:43
Original
1811 people have browsed it

//设置map参数,innerTable,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(pag

//设置map参数,innerTable,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";
}

<!-- xml 配置 table参数-->

select * FROM ${innerTable} where 1 = 1
<if test="config_id != null and config_id !='' ">
and ms.config_id = #{config_id}
</if>
Copy after login
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Mybatis mapping problem
From 1970-01-01 08:00:00
0
0
0
java - Mybatis related query
From 1970-01-01 08:00:00
0
0
0
REGEXP in mybatis
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template