|
@@ -11,7 +11,7 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenColumnDO;
|
|
|
import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenTableDO;
|
|
|
import com.baomidou.mybatisplus.generator.config.po.TableField;
|
|
|
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
|
|
|
-import com.baomidou.mybatisplus.generator.config.rules.IColumnType;
|
|
|
+import org.apache.ibatis.type.JdbcType;
|
|
|
import org.mapstruct.Mapper;
|
|
|
import org.mapstruct.Mapping;
|
|
|
import org.mapstruct.Mappings;
|
|
@@ -39,7 +39,7 @@ public interface CodegenConvert {
|
|
|
|
|
|
@Mappings({
|
|
|
@Mapping(source = "name", target = "columnName"),
|
|
|
- @Mapping(source = "columnType", target = "dataType", qualifiedByName = "getType"),
|
|
|
+ @Mapping(source = "metaInfo.jdbcType", target = "dataType", qualifiedByName = "getDataType"),
|
|
|
@Mapping(source = "comment", target = "columnComment"),
|
|
|
@Mapping(source = "metaInfo.nullable", target = "nullable"),
|
|
|
@Mapping(source = "keyFlag", target = "primaryKey"),
|
|
@@ -49,9 +49,9 @@ public interface CodegenConvert {
|
|
|
})
|
|
|
CodegenColumnDO convert(TableField bean);
|
|
|
|
|
|
- @Named("getType")
|
|
|
- default String getType(IColumnType jdbcType) {
|
|
|
- return jdbcType.getType();
|
|
|
+ @Named("getDataType")
|
|
|
+ default String getDataType(JdbcType jdbcType) {
|
|
|
+ return jdbcType.name();
|
|
|
}
|
|
|
|
|
|
// ========== CodegenTableDO 相关 ==========
|