我有一个关于如何运行sql“desc table”来获取表字段信息的问题。
我试图运行这些代码来获取表字段信息,但出现语法错误。
@Mapper
public interface TableMapper {
/**
* 获取指定表中字段的具体信息
* @param tableName 表名
* @return 所有字段的具体信息.
*/
@Select("desc #{tableName}")
@Results({
@Result(property = "fieldName", column = "Field", javaType = String.class),
@Result(property = "fieldType", column = "Type", javaType = String.class),
@Result(property = "nullable", column = "Null", javaType = String.class),
@Result(property = "key", column = "Key", javaType = String.class),
@Result(property = "extra", column = "Extra", javaType = String.class)
})
Set<TableFieldInfo> findTableFieldsInfo(@Param(value = "tableName") String tableName);}
有人能告诉我如何用mybaits获取表字段信息吗?
1条答案
按热度按时间jfewjypa1#
改变
至