From 349e26a03206a71f99f5dc7c68deb11047359838 Mon Sep 17 00:00:00 2001
From: sk1551 <15175617877@163.com>
Date: Wed, 22 Apr 2020 16:30:28 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=95=99=E5=B8=88=E7=AE=A1?=
=?UTF-8?q?=E7=90=86=E9=83=A8=E5=88=86=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ruoyi-ui/src/api/system/teacher.js | 53 +++
ruoyi-ui/src/views/system/teacher/index.vue | 416 ++++++++++++++++++
.../controller/ByTeacherJbxxController.java | 112 +++++
.../project/system/domain/ByTeacherJbxx.java | 206 +++++++++
.../system/mapper/ByTeacherJbxxMapper.java | 61 +++
.../system/service/IByTeacherJbxxService.java | 61 +++
.../impl/ByTeacherJbxxServiceImpl.java | 93 ++++
.../mybatis/system/ByTeacherJbxxMapper.xml | 136 ++++++
8 files changed, 1138 insertions(+)
create mode 100644 ruoyi-ui/src/api/system/teacher.js
create mode 100644 ruoyi-ui/src/views/system/teacher/index.vue
create mode 100644 ruoyi/src/main/java/com/ruoyi/project/system/controller/ByTeacherJbxxController.java
create mode 100644 ruoyi/src/main/java/com/ruoyi/project/system/domain/ByTeacherJbxx.java
create mode 100644 ruoyi/src/main/java/com/ruoyi/project/system/mapper/ByTeacherJbxxMapper.java
create mode 100644 ruoyi/src/main/java/com/ruoyi/project/system/service/IByTeacherJbxxService.java
create mode 100644 ruoyi/src/main/java/com/ruoyi/project/system/service/impl/ByTeacherJbxxServiceImpl.java
create mode 100644 ruoyi/src/main/resources/mybatis/system/ByTeacherJbxxMapper.xml
diff --git a/ruoyi-ui/src/api/system/teacher.js b/ruoyi-ui/src/api/system/teacher.js
new file mode 100644
index 000000000..2f00938c8
--- /dev/null
+++ b/ruoyi-ui/src/api/system/teacher.js
@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询教师基本信息列表
+export function listTeacher(query) {
+ return request({
+ url: '/system/teacher/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 查询教师基本信息详细
+export function getTeacher(id) {
+ return request({
+ url: '/system/teacher/' + id,
+ method: 'get'
+ })
+}
+
+// 新增教师基本信息
+export function addTeacher(data) {
+ return request({
+ url: '/system/teacher',
+ method: 'post',
+ data: data
+ })
+}
+
+// 修改教师基本信息
+export function updateTeacher(data) {
+ return request({
+ url: '/system/teacher',
+ method: 'put',
+ data: data
+ })
+}
+
+// 删除教师基本信息
+export function delTeacher(id) {
+ return request({
+ url: '/system/teacher/' + id,
+ method: 'delete'
+ })
+}
+
+// 导出教师基本信息
+export function exportTeacher(query) {
+ return request({
+ url: '/system/teacher/export',
+ method: 'get',
+ params: query
+ })
+}
\ No newline at end of file
diff --git a/ruoyi-ui/src/views/system/teacher/index.vue b/ruoyi-ui/src/views/system/teacher/index.vue
new file mode 100644
index 000000000..2c1656e36
--- /dev/null
+++ b/ruoyi-ui/src/views/system/teacher/index.vue
@@ -0,0 +1,416 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 新增
+
+
+ 修改
+
+
+ 删除
+
+
+ 导出
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.createtime) }}
+
+
+
+
+ 修改
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/ByTeacherJbxxController.java b/ruoyi/src/main/java/com/ruoyi/project/system/controller/ByTeacherJbxxController.java
new file mode 100644
index 000000000..23cf7aa27
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/system/controller/ByTeacherJbxxController.java
@@ -0,0 +1,112 @@
+package com.ruoyi.project.system.controller;
+
+import java.util.Date;
+import java.util.List;
+
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.project.system.service.ISysUserService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.project.system.domain.ByTeacherJbxx;
+import com.ruoyi.project.system.service.IByTeacherJbxxService;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.web.page.TableDataInfo;
+
+/**
+ * 教师基本信息Controller
+ *
+ * @author tsbz
+ * @date 2020-04-21
+ */
+@RestController
+@RequestMapping("/system/teacher")
+public class ByTeacherJbxxController extends BaseController
+{
+ @Autowired
+ private IByTeacherJbxxService byTeacherJbxxService;
+
+ @Autowired
+ private ISysUserService userService;
+
+ /**
+ * 查询教师基本信息列表
+ */
+ @PreAuthorize("@ss.hasPermi('system:teacher:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(ByTeacherJbxx byTeacherJbxx)
+ {
+ startPage();
+ List list = byTeacherJbxxService.selectByTeacherJbxxList(byTeacherJbxx);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出教师基本信息列表
+ */
+ @PreAuthorize("@ss.hasPermi('system:teacher:export')")
+ @Log(title = "教师基本信息", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(ByTeacherJbxx byTeacherJbxx)
+ {
+ List list = byTeacherJbxxService.selectByTeacherJbxxList(byTeacherJbxx);
+ ExcelUtil util = new ExcelUtil(ByTeacherJbxx.class);
+ return util.exportExcel(list, "teacher");
+ }
+
+ /**
+ * 获取教师基本信息详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('system:teacher:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id)
+ {
+ return AjaxResult.success(byTeacherJbxxService.selectByTeacherJbxxById(id));
+ }
+
+ /**
+ * 新增教师基本信息
+ */
+ @PreAuthorize("@ss.hasPermi('system:teacher:add')")
+ @Log(title = "教师基本信息", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody ByTeacherJbxx byTeacherJbxx)
+ {
+ byTeacherJbxx.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
+ byTeacherJbxx.setCreatetime(new Date());
+ return toAjax(byTeacherJbxxService.insertByTeacherJbxx(byTeacherJbxx));
+ }
+
+ /**
+ * 修改教师基本信息
+ */
+ @PreAuthorize("@ss.hasPermi('system:teacher:edit')")
+ @Log(title = "教师基本信息", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody ByTeacherJbxx byTeacherJbxx)
+ {
+ return toAjax(byTeacherJbxxService.updateByTeacherJbxx(byTeacherJbxx));
+ }
+
+ /**
+ * 删除教师基本信息
+ */
+ @PreAuthorize("@ss.hasPermi('system:teacher:remove')")
+ @Log(title = "教师基本信息", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids)
+ {
+ return toAjax(byTeacherJbxxService.deleteByTeacherJbxxByIds(ids));
+ }
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/domain/ByTeacherJbxx.java b/ruoyi/src/main/java/com/ruoyi/project/system/domain/ByTeacherJbxx.java
new file mode 100644
index 000000000..7af9d71fe
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/system/domain/ByTeacherJbxx.java
@@ -0,0 +1,206 @@
+package com.ruoyi.project.system.domain;
+
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.framework.aspectj.lang.annotation.Excel;
+import com.ruoyi.framework.web.domain.BaseEntity;
+import java.util.Date;
+
+/**
+ * 教师基本信息对象 by_teacher_jbxx
+ *
+ * @author tsbz
+ * @date 2020-04-21
+ */
+public class ByTeacherJbxx extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 标识 */
+ private Long id;
+
+ /** 用户id */
+ @Excel(name = "用户id")
+ private Long userid;
+
+ /** 证件号码 */
+ @Excel(name = "证件号码")
+ private String zjhm;
+
+ /** 出生日期 */
+ @Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd")
+ private Date csrq;
+
+ /** 毕业院校 */
+ @Excel(name = "毕业院校")
+ private String byyx;
+
+ /** 专业 */
+ @Excel(name = "专业")
+ private String zy;
+
+ /** 学历 */
+ @Excel(name = "学历")
+ private String xl;
+
+ /** 学位 */
+ @Excel(name = "学位")
+ private String xw;
+
+ /** 参加工作日期 */
+ @Excel(name = "参加工作日期", width = 30, dateFormat = "yyyy-MM-dd")
+ private Date cjgzrq;
+
+ /** 资格证书 */
+ @Excel(name = "资格证书")
+ private String zgzs;
+
+ /** 创建人 */
+ @Excel(name = "创建人")
+ private Long createuserid;
+
+ //创建时间
+ @Excel(name = "创建时间")
+ private Date createtime;
+
+ /** user对象 */
+ @Excel(name = "部门名称", targetAttr = "deptName", type = Excel.Type.EXPORT)
+ private SysUser user;
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ public Long getId()
+ {
+ return id;
+ }
+ public void setUserid(Long userid)
+ {
+ this.userid = userid;
+ }
+
+ public Long getUserid()
+ {
+ return userid;
+ }
+ public void setZjhm(String zjhm)
+ {
+ this.zjhm = zjhm;
+ }
+
+ public String getZjhm()
+ {
+ return zjhm;
+ }
+ public void setCsrq(Date csrq)
+ {
+ this.csrq = csrq;
+ }
+
+ public Date getCsrq()
+ {
+ return csrq;
+ }
+ public void setByyx(String byyx)
+ {
+ this.byyx = byyx;
+ }
+
+ public String getByyx()
+ {
+ return byyx;
+ }
+ public void setZy(String zy)
+ {
+ this.zy = zy;
+ }
+
+ public String getZy()
+ {
+ return zy;
+ }
+ public void setXl(String xl)
+ {
+ this.xl = xl;
+ }
+
+ public String getXl()
+ {
+ return xl;
+ }
+ public void setXw(String xw)
+ {
+ this.xw = xw;
+ }
+
+ public String getXw()
+ {
+ return xw;
+ }
+ public void setCjgzrq(Date cjgzrq)
+ {
+ this.cjgzrq = cjgzrq;
+ }
+
+ public Date getCjgzrq()
+ {
+ return cjgzrq;
+ }
+ public void setZgzs(String zgzs)
+ {
+ this.zgzs = zgzs;
+ }
+
+ public String getZgzs()
+ {
+ return zgzs;
+ }
+ public void setCreateuserid(Long createuserid)
+ {
+ this.createuserid = createuserid;
+ }
+
+ public Long getCreateuserid()
+ {
+ return createuserid;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+ .append("id", getId())
+ .append("userid", getUserid())
+ .append("zjhm", getZjhm())
+ .append("csrq", getCsrq())
+ .append("byyx", getByyx())
+ .append("zy", getZy())
+ .append("xl", getXl())
+ .append("xw", getXw())
+ .append("cjgzrq", getCjgzrq())
+ .append("zgzs", getZgzs())
+ .append("createuserid", getCreateuserid())
+ .append("createtime", getCreatetime())
+ .append("user", getUser())
+ .toString();
+ }
+
+ public Date getCreatetime() {
+ return createtime;
+ }
+
+ public void setCreatetime(Date createtime) {
+ this.createtime = createtime;
+ }
+
+
+ public SysUser getUser() {
+ return user;
+ }
+
+ public void setUser(SysUser user) {
+ this.user = user;
+ }
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/mapper/ByTeacherJbxxMapper.java b/ruoyi/src/main/java/com/ruoyi/project/system/mapper/ByTeacherJbxxMapper.java
new file mode 100644
index 000000000..54873d5dc
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/system/mapper/ByTeacherJbxxMapper.java
@@ -0,0 +1,61 @@
+package com.ruoyi.project.system.mapper;
+
+import java.util.List;
+import com.ruoyi.project.system.domain.ByTeacherJbxx;
+
+/**
+ * 教师基本信息Mapper接口
+ *
+ * @author tsbz
+ * @date 2020-04-21
+ */
+public interface ByTeacherJbxxMapper
+{
+ /**
+ * 查询教师基本信息
+ *
+ * @param id 教师基本信息ID
+ * @return 教师基本信息
+ */
+ public ByTeacherJbxx selectByTeacherJbxxById(Long id);
+
+ /**
+ * 查询教师基本信息列表
+ *
+ * @param byTeacherJbxx 教师基本信息
+ * @return 教师基本信息集合
+ */
+ public List selectByTeacherJbxxList(ByTeacherJbxx byTeacherJbxx);
+
+ /**
+ * 新增教师基本信息
+ *
+ * @param byTeacherJbxx 教师基本信息
+ * @return 结果
+ */
+ public int insertByTeacherJbxx(ByTeacherJbxx byTeacherJbxx);
+
+ /**
+ * 修改教师基本信息
+ *
+ * @param byTeacherJbxx 教师基本信息
+ * @return 结果
+ */
+ public int updateByTeacherJbxx(ByTeacherJbxx byTeacherJbxx);
+
+ /**
+ * 删除教师基本信息
+ *
+ * @param id 教师基本信息ID
+ * @return 结果
+ */
+ public int deleteByTeacherJbxxById(Long id);
+
+ /**
+ * 批量删除教师基本信息
+ *
+ * @param ids 需要删除的数据ID
+ * @return 结果
+ */
+ public int deleteByTeacherJbxxByIds(Long[] ids);
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/service/IByTeacherJbxxService.java b/ruoyi/src/main/java/com/ruoyi/project/system/service/IByTeacherJbxxService.java
new file mode 100644
index 000000000..becf82aac
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/system/service/IByTeacherJbxxService.java
@@ -0,0 +1,61 @@
+package com.ruoyi.project.system.service;
+
+import java.util.List;
+import com.ruoyi.project.system.domain.ByTeacherJbxx;
+
+/**
+ * 教师基本信息Service接口
+ *
+ * @author tsbz
+ * @date 2020-04-21
+ */
+public interface IByTeacherJbxxService
+{
+ /**
+ * 查询教师基本信息
+ *
+ * @param id 教师基本信息ID
+ * @return 教师基本信息
+ */
+ public ByTeacherJbxx selectByTeacherJbxxById(Long id);
+
+ /**
+ * 查询教师基本信息列表
+ *
+ * @param byTeacherJbxx 教师基本信息
+ * @return 教师基本信息集合
+ */
+ public List selectByTeacherJbxxList(ByTeacherJbxx byTeacherJbxx);
+
+ /**
+ * 新增教师基本信息
+ *
+ * @param byTeacherJbxx 教师基本信息
+ * @return 结果
+ */
+ public int insertByTeacherJbxx(ByTeacherJbxx byTeacherJbxx);
+
+ /**
+ * 修改教师基本信息
+ *
+ * @param byTeacherJbxx 教师基本信息
+ * @return 结果
+ */
+ public int updateByTeacherJbxx(ByTeacherJbxx byTeacherJbxx);
+
+ /**
+ * 批量删除教师基本信息
+ *
+ * @param ids 需要删除的教师基本信息ID
+ * @return 结果
+ */
+ public int deleteByTeacherJbxxByIds(Long[] ids);
+
+ /**
+ * 删除教师基本信息信息
+ *
+ * @param id 教师基本信息ID
+ * @return 结果
+ */
+ public int deleteByTeacherJbxxById(Long id);
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/service/impl/ByTeacherJbxxServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/system/service/impl/ByTeacherJbxxServiceImpl.java
new file mode 100644
index 000000000..2cff29ab2
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/system/service/impl/ByTeacherJbxxServiceImpl.java
@@ -0,0 +1,93 @@
+package com.ruoyi.project.system.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.system.mapper.ByTeacherJbxxMapper;
+import com.ruoyi.project.system.domain.ByTeacherJbxx;
+import com.ruoyi.project.system.service.IByTeacherJbxxService;
+
+/**
+ * 教师基本信息Service业务层处理
+ *
+ * @author tsbz
+ * @date 2020-04-21
+ */
+@Service
+public class ByTeacherJbxxServiceImpl implements IByTeacherJbxxService
+{
+ @Autowired
+ private ByTeacherJbxxMapper byTeacherJbxxMapper;
+
+ /**
+ * 查询教师基本信息
+ *
+ * @param id 教师基本信息ID
+ * @return 教师基本信息
+ */
+ @Override
+ public ByTeacherJbxx selectByTeacherJbxxById(Long id)
+ {
+ return byTeacherJbxxMapper.selectByTeacherJbxxById(id);
+ }
+
+ /**
+ * 查询教师基本信息列表
+ *
+ * @param byTeacherJbxx 教师基本信息
+ * @return 教师基本信息
+ */
+ @Override
+ public List selectByTeacherJbxxList(ByTeacherJbxx byTeacherJbxx)
+ {
+ return byTeacherJbxxMapper.selectByTeacherJbxxList(byTeacherJbxx);
+ }
+
+ /**
+ * 新增教师基本信息
+ *
+ * @param byTeacherJbxx 教师基本信息
+ * @return 结果
+ */
+ @Override
+ public int insertByTeacherJbxx(ByTeacherJbxx byTeacherJbxx)
+ {
+ return byTeacherJbxxMapper.insertByTeacherJbxx(byTeacherJbxx);
+ }
+
+ /**
+ * 修改教师基本信息
+ *
+ * @param byTeacherJbxx 教师基本信息
+ * @return 结果
+ */
+ @Override
+ public int updateByTeacherJbxx(ByTeacherJbxx byTeacherJbxx)
+ {
+ return byTeacherJbxxMapper.updateByTeacherJbxx(byTeacherJbxx);
+ }
+
+ /**
+ * 批量删除教师基本信息
+ *
+ * @param ids 需要删除的教师基本信息ID
+ * @return 结果
+ */
+ @Override
+ public int deleteByTeacherJbxxByIds(Long[] ids)
+ {
+ return byTeacherJbxxMapper.deleteByTeacherJbxxByIds(ids);
+ }
+
+ /**
+ * 删除教师基本信息信息
+ *
+ * @param id 教师基本信息ID
+ * @return 结果
+ */
+ @Override
+ public int deleteByTeacherJbxxById(Long id)
+ {
+ return byTeacherJbxxMapper.deleteByTeacherJbxxById(id);
+ }
+}
diff --git a/ruoyi/src/main/resources/mybatis/system/ByTeacherJbxxMapper.xml b/ruoyi/src/main/resources/mybatis/system/ByTeacherJbxxMapper.xml
new file mode 100644
index 000000000..72d27d05c
--- /dev/null
+++ b/ruoyi/src/main/resources/mybatis/system/ByTeacherJbxxMapper.xml
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select t.id, t.userid, t.zjhm, t.csrq, t.byyx, t.zy, t.xl, t.xw, t.cjgzrq, t.zgzs, t.createuserid, t.createtime,
+ u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.sex, u.status as user_status
+ from by_teacher_jbxx t
+ left join sys_user u on t.userid = u.user_id
+
+
+
+
+
+
+
+ insert into by_teacher_jbxx
+
+ userid,
+ zjhm,
+ csrq,
+ byyx,
+ zy,
+ xl,
+ xw,
+ cjgzrq,
+ zgzs,
+ createuserid,
+ createtime,
+
+
+ #{userid},
+ #{zjhm},
+ #{csrq},
+ #{byyx},
+ #{zy},
+ #{xl},
+ #{xw},
+ #{cjgzrq},
+ #{zgzs},
+ #{createuserid},
+ #{createtime},
+
+
+
+
+ update by_teacher_jbxx
+
+ userid = #{userid},
+ zjhm = #{zjhm},
+ csrq = #{csrq},
+ byyx = #{byyx},
+ zy = #{zy},
+ xl = #{xl},
+ xw = #{xw},
+ cjgzrq = #{cjgzrq},
+ zgzs = #{zgzs},
+ createuserid = #{createuserid},
+ createtime = #{createtime},
+
+ where id = #{id}
+
+
+
+ delete from by_teacher_jbxx where id = #{id}
+
+
+
+ delete from by_teacher_jbxx where id in
+
+ #{id}
+
+
+
+
\ No newline at end of file