//提取表的列信息,组成类成员基础数据
use information_schema;
select CONCAT('//',COLUMN_COMMENT),CONCAT('public String',COLUMN_NAME) , Data_type,COLUMN_COMMENT ,COLUMN_DEFAULT from information_schema.columns where table_schema ='数据库名' and table_name = '表名'order by ORDINAL_POSITION ;
//提取表的列信息,组成类成员基础数据,带注释
use information_schema;
select CONCAT('/** ',COLUMN_COMMENT,' */'),CONCAT('public String ',COLUMN_NAME,'="";') from information_schema.columns where table_schema ='数据库名' and table_name = '表名'
order by ORDINAL_POSITION ;;
//生成rs提取代码
use information_schema;
select CONCAT('sku.',COLUMN_NAME,' = rssku.getString("',COLUMN_NAME,'");') from information_schema.columns where table_schema ='数据库名' and table_name = '表名'
order by ORDINAL_POSITION ;;