delete ruoyi 1.1.6
This commit is contained in:
@ -1,29 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-${classname}-add">
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $primaryKey.columnName)
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${column.columnComment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="${column.attrname}" name="${column.attrname}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
#end
|
||||
#end
|
||||
<div class="form-group">
|
||||
<div class="form-control-static col-sm-offset-9">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
<button th:onclick="'javascript:layer_close()'" class="btn btn-danger" type="button">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script th:src="@{/ruoyi/${moduleName}/${classname}/add.js}"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,30 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-${classname}-edit">
|
||||
<input id="${primaryKey.attrname}" name="${primaryKey.attrname}" th:value="${${classname}.${primaryKey.attrname}}" type="hidden">
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $primaryKey.columnName)
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${column.columnComment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="${column.attrname}" name="${column.attrname}" th:value="${${classname}.${column.attrname}}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
#end
|
||||
#end
|
||||
<div class="form-group">
|
||||
<div class="form-control-static col-sm-offset-9">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
<button th:onclick="'javascript:layer_close()'" class="btn btn-danger" type="button">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script th:src="@{/ruoyi/${moduleName}/${classname}/edit.js}"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,25 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="gray-bg">
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="btn-group hidden-xs" id="toolbar" role="group">
|
||||
<button type="button" class="btn btn-outline btn-default" onclick="javascript:add()" shiro:hasPermission="${moduleName}:${classname}:add">
|
||||
<i class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline btn-default" onclick="javascript:batchRemove()" shiro:hasPermission="${moduleName}:${classname}:batchRemove">
|
||||
<i class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
<table class="bootstrap-table" data-mobile-responsive="true">
|
||||
</table>
|
||||
</div>
|
||||
<div th:include="include :: footer"></div>
|
||||
<script th:src="@{/ruoyi/${moduleName}/${classname}/${classname}.js}"></script>
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permissionService.hasPermi('${moduleName}:${classname}:edit')}]];
|
||||
var removeFlag = [[${@permissionService.hasPermi('${moduleName}:${classname}:remove')}]];
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,123 +0,0 @@
|
||||
package ${package}.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import ${package}.domain.${className};
|
||||
import ${package}.service.I${className}Service;
|
||||
import com.ruoyi.framework.web.controller.BaseController;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.framework.web.domain.Message;
|
||||
|
||||
/**
|
||||
* ${tableComment} 信息操作处理
|
||||
*
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/${moduleName}/${classname}")
|
||||
public class ${className}Controller extends BaseController
|
||||
{
|
||||
private String prefix = "${moduleName}/${classname}";
|
||||
|
||||
@Autowired
|
||||
private I${className}Service ${classname}Service;
|
||||
|
||||
@GetMapping()
|
||||
@RequiresPermissions("${moduleName}:${classname}:view")
|
||||
public String ${classname}()
|
||||
{
|
||||
return prefix + "/${classname}";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询${tableComment}列表
|
||||
*/
|
||||
@RequiresPermissions("${moduleName}:${classname}:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(${className} ${classname})
|
||||
{
|
||||
startPage();
|
||||
List<${className}> list = ${classname}Service.select${className}List(${classname});
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增${tableComment}
|
||||
*/
|
||||
@RequiresPermissions("${moduleName}:${classname}:add")
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改${tableComment}
|
||||
*/
|
||||
@RequiresPermissions("${moduleName}:${classname}:edit")
|
||||
@GetMapping("/edit/{${primaryKey.attrname}}")
|
||||
public String edit(@PathVariable("${primaryKey.attrname}") ${primaryKey.attrType} ${primaryKey.attrname}, Model model)
|
||||
{
|
||||
${className} ${classname} = ${classname}Service.select${className}ById(${primaryKey.attrname});
|
||||
model.addAttribute("${classname}", ${classname});
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存${tableComment}
|
||||
*/
|
||||
@RequiresPermissions("${moduleName}:${classname}:save")
|
||||
@PostMapping("/save")
|
||||
@ResponseBody
|
||||
public Message save(${className} ${classname})
|
||||
{
|
||||
if (${classname}Service.save${className}(${classname}) > 0)
|
||||
{
|
||||
return Message.success();
|
||||
}
|
||||
return Message.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除${tableComment}
|
||||
*/
|
||||
@RequiresPermissions("${moduleName}:${classname}:remove")
|
||||
@PostMapping( "/remove/{${primaryKey.attrname}}")
|
||||
@ResponseBody
|
||||
public Message remove(@PathVariable("${primaryKey.attrname}") ${primaryKey.attrType} ${primaryKey.attrname})
|
||||
{
|
||||
if (${classname}Service.delete${className}ById(${primaryKey.attrname}) > 0)
|
||||
{
|
||||
return Message.success();
|
||||
}
|
||||
return Message.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除${tableComment}
|
||||
*/
|
||||
@RequiresPermissions("${moduleName}:${classname}:batchRemove")
|
||||
@PostMapping( "/batchRemove")
|
||||
@ResponseBody
|
||||
public Message remove(@RequestParam("ids[]") ${primaryKey.attrType}[] ${primaryKey.attrname}s)
|
||||
{
|
||||
int rows = ${classname}Service.batchDelete${className}(${primaryKey.attrname}s);
|
||||
if (rows > 0)
|
||||
{
|
||||
return Message.success();
|
||||
}
|
||||
return Message.error();
|
||||
}
|
||||
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
package ${package}.mapper;
|
||||
|
||||
import ${package}.domain.${className};
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ${tableComment} 数据层
|
||||
*
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
*/
|
||||
public interface ${className}Mapper
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询${tableComment}信息
|
||||
*
|
||||
* @param ${primaryKey.attrname} ${tableComment}ID
|
||||
* @return ${tableComment}信息
|
||||
*/
|
||||
public ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname});
|
||||
|
||||
/**
|
||||
* 查询${tableComment}列表
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return ${tableComment}集合
|
||||
*/
|
||||
public List<${className}> select${className}List(${className} ${classname});
|
||||
|
||||
/**
|
||||
* 新增${tableComment}
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert${className}(${className} ${classname});
|
||||
|
||||
/**
|
||||
* 修改${tableComment}
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int update${className}(${className} ${classname});
|
||||
|
||||
/**
|
||||
* 删除${tableComment}
|
||||
*
|
||||
* @param ${primaryKey.attrname} ${tableComment}ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int delete${className}ById(${primaryKey.attrType} ${primaryKey.attrname});
|
||||
|
||||
/**
|
||||
* 批量删除${tableComment}
|
||||
*
|
||||
* @param ${primaryKey.attrname}s 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchDelete${className}(${primaryKey.attrType}[] ${primaryKey.attrname}s);
|
||||
|
||||
}
|
@ -1,71 +0,0 @@
|
||||
package ${package}.service;
|
||||
|
||||
import ${package}.domain.${className};
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ${tableComment} 服务层
|
||||
*
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
*/
|
||||
public interface I${className}Service
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询${tableComment}信息
|
||||
*
|
||||
* @param ${primaryKey.attrname} ${tableComment}ID
|
||||
* @return ${tableComment}信息
|
||||
*/
|
||||
public ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname});
|
||||
|
||||
/**
|
||||
* 查询${tableComment}列表
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return ${tableComment}集合
|
||||
*/
|
||||
public List<${className}> select${className}List(${className} ${classname});
|
||||
|
||||
/**
|
||||
* 新增${tableComment}
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert${className}(${className} ${classname});
|
||||
|
||||
/**
|
||||
* 修改${tableComment}
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int update${className}(${className} ${classname});
|
||||
|
||||
/**
|
||||
* 保存${tableComment}
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int save${className}(${className} ${classname});
|
||||
|
||||
/**
|
||||
* 删除${tableComment}信息
|
||||
*
|
||||
* @param ${primaryKey.attrname} ${tableComment}ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int delete${className}ById(${primaryKey.attrType} ${primaryKey.attrname});
|
||||
|
||||
/**
|
||||
* 批量删除${tableComment}信息
|
||||
*
|
||||
* @param ${primaryKey.attrname}s 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchDelete${className}(${primaryKey.attrType}[] ${primaryKey.attrname}s);
|
||||
|
||||
}
|
@ -1,117 +0,0 @@
|
||||
package ${package}.service;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import ${package}.mapper.${className}Mapper;
|
||||
import ${package}.domain.${className};
|
||||
import ${package}.service.I${className}Service;
|
||||
|
||||
/**
|
||||
* ${tableComment} 服务层实现
|
||||
*
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
*/
|
||||
@Service
|
||||
public class ${className}ServiceImpl implements I${className}Service
|
||||
{
|
||||
@Autowired
|
||||
private ${className}Mapper ${classname}Mapper;
|
||||
|
||||
/**
|
||||
* 查询${tableComment}信息
|
||||
*
|
||||
* @param ${primaryKey.attrname} ${tableComment}ID
|
||||
* @return ${tableComment}信息
|
||||
*/
|
||||
@Override
|
||||
public ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname})
|
||||
{
|
||||
return ${classname}Mapper.select${className}ById(${primaryKey.attrname});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询${tableComment}列表
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return ${tableComment}集合
|
||||
*/
|
||||
@Override
|
||||
public List<${className}> select${className}List(${className} ${classname})
|
||||
{
|
||||
return ${classname}Mapper.select${className}List(${classname});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增${tableComment}
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insert${className}(${className} ${classname})
|
||||
{
|
||||
return ${classname}Mapper.insert${className}(${classname});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改${tableComment}
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int update${className}(${className} ${classname})
|
||||
{
|
||||
return ${classname}Mapper.update${className}(${classname});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存${tableComment}
|
||||
*
|
||||
* @param ${classname} ${tableComment}信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int save${className}(${className} ${classname})
|
||||
{
|
||||
${primaryKey.attrType} ${primaryKey.attrname} = ${classname}.get${primaryKey.attrName}();
|
||||
int rows = 0;
|
||||
if (StringUtils.isNotNull(${primaryKey.attrname}))
|
||||
{
|
||||
rows = ${classname}Mapper.update${className}(${classname});
|
||||
}
|
||||
else
|
||||
{
|
||||
rows = ${classname}Mapper.insert${className}(${classname});
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除${tableComment}信息
|
||||
*
|
||||
* @param ${primaryKey.attrname} ${tableComment}ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int delete${className}ById(${primaryKey.attrType} ${primaryKey.attrname})
|
||||
{
|
||||
return ${classname}Mapper.delete${className}ById(${primaryKey.attrname});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除${tableComment}对象
|
||||
*
|
||||
* @param ${primaryKey.attrname}s 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int batchDelete${className}(${primaryKey.attrType}[] ${primaryKey.attrname}s)
|
||||
{
|
||||
return ${classname}Mapper.batchDelete${className}(${primaryKey.attrname}s);
|
||||
}
|
||||
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
package ${package}.domain;
|
||||
|
||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||
#foreach ($column in $columns)
|
||||
#if($column.attrType == 'Date')
|
||||
import java.util.Date;
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
|
||||
/**
|
||||
* ${tableComment}表 ${tableName}
|
||||
*
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
*/
|
||||
public class ${className} extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
#foreach ($column in $columns)
|
||||
/** $column.columnComment */
|
||||
private $column.attrType $column.attrname;
|
||||
#end
|
||||
|
||||
#foreach ($column in $columns)
|
||||
/**
|
||||
* 设置:${column.columnComment}
|
||||
*/
|
||||
public void set${column.attrName}($column.attrType $column.attrname)
|
||||
{
|
||||
this.$column.attrname = $column.attrname;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取:${column.columnComment}
|
||||
*/
|
||||
public $column.attrType get${column.attrName}()
|
||||
{
|
||||
return $column.attrname;
|
||||
}
|
||||
|
||||
#end
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
$("#form-${classname}-add").validate({
|
||||
rules:{
|
||||
xxxx:{
|
||||
required:true,
|
||||
},
|
||||
},
|
||||
submitHandler:function(form){
|
||||
add();
|
||||
}
|
||||
});
|
||||
|
||||
function add() {
|
||||
_ajax_save(ctx + "${moduleName}/${classname}/save", $('#form-${classname}-add').serialize());
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
$("#form-${classname}-edit").validate({
|
||||
rules:{
|
||||
xxxx:{
|
||||
required:true,
|
||||
},
|
||||
},
|
||||
submitHandler:function(form){
|
||||
update();
|
||||
}
|
||||
});
|
||||
|
||||
function update() {
|
||||
_ajax_save(ctx + "${moduleName}/${classname}/save", $('#form-${classname}-edit').serialize());
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
var prefix = ctx + "${moduleName}/${classname}"
|
||||
|
||||
$(function() {
|
||||
var columns = [{
|
||||
checkbox: true
|
||||
},
|
||||
#foreach($column in $columns)
|
||||
{
|
||||
field : '${column.attrname}',
|
||||
title : '${column.columnComment}'
|
||||
},
|
||||
#end
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-primary btn-sm ' + editFlag + '" href="#" title="编辑" mce_href="#" onclick="edit(\'' + row.${primaryKey.attrname} + '\')"><i class="fa fa-edit"></i></a> ');
|
||||
actions.push('<a class="btn btn-warning btn-sm ' + removeFlag + '" href="#" title="删除" onclick="remove(\'' + row.${primaryKey.attrname} + '\')"><i class="fa fa-remove"></i></a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}];
|
||||
var url = prefix + "/list";
|
||||
$.initTable(columns, url);
|
||||
});
|
||||
|
||||
/*${tableComment}-新增*/
|
||||
function add() {
|
||||
var url = prefix + '/add';
|
||||
layer_showAuto("新增${tableComment}", url);
|
||||
}
|
||||
|
||||
/*${tableComment}-修改*/
|
||||
function edit(${primaryKey.attrname}) {
|
||||
var url = prefix + '/edit/' + ${primaryKey.attrname};
|
||||
layer_showAuto("修改${tableComment}", url);
|
||||
}
|
||||
|
||||
// 单条删除
|
||||
function remove(id) {
|
||||
$.modalConfirm("确定要删除选中${tableComment}吗?", function() {
|
||||
_ajax(prefix + "/remove/" + id, "", "post");
|
||||
})
|
||||
}
|
||||
|
||||
// 批量删除
|
||||
function batchRemove() {
|
||||
var rows = $.getSelections("${primaryKey.attrname}");
|
||||
if (rows.length == 0) {
|
||||
$.modalMsg("请选择要删除的数据", "warning");
|
||||
return;
|
||||
}
|
||||
$.modalConfirm("确认要删除选中的" + rows.length + "条数据吗?", function() {
|
||||
_ajax(prefix + '/batchRemove', { "ids": rows }, "post");
|
||||
});
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${tableComment}', '3', '1', '/${moduleName}/${classname}', 'C', '0', '${moduleName}:${classname}:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '${tableComment}菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${tableComment}查询', @parentId, '1', '#', 'F', '0', '${moduleName}:${classname}:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${tableComment}新增', @parentId, '2', '#', 'F', '0', '${moduleName}:${classname}:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${tableComment}修改', @parentId, '3', '#', 'F', '0', '${moduleName}:${classname}:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${tableComment}删除', @parentId, '4', '#', 'F', '0', '${moduleName}:${classname}:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${tableComment}保存', @parentId, '5', '#', 'F', '0', '${moduleName}:${classname}:save', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('批量删除', @parentId, '6', '#', 'F', '0', '${moduleName}:${classname}:batchRemove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
|
@ -1,66 +0,0 @@
|
||||
<?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="${package}.mapper.${className}Mapper">
|
||||
|
||||
<resultMap type="${className}" id="${className}Result">
|
||||
#foreach ($column in $columns)
|
||||
<result property="${column.attrname}" column="${column.columnName}" />
|
||||
#end
|
||||
</resultMap>
|
||||
|
||||
<select id="select${className}ById" parameterType="${primaryKey.attrType}" resultMap="${className}Result">
|
||||
select#foreach($column in $columns) $column.columnName#if($velocityCount != $columns.size()),#end#end from ${tableName}
|
||||
where ${primaryKey.columnName} = #{${primaryKey.attrname}}
|
||||
</select>
|
||||
|
||||
<select id="select${className}List" parameterType="${className}" resultMap="${className}Result">
|
||||
select#foreach($column in $columns) $column.columnName#if($velocityCount != $columns.size()),#end#end from ${tableName}
|
||||
<where>
|
||||
#foreach($column in $columns)
|
||||
<if test="$column.attrname != null and $column.attrname.trim() != ''"> and $column.columnName = #{$column.attrname}</if>
|
||||
#end
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insert${className}" parameterType="${className}"#if($primaryKey.extra == 'auto_increment') useGeneratedKeys="true" keyProperty="$primaryKey.attrname"#end>
|
||||
insert into ${tableName} (
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $primaryKey.columnName || $primaryKey.extra != 'auto_increment')
|
||||
<if test="$column.attrname != null and $column.attrname != '' ">$column.columnName#if($velocityCount != $columns.size()), #end</if>
|
||||
#end
|
||||
#end
|
||||
)values(
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $primaryKey.columnName || $primaryKey.extra != 'auto_increment')
|
||||
<if test="$column.attrname != null and $column.attrname != ''">#{$column.attrname}#if($velocityCount != $columns.size()), #end</if>
|
||||
#end
|
||||
#end
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update${className}" parameterType="${className}">
|
||||
update ${tableName}
|
||||
<set>
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $primaryKey.columnName)
|
||||
<if test="$column.attrname != null and $column.attrname != ''">$column.columnName = #{$column.attrname}#if($velocityCount != $columns.size()), #end</if>
|
||||
#end
|
||||
#end
|
||||
</set>
|
||||
where ${primaryKey.columnName} = #{${primaryKey.attrname}}
|
||||
</update>
|
||||
|
||||
<delete id="delete${className}ById" parameterType="${primaryKey.attrType}">
|
||||
delete from ${tableName} where ${primaryKey.columnName} = #{value}
|
||||
</delete>
|
||||
|
||||
<delete id="batchDelete${className}" parameterType="${primaryKey.attrType}">
|
||||
delete from ${tableName} where ${primaryKey.columnName} in
|
||||
<foreach item="${primaryKey.attrname}" collection="array" open="(" separator="," close=")">
|
||||
#{${primaryKey.attrname}}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user