EasyCode是一個什麼東西?
EasyCode是基于IntelliJ IDEA開發的代碼生成插件,支援自定義任意模闆(Java,html,js,xml)。隻要是與資料庫相關的代碼都可以通過自定義模闆來生成。支援資料庫類型與java類型映射關系配置。支援同時生成生成多張表的代碼。每張表有獨立的配置資訊。完全的個性化定義,規則由你設定。
建立一個SpringBoot項目

下載下傳Easy Code
配置資料源
使用Easy Code一定要使用IDEA自帶的資料庫工具來配置資料源。
打開側邊的Database,檢視效果
準備資料表
我這裡使用Navcat工具建立了一個user表
自定義生成模闆
第一次安裝EasyCode的時候預設的模闆(服務于MyBatis)可以生成下面類型的代碼
- entity.java
- dao.java
- service.java
- serviceImpl.java
- controller.java
- mapper.xml
-
debug.json
檢視分組,也可以看到還可以支援生成MyBatisPlus
以user表為例,根據你定義的模闆生成代碼,文章的最後貼出我自定義的模闆
選擇模闆
點選OK之後,就可以看到生成了這些代碼
實體類層:User.java
package com.moti.springbooteasycode.entity;
import java.io.Serializable;
/**
* (User)實體類
*
* @author 莫提
* @since 2020-02-14 12:37:22
*/
public class User implements Serializable {
private static final long serialVersionUID = 360314844000215122L;
private Integer userId;
private String userName;
private String password;
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return "User{" +
"userId=" + userId +
"userName=" + userName +
"password=" + password +
'}';
}
}
Dao層:UserDao.java
package com.moti.springbooteasycode.dao;
import com.moti.springbooteasycode.entity.User;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @InterfaceName UserDao
* @Description (User)表資料庫通路層
* @author 莫提
* @date 2020-02-14 11:54:45
* @Version 1.0
**/
@Mapper
public interface UserDao {
/**
* @Description 添加User
* @author 莫提
* @date 2020-02-14 11:54:45
* @param user 執行個體對象
* @return 影響行數
*/
int insert(User user);
/**
* @Description 删除User
* @author 莫提
* @date 2020-02-14 11:54:45
* @param userId 主鍵
* @return 影響行數
*/
int deleteById(Integer userId);
/**
* @Description 查詢單條資料
* @author 莫提
* @date 2020-02-14 11:54:45
* @param userId 主鍵
* @return 執行個體對象
*/
User queryById(Integer userId);
/**
* @Description 查詢全部資料
* @author 莫提
* @date 2020-02-14 11:54:45
* 分頁使用MyBatis的插件實作
* @return 對象清單
*/
List<User> queryAll();
/**
* @Description 實體作為篩選條件查詢資料
* @author 莫提
* @date 2020-02-14 11:54:45
* @param user 執行個體對象
* @return 對象清單
*/
List<User> queryAll(User user);
/**
* @Description 修改User
* @author 莫提
* @date 2020-02-14 11:54:45
* @param 根據user的主鍵修改資料
* @return 影響行數
*/
int update(User user);
}
Service接口層:UserService.java
package com.moti.springbooteasycode.service;
import com.moti.springbooteasycode.entity.User;
import java.util.List;
/**
* @InterfaceName UserService
* @Description (User)表服務接口
* @author 莫提
* @date 2020-02-14 11:54:45
* @Version 1.0
**/
public interface UserService {
/**
* @Description 添加User
* @author 莫提
* @date 2020-02-14 11:54:45
* @param user 執行個體對象
* @return 是否成功
*/
boolean insert(User user);
/**
* @Description 删除User
* @author 莫提
* @date 2020-02-14 11:54:45
* @param userId 主鍵
* @return 是否成功
*/
boolean deleteById(Integer userId);
/**
* @Description 查詢單條資料
* @author 莫提
* @date 2020-02-14 11:54:45
* @param userId 主鍵
* @return 執行個體對象
*/
User queryById(Integer userId);
/**
* @Description 查詢全部資料
* @author 莫提
* @date 2020-02-14 11:54:45
* 分頁使用MyBatis的插件實作
* @return 對象清單
*/
List<User> queryAll();
/**
* @Description 實體作為篩選條件查詢資料
* @author 莫提
* @date 2020-02-14 11:54:45
* @param user 執行個體對象
* @return 對象清單
*/
List<User> queryAll(User user);
/**
* @Description 修改資料,哪個屬性不為空就修改哪個屬性
* @author 莫提
* @date 2020-02-14 11:54:45
* @param user 執行個體對象
* @return 是否成功
*/
boolean update(User user);
}
ServiceImpl服務接口實作層:UserServiceImpl.java
package com.moti.springbooteasycode.service.impl;
import com.moti.springbooteasycode.dao.UserDao;
import com.moti.springbooteasycode.entity.User;
import com.moti.springbooteasycode.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @ClassName UserServiceImpl
* @Description (User)表服務實作類
* @author 莫提
* @date 2020-02-14 11:54:45
* @Version 1.0
**/
@Service("userService")
public class UserServiceImpl extends BaseService implements UserService {
@Autowired
protected UserDao userDao;
/**
* @Description 添加User
* @author 莫提
* @date 2020-02-14 11:54:45
* @param user 執行個體對象
* @return 是否成功
*/
@Override
public boolean insert(User user) {
if(userDao.insert(user) == 1){
return true;
}
return false;
}
/**
* @Description 删除User
* @author 莫提
* @date 2020-02-14 11:54:45
* @param userId 主鍵
* @return 是否成功
*/
@Override
public boolean deleteById(Integer userId) {
if(userDao.deleteById(userId) == 1){
return true;
}
return false;
}
/**
* @Description 查詢單條資料
* @author 莫提
* @date 2020-02-14 11:54:45
* @param userId 主鍵
* @return 執行個體對象
*/
@Override
public User queryById(Integer userId) {
return userDao.queryById(userId);
}
/**
* @Description 查詢全部資料
* @author 莫提
* @date 2020-02-14 11:54:45
* 分頁使用MyBatis的插件實作
* @return 對象清單
*/
@Override
public List<User> queryAll() {
return userDao.queryAll();
}
/**
* @Description 實體作為篩選條件查詢資料
* @author 莫提
* @date 2020-02-14 11:54:45
* @param user 執行個體對象
* @return 對象清單
*/
@Override
public List<User> queryAll(User user) {
return userDao.queryAll(user);
}
/**
* @Description 修改資料,哪個屬性不為空就修改哪個屬性
* @author 莫提
* @date 2020-02-14 11:54:45
* @param user 執行個體對象
* @return 是否成功
*/
@Override
public boolean update(User user) {
if(userDao.update(user) == 1){
return true;
}
return false;
}
}
Mapper映射檔案:UserMapper.xml
<?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="com.moti.springbooteasycode.dao.UserDao">
<!--user的映射結果集-->
<resultMap type="com.moti.springbooteasycode.entity.User" id="UserMap">
<result property="userId" column="user_id" jdbcType="INTEGER"/>
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
<result property="password" column="password" jdbcType="VARCHAR"/>
</resultMap>
<!--全部字段-->
<sql id="allColumn"> user_id, user_name, password </sql>
<!--添加語句的字段清單-->
<sql id="insertColumn">
<if test="userName != null and userName != ''">
user_name,
</if>
<if test="password != null and password != ''">
password,
</if>
</sql>
<!--添加語句的值清單-->
<sql id="insertValue">
<if test="userName != null and userName != ''">
#{userName},
</if>
<if test="password != null and password != ''">
#{password},
</if>
</sql>
<!--通用對User各個屬性的值的非空判斷-->
<sql id="commonsValue">
<if test="userName != null and userName != ''">
user_name = #{userName},
</if>
<if test="password != null and password != ''">
password = #{password},
</if>
</sql>
<!--新增user:哪個字段不為空就添加哪列資料,傳回自增主鍵-->
<insert id="insert" keyProperty="userId" useGeneratedKeys="true">
insert into user
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="insertColumn"/>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<include refid="insertValue"/>
</trim>
</insert>
<!--删除user:通過主鍵-->
<delete id="deleteById">
delete from user
<where>
user_id = #{userId}
</where>
</delete>
<!--查詢單個user-->
<select id="queryById" resultMap="UserMap">
select
<include refid="allColumn"></include>
from user
<where>
user_id = #{userId}
</where>
</select>
<!--查詢所有user-->
<select id="queryAllByLimit" resultMap="UserMap">
select
<include refid="allColumn"></include>
from user
</select>
<!--通過實體作為篩選條件查詢-->
<select id="queryAll" resultMap="UserMap">
select
<include refid="allColumn"></include>
from user
<trim prefix="where" prefixOverrides="and" suffixOverrides=",">
<include refid="commonsValue"></include>
</trim>
</select>
<!--通過主鍵修改資料-->
<update id="update">
update user
<set>
<include refid="commonsValue"></include>
</set>
<where>
user_id = #{userId}
</where>
</update>
</mapper>
以上代碼完全是生成出來了,從頭到尾隻需要點幾下滑鼠,是不是很神奇!
BaseService是我根據需求自己後加的
package com.moti.springbooteasycode.service.impl;
import com.moti.springbooteasycode.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @ClassName: BaseService
* @Description: TODO
* @author: xw
* @date 2020/2/14 1:49
* @Version: 1.0
**/
public class BaseService {
@Autowired
protected UserDao userDao;
}
我的預設模闆
注意使用我的模闆的時候,需要将我上面的BaseService類添加到service.impl包下
entity.java
##引入宏定義
$!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
#foreach($column in $tableInfo.fullColumn)
##使用宏定義實作get,set方法
#getSetMethod($column)
#end
@Override
public String toString() {
return "$!{tableInfo.name}{" +
#foreach($column in $tableInfo.fullColumn)
"$!{column.name}=" + $!{column.name} +
#end
'}';
}
}
dao.java
##定義初始變量
#set($tableName = $tool.append($tableInfo.name, "Dao"))
##設定回調
$!callback.setFileName($tool.append($tableName, ".java"))
$!callback.setSavePath($tool.append($tableInfo.savePath, "/dao"))
##拿到主鍵
#if(!$tableInfo.pkColumn.isEmpty())
#set($pk = $tableInfo.pkColumn.get(0))
#end
#if($tableInfo.savePackageName)package $!{tableInfo.savePackageName}.#{end}dao;
import $!{tableInfo.savePackageName}.entity.$!{tableInfo.name};
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @InterfaceName $!{tableName}
* @Description $!{tableInfo.comment}($!{tableInfo.name})表資料庫通路層
* @author $!author
* @date $!time.currTime()
* @Version 1.0
**/
@Mapper
public interface $!{tableName} {
/**
* @Description 添加$!{tableInfo.name}
* @author $!author
* @date $!time.currTime()
* @param $!tool.firstLowerCase($!{tableInfo.name}) 執行個體對象
* @return 影響行數
*/
int insert($!{tableInfo.name} $!tool.firstLowerCase($!{tableInfo.name}));
/**
* @Description 删除$!{tableInfo.name}
* @author $!author
* @date $!time.currTime()
* @param $!pk.name 主鍵
* @return 影響行數
*/
int deleteById($!pk.shortType $!pk.name);
/**
* @Description 查詢單條資料
* @author $!author
* @date $!time.currTime()
* @param $!pk.name 主鍵
* @return 執行個體對象
*/
$!{tableInfo.name} queryById($!pk.shortType $!pk.name);
/**
* @Description 查詢全部資料
* @author $!author
* @date $!time.currTime()
* 分頁使用MyBatis的插件實作
* @return 對象清單
*/
List<$!{tableInfo.name}> queryAll();
/**
* @Description 實體作為篩選條件查詢資料
* @author $!author
* @date $!time.currTime()
* @param $!tool.firstLowerCase($!{tableInfo.name}) 執行個體對象
* @return 對象清單
*/
List<$!{tableInfo.name}> queryAll($!{tableInfo.name} $!tool.firstLowerCase($!{tableInfo.name}));
/**
* @Description 修改$!{tableInfo.name}
* @author $!author
* @date $!time.currTime()
* @param 根據$!tool.firstLowerCase($!{tableInfo.name})的主鍵修改資料
* @return 影響行數
*/
int update($!{tableInfo.name} $!tool.firstLowerCase($!{tableInfo.name}));
}
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;
import $!{tableInfo.savePackageName}.entity.$!{tableInfo.name};
import java.util.List;
/**
* @InterfaceName $!{tableName}
* @Description $!{tableInfo.comment}($!{tableInfo.name})表服務接口
* @author $!author
* @date $!time.currTime()
* @Version 1.0
**/
public interface $!{tableName} {
/**
* @Description 添加$!{tableInfo.name}
* @author $!author
* @date $!time.currTime()
* @param $!tool.firstLowerCase($!{tableInfo.name}) 執行個體對象
* @return 是否成功
*/
boolean insert($!{tableInfo.name} $!tool.firstLowerCase($!{tableInfo.name}));
/**
* @Description 删除$!{tableInfo.name}
* @author $!author
* @date $!time.currTime()
* @param $!pk.name 主鍵
* @return 是否成功
*/
boolean deleteById($!pk.shortType $!pk.name);
/**
* @Description 查詢單條資料
* @author $!author
* @date $!time.currTime()
* @param $!pk.name 主鍵
* @return 執行個體對象
*/
$!{tableInfo.name} queryById($!pk.shortType $!pk.name);
/**
* @Description 查詢全部資料
* @author $!author
* @date $!time.currTime()
* 分頁使用MyBatis的插件實作
* @return 對象清單
*/
List<$!{tableInfo.name}> queryAll();
/**
* @Description 實體作為篩選條件查詢資料
* @author $!author
* @date $!time.currTime()
* @param $!tool.firstLowerCase($!{tableInfo.name}) 執行個體對象
* @return 對象清單
*/
List<$!{tableInfo.name}> queryAll($!{tableInfo.name} $!tool.firstLowerCase($!{tableInfo.name}));
/**
* @Description 修改資料,哪個屬性不為空就修改哪個屬性
* @author $!author
* @date $!time.currTime()
* @param $!tool.firstLowerCase($!{tableInfo.name}) 執行個體對象
* @return 是否成功
*/
boolean update($!{tableInfo.name} $!tool.firstLowerCase($!{tableInfo.name}));
}
serviceImpl.java
##定義初始變量
#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}.entity.$!{tableInfo.name};
import $!{tableInfo.savePackageName}.dao.$!{tableInfo.name}Dao;
import $!{tableInfo.savePackageName}.service.$!{tableInfo.name}Service;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @ClassName $!{tableName}
* @Description $!{tableInfo.comment}($!{tableInfo.name})表服務實作類
* @author $!author
* @date $!time.currTime()
* @Version 1.0
**/
@Service("$!tool.firstLowerCase($!{tableInfo.name})Service")
public class $!{tableName} extends BaseService implements $!{tableInfo.name}Service {
@Autowired
protected $!{tableInfo.name}Dao $!tool.firstLowerCase($!{tableInfo.name})Dao;
/**
* @Description 添加$!{tableInfo.name}
* @author $!author
* @date $!time.currTime()
* @param $!tool.firstLowerCase($!{tableInfo.name}) 執行個體對象
* @return 是否成功
*/
@Override
public boolean insert($!{tableInfo.name} $!tool.firstLowerCase($!{tableInfo.name})) {
if($!{tool.firstLowerCase($!{tableInfo.name})}Dao.insert($!tool.firstLowerCase($!{tableInfo.name})) == 1){
return true;
}
return false;
}
/**
* @Description 删除$!{tableInfo.name}
* @author $!author
* @date $!time.currTime()
* @param $!pk.name 主鍵
* @return 是否成功
*/
@Override
public boolean deleteById($!pk.shortType $!pk.name) {
if($!{tool.firstLowerCase($!{tableInfo.name})}Dao.deleteById($!pk.name) == 1){
return true;
}
return false;
}
/**
* @Description 查詢單條資料
* @author $!author
* @date $!time.currTime()
* @param $!pk.name 主鍵
* @return 執行個體對象
*/
@Override
public $!{tableInfo.name} queryById($!pk.shortType $!pk.name) {
return $!{tool.firstLowerCase($!{tableInfo.name})}Dao.queryById($!pk.name);
}
/**
* @Description 查詢全部資料
* @author $!author
* @date $!time.currTime()
* 分頁使用MyBatis的插件實作
* @return 對象清單
*/
@Override
public List<$!{tableInfo.name}> queryAll() {
return $!{tool.firstLowerCase($!{tableInfo.name})}Dao.queryAll();
}
/**
* @Description 實體作為篩選條件查詢資料
* @author $!author
* @date $!time.currTime()
* @param $!tool.firstLowerCase($!{tableInfo.name}) 執行個體對象
* @return 對象清單
*/
@Override
public List<$!{tableInfo.name}> queryAll($!{tableInfo.name} $!tool.firstLowerCase($!{tableInfo.name})) {
return $!{tool.firstLowerCase($!{tableInfo.name})}Dao.queryAll($!tool.firstLowerCase($!{tableInfo.name}));
}
/**
* @Description 修改資料,哪個屬性不為空就修改哪個屬性
* @author $!author
* @date $!time.currTime()
* @param $!tool.firstLowerCase($!{tableInfo.name}) 執行個體對象
* @return 是否成功
*/
@Override
public boolean update($!{tableInfo.name} $!tool.firstLowerCase($!{tableInfo.name})) {
if($!{tool.firstLowerCase($!{tableInfo.name})}Dao.update($!tool.firstLowerCase($!{tableInfo.name})) == 1){
return true;
}
return false;
}
}
mapper.xml
##引入mybatis支援
$!mybatisSupport
##設定儲存名稱與儲存位置
$!callback.setFileName($tool.append($!{tableInfo.name}, "Dao.xml"))
$!callback.setSavePath($tool.append($modulePath, "/src/main/resources/mybatis/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}.dao.$!{tableInfo.name}Dao">
<!--$!{tableInfo.obj.name}的映射結果集-->
<resultMap type="$!{tableInfo.savePackageName}.entity.$!{tableInfo.name}" id="$!{tableInfo.name}Map">
#foreach($column in $tableInfo.fullColumn)
<result property="$!column.name" column="$!column.obj.name" jdbcType="$!column.ext.jdbcType"/>
#end
</resultMap>
<!--全部字段-->
<sql id="allColumn"> #allSqlColumn() </sql>
<!--添加語句的字段清單-->
<sql id="insertColumn">
#foreach($column in $tableInfo.otherColumn)
<if test="$!column.name != null#if($column.type.equals("java.lang.String")) and $!column.name != ''#end">
$!column.obj.name,
</if>
#end
</sql>
<!--添加語句的值清單-->
<sql id="insertValue">
#foreach($column in $tableInfo.otherColumn)
<if test="$!column.name != null#if($column.type.equals("java.lang.String")) and $!column.name != ''#end">
#{$!column.name},
</if>
#end
</sql>
<!--通用對$!{tableInfo.name}各個屬性的值的非空判斷-->
<sql id="commonsValue">
#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
</sql>
<!--新增$!{tableInfo.obj.name}:哪個字段不為空就添加哪列資料,傳回自增主鍵-->
<insert id="insert" keyProperty="$!pk.name" useGeneratedKeys="true">
insert into $!{tableInfo.obj.name}
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="insertColumn"/>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<include refid="insertValue"/>
</trim>
</insert>
<!--删除$!{tableInfo.obj.name}:通過主鍵-->
<delete id="deleteById">
delete from $!{tableInfo.obj.name}
<where>
$!pk.obj.name = #{$!pk.name}
</where>
</delete>
<!--查詢單個$!{tableInfo.obj.name}-->
<select id="queryById" resultMap="$!{tableInfo.name}Map">
select
<include refid="allColumn"></include>
from $!tableInfo.obj.name
<where>
$!pk.obj.name = #{$!pk.name}
</where>
</select>
<!--查詢所有$!{tableInfo.obj.name}-->
<select id="queryAllByLimit" resultMap="$!{tableInfo.name}Map">
select
<include refid="allColumn"></include>
from $!tableInfo.obj.name
</select>
<!--通過實體作為篩選條件查詢-->
<select id="queryAll" resultMap="$!{tableInfo.name}Map">
select
<include refid="allColumn"></include>
from $!tableInfo.obj.name
<trim prefix="where" prefixOverrides="and" suffixOverrides=",">
<include refid="commonsValue"></include>
</trim>
</select>
<!--通過主鍵修改資料-->
<update id="update">
update $!{tableInfo.obj.name}
<set>
<include refid="commonsValue"></include>
</set>
<where>
$!pk.obj.name = #{$!pk.name}
</where>
</update>
</mapper>
Lombok實體類層:entity.java
##引入宏定義
$!define
##使用宏定義設定回調(儲存位置與檔案字尾)
#save("/entity", ".java")
##使用宏定義設定包字尾
#setPackageSuffix("entity")
##使用全局變量實作預設包導入
$!autoImport
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
##使用宏定義實作類注釋資訊
#tableComment("實體類")
@AllArgsConstructor
@Data
@Builder
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
}
多個分組的切換
選擇好分組後,點選OK,之後在Datebase視圖的資料表右鍵選擇EasyCode生成的時候會讓你選擇目前分組的模闆