涉密文件销毁,统计

master
20918 11 months ago
parent 4bb71abc43
commit c79a9f89db

@ -1,12 +1,15 @@
package com.ruoyi.web.controller.system.count; package com.ruoyi.web.controller.system.count;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysPostService; import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
@ -16,6 +19,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -33,6 +37,8 @@ public class SysUsernumController extends BaseController {
private ISysPostService postService; private ISysPostService postService;
@Autowired @Autowired
private ISysRoleService roleService; private ISysRoleService roleService;
@Autowired
private ISysDeptService deptService;
@RequiresPermissions("system:usernum:view") @RequiresPermissions("system:usernum:view")
@GetMapping() @GetMapping()
@ -49,11 +55,20 @@ public class SysUsernumController extends BaseController {
@RequiresPermissions("system:usernum:list") @RequiresPermissions("system:usernum:list")
@PostMapping("/list") @PostMapping("/list")
@ResponseBody @ResponseBody
public TableDataInfo list(SysUser user) public TableDataInfo list(SysUser user,SysDept dept)
{ {
startPage(); startPage();
List<SysUser> list = userService.selectUserList(user); List<SysUser> sysuser = new ArrayList<>();
return getDataTable(list); List<SysUser> list = userService.selectUserGroupBydept(user);
List<SysDept> sysDepts = deptService.selectDeptList(dept);
for (SysDept Dept : sysDepts){
for ( SysUser user1 : list){
if (Dept.getDeptName().equals(user1.getDept().getDeptName())){
sysuser.add(user1);
}
}
}
return getDataTable(sysuser);
} }
/** /**
@ -72,29 +87,22 @@ public class SysUsernumController extends BaseController {
return util.exportExcel(list, "用户统计数据"); return util.exportExcel(list, "用户统计数据");
} }
/**
*
* @param userId
* @param mmap
* @return
*/
@RequiresPermissions("system:usernum:detail")
@GetMapping("/detail/{userId}")
public String detail(@PathVariable("userId") Long userId, ModelMap mmap){
mmap.put("user",userService.selectUserById(userId));
mmap.put("role",roleService.selectRolesByUserIds(userId));
mmap.put("post",postService.selectPostsByUserIds(userId));
return prefix + "/detail";
}
/** /**
* *
*/ */
@RequiresPermissions("system:usernum:print") @RequiresPermissions("system:usernum:detail")
@PostMapping("/print") @GetMapping("/print/{deptId}")
@ResponseBody public String print(@PathVariable("deptId")String deptId, SysUser user,ModelMap mmap)
public AjaxResult print(SysUser user){ {
List<SysUser> sysUsers = userService.selectUserList(user); List<SysUser> sysUsers = userService.selectUserList(user);
return AjaxResult.success(sysUsers); List<SysUser> list = new ArrayList<>();
for (SysUser User : sysUsers){
if (User.getDept().getDeptId().equals(deptId)){
list.add(User);
}
}
mmap.put("list", list);
mmap.put("sysuser",getSysUser());
return prefix + "/print";
} }
} }

@ -72,8 +72,9 @@ public class TdQuestionController extends BaseController
* *
*/ */
@GetMapping("/add") @GetMapping("/add")
public String add() public String add(ModelMap mmap)
{ {
mmap.put("sysuser",getSysUser());
return prefix + "/add"; return prefix + "/add";
} }

@ -79,8 +79,9 @@ public class TdPropertyManagerController extends BaseController
* *
*/ */
@GetMapping("/add") @GetMapping("/add")
public String add() public String add(ModelMap mmap)
{ {
mmap.put("sysuser",getSysUser());
return prefix + "/add"; return prefix + "/add";
} }

@ -74,8 +74,9 @@ public class TdPropertyNetController extends BaseController
* *
*/ */
@GetMapping("/add") @GetMapping("/add")
public String add() public String add(ModelMap mmap)
{ {
mmap.put("sysuser",getSysUser());
return prefix + "/add"; return prefix + "/add";
} }

@ -72,8 +72,9 @@ public class TdIndentureController extends BaseController
* *
*/ */
@GetMapping("/add") @GetMapping("/add")
public String add() public String add(ModelMap mmap)
{ {
mmap.put("sysuser", getSysUser());
return prefix + "/add"; return prefix + "/add";
} }

@ -39,9 +39,6 @@
</div> </div>
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:check:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:check:remove"> <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:check:remove">
<i class="fa fa-remove"></i> 删除 <i class="fa fa-remove"></i> 删除
</a> </a>

@ -16,6 +16,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">所属市州:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="framework" id="framework" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">所属区县:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="area" id="area" required>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">部门名称:</label> <label class="col-sm-3 control-label is-required">部门名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">

@ -17,6 +17,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">所属市州:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="framework" th:field="*{framework}" id="framework" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">所属区县:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="area" th:field="*{area}" id="area" required>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">部门名称:</label> <label class="col-sm-3 control-label is-required">部门名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">

@ -41,21 +41,10 @@
<div align="center"> <div align="center">
<table width="600"> <table width="600">
<tr> <tr>
<td colspan="3" ><br><h5>您的相关信息:</h5><hr /></td> <td colspan="3" ><br><h4>您的相关信息:</h4><hr /></td>
</tr> </tr>
<tr> <tr>
<td class="table" align="left"><b>人员编号: </b>[[${user.loginName}]]<hr /></td> <td class="table" align="left"><b>人员编号: </b>[[${user.loginName}]]<hr /></td>
<!-- <%-->
<!-- String disabled="";-->
<!-- String tmpsex=buf.fget("sex",0);-->
<!-- if (tmpsex.equals("0")) {-->
<!-- tmpsex = "女";-->
<!-- disabled = "";-->
<!-- } else {-->
<!-- tmpsex = "男";-->
<!-- disabled = "disabled";-->
<!-- }-->
<!-- %>-->
<td class="table" align="left"><b>性别: </b><span th:text="${user.sex == 0 ? '女' : '男'}"></span><hr /></td> <td class="table" align="left"><b>性别: </b><span th:text="${user.sex == 0 ? '女' : '男'}"></span><hr /></td>
<td class="table" align="left"><b>选择相关考题</b><hr /></td> <td class="table" align="left"><b>选择相关考题</b><hr /></td>
</tr> </tr>
@ -74,9 +63,10 @@
<p align="center" class="unnamed1">答题过程不能中断!不能作弊和抄袭,</p> <p align="center" class="unnamed1">答题过程不能中断!不能作弊和抄袭,</p>
<p align="center" class="unnamed1">考试时间为45分钟到考试结束时间没有交卷的系统将强制交卷</p> <p align="center" class="unnamed1">考试时间为45分钟到考试结束时间没有交卷的系统将强制交卷</p>
<p align="center"> <p align="center">
<input type="button" name="button1" value=" 开始答卷" class="box_button" onclick="check()" <input type="button" class="btn btn-primary" name="button1" value=" 开始答卷" onclick="check()"
/> />
</p></td> </p>
</td>
</tr> </tr>
</table> </table>
</div> </div>

@ -66,7 +66,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">创建人:</label> <label class="col-sm-3 control-label">创建人:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="createStaffid" class="form-control" type="text"> <input name="createStaffid" class="form-control" readonly th:value="${sysuser.userName}" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">

@ -43,7 +43,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">登记人员:</label> <label class="col-sm-3 control-label">登记人员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="netname" class="form-control" type="text"> <input name="netname" class="form-control" readonly th:value="${sysuser.userName}" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">

@ -34,7 +34,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">登记人员:</label> <label class="col-sm-3 control-label">登记人员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="netUser" class="form-control" type="text"> <input name="netUser" class="form-control" readonly th:value="${sysuser.userName}" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">

@ -37,13 +37,13 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">登记部门:</label> <label class="col-sm-3 control-label">登记部门:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="recoverDepart" class="form-control" type="text"> <input name="recoverDepart" class="form-control" readonly th:value="${sysuser.dept.deptName}" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">登记人员:</label> <label class="col-sm-3 control-label">登记人员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="recoverName" class="form-control" type="text"> <input name="recoverName" class="form-control" readonly th:value="${sysuser.userName}" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">

@ -54,7 +54,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">创建人:</label> <label class="col-sm-3 control-label">创建人:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="CREATEPERSON" class="form-control" type="text"> <input name="CREATEPERSON" class="form-control" readonly th:value="${sysuser.userName}" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">

@ -55,7 +55,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">创建人:</label> <label class="col-sm-3 control-label">创建人:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="CREATEPERSON" th:field="*{CREATEPERSON}" class="form-control" type="text"> <input name="CREATEPERSON" readonly th:field="*{CREATEPERSON}" class="form-control" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h3>用户数量统计</h3>
</body>
</html>

@ -16,19 +16,16 @@
<div class="select-list"> <div class="select-list">
<ul> <ul>
<li> <li>
人员名称:<input type="text" name="loginName"/> <label>单位名称:</label>
<input type="text" name="deptName"/>
</li> </li>
<li> <li>
用户状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}"> <label>所属市州:</label>
<option value="">所有</option> <input type="text" name="framework"/>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li> </li>
<li class="select-time"> <li>
<label>创建时间: </label> <label>所属区县:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/> <input type="text" name="area"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
</li> </li>
<li> <li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@ -43,9 +40,6 @@
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:usernum:export"> <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:usernum:export">
<i class="fa fa-download"></i> 导出 <i class="fa fa-download"></i> 导出
</a> </a>
<a class="btn btn-warning" onclick="$.table.print()" shiro:hasPermission="system:usernum:print">
<i class="fa fa-download"></i> 打印
</a>
</div> </div>
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table> <table id="bootstrap-table"></table>
@ -59,6 +53,9 @@
<th:block th:include="include :: ztree-js" /> <th:block th:include="include :: ztree-js" />
<script th:inline="javascript"> <script th:inline="javascript">
var detailFlag = [[${@permission.hasPermi('system:usernum:detail')}]]; var detailFlag = [[${@permission.hasPermi('system:usernum:detail')}]];
var politics = [[${@dict.getType('sys_user_politics')}]];
var shemichengdu = [[${@dict.getType('sys_user_shemi')}]];
var examineState = [[${@dict.getType('sys_examine_state')}]];
var prefix = ctx + "system/usernum"; var prefix = ctx + "system/usernum";
$(function() { $(function() {
@ -84,97 +81,42 @@
url: prefix + "/list", url: prefix + "/list",
createUrl: prefix + "/add", createUrl: prefix + "/add",
detail: prefix + "/detail/{id}", detail: prefix + "/detail/{id}",
print: prefix + "/print/{id}",
removeUrl: prefix + "/remove", removeUrl: prefix + "/remove",
exportUrl: prefix + "/export", exportUrl: prefix + "/export",
importUrl: prefix + "/importData",
importTemplateUrl: prefix + "/importTemplate",
sortName: "createTime",
sortOrder: "desc",
modalName: "用户", modalName: "用户",
columns: [{ columns: [{
checkbox: true checkbox: true
}, },
{
field: 'userName',
title: '用户名称'
},
{
field: 'dept.deptName',
title: '所在单位'
},
{ {
field: 'phonenumber', field : 'dept.deptid',
title: '手机' title : '编号',
visible: false
}, },
{ {
field: 'shemichengdu', field: 'dept.framework',
title: '涉密程度' title: '所属市州'
}, },
{ {
field: 'politics', field: 'dept.area',
title: '政治面貌' title: '所属区县'
}, },
{
{ field: 'dept.deptName',
title: '用户状态', title: '所在单位'
align: 'center',
formatter: function (value, row, index) {
return statusTools(row);
}
},
{
field: 'examine',
title: '审核状态'
},
{
field: 'startdate',
title: '入职日期',
sortable: true
}, },
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.userId + '\')"><i class="fa fa-edit"></i>详情</a> '); actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="print(\'' + row.deptId + '\')"><i class="fa fa-search"></i>详细</a> ');
} return actions.join(''); }
}] }]
}; };
$.table.init(options); $.table.init(options);
} }
function queryDeptTree()
{
var url = ctx + "system/user/deptTreeData";
var options = {
url: url,
expandLevel: 2,
onClick : zOnClick
};
$.tree.init(options);
function zOnClick(event, treeId, treeNode) {
$("#deptId").val(treeNode.id);
$("#parentId").val(treeNode.pId);
$.table.search();
}
}
$('#btnExpand').click(function() {
$._tree.expandAll(true);
$(this).hide();
$('#btnCollapse').show();
});
$('#btnCollapse').click(function() {
$._tree.expandAll(false);
$(this).hide();
$('#btnExpand').show();
});
$('#btnRefresh').click(function() { $('#btnRefresh').click(function() {
queryDeptTree(); queryDeptTree();
}); });
@ -194,33 +136,11 @@
var url = ctx + "system/dept"; var url = ctx + "system/dept";
$.modal.openTab("部门管理", url); $.modal.openTab("部门管理", url);
} }
function print(deptId) {
var url = prefix + '/print/' + deptId;
/* 用户状态显示 */ $.modal.openTab("打印界面", url);
function statusTools(row) {
if (row.status == 1) {
return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.userId + '\')"></i> ';
} else {
return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.userId + '\')"></i> ';
}
} }
</script> </script>
</body> </body>
<!-- 导入区域 -->
<script id="importTpl" type="text/template">
<form enctype="multipart/form-data" class="mt20 mb10">
<div class="col-xs-offset-1">
<input type="file" id="file" name="file"/>
<div class="mt10 pt5">
<input type="checkbox" id="updateSupport" name="updateSupport" title="如果登录账户已经存在,更新这条数据。"> 是否更新已经存在的用户数据
&nbsp; <a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
</div>
<font color="red" class="pull-left mt10">
提示仅允许导入“xls”或“xlsx”格式文件
</font>
</div>
</form>
</script>
</html> </html>

@ -4,6 +4,8 @@ import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import com.baomidou.mybatisplus.annotation.TableField;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
@ -30,6 +32,28 @@ public class SysDept extends BaseEntity
/** 部门名称 */ /** 部门名称 */
private String deptName; private String deptName;
/** 所属市州 */
private String framework;
/** 所属区县 */
private String area;
public String getFramework() {
return framework;
}
public void setFramework(String framework) {
this.framework = framework;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
/** 显示顺序 */ /** 显示顺序 */
private Integer orderNum; private Integer orderNum;
@ -188,6 +212,8 @@ public class SysDept extends BaseEntity
.append("parentId", getParentId()) .append("parentId", getParentId())
.append("ancestors", getAncestors()) .append("ancestors", getAncestors())
.append("deptName", getDeptName()) .append("deptName", getDeptName())
.append("framework", getFramework())
.append("area", getArea())
.append("orderNum", getOrderNum()) .append("orderNum", getOrderNum())
.append("leader", getLeader()) .append("leader", getLeader())
.append("phone", getPhone()) .append("phone", getPhone())

@ -5,7 +5,6 @@ import java.util.Date;
import java.util.List; import java.util.List;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ruoyi.common.annotation.DataSource; import com.ruoyi.common.annotation.DataSource;

@ -3,6 +3,7 @@ package com.ruoyi.system.mapper;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
/** /**
@ -44,6 +45,8 @@ public interface SysUserMapper extends BaseMapper<SysUser>
*/ */
public SysUser selectUserByLoginName(String userName); public SysUser selectUserByLoginName(String userName);
public List<SysUser> selectUserGroupBydept(SysUser user);
/** /**
* *
* *

@ -3,6 +3,7 @@ package com.ruoyi.system.service;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.domain.SysUserRole;
@ -45,6 +46,8 @@ public interface ISysUserService extends IService<SysUser>
*/ */
public SysUser selectUserByLoginName(String userName); public SysUser selectUserByLoginName(String userName);
public List<SysUser> selectUserGroupBydept(SysUser user);
/** /**
* *
* *

@ -6,6 +6,7 @@ import java.util.stream.Collectors;
import javax.validation.Validator; import javax.validation.Validator;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.entity.SysDept;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -116,6 +117,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper,SysUser> imple
return userMapper.selectUserByLoginName(userName); return userMapper.selectUserByLoginName(userName);
} }
@Override
public List<SysUser> selectUserGroupBydept(SysUser user) {
return userMapper.selectUserGroupBydept(user);
}
/** /**
* *
* *

@ -9,6 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="parentId" column="parent_id" /> <result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" /> <result property="ancestors" column="ancestors" />
<result property="deptName" column="dept_name" /> <result property="deptName" column="dept_name" />
<result property="framework" column="framework" />
<result property="area" column="area" />
<result property="orderNum" column="order_num" /> <result property="orderNum" column="order_num" />
<result property="leader" column="leader" /> <result property="leader" column="leader" />
<result property="phone" column="phone" /> <result property="phone" column="phone" />
@ -23,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDeptVo"> <sql id="selectDeptVo">
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time select d.dept_id, d.parent_id, d.ancestors, d.dept_name,d.framework,d.area, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
from sys_dept d from sys_dept d
</sql> </sql>
@ -72,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult"> <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, select d.dept_id, d.parent_id, d.ancestors, d.dept_name,d.framework,d.area, d.order_num, d.leader, d.phone, d.email, d.status,
(select dept_name from sys_dept where dept_id = d.parent_id) parent_name (select dept_name from sys_dept where dept_id = d.parent_id) parent_name
from sys_dept d from sys_dept d
where d.dept_id = #{deptId} where d.dept_id = #{deptId}
@ -91,6 +93,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null and deptId != 0">dept_id,</if> <if test="deptId != null and deptId != 0">dept_id,</if>
<if test="parentId != null and parentId != 0">parent_id,</if> <if test="parentId != null and parentId != 0">parent_id,</if>
<if test="deptName != null and deptName != ''">dept_name,</if> <if test="deptName != null and deptName != ''">dept_name,</if>
<if test="framework != null and framework != ''">framework,</if>
<if test="area != null and area != ''">area,</if>
<if test="ancestors != null and ancestors != ''">ancestors,</if> <if test="ancestors != null and ancestors != ''">ancestors,</if>
<if test="orderNum != null">order_num,</if> <if test="orderNum != null">order_num,</if>
<if test="leader != null and leader != ''">leader,</if> <if test="leader != null and leader != ''">leader,</if>
@ -103,6 +107,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null and deptId != 0">#{deptId},</if> <if test="deptId != null and deptId != 0">#{deptId},</if>
<if test="parentId != null and parentId != 0">#{parentId},</if> <if test="parentId != null and parentId != 0">#{parentId},</if>
<if test="deptName != null and deptName != ''">#{deptName},</if> <if test="deptName != null and deptName != ''">#{deptName},</if>
<if test="framework != null and framework != ''">#{framework},</if>
<if test="area != null and area != ''">#{area},</if>
<if test="ancestors != null and ancestors != ''">#{ancestors},</if> <if test="ancestors != null and ancestors != ''">#{ancestors},</if>
<if test="orderNum != null">#{orderNum},</if> <if test="orderNum != null">#{orderNum},</if>
<if test="leader != null and leader != ''">#{leader},</if> <if test="leader != null and leader != ''">#{leader},</if>
@ -119,6 +125,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<set> <set>
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if> <if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if> <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
<if test="framework != null and framework != ''">framework = #{framework},</if>
<if test="area != null and area != ''">area = #{area},</if>
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if> <if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
<if test="orderNum != null">order_num = #{orderNum},</if> <if test="orderNum != null">order_num = #{orderNum},</if>
<if test="leader != null">leader = #{leader},</if> <if test="leader != null">leader = #{leader},</if>

@ -46,6 +46,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<id property="deptId" column="dept_id" /> <id property="deptId" column="dept_id" />
<result property="parentId" column="parent_id" /> <result property="parentId" column="parent_id" />
<result property="deptName" column="dept_name" /> <result property="deptName" column="dept_name" />
<result property="framework" column="framework" />
<result property="area" column="area" />
<result property="ancestors" column="ancestors" /> <result property="ancestors" column="ancestors" />
<result property="orderNum" column="order_num" /> <result property="orderNum" column="order_num" />
<result property="leader" column="leader" /> <result property="leader" column="leader" />
@ -139,6 +141,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectUserVo"/> <include refid="selectUserVo"/>
where u.login_name = #{userName} and u.del_flag = '0' where u.login_name = #{userName} and u.del_flag = '0'
</select> </select>
<select id="selectUserGroupBydept" parameterType="SysUser" resultMap="SysUserResult">
select d.dept_name, d.framework, d.area, d.dept_id ,COUNT(u.user_id) AS num_of_users
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
group by d.dept_name ,d.framework, d.area , d.dept_id
</select>
<select id="selectUserByPhoneNumber" parameterType="String" resultMap="SysUserResult"> <select id="selectUserByPhoneNumber" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/> <include refid="selectUserVo"/>

Loading…
Cancel
Save