数据库~大叔通过脚本升级实体
时间:2021-07-01 10:21:17
帮助过:3人阅读
COLUMN_TYPE,
CONCAT(
‘public ‘,
CASE
WHEN LEFT (COLUMN_TYPE,
3)
= ‘int‘ THEN
‘int‘
WHEN LEFT (COLUMN_TYPE,
7)
= ‘tinyint‘ THEN
‘byte‘
WHEN LEFT (COLUMN_TYPE,
8)
= ‘smallint‘ THEN
‘short‘
WHEN LEFT (COLUMN_TYPE,
6)
= ‘bigint‘ THEN
‘long‘
WHEN LEFT (COLUMN_TYPE,
5)
= ‘float‘ THEN
‘float‘
WHEN LEFT (COLUMN_TYPE,
5)
= ‘double‘ THEN
‘double‘
WHEN LEFT (COLUMN_TYPE,
5)
= ‘decimal‘ THEN
‘decimal‘
WHEN LEFT (COLUMN_TYPE,
7)
= ‘char‘ THEN
‘string‘
WHEN LEFT (COLUMN_TYPE,
7)
= ‘varchar‘ THEN
‘string‘
WHEN LEFT (COLUMN_TYPE,
4)
= ‘text‘ THEN
‘string‘
WHEN LEFT (COLUMN_TYPE,
8)
= ‘datetime‘ THEN
‘DateTime‘
ELSE
COLUMN_TYPE
END,
‘ ‘,
COLUMN_NAME,
‘{get;set;}‘
)
FROM
information_schema. COLUMNS
WHERE
table_name = ‘system_companyfinancetaxsetting‘
AND table_schema
= ‘pilipadb‘;
产生的结果
我们可以直接把第二列复制到VS的实体里就可以了,还是挺方便的!
数据库~大叔通过脚本升级实体
标签:any 网上 ipa png cat sch select double set