This commit is contained in:
zhujj 2018-11-30 17:11:47 +08:00
parent d75b9f52a8
commit 828bd9b85e
30 changed files with 224 additions and 346 deletions

View File

@ -31,6 +31,7 @@
pageNumber: 1, // 初始化加载第一页,默认第一页
pageSize: 10, // 每页的记录行数(*
pageList: [10, 25, 50], // 可供选择的每页的行数(*
clickToSelect: true, // 点击行选中
iconSize: 'outline', // 图标大小undefined默认的按钮尺寸 xs超小按钮sm小按钮lg大按钮
toolbar: '#toolbar', // 指定工作栏
sidePagination: "server", // 启用服务端分页

View File

@ -61,9 +61,7 @@ public class EntityUtils {
try {
Method[] methods = entity.getClass().getMethods();
for(Method m : methods){
if(m.getName().equals("setCreateBy")){
m.invoke(entity, ShiroUtils.getUserId());
}else if(m.getName().equals("setUpdateBy")){
if(m.getName().equals("setUpdateBy")){
m.invoke(entity, ShiroUtils.getUserId());
}
}

View File

@ -9,46 +9,113 @@ import java.util.List;
* Version 1.0.0
*/
public abstract interface AbstractBaseService<T> {
/**
* 查询单条数据信息
* 保证条件使数据唯一
* @param entity
* @return
*/
public T selectOne(T entity);
/**
* 查询单条数据信息
* @param id 代码
* @return
*/
public T selectById(Object id);
/**
* 单表分页查询
* @param entity
* @return
*/
public List<T> selectListByPage(T entity);
/**
* 查询数据集合
* @param entity
* @return
*/
public List<T> selectList(T entity) ;
/**
* 查询所有数据集合
* @return
*/
public List<T> selectListAll();
/**
* 查询数据量
* @param entity
* @return
*/
public Long selectCount(T entity);
/**
* 保存
* @param entity
* @return
*/
public int insert(T entity);
public void insert(T entity);
/**
* 保存不为null的数据
* @param entity
* @return
*/
public int insertSelective(T entity);
/**
* 删除符合条件的数据
* @param entity
* @return
*/
public int delete(T entity) ;
public void insertSelective(T entity);
/**
* 根据编码ID删除
* @param id
* @return
*/
public int deleteById(Object id);
/**
* 根据id集合删除
* ids 例如 '1','2'
* @param ids
* @return
*/
public int deleteByIds(String ids);
public void delete(T entity) ;
/**
* 根据编码ID全部字段更新
* 包含NULL
* @param entity
* @return
*/
public int updateById(T entity) ;
/**
* 根据编码ID更新
* 不包含NULL
* @param entity
* @return
*/
public int updateSelectiveById(T entity);
public void deleteById(Object id);
public void updateById(T entity) ;
public void updateSelectiveById(T entity);
/**
* 自定义模板查询
* @param example
* @return
*/
public List<T> selectByExample(Object example);
/**
* 自定义模板查询数量
* @param example
* @return
*/
public int selectCountByExample(Object example);
public List<T> selectByQuery(T entity) ;
/**
* 设置请求分页数据
*/

View File

@ -16,7 +16,7 @@ import java.util.List;
* Time: 15:13
* Version 1.0.0
*/
public abstract class AbstractBaseServiceImpl<M extends Mapper<T>, T> implements AbstractBaseService<T>{
public abstract class AbstractBaseServiceImpl<M extends MyMapper<T>, T> implements AbstractBaseService<T>{
@Autowired
protected M mapper;
public void setMapper(M mapper) {
@ -33,6 +33,11 @@ public abstract class AbstractBaseServiceImpl<M extends Mapper<T>, T> implements
return mapper.selectByPrimaryKey(id);
}
@Override
public List<T> selectListByPage(T entity) {
startPage();
return mapper.select(entity);
}
@Override
public List<T> selectList(T entity) {
@ -53,43 +58,45 @@ public abstract class AbstractBaseServiceImpl<M extends Mapper<T>, T> implements
@Override
public void insert(T entity) {
public int insert(T entity) {
EntityUtils.setCreatAndUpdatInfo(entity);
mapper.insert(entity);
return mapper.insert(entity);
}
@Override
public void insertSelective(T entity) {
public int insertSelective(T entity) {
EntityUtils.setCreatAndUpdatInfo(entity);
mapper.insertSelective(entity);
return mapper.insertSelective(entity);
}
@Override
public void delete(T entity) {
mapper.delete(entity);
public int delete(T entity) {
return mapper.delete(entity);
}
@Override
public void deleteById(Object id) {
mapper.deleteByPrimaryKey(id);
public int deleteById(Object id) {
return mapper.deleteByPrimaryKey(id);
}
@Override
public void updateById(T entity) {
public int deleteByIds(String ids) {
return mapper.deleteByIds(ids);
}
@Override
public int updateById(T entity) {
EntityUtils.setUpdatedInfo(entity);
mapper.updateByPrimaryKey(entity);
return mapper.updateByPrimaryKey(entity);
}
@Override
public void updateSelectiveById(T entity) {
public int updateSelectiveById(T entity) {
EntityUtils.setUpdatedInfo(entity);
mapper.updateByPrimaryKeySelective(entity);
return mapper.updateByPrimaryKeySelective(entity);
}
@Override
@ -102,13 +109,6 @@ public abstract class AbstractBaseServiceImpl<M extends Mapper<T>, T> implements
return mapper.selectCountByExample(example);
}
@Override
public List<T> selectByQuery(T entity) {
startPage();
return mapper.select(entity);
}
/**
* 设置请求分页数据
*/

View File

@ -0,0 +1,25 @@
package com.ruoyi.framework.web.base;
/**
* Created by Administrator on 2017/8/4.
*/
import tk.mybatis.mapper.common.ConditionMapper;
import tk.mybatis.mapper.common.IdsMapper;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;
/**
* 被继承的Mapper一般业务Mapper继承它
*
* @author admin
* @since 2017年8月22日11:50:27
*/
public interface MyMapper<T> extends Mapper<T>,
MySqlMapper<T>,
ConditionMapper<T>,
IdsMapper<T> {
//TODO
//FIXME 特别注意该接口不能被扫描到否则会出错
}

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.system.domain.SysConfig;
import tk.mybatis.mapper.common.Mapper;
@ -9,7 +11,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysConfigMapper extends Mapper<SysConfig>
public interface SysConfigMapper extends MyMapper<SysConfig>
{
/**
* 查询参数配置信息

View File

@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.system.domain.SysConfig;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.system.domain.SysDept;
@ -12,7 +13,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysDeptMapper extends Mapper<SysDept>
public interface SysDeptMapper extends MyMapper<SysDept>
{
/**
* 查询部门人数

View File

@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.system.domain.SysDept;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.system.domain.SysDictData;
@ -12,7 +13,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysDictDataMapper extends Mapper<SysDictData>
public interface SysDictDataMapper extends MyMapper<SysDictData>
{
/**
* 根据条件分页查询字典数据

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import org.apache.ibatis.annotations.Mapper;
import com.ruoyi.system.domain.SysDictType;
@ -10,7 +12,7 @@ import com.ruoyi.system.domain.SysDictType;
* @author ruoyi
*/
@Mapper
public interface SysDictTypeMapper extends tk.mybatis.mapper.common.Mapper<SysDictType>
public interface SysDictTypeMapper extends MyMapper<SysDictType>
{
/**
* 根据条件分页查询字典类型

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.system.domain.SysLogininfor;
import tk.mybatis.mapper.common.Mapper;
@ -9,7 +11,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysLogininforMapper extends Mapper<SysLogininfor>
public interface SysLogininforMapper extends MyMapper<SysLogininfor>
{
/**
* 新增系统登录日志

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.system.domain.SysMenu;
import tk.mybatis.mapper.common.Mapper;
@ -10,7 +12,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysMenuMapper extends Mapper<SysMenu>
public interface SysMenuMapper extends MyMapper<SysMenu>
{
/**
* 查询系统所有菜单含按钮

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.system.domain.SysNotice;
import tk.mybatis.mapper.common.Mapper;
@ -9,7 +11,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysNoticeMapper extends Mapper<SysNotice>
public interface SysNoticeMapper extends MyMapper<SysNotice>
{
/**
* 查询公告信息

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.system.domain.SysOperLog;
import tk.mybatis.mapper.common.Mapper;
@ -9,7 +11,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysOperLogMapper extends Mapper<SysOperLog>
public interface SysOperLogMapper extends MyMapper<SysOperLog>
{
/**
* 新增操作日志

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.system.domain.SysPost;
import tk.mybatis.mapper.common.Mapper;
@ -9,7 +11,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysPostMapper extends Mapper<SysPost>
public interface SysPostMapper extends MyMapper<SysPost>
{
/**
* 查询岗位数据集合

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.system.domain.SysRoleDept;
import tk.mybatis.mapper.common.Mapper;
@ -9,7 +11,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysRoleDeptMapper extends Mapper<SysRoleDept>
public interface SysRoleDeptMapper extends MyMapper<SysRoleDept>
{
/**
* 通过角色ID删除角色和部门关联

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.system.domain.SysRole;
import tk.mybatis.mapper.common.Mapper;
@ -9,7 +11,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysRoleMapper extends Mapper<SysRole>
public interface SysRoleMapper extends MyMapper<SysRole>
{
/**
* 根据条件分页查询角色数据

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.system.domain.SysRoleMenu;
import tk.mybatis.mapper.common.Mapper;
@ -9,7 +11,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysRoleMenuMapper extends Mapper<SysRoleMenu>
public interface SysRoleMenuMapper extends MyMapper<SysRoleMenu>
{
/**
* 通过角色ID删除角色和菜单关联

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.system.domain.SysUser;
import tk.mybatis.mapper.common.Mapper;
@ -9,12 +11,12 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysUserMapper extends Mapper<SysUser>
public interface SysUserMapper extends MyMapper<SysUser>
{
/**
* 根据条件分页查询用户对象
*
* @param user 用户信息
* @param sysUser 用户信息
* @return 用户信息集合信息
*/
public List<SysUser> selectUserList(SysUser sysUser);

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.system.domain.SysUserOnline;
import tk.mybatis.mapper.common.Mapper;
@ -9,7 +11,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysUserOnlineMapper extends Mapper<SysUserOnline>
public interface SysUserOnlineMapper extends MyMapper<SysUserOnline>
{
/**
* 通过会话序号查询信息

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.system.domain.SysUserPost;
import tk.mybatis.mapper.common.Mapper;
@ -9,7 +11,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysUserPostMapper extends Mapper<SysUserPost>
public interface SysUserPostMapper extends MyMapper<SysUserPost>
{
/**
* 通过用户ID删除用户和岗位关联

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.system.domain.SysUserRole;
import tk.mybatis.mapper.common.Mapper;
@ -9,7 +11,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysUserRoleMapper extends Mapper<SysUserRole>
public interface SysUserRoleMapper extends MyMapper<SysUserRole>
{
/**
* 通过用户ID删除用户和角色关联

View File

@ -22,7 +22,7 @@ import com.ruoyi.common.utils.ExcelUtil;
* @author zhujj
* @date 2018-11-29
*/
@RestController
@Controller
@RequestMapping("/agile/genTable")
public class GenTableController extends BaseController {
private String prefix = "agile/genTable";
@ -43,7 +43,7 @@ public class GenTableController extends BaseController {
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(GenTable genTable) {
List<GenTable> list = genTableService.selectGenTableList(genTable);
List<GenTable> list = genTableService.selectListByPage(genTable);
return getDataTable(list);
}
@ -55,7 +55,7 @@ public class GenTableController extends BaseController {
@PostMapping("/export")
@ResponseBody
public AjaxResult export(GenTable genTable) {
List<GenTable> list = genTableService.selectGenTableList(genTable);
List<GenTable> list = genTableService.selectList(genTable);
ExcelUtil<GenTable> util = new ExcelUtil<GenTable>(GenTable.class);
return util.exportExcel(list, "genTable");
}
@ -77,15 +77,15 @@ public class GenTableController extends BaseController {
@ResponseBody
public AjaxResult addSave(GenTable genTable) {
return toAjax(genTableService.insertGenTable(genTable));
return toAjax(genTableService.insert(genTable));
}
/**
* 修改代码生成
*/
@GetMapping("/edit/{tableName}")
public String edit(@PathVariable("tableName") String tableName, ModelMap mmap) {
GenTable genTable = genTableService.selectGenTableById(tableName);
public String edit(@PathVariable("id") String id, ModelMap mmap) {
GenTable genTable = genTableService.selectById(id);
mmap.put("genTable", genTable);
return prefix + "/edit";
}
@ -98,7 +98,7 @@ public class GenTableController extends BaseController {
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(GenTable genTable) {
return toAjax(genTableService.updateGenTable(genTable));
return toAjax(genTableService.updateById(genTable));
}
/**
@ -109,8 +109,10 @@ public class GenTableController extends BaseController {
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(genTableService.deleteGenTableByIds(ids));
genTableService.deleteByIds(ids);
// return toAjax(genTableService.deleteGenTableByIds(ids));
return null;
}
}

View File

@ -3,6 +3,8 @@ package com.ruoyi.agile.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.base.BaseEntity;
import javax.persistence.Id;
import java.util.Date;
/**
@ -16,6 +18,7 @@ public class GenTable extends BaseEntity
private static final long serialVersionUID = 1L;
/** 编码 */
@Id
private Integer id;
/** 表名 */
private String tableName;

View File

@ -1,6 +1,10 @@
package com.ruoyi.agile.mapper;
import com.ruoyi.agile.domain.GenTableColumn;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.generator.domain.TableInfo;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
@ -9,7 +13,7 @@ import java.util.List;
* @author zhujj
* @date 2018-11-29
*/
public interface GenTableColumnMapper
public interface GenTableColumnMapper extends MyMapper<TableInfo>
{
/**
* 查询代码生成列信息

View File

@ -1,6 +1,10 @@
package com.ruoyi.agile.mapper;
import com.ruoyi.agile.domain.GenTable;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.generator.domain.TableInfo;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
@ -9,54 +13,8 @@ import java.util.List;
* @author zhujj
* @date 2018-11-29
*/
public interface GenTableMapper
public interface GenTableMapper extends MyMapper<GenTable>
{
/**
* 查询代码生成信息
*
* @param tableName 代码生成ID
* @return 代码生成信息
*/
public GenTable selectGenTableById(String tableName);
/**
* 查询代码生成列表
*
* @param genTable 代码生成信息
* @return 代码生成集合
*/
public List<GenTable> selectGenTableList(GenTable genTable);
/**
* 新增代码生成
*
* @param genTable 代码生成信息
* @return 结果
*/
public int insertGenTable(GenTable genTable);
/**
* 修改代码生成
*
* @param genTable 代码生成信息
* @return 结果
*/
public int updateGenTable(GenTable genTable);
/**
* 删除代码生成
*
* @param tableName 代码生成ID
* @return 结果
*/
public int deleteGenTableById(String tableName);
/**
* 批量删除代码生成
*
* @param tableNames 需要删除的数据ID
* @return 结果
*/
public int deleteGenTableByIds(String[] tableNames);
}

View File

@ -1,6 +1,9 @@
package com.ruoyi.agile.service;
import com.ruoyi.agile.domain.GenTable;
import com.ruoyi.framework.web.base.AbstractBaseService;
import com.ruoyi.generator.domain.TableInfo;
import java.util.List;
/**
@ -9,46 +12,8 @@ import java.util.List;
* @author zhujj
* @date 2018-11-29
*/
public interface IGenTableService
public interface IGenTableService extends AbstractBaseService<GenTable>
{
/**
* 查询代码生成信息
*
* @param tableName 代码生成ID
* @return 代码生成信息
*/
public GenTable selectGenTableById(String tableName);
/**
* 查询代码生成列表
*
* @param genTable 代码生成信息
* @return 代码生成集合
*/
public List<GenTable> selectGenTableList(GenTable genTable);
/**
* 新增代码生成
*
* @param genTable 代码生成信息
* @return 结果
*/
public int insertGenTable(GenTable genTable);
/**
* 修改代码生成
*
* @param genTable 代码生成信息
* @return 结果
*/
public int updateGenTable(GenTable genTable);
/**
* 删除代码生成信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteGenTableByIds(String ids);
}

View File

@ -1,6 +1,10 @@
package com.ruoyi.agile.service.impl;
import java.util.List;
import com.ruoyi.framework.web.base.AbstractBaseServiceImpl;
import com.ruoyi.generator.domain.TableInfo;
import com.ruoyi.generator.mapper.GenMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.agile.mapper.GenTableMapper;
@ -15,69 +19,7 @@ import com.ruoyi.common.support.Convert;
* @date 2018-11-29
*/
@Service
public class GenTableServiceImpl implements IGenTableService
{
@Autowired
private GenTableMapper genTableMapper;
public class GenTableServiceImpl extends AbstractBaseServiceImpl<GenTableMapper,GenTable> implements IGenTableService {
/**
* 查询代码生成信息
*
* @param tableName 代码生成ID
* @return 代码生成信息
*/
@Override
public GenTable selectGenTableById(String tableName)
{
return genTableMapper.selectGenTableById(tableName);
}
/**
* 查询代码生成列表
*
* @param genTable 代码生成信息
* @return 代码生成集合
*/
@Override
public List<GenTable> selectGenTableList(GenTable genTable)
{
return genTableMapper.selectGenTableList(genTable);
}
/**
* 新增代码生成
*
* @param genTable 代码生成信息
* @return 结果
*/
@Override
public int insertGenTable(GenTable genTable)
{
return genTableMapper.insertGenTable(genTable);
}
/**
* 修改代码生成
*
* @param genTable 代码生成信息
* @return 结果
*/
@Override
public int updateGenTable(GenTable genTable)
{
return genTableMapper.updateGenTable(genTable);
}
/**
* 删除代码生成对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteGenTableByIds(String ids)
{
return genTableMapper.deleteGenTableByIds(Convert.toStrArray(ids));
}
}

View File

@ -1,6 +1,8 @@
package com.ruoyi.generator.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.generator.domain.ColumnInfo;
import com.ruoyi.generator.domain.TableInfo;
import tk.mybatis.mapper.common.Mapper;
@ -10,7 +12,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface GenMapper extends Mapper<TableInfo>
public interface GenMapper extends MyMapper<TableInfo>
{
/**
* 查询ry数据库表信息

View File

@ -32,124 +32,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select id, table_name, class_name, comments, parent_table_name, parent_table_fk_name, data_source_name, tpl_category, package_name, module_name, sub_module_name, function_name, function_name_simple, function_author, gen_base_dir, options, create_by, create_date, update_by, update_date, remarks from gen_table
</sql>
<select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
<include refid="selectGenTableVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="tableName != null and tableName != '' "> and table_name = #{tableName}</if>
<if test="className != null and className != '' "> and class_name = #{className}</if>
<if test="comments != null and comments != '' "> and comments = #{comments}</if>
<if test="parentTableName != null and parentTableName != '' "> and parent_table_name = #{parentTableName}</if>
<if test="parentTableFkName != null and parentTableFkName != '' "> and parent_table_fk_name = #{parentTableFkName}</if>
<if test="dataSourceName != null and dataSourceName != '' "> and data_source_name = #{dataSourceName}</if>
<if test="tplCategory != null and tplCategory != '' "> and tpl_category = #{tplCategory}</if>
<if test="packageName != null and packageName != '' "> and package_name = #{packageName}</if>
<if test="moduleName != null and moduleName != '' "> and module_name = #{moduleName}</if>
<if test="subModuleName != null and subModuleName != '' "> and sub_module_name = #{subModuleName}</if>
<if test="functionName != null and functionName != '' "> and function_name = #{functionName}</if>
<if test="functionNameSimple != null and functionNameSimple != '' "> and function_name_simple = #{functionNameSimple}</if>
<if test="functionAuthor != null and functionAuthor != '' "> and function_author = #{functionAuthor}</if>
<if test="genBaseDir != null and genBaseDir != '' "> and gen_base_dir = #{genBaseDir}</if>
<if test="options != null and options != '' "> and options = #{options}</if>
<if test="createBy != null and createBy != '' "> and create_by = #{createBy}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateBy != null and updateBy != '' "> and update_by = #{updateBy}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="remarks != null and remarks != '' "> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectGenTableById" parameterType="Integer" resultMap="GenTableResult">
<include refid="selectGenTableVo"/>
where id = #{id}
</select>
<insert id="insertGenTable" parameterType="GenTable">
insert into gen_table
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null ">id,</if>
<if test="tableName != null and tableName != '' ">table_name,</if>
<if test="className != null and className != '' ">class_name,</if>
<if test="comments != null and comments != '' ">comments,</if>
<if test="parentTableName != null and parentTableName != '' ">parent_table_name,</if>
<if test="parentTableFkName != null and parentTableFkName != '' ">parent_table_fk_name,</if>
<if test="dataSourceName != null and dataSourceName != '' ">data_source_name,</if>
<if test="tplCategory != null and tplCategory != '' ">tpl_category,</if>
<if test="packageName != null and packageName != '' ">package_name,</if>
<if test="moduleName != null and moduleName != '' ">module_name,</if>
<if test="subModuleName != null and subModuleName != '' ">sub_module_name,</if>
<if test="functionName != null and functionName != '' ">function_name,</if>
<if test="functionNameSimple != null and functionNameSimple != '' ">function_name_simple,</if>
<if test="functionAuthor != null and functionAuthor != '' ">function_author,</if>
<if test="genBaseDir != null and genBaseDir != '' ">gen_base_dir,</if>
<if test="options != null and options != '' ">options,</if>
<if test="createBy != null and createBy != '' ">create_by,</if>
<if test="createDate != null ">create_date,</if>
<if test="updateBy != null and updateBy != '' ">update_by,</if>
<if test="updateDate != null ">update_date,</if>
<if test="remarks != null and remarks != '' ">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null ">#{id},</if>
<if test="tableName != null and tableName != '' ">#{tableName},</if>
<if test="className != null and className != '' ">#{className},</if>
<if test="comments != null and comments != '' ">#{comments},</if>
<if test="parentTableName != null and parentTableName != '' ">#{parentTableName},</if>
<if test="parentTableFkName != null and parentTableFkName != '' ">#{parentTableFkName},</if>
<if test="dataSourceName != null and dataSourceName != '' ">#{dataSourceName},</if>
<if test="tplCategory != null and tplCategory != '' ">#{tplCategory},</if>
<if test="packageName != null and packageName != '' ">#{packageName},</if>
<if test="moduleName != null and moduleName != '' ">#{moduleName},</if>
<if test="subModuleName != null and subModuleName != '' ">#{subModuleName},</if>
<if test="functionName != null and functionName != '' ">#{functionName},</if>
<if test="functionNameSimple != null and functionNameSimple != '' ">#{functionNameSimple},</if>
<if test="functionAuthor != null and functionAuthor != '' ">#{functionAuthor},</if>
<if test="genBaseDir != null and genBaseDir != '' ">#{genBaseDir},</if>
<if test="options != null and options != '' ">#{options},</if>
<if test="createBy != null and createBy != '' ">#{createBy},</if>
<if test="createDate != null ">#{createDate},</if>
<if test="updateBy != null and updateBy != '' ">#{updateBy},</if>
<if test="updateDate != null ">#{updateDate},</if>
<if test="remarks != null and remarks != '' ">#{remarks},</if>
</trim>
</insert>
<update id="updateGenTable" parameterType="GenTable">
update gen_table
<trim prefix="SET" suffixOverrides=",">
<if test="tableName != null and tableName != '' ">table_name = #{tableName},</if>
<if test="className != null and className != '' ">class_name = #{className},</if>
<if test="comments != null and comments != '' ">comments = #{comments},</if>
<if test="parentTableName != null and parentTableName != '' ">parent_table_name = #{parentTableName},</if>
<if test="parentTableFkName != null and parentTableFkName != '' ">parent_table_fk_name = #{parentTableFkName},</if>
<if test="dataSourceName != null and dataSourceName != '' ">data_source_name = #{dataSourceName},</if>
<if test="tplCategory != null and tplCategory != '' ">tpl_category = #{tplCategory},</if>
<if test="packageName != null and packageName != '' ">package_name = #{packageName},</if>
<if test="moduleName != null and moduleName != '' ">module_name = #{moduleName},</if>
<if test="subModuleName != null and subModuleName != '' ">sub_module_name = #{subModuleName},</if>
<if test="functionName != null and functionName != '' ">function_name = #{functionName},</if>
<if test="functionNameSimple != null and functionNameSimple != '' ">function_name_simple = #{functionNameSimple},</if>
<if test="functionAuthor != null and functionAuthor != '' ">function_author = #{functionAuthor},</if>
<if test="genBaseDir != null and genBaseDir != '' ">gen_base_dir = #{genBaseDir},</if>
<if test="options != null and options != '' ">options = #{options},</if>
<if test="createBy != null and createBy != '' ">create_by = #{createBy},</if>
<if test="createDate != null ">create_date = #{createDate},</if>
<if test="updateBy != null and updateBy != '' ">update_by = #{updateBy},</if>
<if test="updateDate != null ">update_date = #{updateDate},</if>
<if test="remarks != null and remarks != '' ">remarks = #{remarks},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteGenTableById" parameterType="Integer">
delete from gen_table where id = #{id}
</delete>
<delete id="deleteGenTableByIds" parameterType="String">
delete from gen_table where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -52,7 +52,7 @@
$(function() {
var options = {
url: prefix + "/list",
url: prefix + "/page",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",