bash
public interface DbMapper {
/**
* 查询数据库类型
*/
String queryDbType();
}
<select id="queryDbType" resultType="java.lang.String">
select
<choose>
<when test="_databaseId == 'mysql'">
'mysql'
</when>
<when test="_databaseId == 'oracle'">
'oracle'
</when>
<when test="_databaseId == 'sqlserver'">
'sqlserver'
</when>
<when test="_databaseId == 'db2'">
'db2'
</when>
<when test="_databaseId == 'postgresql'">
'postgresql'
</when>
<when test="_databaseId == 'dm'">
'dm'
</when>
<otherwise>
'unknown'
</otherwise>
</choose> as dbType
</select>