若依开源1.1.3发布
This commit is contained in:
@ -33,8 +33,8 @@
|
||||
<script src="../static/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js" th:src="@{/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js}"></script>
|
||||
<script src="../static/ajax/libs/bootstrap-table/extensions/export/tableExport.js" th:src="@{/ajax/libs/bootstrap-table/extensions/export/tableExport.js}"></script>
|
||||
<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
|
||||
<script src="../static/ruoyi/js/common.js?v=1.1.2" th:src="@{/ruoyi/js/common.js?v=1.1.2}"></script>
|
||||
<script src="../static/ruoyi/js/ry-ui.js?v=1.1.2" th:src="@{/ruoyi/js/ry-ui.js?v=1.1.2}"></script>
|
||||
<script src="../static/ruoyi/js/common.js?v=1.1.3" th:src="@{/ruoyi/js/common.js?v=1.1.3}"></script>
|
||||
<script src="../static/ruoyi/js/ry-ui.js?v=1.1.3" th:src="@{/ruoyi/js/ry-ui.js?v=1.1.3}"></script>
|
||||
<script th:inline="javascript"> var ctx = [[@{/}]]; </script>
|
||||
<script src="http://tajs.qq.com/stats?sId=62048022"></script>
|
||||
</div>
|
||||
|
@ -32,7 +32,7 @@
|
||||
<ul class="nav" id="side-menu">
|
||||
<li class="nav-header">
|
||||
<div class="dropdown profile-element"> <span>
|
||||
<img src="img/profile_small.jpg" alt="image" class="img-circle" height="60" width="60"/></span>
|
||||
<img th:src="(${user.avatar} == '') ? '/img/profile.jpg' : '/profile/' + ${user.avatar}" alt="image" class="img-circle" height="60" width="60"/></span>
|
||||
<a data-toggle="dropdown" class="dropdown-toggle" href="#">
|
||||
<span class="clear"><span class="block m-t-xs"><strong class="font-bold">[[${user.userName}]]</strong></span>
|
||||
<span class="text-muted text-xs block"><span>[[${user.dept.deptName}]]</span> <b class="caret"></b></span> </span> </a>
|
||||
@ -128,6 +128,6 @@
|
||||
<script src="../static/js/bootstrap.min.js" th:src="@{/js/bootstrap.min.js}"></script>
|
||||
<script src="../static/js/plugins/metisMenu/jquery.metisMenu.js" th:src="@{/js/plugins/metisMenu/jquery.metisMenu.js}"></script>
|
||||
<script src="../static/js/plugins/slimscroll/jquery.slimscroll.min.js" th:src="@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script>
|
||||
<script src="../static/ruoyi/js/index.js" th:src="@{/ruoyi/js/index.js}"></script>
|
||||
<script src="../static/ruoyi/index.js" th:src="@{/ruoyi/index.js}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -12,6 +12,7 @@
|
||||
<link href="../static/css/font-awesome.css" th:href="@{css/font-awesome.css}" rel="stylesheet"/>
|
||||
<link href="../static/css/style.min.css" th:href="@{css/style.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/css/login.min.css" th:href="@{css/login.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/ajax/libs/iCheck/custom.css" th:href="@{/ajax/libs/iCheck/custom.css}" rel="stylesheet"/>
|
||||
<!--[if lt IE 9]>
|
||||
<meta http-equiv="refresh" content="0;ie.html" />
|
||||
<![endif]-->
|
||||
@ -22,6 +23,7 @@
|
||||
</head>
|
||||
|
||||
<body class="signin">
|
||||
|
||||
<div class="signinpanel">
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
@ -47,7 +49,17 @@
|
||||
<p class="m-t-md">你若不离不弃,我必生死相依</p>
|
||||
<input type="text" name="username" class="form-control uname" placeholder="用户名" value="admin" />
|
||||
<input type="password" name="password" class="form-control pword m-b" placeholder="密码" value="admin123" />
|
||||
<a href="#">忘记密码了?</a>
|
||||
<div class="row" th:if="${captchaEbabled==true}">
|
||||
<div class="col-xs-6">
|
||||
<input type="text" name="validateCode" class="form-control code" placeholder="验证码" maxlength="5">
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<a href="javascript:void(0);" title="点击更换验证码">
|
||||
<img th:src="@{captcha/captchaImage(type=${captchaType})}" class="imgcode" width="85%"/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<input class="i-checks" type="checkbox" name="rememberme" /> 记住我
|
||||
<button class="btn btn-success btn-block">登录</button>
|
||||
</form>
|
||||
</div>
|
||||
@ -58,7 +70,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script th:inline="javascript"> var ctx = [[@{/}]]; </script>
|
||||
<script th:inline="javascript"> var ctx = [[@{/}]]; var captchaType = [[${captchaType}]]; </script>
|
||||
<!-- 全局js -->
|
||||
<script src="../static/js/jquery.min.js" th:src="@{js/jquery.min.js}"></script>
|
||||
<script src="../static/js/bootstrap.min.js" th:src="@{js/bootstrap.min.js}"></script>
|
||||
@ -66,55 +78,9 @@
|
||||
<script src="../static/ajax/libs/validate/jquery.validate.min.js" th:src="@{ajax/libs/validate/jquery.validate.min.js}"></script>
|
||||
<script src="../static/ajax/libs/validate/messages_zh.min.js" th:src="@{ajax/libs/validate/messages_zh.min.js}"></script>
|
||||
<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{ajax/libs/layer/layer.min.js}"></script>
|
||||
<script src="../static/ajax/libs/iCheck/icheck.min.js" th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
|
||||
<script src="http://tajs.qq.com/stats?sId=62048022"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
console.log(ctx);
|
||||
validateRule();
|
||||
});
|
||||
|
||||
$.validator.setDefaults({
|
||||
submitHandler: function() {
|
||||
login();
|
||||
}
|
||||
});
|
||||
|
||||
function login() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ctx + "login",
|
||||
data: $('#signupForm').serialize(),
|
||||
success: function(r) {
|
||||
if (r.code == 0) {
|
||||
parent.location.href = ctx + 'index';
|
||||
} else {
|
||||
layer.msg(r.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function validateRule() {
|
||||
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||
$("#signupForm").validate({
|
||||
rules: {
|
||||
username: {
|
||||
required: true
|
||||
},
|
||||
password: {
|
||||
required: true
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
username: {
|
||||
required: icon + "请输入您的用户名",
|
||||
},
|
||||
password: {
|
||||
required: icon + "请输入您的密码",
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script src="../static/ruoyi/login.js" th:src="@{/ruoyi/login.js}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -94,13 +94,34 @@
|
||||
<div class="ibox-content no-padding">
|
||||
<div class="panel-body">
|
||||
<div class="panel-group" id="version">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h5 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#version" href="#v13">v1.1.3</a><code class="pull-right">2018.05.14</code>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="v13" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<ol>
|
||||
<li>新增验证码(数组计算、字符验证)</li>
|
||||
<li>新增cookie记住我</li>
|
||||
<li>新增头像上传</li>
|
||||
<li>用户名密码长度限制</li>
|
||||
<li>通用字段提取</li>
|
||||
<li>支持自定义条件查询</li>
|
||||
<li>部门名称必填、时间格式调整</li>
|
||||
<li>其他细节优化</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h5 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#version" href="#v12">v1.1.2</a><code class="pull-right">2018.05.07</code>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="v12" class="panel-collapse collapse in">
|
||||
<div id="v12" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<ol>
|
||||
<li>新增个人信息修改</li>
|
||||
|
@ -101,7 +101,7 @@
|
||||
</script>
|
||||
<script src="/ajax/libs/iCheck/icheck.min.js" th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
|
||||
<script src="/ajax/libs/select/select2.js" th:src="@{/ajax/libs/select/select2.js}"></script>
|
||||
<script>
|
||||
<script>
|
||||
$(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
|
||||
</script>
|
||||
</body>
|
||||
|
@ -96,7 +96,7 @@
|
||||
</script>
|
||||
<script src="/ajax/libs/iCheck/icheck.min.js" th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
|
||||
<script src="/ajax/libs/select/select2.js" th:src="@{/ajax/libs/select/select2.js}"></script>
|
||||
<script>
|
||||
<script>
|
||||
$(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
|
||||
</script>
|
||||
</body>
|
||||
|
81
src/main/resources/templates/system/user/profile/avatar.html
Normal file
81
src/main/resources/templates/system/user/profile/avatar.html
Normal file
@ -0,0 +1,81 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
<meta charset="utf-8">
|
||||
<title>用户头像修改</title>
|
||||
<link href="/ajax/libs/cropbox/cropbox.css" th:href="@{/ajax/libs/cropbox/cropbox.css}" rel="stylesheet"/>
|
||||
<body class="white-bg">
|
||||
<div class="container">
|
||||
<div class="imageBox">
|
||||
<div class="thumbBox"></div>
|
||||
<div class="spinner" style="display: none">Loading...</div>
|
||||
</div>
|
||||
<div class="action">
|
||||
<div class="new-contentarea tc">
|
||||
<a href="javascript:void(0)" class="upload-img"> <label for="avatar">上传图像</label> </a>
|
||||
<input type="file" class="" name="avatar" id="avatar" />
|
||||
</div>
|
||||
<input type="button" id="btnCrop" class="Btnsty_peyton" value="裁切" />
|
||||
<input type="button" id="btnZoomIn" class="Btnsty_peyton" value="+" />
|
||||
<input type="button" id="btnZoomOut" class="Btnsty_peyton" value="-" />
|
||||
<input type="button" id="blobSubmit" class="Btnsty_peyton" value="提交" />
|
||||
</div>
|
||||
<div class="cropped"></div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script src="/ajax/libs/cropbox/cropbox.js" th:src="@{/ajax/libs/cropbox/cropbox.js}"></script>
|
||||
<script type="text/javascript">
|
||||
$(window).load(function() {
|
||||
var options = {
|
||||
thumbBox: '.thumbBox',
|
||||
spinner: '.spinner',
|
||||
imgSrc: '/img/profile.jpg'
|
||||
}
|
||||
var cropper = $('.imageBox').cropbox(options);
|
||||
$('#avatar').on('change',
|
||||
function() {
|
||||
var reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
options.imgSrc = e.target.result;
|
||||
cropper = $('.imageBox').cropbox(options);
|
||||
}
|
||||
reader.readAsDataURL(this.files[0]);
|
||||
})
|
||||
$('#blobSubmit').on('click', function(){
|
||||
var img = cropper.getBlob();
|
||||
var formdata = new FormData();
|
||||
formdata.append("avatarfile", img);
|
||||
formdata.append("userId", 1);
|
||||
$.ajax({
|
||||
url: ctx + "system/user/profile/updateAvatar",
|
||||
data: formdata,
|
||||
type: "post",
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(result) {
|
||||
if (result.code == "0") {
|
||||
parent.layer.msg("修改成功,正在刷新数据请稍后……",{icon:1,time: 500,shade: [0.1,'#fff']},function(){
|
||||
$.parentReload();
|
||||
});
|
||||
}else{
|
||||
$.modalAlert(result.msg, "error");
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
$('#btnCrop').on('click', function(){
|
||||
var img = cropper.getDataURL();
|
||||
$('.cropped').html('');
|
||||
$('.cropped').append('<img src="'+img+'" align="absmiddle" style="width:64px;margin-top:4px;border-radius:64px;box-shadow:0px 0px 12px #7E7E7E;" ><p>64px*64px</p>');
|
||||
$('.cropped').append('<img src="'+img+'" align="absmiddle" style="width:128px;margin-top:4px;border-radius:128px;box-shadow:0px 0px 12px #7E7E7E;"><p>128px*128px</p>');
|
||||
$('.cropped').append('<img src="'+img+'" align="absmiddle" style="width:180px;margin-top:4px;border-radius:180px;box-shadow:0px 0px 12px #7E7E7E;"><p>180px*180px</p>');
|
||||
})
|
||||
$('#btnZoomIn').on('click', function(){
|
||||
cropper.zoomIn();
|
||||
})
|
||||
$('#btnZoomOut').on('click', function(){
|
||||
cropper.zoomOut();
|
||||
})
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -27,6 +27,7 @@
|
||||
<ul class="dropdown-menu dropdown-user">
|
||||
<li><a href="javascript:edit()">修改信息</a></li>
|
||||
<li><a href="javascript:resetPwd()">修改密码</a></li>
|
||||
<li><a href="javascript:avatar()">修改头像</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@ -34,7 +35,7 @@
|
||||
<div class="contact-box">
|
||||
<div class="col-sm-4">
|
||||
<div class="text-center">
|
||||
<img alt="image" class="img-circle m-t-xs img-responsive" src="/img/profilel.jpg">
|
||||
<img alt="image" class="img-circle m-t-xs img-responsive" th:src="(${user.avatar} == '') ? '/img/profile.jpg' : '/profile/' + ${user.avatar}">
|
||||
<div class="m-t-xs font-bold">CEO</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -45,7 +46,7 @@
|
||||
<p><i class="fa fa-group"></i> [[${user.dept.deptName}]] / [[${#strings.defaultString(postGroup,'无岗位')}]]</p>
|
||||
<p><i class="fa fa-transgender"></i> [[${user.sex}]]</p>
|
||||
<p><i class="fa fa-envelope-o"></i> [[${user.email}]]</p>
|
||||
<p><i class="fa fa-calendar"></i> [[${user.createTime}]]</p>
|
||||
<p><i class="fa fa-calendar"></i> [[${user.createDateTimeStr}]]</p>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</a>
|
||||
@ -68,6 +69,11 @@
|
||||
var url = ctx + 'system/user/profile/resetPwd/' + userId;
|
||||
layer_show("重置密码", url, '800', '500');
|
||||
}
|
||||
/*用户管理-头像*/
|
||||
function avatar() {
|
||||
var url = ctx + 'system/user/profile/avatar/' + userId;
|
||||
layer_showAuto("修改头像", url);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -7,7 +7,6 @@
|
||||
<link href="/ajax/libs/jquery-layout/jquery.layout-latest.css" th:href="@{/ajax/libs/jquery-layout/jquery.layout-latest.css}" rel="stylesheet"/>
|
||||
<link href="/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css" th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
|
||||
<body class="white-bg">
|
||||
|
||||
<div class="ui-layout-west">
|
||||
<div class="main-content">
|
||||
<div class="box box-main">
|
||||
@ -38,7 +37,8 @@
|
||||
<i class="glyphicon glyphicon-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="deptId">
|
||||
<input type="hidden" id="parentId">
|
||||
<table class="bootstrap-table" data-mobile-responsive="true"
|
||||
data-sort-name="create_time" data-sort-order="desc">
|
||||
</table>
|
||||
|
@ -18,7 +18,7 @@ import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.framework.web.domain.Message;
|
||||
|
||||
/**
|
||||
* ${tableComment} 控制层处理
|
||||
* ${tableComment} 信息操作处理
|
||||
*
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
@ -47,7 +47,7 @@ public class ${className}Controller extends BaseController
|
||||
@ResponseBody
|
||||
public TableDataInfo list(${className} ${classname})
|
||||
{
|
||||
setPageInfo(${classname});
|
||||
startPage();
|
||||
List<${className}> list = ${classname}Service.select${className}List(${classname});
|
||||
return getDataTable(list);
|
||||
}
|
||||
@ -84,7 +84,7 @@ public class ${className}Controller extends BaseController
|
||||
{
|
||||
if (${classname}Service.save${className}(${classname}) > 0)
|
||||
{
|
||||
return Message.ok();
|
||||
return Message.success();
|
||||
}
|
||||
return Message.error();
|
||||
}
|
||||
@ -99,7 +99,7 @@ public class ${className}Controller extends BaseController
|
||||
{
|
||||
if (${classname}Service.delete${className}ById(${primaryKey.attrname}) > 0)
|
||||
{
|
||||
return Message.ok();
|
||||
return Message.success();
|
||||
}
|
||||
return Message.error();
|
||||
}
|
||||
@ -115,7 +115,7 @@ public class ${className}Controller extends BaseController
|
||||
int rows = ${classname}Service.batchDelete${className}(${primaryKey.attrname}s);
|
||||
if (rows > 0)
|
||||
{
|
||||
return Message.ok();
|
||||
return Message.success();
|
||||
}
|
||||
return Message.error();
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package ${package}.dao;
|
||||
package ${package}.mapper;
|
||||
|
||||
import ${package}.domain.${className};
|
||||
import java.util.List;
|
||||
@ -9,7 +9,7 @@ import java.util.List;
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
*/
|
||||
public interface I${className}Dao
|
||||
public interface I${className}Mapper
|
||||
{
|
||||
|
||||
/**
|
@ -4,7 +4,7 @@ import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import ${package}.dao.I${className}Dao;
|
||||
import ${package}.mapper.I${className}Mapper;
|
||||
import ${package}.domain.${className};
|
||||
import ${package}.service.I${className}Service;
|
||||
|
||||
@ -18,7 +18,7 @@ import ${package}.service.I${className}Service;
|
||||
public class ${className}ServiceImpl implements I${className}Service
|
||||
{
|
||||
@Autowired
|
||||
private I${className}Dao ${classname}Dao;
|
||||
private I${className}Mapper ${classname}Mapper;
|
||||
|
||||
/**
|
||||
* 查询${tableComment}信息
|
||||
@ -29,7 +29,7 @@ public class ${className}ServiceImpl implements I${className}Service
|
||||
@Override
|
||||
public ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname})
|
||||
{
|
||||
return ${classname}Dao.select${className}ById(${primaryKey.attrname});
|
||||
return ${classname}Mapper.select${className}ById(${primaryKey.attrname});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -41,7 +41,7 @@ public class ${className}ServiceImpl implements I${className}Service
|
||||
@Override
|
||||
public List<${className}> select${className}List(${className} ${classname})
|
||||
{
|
||||
return ${classname}Dao.select${className}List(${classname});
|
||||
return ${classname}Mapper.select${className}List(${classname});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,7 +53,7 @@ public class ${className}ServiceImpl implements I${className}Service
|
||||
@Override
|
||||
public int insert${className}(${className} ${classname})
|
||||
{
|
||||
return ${classname}Dao.insert${className}(${classname});
|
||||
return ${classname}Mapper.insert${className}(${classname});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -65,7 +65,7 @@ public class ${className}ServiceImpl implements I${className}Service
|
||||
@Override
|
||||
public int update${className}(${className} ${classname})
|
||||
{
|
||||
return ${classname}Dao.update${className}(${classname});
|
||||
return ${classname}Mapper.update${className}(${classname});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -81,11 +81,11 @@ public class ${className}ServiceImpl implements I${className}Service
|
||||
int rows = 0;
|
||||
if (StringUtils.isNotNull(${primaryKey.attrname}))
|
||||
{
|
||||
rows = ${classname}Dao.update${className}(${classname});
|
||||
rows = ${classname}Mapper.update${className}(${classname});
|
||||
}
|
||||
else
|
||||
{
|
||||
rows = ${classname}Dao.insert${className}(${classname});
|
||||
rows = ${classname}Mapper.insert${className}(${classname});
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
@ -99,7 +99,7 @@ public class ${className}ServiceImpl implements I${className}Service
|
||||
@Override
|
||||
public int delete${className}ById(${primaryKey.attrType} ${primaryKey.attrname})
|
||||
{
|
||||
return ${classname}Dao.delete${className}ById(${primaryKey.attrname});
|
||||
return ${classname}Mapper.delete${className}ById(${primaryKey.attrname});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -111,7 +111,7 @@ public class ${className}ServiceImpl implements I${className}Service
|
||||
@Override
|
||||
public int batchDelete${className}(${primaryKey.attrType}[] ${primaryKey.attrname}s)
|
||||
{
|
||||
return ${classname}Dao.batchDelete${className}(${primaryKey.attrname}s);
|
||||
return ${classname}Mapper.batchDelete${className}(${primaryKey.attrname}s);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package ${package}.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import com.ruoyi.framework.web.page.PageDomain;
|
||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||
#if(${hasBigDecimal})
|
||||
import java.math.BigDecimal;
|
||||
#end
|
||||
@ -12,7 +11,7 @@ import java.math.BigDecimal;
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
*/
|
||||
public class ${className} extends PageDomain implements Serializable
|
||||
public class ${className} extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="${package}.dao.I${className}Dao">
|
||||
<mapper namespace="${package}.mapper.I${className}Mapper">
|
||||
|
||||
<resultMap type="${className}" id="${className}Result">
|
||||
#foreach ($column in $columns)
|
||||
@ -25,32 +25,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</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')
|
||||
$column.columnName#if($velocityCount != $columns.size()), #end
|
||||
#end
|
||||
#end
|
||||
)
|
||||
values
|
||||
(
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $primaryKey.columnName || $primaryKey.extra != 'auto_increment')
|
||||
#{$column.attrname}#if($velocityCount != $columns.size()), #end
|
||||
#end
|
||||
#end
|
||||
)
|
||||
insert into ${tableName} (
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $primaryKey.columnName || $primaryKey.extra != 'auto_increment')
|
||||
$column.columnName#if($velocityCount != $columns.size()), #end
|
||||
#end
|
||||
#end
|
||||
)
|
||||
values (
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $primaryKey.columnName || $primaryKey.extra != 'auto_increment')
|
||||
#{$column.attrname}#if($velocityCount != $columns.size()), #end
|
||||
#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">`$column.columnName` = #{$column.attrname}#if($velocityCount != $columns.size()), #end</if>
|
||||
#end
|
||||
#end
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $primaryKey.columnName)
|
||||
<if test="$column.attrname != null">$column.columnName = #{$column.attrname}#if($velocityCount != $columns.size()), #end</if>
|
||||
#end
|
||||
#end
|
||||
</set>
|
||||
where ${primaryKey.columnName} = #{${primaryKey.attrname}}
|
||||
</update>
|
||||
|
Reference in New Issue
Block a user