新增教师管理部分功能

This commit is contained in:
sk1551 2020-04-22 16:30:28 +08:00
parent 024f4b5617
commit 349e26a032
8 changed files with 1138 additions and 0 deletions

View File

@ -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
})
}

View File

@ -0,0 +1,416 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="用户id" prop="userid">
<el-input
v-model="queryParams.userid"
placeholder="请输入用户id"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!--<el-form-item label="证件号码" prop="zjhm">
<el-input
v-model="queryParams.zjhm"
placeholder="请输入证件号码"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item label="学历" prop="xl">
<el-select v-model="queryParams.xl" placeholder="请选择学历" clearable size="small">
<el-option
v-for="dict in xlOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:teacher:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:teacher:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:teacher:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:teacher:export']"
>导出</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="teacherList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="用户名称" align="center" prop="user.nickName" />
<!--<el-table-column label="标识" align="center" prop="id" />
<el-table-column label="证件号码" align="center" prop="zjhm" />
<el-table-column label="出生日期" align="center" prop="csrq" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.csrq) }}</span>
</template>
</el-table-column>
<el-table-column label="毕业院校" align="center" prop="byyx" />
<el-table-column label="专业" align="center" prop="zy" />-->
<el-table-column label="学历" align="center" prop="xl" :formatter="xlFormat" />
<el-table-column label="学位" align="center" prop="xw" :formatter="xwFormat" />
<!--<el-table-column label="参加工作日期" align="center" prop="cjgzrq" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.cjgzrq) }}</span>
</template>
</el-table-column>
<el-table-column label="资格证书" align="center" prop="zgzs" :formatter="zgzsFormat" />
<el-table-column label="创建人" align="center" prop="createuserid" />-->
<el-table-column label="创建时间" align="center" prop="createtime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createtime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:teacher:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:teacher:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改教师基本信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="用户id" prop="userid">
<el-input v-model="form.userid" placeholder="请输入用户id" />
</el-form-item>
<el-form-item label="证件号码" prop="zjhm">
<el-input v-model="form.zjhm" placeholder="请输入证件号码" />
</el-form-item>
<el-form-item label="出生日期" prop="csrq">
<el-date-picker
clearable
size="small"
style="width: 200px"
v-model="form.csrq"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择出生日期"
></el-date-picker>
</el-form-item>
<el-form-item label="毕业院校" prop="byyx">
<el-input v-model="form.byyx" placeholder="请输入毕业院校" />
</el-form-item>
<el-form-item label="专业" prop="zy">
<el-input v-model="form.zy" placeholder="请输入专业" />
</el-form-item>
<el-form-item label="学历">
<el-select v-model="form.xl" placeholder="请选择学历">
<el-option
v-for="dict in xlOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="学位">
<el-select v-model="form.xw" placeholder="请选择学位">
<el-option
v-for="dict in xwOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="参加工作日期" prop="cjgzrq">
<el-date-picker
clearable
size="small"
style="width: 200px"
v-model="form.cjgzrq"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择参加工作日期"
></el-date-picker>
</el-form-item>
<el-form-item label="创建人" prop="createuserid" v-show="false">
<el-input v-model="form.createuserid" placeholder="请输入创建人" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listTeacher,
getTeacher,
delTeacher,
addTeacher,
updateTeacher,
exportTeacher
} from "@/api/system/teacher";
export default {
name: "Teacher",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
total: 0,
//
teacherList: [],
//
title: "",
//
open: false,
//
xlOptions: [],
//
xwOptions: [],
//
zgzsOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
userid: undefined,
zjhm: undefined,
csrq: undefined,
byyx: undefined,
zy: undefined,
xl: undefined,
xw: undefined,
cjgzrq: undefined,
zgzs: undefined,
createuserid: undefined,
createtime: undefined
},
//
form: {},
//
rules: {}
};
},
created() {
this.getList();
this.getDicts("sys_jsxl").then(response => {
this.xlOptions = response.data;
});
this.getDicts("sys_jsxw").then(response => {
this.xwOptions = response.data;
});
this.getDicts("sys_jszgzs").then(response => {
this.zgzsOptions = response.data;
});
},
methods: {
/** 查询教师基本信息列表 */
getList() {
this.loading = true;
listTeacher(this.queryParams).then(response => {
this.teacherList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
xlFormat(row, column) {
return this.selectDictLabel(this.xlOptions, row.xl);
},
//
xwFormat(row, column) {
return this.selectDictLabel(this.xwOptions, row.xw);
},
//
zgzsFormat(row, column) {
return this.selectDictLabel(this.zgzsOptions, row.zgzs);
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: undefined,
userid: undefined,
zjhm: undefined,
csrq: undefined,
byyx: undefined,
zy: undefined,
xl: undefined,
xw: undefined,
cjgzrq: undefined,
zgzs: undefined,
createuserid: undefined,
createtime: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加教师基本信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getTeacher(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改教师基本信息";
});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != undefined) {
updateTeacher(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
} else {
this.msgError(response.msg);
}
});
} else {
addTeacher(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
} else {
this.msgError(response.msg);
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm(
'是否确认删除教师基本信息编号为"' + ids + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
)
.then(function() {
return delTeacher(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function() {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有教师基本信息数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(function() {
return exportTeacher(queryParams);
})
.then(response => {
this.download(response.msg);
})
.catch(function() {});
}
}
};
</script>

View File

@ -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<ByTeacherJbxx> 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<ByTeacherJbxx> list = byTeacherJbxxService.selectByTeacherJbxxList(byTeacherJbxx);
ExcelUtil<ByTeacherJbxx> util = new ExcelUtil<ByTeacherJbxx>(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));
}
}

View File

@ -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;
}
}

View File

@ -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<ByTeacherJbxx> 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);
}

View File

@ -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<ByTeacherJbxx> 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);
}

View File

@ -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<ByTeacherJbxx> 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);
}
}

View File

@ -0,0 +1,136 @@
<?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="com.ruoyi.project.system.mapper.ByTeacherJbxxMapper">
<resultMap type="ByTeacherJbxx" id="ByTeacherJbxxResult">
<result property="id" column="id" />
<result property="userid" column="userid" />
<result property="zjhm" column="zjhm" />
<result property="csrq" column="csrq" />
<result property="byyx" column="byyx" />
<result property="zy" column="zy" />
<result property="xl" column="xl" />
<result property="xw" column="xw" />
<result property="cjgzrq" column="cjgzrq" />
<result property="zgzs" column="zgzs" />
<result property="createuserid" column="createuserid" />
<result property="createtime" column="createtime" />
<association property="user" column="user_id" javaType="SysUser" resultMap="SysUserResult" />
</resultMap>
<resultMap type="SysUser" id="SysUserResult">
<id property="userId" column="user_id" />
<result property="deptId" column="dept_id" />
<result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="email" column="email" />
<result property="phonenumber" column="phonenumber" />
<result property="sex" column="sex" />
<result property="avatar" column="avatar" />
<result property="password" column="password" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="loginIp" column="login_ip" />
<result property="loginDate" column="login_date" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectByTeacherJbxxVo">
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
</sql>
<select id="selectByTeacherJbxxList" parameterType="ByTeacherJbxx" resultMap="ByTeacherJbxxResult">
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.nick_name
from by_teacher_jbxx t
left join sys_user u on t.userid = u.user_id
<if test="userid != null "> and userid = #{userid}</if>
<if test="zjhm != null and zjhm != ''"> and zjhm = #{zjhm}</if>
<if test="csrq != null "> and csrq = #{csrq}</if>
<if test="byyx != null and byyx != ''"> and byyx = #{byyx}</if>
<if test="zy != null and zy != ''"> and zy = #{zy}</if>
<if test="xl != null and xl != ''"> and xl = #{xl}</if>
<if test="xw != null and xw != ''"> and xw = #{xw}</if>
<if test="cjgzrq != null "> and cjgzrq = #{cjgzrq}</if>
<if test="zgzs != null and zgzs != ''"> and zgzs = #{zgzs}</if>
<if test="createuserid != null "> and createuserid = #{createuserid}</if>
<if test="createtime != null "> and createtime = #{createtime}</if>
<!-- 数据范围过滤 -->
${dataScope}
</select>
<select id="selectByTeacherJbxxById" parameterType="Long" resultMap="ByTeacherJbxxResult">
<include refid="selectByTeacherJbxxVo"/>
where id = #{id}
</select>
<insert id="insertByTeacherJbxx" parameterType="ByTeacherJbxx" useGeneratedKeys="true" keyProperty="id">
insert into by_teacher_jbxx
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userid != null ">userid,</if>
<if test="zjhm != null and zjhm != ''">zjhm,</if>
<if test="csrq != null ">csrq,</if>
<if test="byyx != null and byyx != ''">byyx,</if>
<if test="zy != null and zy != ''">zy,</if>
<if test="xl != null and xl != ''">xl,</if>
<if test="xw != null and xw != ''">xw,</if>
<if test="cjgzrq != null ">cjgzrq,</if>
<if test="zgzs != null and zgzs != ''">zgzs,</if>
<if test="createuserid != null ">createuserid,</if>
<if test="createtime != null ">createtime,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userid != null ">#{userid},</if>
<if test="zjhm != null and zjhm != ''">#{zjhm},</if>
<if test="csrq != null ">#{csrq},</if>
<if test="byyx != null and byyx != ''">#{byyx},</if>
<if test="zy != null and zy != ''">#{zy},</if>
<if test="xl != null and xl != ''">#{xl},</if>
<if test="xw != null and xw != ''">#{xw},</if>
<if test="cjgzrq != null ">#{cjgzrq},</if>
<if test="zgzs != null and zgzs != ''">#{zgzs},</if>
<if test="createuserid != null ">#{createuserid},</if>
<if test="createtime != null ">#{createtime},</if>
</trim>
</insert>
<update id="updateByTeacherJbxx" parameterType="ByTeacherJbxx">
update by_teacher_jbxx
<trim prefix="SET" suffixOverrides=",">
<if test="userid != null ">userid = #{userid},</if>
<if test="zjhm != null and zjhm != ''">zjhm = #{zjhm},</if>
<if test="csrq != null ">csrq = #{csrq},</if>
<if test="byyx != null and byyx != ''">byyx = #{byyx},</if>
<if test="zy != null and zy != ''">zy = #{zy},</if>
<if test="xl != null and xl != ''">xl = #{xl},</if>
<if test="xw != null and xw != ''">xw = #{xw},</if>
<if test="cjgzrq != null ">cjgzrq = #{cjgzrq},</if>
<if test="zgzs != null and zgzs != ''">zgzs = #{zgzs},</if>
<if test="createuserid != null ">createuserid = #{createuserid},</if>
<if test="createtime != null ">createtime = #{createtime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteByTeacherJbxxById" parameterType="Long">
delete from by_teacher_jbxx where id = #{id}
</delete>
<delete id="deleteByTeacherJbxxByIds" parameterType="String">
delete from by_teacher_jbxx where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>