标签:suse select tostring new ring ace method mybatis app
public interface UserMapper
{
@SelectProvider(type="UserSqlProvider.class" method="selectWithParam")
List<User> selectWithParam(Map<String,Object> param);
}
public classUserSqpProvider
{
public String selectWithParam(Map<String,Object> param)
{
return new SQL(){
{
SELECT("*")
FROM("User")
if(param.get("id") != null)
{
WHERE(" id=#{id}")
}
...
}.toString();
};
}
}
标签:suse select tostring new ring ace method mybatis app
原文地址:http://www.cnblogs.com/tengfeixinxing/p/7075485.html