mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 18:28:43 +08:00 
			
		
		
		
	| @@ -11,9 +11,11 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenColumnDO; | |||||||
| import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenTableDO; | 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.TableField; | ||||||
| import com.baomidou.mybatisplus.generator.config.po.TableInfo; | import com.baomidou.mybatisplus.generator.config.po.TableInfo; | ||||||
|  | import com.baomidou.mybatisplus.generator.config.rules.IColumnType; | ||||||
| import org.mapstruct.Mapper; | import org.mapstruct.Mapper; | ||||||
| import org.mapstruct.Mapping; | import org.mapstruct.Mapping; | ||||||
| import org.mapstruct.Mappings; | import org.mapstruct.Mappings; | ||||||
|  | import org.mapstruct.Named; | ||||||
| import org.mapstruct.factory.Mappers; | import org.mapstruct.factory.Mappers; | ||||||
|  |  | ||||||
| import java.util.List; | import java.util.List; | ||||||
| @@ -37,7 +39,7 @@ public interface CodegenConvert { | |||||||
|  |  | ||||||
|     @Mappings({ |     @Mappings({ | ||||||
|             @Mapping(source = "name", target = "columnName"), |             @Mapping(source = "name", target = "columnName"), | ||||||
|             @Mapping(source = "type", target = "dataType"), |             @Mapping(source = "columnType", target = "dataType", qualifiedByName = "getType"), | ||||||
|             @Mapping(source = "comment", target = "columnComment"), |             @Mapping(source = "comment", target = "columnComment"), | ||||||
|             @Mapping(source = "metaInfo.nullable", target = "nullable"), |             @Mapping(source = "metaInfo.nullable", target = "nullable"), | ||||||
|             @Mapping(source = "keyFlag", target = "primaryKey"), |             @Mapping(source = "keyFlag", target = "primaryKey"), | ||||||
| @@ -47,6 +49,11 @@ public interface CodegenConvert { | |||||||
|     }) |     }) | ||||||
|     CodegenColumnDO convert(TableField bean); |     CodegenColumnDO convert(TableField bean); | ||||||
|  |  | ||||||
|  |     @Named("getType") | ||||||
|  |     default String getType(IColumnType jdbcType) { | ||||||
|  |         return jdbcType.getType(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     // ========== CodegenTableDO 相关 ========== |     // ========== CodegenTableDO 相关 ========== | ||||||
|  |  | ||||||
| //    List<CodegenTableRespVO> convertList02(List<CodegenTableDO> list); | //    List<CodegenTableRespVO> convertList02(List<CodegenTableDO> list); | ||||||
|   | |||||||
| @@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.infra.enums.codegen.CodegenColumnListConditionEnu | |||||||
| import com.baomidou.mybatisplus.annotation.KeySequence; | import com.baomidou.mybatisplus.annotation.KeySequence; | ||||||
| import com.baomidou.mybatisplus.annotation.TableId; | import com.baomidou.mybatisplus.annotation.TableId; | ||||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||||
|  | import com.baomidou.mybatisplus.generator.config.po.TableField; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||||
| import lombok.experimental.Accessors; | import lombok.experimental.Accessors; | ||||||
| @@ -42,6 +43,7 @@ public class CodegenColumnDO extends BaseDO { | |||||||
|     private String columnName; |     private String columnName; | ||||||
|     /** |     /** | ||||||
|      * 字段类型 |      * 字段类型 | ||||||
|  |      * 关联 {@link TableField#getColumnType()}} | ||||||
|      */ |      */ | ||||||
|     private String dataType; |     private String dataType; | ||||||
|     /** |     /** | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 芋道源码
					芋道源码