您好,登錄后才能下訂單哦!
本篇文章給大家分享的是有關如何在IDEA中對EasyCode進行配置,小編覺得挺實用的,因此分享給大家學習,希望大家閱讀完這篇文章后可以有所收獲,話不多說,跟著小編一起來看看吧。
Type Mapper
varchar(\(\d+\))? java.lang.String char(\(\d+\))? java.lang.String text java.lang.String decimal(\(\d+\))? java.lang.Double decimal(\(\d+,\d+\))? java.lang.Double integer java.lang.Integer int(\(\d+\))? java.lang.Integer int4 java.lang.Integer int8 java.lang.Long bigint(\(\d+\))? java.lang.Long datetime(\(\d+\))? java.time.LocalDateTime timestamp java.time.LocalDateTime boolean java.lang.Boolean tinyint(\(\d+\))? java.lang.Integer smallint(\(\d+\))? java.lang.Integer double(\(\d+\))? java.lang.Double double(\(\d+,\d+\))? java.lang.Double
Template Setting
entity.java
##初始化定義 $!init ##引入宏定義 $!define ##使用宏定義設置回調(保存位置與文件后綴) #save("/entity", ".java") ##使用宏定義設置包后綴 #setPackageSuffix("entity") ##使用全局變量實現默認包導入 $!autoImport import java.io.Serializable; ##使用宏定義實現類注釋信息 #tableComment("實體類") public class $!{tableInfo.name} implements Serializable { private static final long serialVersionUID = $!tool.serial(); #foreach($column in $tableInfo.fullColumn) #if(${column.comment})/** * ${column.comment} */#end private $!{tool.getClsNameByFullName($column.type)} $!{column.name}; #end public $!{tableInfo.name}() { } public $!{tableInfo.name}(#foreach($column in $tableInfo.fullColumn)$!{tool.getClsNameByFullName($column.type)} $!column.name #if($velocityCount != $tableInfo.fullColumn.size()), #end#end) { #foreach($column in $tableInfo.fullColumn) this.$!column.name = $!column.name;#end } #foreach($column in $tableInfo.fullColumn) ##使用宏定義實現get,set方法 #getSetMethod($column) #end @Override public String toString() { StringBuilder str = new StringBuilder(); str.append("$!{tableInfo.name}{"); #foreach( $column in $tableInfo.fullColumn ) str.append("$!column.name=").append(this.$!column.name)#if( $foreach.hasNext ).append(", ")#end; #end str.append('}'); return str.toString(); } }
DTO.java
##導入宏定義 $!define ##保存文件(宏定義) #save("/dto", "DTO.java") ##包路徑(宏定義) #setPackageSuffix("dto") ##自動導入包(全局變量) $!autoImport ##import com.baomidou.mybatisplus.extension.activerecord.Model; import java.io.Serializable; import lombok.Data; ##import com.baomidou.mybatisplus.annotation.IdType; ##import com.baomidou.mybatisplus.annotation.TableId; ##表注釋(宏定義) #tableComment("DTO") @Data public class $!{tableInfo.name}DTO implements Serializable { private static final long serialVersionUID = $!tool.serial(); #foreach($column in $tableInfo.fullColumn) #if(${column.comment})/**${column.comment}*/#end private $!{tool.getClsNameByFullName($column.type)} $!{column.name}; #end }
mapper.java
##定義初始變量 #set($tableName = $tool.append($tableInfo.name, "Mapper")) ##設置回調 $!callback.setFileName($tool.append($tableName, ".java")) $!callback.setSavePath($tool.append($tableInfo.savePath, "/mapper")) ##拿到主鍵 #if(!$tableInfo.pkColumn.isEmpty()) #set($pk = $tableInfo.pkColumn.get(0)) #end #if($tableInfo.savePackageName)package $!{tableInfo.savePackageName}.#{end}mapper; import $!{tableInfo.savePackageName}.entity.$!{tableInfo.name}; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; #set($time=$!time.currTime()) #set($time=$time.substring(0,11)) #set($time=$time.replace("-","/")) /** * <p> * $!{tableInfo.comment}($!{tableInfo.name})表數據庫訪問層 * </p> * * @author:$!author * @date:$!time */ @Mapper public interface $!{tableName} { /** * 通過ID查詢單條數據 * * @param $!pk.name 主鍵 * @return 實例對象 */ $!{tableInfo.name} queryById($!pk.shortType $!pk.name); /** * 通過實體作為篩選條件查詢 * * @param $!tool.firstLowerCase($!{tableInfo.name}) 實例對象 * @return 對象列表 */ List<$!{tableInfo.name}> queryAll($!{tableInfo.name} $!tool.firstLowerCase($!{tableInfo.name})); /** * 通過實體作為篩選條件查詢條數 * * @param $!tool.firstLowerCase($!{tableInfo.name}) 實例對象 * @return 條數 */ int queryAllCount($!{tableInfo.name} $!tool.firstLowerCase($!{tableInfo.name})); /** * 新增數據 * * @param $!tool.firstLowerCase($!{tableInfo.name}) 實例對象 * @return 影響行數 */ int insert($!{tableInfo.name} $!tool.firstLowerCase($!{tableInfo.name})); /** * 新增選擇列 * * @param $!tool.firstLowerCase($!{tableInfo.name}) 實例對象 * @return 影響行數 */ int insertSelective($!{tableInfo.name} $!tool.firstLowerCase($!{tableInfo.name})); /** * 修改數據 * * @param $!tool.firstLowerCase($!{tableInfo.name}) 實例對象 * @return 影響行數 */ int update($!{tableInfo.name} $!tool.firstLowerCase($!{tableInfo.name})); /** * 通過主鍵刪除數據 * * @param $!pk.name 主鍵 * @return 影響行數 */ int deleteById($!pk.shortType $!pk.name); /** * 批量新增 * @param recordList * @return 影響行數 */ int batchInsert(@Param("recordList") List<$!{tableInfo.name}> recordList); /** * 批量修改 * @param recordList * @return 影響行數 */ int batchUpdate(@Param("recordList") List<$!{tableInfo.name}> recordList); /** * 根據主鍵批量刪除 * @param ids 主鍵s * @return 影響行數 */ int batchDelete(@Param("ids") String[] ids); }
serviceImpl.java
##初始化定義 $!init ##定義初始變量 #set($tableName = $tool.append($tableInfo.name, "ServiceImpl")) ##設置回調 $!callback.setFileName($tool.append($tableName, ".java")) $!callback.setSavePath($tool.append($tableInfo.savePath, "/service/impl")) ##拿到主鍵 #if(!$tableInfo.pkColumn.isEmpty()) #set($pk = $tableInfo.pkColumn.get(0)) #end #if($tableInfo.savePackageName)package $!{tableInfo.savePackageName}.#{end}service.impl; import $!{tableInfo.savePackageName}.mapper.$!{tableInfo.name}Mapper; import $!{tableInfo.savePackageName}.service.$!{tableInfo.name}Service; import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; #set($time=$!time.currTime()) #set($time=$time.substring(0,11)) #set($time=$time.replace("-","/")) /** * <p> * $!{tableInfo.comment}($!{tableInfo.name})表服務實現類 * </p> * * @author:$!author * @date:$!time */ @Service("/$!tool.firstLowerCase($!{tableInfo.name})Service") public class $!{tableName} implements $!{tableInfo.name}Service { @Autowired private $!{tableInfo.name}Mapper $!tool.firstLowerCase($!{tableInfo.name})Mapper; }
service.java
##定義初始變量 #set($tableName = $tool.append($tableInfo.name, "Service")) ##設置回調 $!callback.setFileName($tool.append($tableName, ".java")) $!callback.setSavePath($tool.append($tableInfo.savePath, "/service")) ##拿到主鍵 #if(!$tableInfo.pkColumn.isEmpty()) #set($pk = $tableInfo.pkColumn.get(0)) #end #if($tableInfo.savePackageName)package $!{tableInfo.savePackageName}.#{end}service; #set($time=$!time.currTime()) #set($time=$time.substring(0,11)) #set($time=$time.replace("-","/")) /** * <p> * $!{tableInfo.comment}($!{tableInfo.name})表服務接口 * </p> * * @author:$!author * @date:$!time */ public interface $!{tableName} { }
controller.java
##定義初始變量 #set($tableName = $tool.append($tableInfo.name, "Controller")) ##設置回調 $!callback.setFileName($tool.append($tableName, ".java")) $!callback.setSavePath($tool.append($tableInfo.savePath, "/controller")) ##拿到主鍵 #if(!$tableInfo.pkColumn.isEmpty()) #set($pk = $tableInfo.pkColumn.get(0)) #end #if($tableInfo.savePackageName)package $!{tableInfo.savePackageName}.#{end}controller; import $!{tableInfo.savePackageName}.service.$!{tableInfo.name}Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; #set($time=$!time.currTime()) #set($time=$time.substring(0,11)) #set($time=$time.replace("-","/")) /** * <p> * $!{tableInfo.comment}($!{tableInfo.name})表控制層 * </p> * * @author:$!author * @date:$!time */ @RestController @RequestMapping("/$!tool.firstLowerCase($tableInfo.name)") public class $!{tableName} { @Autowired private $!{tableInfo.name}Service $!tool.firstLowerCase($tableInfo.name)Service; }
mysql-mapper.xml
##引入mybatis支持 $!mybatisSupport ##設置保存名稱與保存位置 $!callback.setFileName($tool.append($!{tableInfo.name}, "Mapper.xml")) $!callback.setSavePath($tool.append($modulePath, "/src/main/resources/mapper")) ##拿到主鍵 #if(!$tableInfo.pkColumn.isEmpty()) #set($pk = $tableInfo.pkColumn.get(0)) #end <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="$!{tableInfo.savePackageName}.mapper.$!{tableInfo.name}Mapper"> <resultMap type="$!{tableInfo.savePackageName}.entity.$!{tableInfo.name}" id="$!{tableInfo.name}Map"> #foreach($column in $tableInfo.fullColumn) <result property="$!column.name" column="$!column.name" jdbcType="$!column.ext.jdbcType"/> #end </resultMap> <!-- 偽列 --> <sql id="columns"> #foreach($column in $tableInfo.fullColumn) a.$!column.obj.name AS $!column.name #if($velocityCount != $tableInfo.fullColumn.size()),#end #end </sql> <!-- 查詢條件 --> <sql id="whereSql"> <where> #foreach($column in $tableInfo.fullColumn) <if test="$!column.name != null#if($column.type.equals("java.lang.String")) and $!column.name != ''#end"> and a.$!column.obj.name = #{$!column.name} </if> #end </where> </sql> <!-- 通過ID查詢單條數據 --> <select id="queryById" resultType="$!{tableInfo.savePackageName}.entity.$!{tableInfo.name}"> select <include refid="columns"/> from $!{tableInfo.obj.parent.name}.$!tableInfo.obj.name a where a.$!pk.obj.name = #{$!pk.name} </select> <!-- 通過實體作為篩選條件查詢 --> <select id="queryAll" resultType="$!{tableInfo.savePackageName}.entity.$!{tableInfo.name}"> select <include refid="columns"/> from $!{tableInfo.obj.parent.name}.$!tableInfo.obj.name a <include refid="whereSql" /> </select> <!-- 通過實體作為篩選條件查詢條數 --> <select id="queryAllCount" resultType="java.lang.Integer"> select count(1) from $!{tableInfo.obj.parent.name}.$!tableInfo.obj.name a <include refid="whereSql" /> </select> <!-- 新增數據 --> <insert id="insert" keyProperty="$!pk.name" useGeneratedKeys="true"> insert into $!{tableInfo.obj.parent.name}.$!{tableInfo.obj.name}(#foreach($column in $tableInfo.fullColumn)$!column.obj.name#if($velocityHasNext), #end#end) values (#foreach($column in $tableInfo.fullColumn)#{$!{column.name}}#if($velocityHasNext), #end#end) </insert> <!-- 新增選擇列 --> <insert id="insertSelective" keyProperty="$!pk.name" useGeneratedKeys="true"> insert into $!{tableInfo.obj.parent.name}.$!{tableInfo.obj.name} <trim prefix="(" suffix=")" suffixOverrides="," > #foreach($column in $tableInfo.fullColumn) <if test="$!column.name != null#if($column.type.equals("java.lang.String")) and $!column.name != ''#end"> $!column.obj.name, </if> #end </trim> <trim prefix="values (" suffix=")" suffixOverrides="," > #foreach($column in $tableInfo.fullColumn) <if test="$!column.name != null#if($column.type.equals("java.lang.String")) and $!column.name != ''#end"> #{$!column.name,jdbcType=$!column.ext.jdbcType}, </if> #end </trim> </insert> <!-- 修改數據 --> <update id="update"> update $!{tableInfo.obj.parent.name}.$!{tableInfo.obj.name} <set> #foreach($column in $tableInfo.otherColumn) <if test="$!column.name != null#if($column.type.equals("java.lang.String")) and $!column.name != ''#end"> $!column.obj.name = #{$!column.name}, </if> #end </set> where $!pk.obj.name = #{$!pk.name} </update> <!-- 通過主鍵刪除數據 --> <delete id="deleteById"> delete from $!{tableInfo.obj.parent.name}.$!{tableInfo.obj.name} where $!pk.obj.name = #{$!pk.name} </delete> <!-- 批量新增 --> <insert id="batchInsert" parameterType="java.util.List"> insert into $!{tableInfo.obj.parent.name}.$!{tableInfo.obj.name} ( #foreach($column in $tableInfo.fullColumn)$!column.obj.name#if($velocityHasNext), #end#end ) values <foreach collection="recordList" index="index" item="item" separator=","> ( #foreach($column in $tableInfo.fullColumn)#{item.$!{column.name}}#if($velocityHasNext), #end#end ) </foreach> </insert> <!-- 批量修改 --> <update id="batchUpdate" parameterType="java.util.List"> update $!{tableInfo.obj.parent.name}.$!{tableInfo.obj.name} <trim prefix="set" suffixOverrides=","> #foreach($column in $tableInfo.otherColumn) <trim prefix="$!column.obj.name =case $!pk.obj.name" suffix="end,"> <foreach collection="recordList" index="index" item="item"> <if test="item.$!column.name !=null "> when #{item.$!pk.name} then #{item.$!column.name} </if> <if test="item.$!column.name ==null "> when #{item.$!pk.name} then $!{tableInfo.obj.name}.$!column.obj.name </if> </foreach> </trim> #end </trim> where $!pk.obj.name in( <foreach collection="recordList" index="index" item="item" separator=","> #{item.$!pk.name} </foreach> ) </update> <!-- 根據主鍵批量刪除 --> <delete id="batchDelete" parameterType="java.lang.String"> delete from $!{tableInfo.obj.parent.name}.$!{tableInfo.obj.name} where $!pk.obj.name in ( <foreach collection="ids" index="index" item="item" separator=","> #{item} </foreach> ) </delete> </mapper>
oracle-mapper.xml
##引入mybatis支持 $!mybatisSupport ##設置保存名稱與保存位置 $!callback.setFileName($tool.append($!{tableInfo.name}, "Mapper.xml")) $!callback.setSavePath($tool.append($tableInfo.savePath, "/src/main/resources/mapper")) ##拿到主鍵 #if(!$tableInfo.pkColumn.isEmpty()) #set($pk = $tableInfo.pkColumn.get(0)) #end <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="$!{tableInfo.savePackageName}.mapper.$!{tableInfo.name}Mapper"> <resultMap type="$!{tableInfo.savePackageName}.entity.$!{tableInfo.name}" id="$!{tableInfo.name}Map"> #foreach($column in $tableInfo.fullColumn) <result property="$!column.name" column="$!column.name" jdbcType="$!column.ext.jdbcType"/> #end </resultMap> <!-- 偽列 --> <sql id="columns"> #foreach($column in $tableInfo.fullColumn) a.$!column.obj.name AS $!column.name #if($velocityCount != $tableInfo.fullColumn.size()),#end #end </sql> <!-- 查詢條件 --> <sql id="whereSql"> <where> #foreach($column in $tableInfo.fullColumn) <if test="$!column.name != null#if($column.type.equals("java.lang.String")) and $!column.name != ''#end"> and a.$!column.obj.name = #{$!column.name} </if> #end </where> </sql> <!-- 通過ID查詢單條數據 --> <select id="queryById" resultType="$!{tableInfo.savePackageName}.entity.$!{tableInfo.name}"> select <include refid="columns"/> from $!{tableInfo.obj.parent.name}.$!tableInfo.obj.name a where a.$!pk.obj.name = #{$!pk.name} </select> <!-- 通過實體作為篩選條件查詢 --> <select id="queryAll" resultType="$!{tableInfo.savePackageName}.entity.$!{tableInfo.name}"> select <include refid="columns"/> from $!{tableInfo.obj.parent.name}.$!tableInfo.obj.name a <include refid="whereSql" /> </select> <!-- 通過實體作為篩選條件查詢條數 --> <select id="queryAllCount" resultType="java.lang.Integer"> select count(1) from $!{tableInfo.obj.parent.name}.$!tableInfo.obj.name a <include refid="whereSql" /> </select> <!-- 新增數據 --> <insert id="insert" keyProperty="$!pk.name" useGeneratedKeys="true"> insert into $!{tableInfo.obj.parent.name}.$!{tableInfo.obj.name}(#foreach($column in $tableInfo.fullColumn)$!column.obj.name#if($velocityHasNext), #end#end) values (#foreach($column in $tableInfo.fullColumn)#{$!{column.name}}#if($velocityHasNext), #end#end) </insert> <!-- 新增選擇列 --> <insert id="insertSelective" keyProperty="$!pk.name" useGeneratedKeys="true"> insert into $!{tableInfo.obj.parent.name}.$!{tableInfo.obj.name} <trim prefix="(" suffix=")" suffixOverrides="," > #foreach($column in $tableInfo.fullColumn) <if test="$!column.name != null#if($column.type.equals("java.lang.String")) and $!column.name != ''#end"> $!column.obj.name, </if> #end </trim> <trim prefix="values (" suffix=")" suffixOverrides="," > #foreach($column in $tableInfo.fullColumn) <if test="$!column.name != null#if($column.type.equals("java.lang.String")) and $!column.name != ''#end"> #{$!column.name,jdbcType=$!column.ext.jdbcType}, </if> #end </trim> </insert> <!-- 修改數據 --> <update id="update"> update $!{tableInfo.obj.parent.name}.$!{tableInfo.obj.name} <set> #foreach($column in $tableInfo.otherColumn) <if test="$!column.name != null#if($column.type.equals("java.lang.String")) and $!column.name != ''#end"> $!column.obj.name = #{$!column.name}, </if> #end </set> where $!pk.obj.name = #{$!pk.name} </update> <!-- 通過主鍵刪除數據 --> <delete id="deleteById"> delete from $!{tableInfo.obj.parent.name}.$!{tableInfo.obj.name} where $!pk.obj.name = #{$!pk.name} </delete> <!-- 批量新增 --> <insert id="batchInsert" parameterType="java.util.List"> insert into $!{tableInfo.obj.parent.name}.$!{tableInfo.obj.name} ( #foreach($column in $tableInfo.fullColumn)$!column.obj.name#if($velocityHasNext), #end#end ) ( <foreach collection="recordList" index="index" item="item" separator=","> ( select #foreach($column in $tableInfo.fullColumn)#{item.$!{column.name}}#if($velocityHasNext), #end#end from dual ) </foreach> ) </insert> <!-- 批量修改 --> <update id="batchUpdate" parameterType="java.util.List"> begin <foreach collection="recordList" index="index" item="item" separator=";"> update $!{tableInfo.obj.parent.name}.$!{tableInfo.obj.name} <set> #foreach($column in $tableInfo.otherColumn) $!column.obj.name = #{item.$!column.name} #end </set> where ID = #{item.$!pk.obj.name} </foreach> ;end; </update> <!-- 根據主鍵批量刪除 --> <delete id="batchDelete" parameterType="java.lang.String"> delete from $!{tableInfo.obj.parent.name}.$!{tableInfo.obj.name} where $!pk.obj.name in ( <foreach collection="ids" index="index" item="item" separator=","> #{item} </foreach> ) </delete> </mapper>
Global Config
init
##初始化區域 ##去掉表的t_前綴 #if($tableInfo.obj.name.startsWith("t_")) $!tableInfo.setName($tool.getClassName($tableInfo.obj.name.substring(2))) #end ##參考阿里巴巴開發手冊,POJO 類中布爾類型的變量,都不要加 is 前綴,否則部分框架解析會引起序列化錯誤 #foreach($column in $tableInfo.fullColumn) #if($column.name.startsWith("is") && $column.type.equals("java.lang.Boolean")) $!column.setName($tool.firstLowerCase($column.name.substring(2))) #end #end ##實現動態排除列 #set($temp = $tool.newHashSet("testCreateTime", "otherColumn")) #foreach($item in $temp) #set($newList = $tool.newArrayList()) #foreach($column in $tableInfo.fullColumn) #if($column.name!=$item) ##帶有反回值的方法調用時使用$tool.call來消除返回值 $tool.call($newList.add($column)) #end #end ##重新保存 $tableInfo.setFullColumn($newList) #end ##對importList進行篡改 #set($temp = $tool.newHashSet()) #foreach($column in $tableInfo.fullColumn) #if(!$column.type.startsWith("java.lang.")) ##帶有反回值的方法調用時使用$tool.call來消除返回值 $tool.call($temp.add($column.type)) #end #end ##覆蓋 #set($importList = $temp)
define
##(Velocity宏定義) ##定義設置表名后綴的宏定義,調用方式:#setTableSuffix("Test") #macro(setTableSuffix $suffix) #set($tableName = $!tool.append($tableInfo.name, $suffix)) #end ##定義設置包名后綴的宏定義,調用方式:#setPackageSuffix("Test") #macro(setPackageSuffix $suffix) #if($suffix!="")package #end#if($tableInfo.savePackageName!="")$!{tableInfo.savePackageName}.#{end}$!suffix; #end ##定義直接保存路徑與文件名簡化的宏定義,調用方式:#save("/entity", ".java") #macro(save $path $fileName) $!callback.setSavePath($tool.append($tableInfo.savePath, $path)) $!callback.setFileName($tool.append($tableInfo.name, $fileName)) #end ##定義表注釋的宏定義,調用方式:#tableComment("注釋信息") #macro(tableComment $desc) #set($time=$!time.currTime()) #set($time=$time.substring(0,11)) #set($time=$time.replace("-","/")) /** * <p> * $!{tableInfo.comment}($!{tableInfo.name})$desc * </p> * * @author:$!author * @date:$!time */ #end ##定義GET,SET方法的宏定義,調用方式:#getSetMethod($column) #macro(getSetMethod $column) public $!{tool.getClsNameByFullName($column.type)} get$!{tool.firstUpperCase($column.name)}() { return $!{column.name}; } public void set$!{tool.firstUpperCase($column.name)}($!{tool.getClsNameByFullName($column.type)} $!{column.name}) { #if(${column.type.equals("java.lang.String")})this.$!{column.name} = $!{column.name}== null ? null : $!{column.name}.trim(); #else this.$!{column.name} = $!{column.name};#end} #end
mybatisSupport
##針對Mybatis 進行支持,主要用于生成xml文件 #foreach($column in $tableInfo.fullColumn) ##儲存列類型 $tool.call($column.ext.put("sqlType", $tool.getField($column.obj.dataType, "typeName"))) #if($tool.newHashSet("java.lang.String").contains($column.type)) #set($jdbcType="VARCHAR") #elseif($tool.newHashSet("java.lang.Boolean", "boolean").contains($column.type)) #set($jdbcType="BOOLEAN") #elseif($tool.newHashSet("java.lang.Byte", "byte").contains($column.type)) #set($jdbcType="BYTE") #elseif($tool.newHashSet("java.lang.Integer", "int", "java.lang.Short", "short").contains($column.type)) #set($jdbcType="INTEGER") #elseif($tool.newHashSet("java.lang.Long", "long").contains($column.type)) #set($jdbcType="INTEGER") #elseif($tool.newHashSet("java.lang.Float", "float", "java.lang.Double", "double").contains($column.type)) #set($jdbcType="NUMERIC") #elseif($tool.newHashSet("java.util.Date", "java.sql.Timestamp", "java.time.Instant", "java.time.LocalDateTime", "java.time.OffsetDateTime", " java.time.ZonedDateTime").contains($column.type)) #set($jdbcType="TIMESTAMP") #elseif($tool.newHashSet("java.sql.Date", "java.time.LocalDate").contains($column.type)) #set($jdbcType="TIMESTAMP") #else ##其他類型 #set($jdbcType="OTHER") #end $tool.call($column.ext.put("jdbcType", $jdbcType)) #end ##定義宏,查詢所有列 #macro(allSqlColumn)#foreach($column in $tableInfo.fullColumn)$column.obj.name#if($velocityHasNext), #end#end#end
以上就是如何在IDEA中對EasyCode進行配置,小編相信有部分知識點可能是我們日常工作會見到或用到的。希望你能通過這篇文章學到更多知識。更多詳情敬請關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。