20200414-zlp-1
班级管理
This commit is contained in:
parent
64a6caf923
commit
c56fbfd8bf
53
ruoyi-ui/src/api/system/class.js
Normal file
53
ruoyi-ui/src/api/system/class.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询班级信息列表
|
||||
export function listClass(query) {
|
||||
return request({
|
||||
url: '/system/class/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询班级信息详细
|
||||
export function getClass(bjbh) {
|
||||
return request({
|
||||
url: '/system/class/' + bjbh,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增班级信息
|
||||
export function addClass(data) {
|
||||
return request({
|
||||
url: '/system/class',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改班级信息
|
||||
export function updateClass(data) {
|
||||
return request({
|
||||
url: '/system/class',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除班级信息
|
||||
export function delClass(bjbh) {
|
||||
return request({
|
||||
url: '/system/class/' + bjbh,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出班级信息
|
||||
export function exportClass(query) {
|
||||
return request({
|
||||
url: '/system/class/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
387
ruoyi-ui/src/views/system/class/index.vue
Normal file
387
ruoyi-ui/src/views/system/class/index.vue
Normal file
@ -0,0 +1,387 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
||||
<el-form-item label="班级类型" prop="bjtype">
|
||||
<el-select v-model="queryParams.bjtype" placeholder="请选择班级类型" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in bjtypeOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班级名称" prop="bjmc">
|
||||
<el-input
|
||||
v-model="queryParams.bjmc"
|
||||
placeholder="请输入班级名称"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="主班教师" prop="zbjs">
|
||||
<el-input
|
||||
v-model="queryParams.zbjs"
|
||||
placeholder="请输入主班教师"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="配班教师" prop="pbjs">
|
||||
<el-input
|
||||
v-model="queryParams.pbjs"
|
||||
placeholder="请输入配班教师"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="助理教师" prop="zljs">
|
||||
<el-input
|
||||
v-model="queryParams.zljs"
|
||||
placeholder="请输入助理教师"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</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:class: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:class: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:class: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:class:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="classList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="班级编号" align="center" prop="bjbh" />
|
||||
<el-table-column label="学校代码" align="center" prop="schoolid" />
|
||||
<el-table-column label="班级类型" align="center" :formatter="bjtypeFormat" prop="bjtype" />
|
||||
<el-table-column label="班级序号" align="center" prop="bhxh" />
|
||||
<el-table-column label="学年" align="center" prop="xn" />
|
||||
<el-table-column label="班级名称" align="center" prop="bjmc" />
|
||||
<el-table-column label="班级荣誉称号" align="center" prop="bjrych" />
|
||||
<el-table-column label="建班年月" align="center" prop="jbny" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.jbny) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="主班教师" align="center" prop="zbjs" />
|
||||
<el-table-column label="配班教师" align="center" prop="pbjs" />
|
||||
<el-table-column label="助理教师" align="center" prop="zljs" />
|
||||
<el-table-column label="是否删除
|
||||
1:删除
|
||||
0:正常" align="center" prop="isdel" />
|
||||
<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:class:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:class: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="班级类型" prop="bjtype">
|
||||
<el-select v-model="form.bjtype" placeholder="请选择班级类型">
|
||||
<el-option
|
||||
v-for="dict in bjtypeOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班级名称" prop="bjmc">
|
||||
<el-input v-model="form.bjmc" placeholder="请输入班级名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="主班教师" prop="zbjs">
|
||||
<el-input v-model="form.zbjs" placeholder="请输入主班教师" />
|
||||
</el-form-item>
|
||||
<el-form-item label="配班教师" prop="pbjs">
|
||||
<el-input v-model="form.pbjs" placeholder="请输入配班教师" />
|
||||
</el-form-item>
|
||||
<el-form-item label="助理教师" prop="zljs">
|
||||
<el-input v-model="form.zljs" 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 {
|
||||
listClass,
|
||||
getClass,
|
||||
delClass,
|
||||
addClass,
|
||||
updateClass,
|
||||
exportClass
|
||||
} from "@/api/system/class";
|
||||
|
||||
export default {
|
||||
name: "Class",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班级信息表格数据
|
||||
classList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
//班级类型 字典
|
||||
bjtypeOptions: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
schoolid: undefined,
|
||||
bjtype: undefined,
|
||||
bhxh: undefined,
|
||||
xn: undefined,
|
||||
bjmc: undefined,
|
||||
bjrych: undefined,
|
||||
jbny: undefined,
|
||||
zbjs: undefined,
|
||||
pbjs: undefined,
|
||||
zljs: undefined,
|
||||
isdel: undefined,
|
||||
createtime: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
bjtype: [
|
||||
{ required: true, message: "班级类型不能为空", trigger: "blur" }
|
||||
],
|
||||
bjmc: [{ required: true, message: "班级名称不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getDicts("sys_yebjlx").then(response => {
|
||||
this.bjtypeOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询班级信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listClass(this.queryParams).then(response => {
|
||||
this.classList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 班级类型--字典状态字典翻译
|
||||
bjtypeFormat(row, column) {
|
||||
return this.selectDictLabel(this.bjtypeOptions, row.bjtype);
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
bjbh: undefined,
|
||||
schoolid: undefined,
|
||||
bjtype: undefined,
|
||||
bhxh: undefined,
|
||||
xn: undefined,
|
||||
bjmc: undefined,
|
||||
bjrych: undefined,
|
||||
jbny: undefined,
|
||||
zbjs: undefined,
|
||||
pbjs: undefined,
|
||||
zljs: undefined,
|
||||
isdel: 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.bjbh);
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加班级信息";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const bjbh = row.bjbh || this.ids;
|
||||
getClass(bjbh).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改班级信息";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.bjbh != undefined) {
|
||||
updateClass(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
} else {
|
||||
this.msgError(response.msg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addClass(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
} else {
|
||||
this.msgError(response.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const bjbhs = row.bjbh || this.ids;
|
||||
this.$confirm(
|
||||
'是否确认删除班级信息编号为"' + bjbhs + '"的数据项?',
|
||||
"警告",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}
|
||||
)
|
||||
.then(function() {
|
||||
return delClass(bjbhs);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(function() {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm("是否确认导出所有班级信息数据项?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(function() {
|
||||
return exportClass(queryParams);
|
||||
})
|
||||
.then(response => {
|
||||
this.download(response.msg);
|
||||
})
|
||||
.catch(function() {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -0,0 +1,103 @@
|
||||
package com.ruoyi.project.system.controller;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
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.ByClass;
|
||||
import com.ruoyi.project.system.service.IByClassService;
|
||||
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-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/class")
|
||||
public class ByClassController extends BaseController {
|
||||
@Autowired
|
||||
private IByClassService byClassService;
|
||||
|
||||
/**
|
||||
* 查询班级信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:class:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ByClass byClass) {
|
||||
startPage();
|
||||
List<ByClass> list = byClassService.selectByClassList(byClass);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出班级信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:class:export')")
|
||||
@Log(title = "班级信息", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(ByClass byClass) {
|
||||
List<ByClass> list = byClassService.selectByClassList(byClass);
|
||||
ExcelUtil<ByClass> util = new ExcelUtil<ByClass>(ByClass.class);
|
||||
return util.exportExcel(list, "class");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取班级信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:class:query')")
|
||||
@GetMapping(value = "/{bjbh}")
|
||||
public AjaxResult getInfo(@PathVariable("bjbh") String bjbh) {
|
||||
return AjaxResult.success(byClassService.selectByClassById(bjbh));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增班级信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:class:add')")
|
||||
@Log(title = "班级信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ByClass byClass) {
|
||||
String strBjbh = UUID.randomUUID().toString().replace("-","");
|
||||
System.out.println("bjbh:==" + strBjbh);
|
||||
byClass.setBjbh(strBjbh);
|
||||
byClass.setCreatetime(new Date());
|
||||
return toAjax(byClassService.insertByClass(byClass));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班级信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:class:edit')")
|
||||
@Log(title = "班级信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ByClass byClass) {
|
||||
return toAjax(byClassService.updateByClass(byClass));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除班级信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:class:remove')")
|
||||
@Log(title = "班级信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{bjbhs}")
|
||||
public AjaxResult remove(@PathVariable String[] bjbhs) {
|
||||
return toAjax(byClassService.deleteByClassByIds(bjbhs));
|
||||
}
|
||||
}
|
219
ruoyi/src/main/java/com/ruoyi/project/system/domain/ByClass.java
Normal file
219
ruoyi/src/main/java/com/ruoyi/project/system/domain/ByClass.java
Normal file
@ -0,0 +1,219 @@
|
||||
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_class
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2020-04-14
|
||||
*/
|
||||
public class ByClass extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 班级编号
|
||||
*/
|
||||
private String bjbh;
|
||||
|
||||
/**
|
||||
* 学校代码
|
||||
*/
|
||||
@Excel(name = "学校代码")
|
||||
private String schoolid;
|
||||
|
||||
/**
|
||||
* 班级类型
|
||||
*/
|
||||
@Excel(name = "班级类型")
|
||||
private String bjtype;
|
||||
|
||||
/**
|
||||
* 班级序号
|
||||
*/
|
||||
@Excel(name = "班级序号")
|
||||
private Long bhxh;
|
||||
|
||||
/**
|
||||
* 学年
|
||||
*/
|
||||
@Excel(name = "学年")
|
||||
private String xn;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
@Excel(name = "班级名称")
|
||||
private String bjmc;
|
||||
|
||||
/**
|
||||
* 班级荣誉称号
|
||||
*/
|
||||
@Excel(name = "班级荣誉称号")
|
||||
private String bjrych;
|
||||
|
||||
/**
|
||||
* 建班年月
|
||||
*/
|
||||
@Excel(name = "建班年月", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date jbny;
|
||||
|
||||
/**
|
||||
* 主班教师
|
||||
*/
|
||||
@Excel(name = "主班教师")
|
||||
private Long zbjs;
|
||||
|
||||
/**
|
||||
* 配班教师
|
||||
*/
|
||||
@Excel(name = "配班教师")
|
||||
private Long pbjs;
|
||||
|
||||
/**
|
||||
* 助理教师
|
||||
*/
|
||||
@Excel(name = "助理教师")
|
||||
private Long zljs;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
* 1:删除
|
||||
* 0:正常
|
||||
*/
|
||||
@Excel(name = "是否删除 1:删除 0:正常")
|
||||
private String isdel;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createtime;
|
||||
|
||||
public void setBjbh(String bjbh) {
|
||||
this.bjbh = bjbh;
|
||||
}
|
||||
|
||||
public String getBjbh() {
|
||||
return bjbh;
|
||||
}
|
||||
|
||||
public void setSchoolid(String schoolid) {
|
||||
this.schoolid = schoolid;
|
||||
}
|
||||
|
||||
public String getSchoolid() {
|
||||
return schoolid;
|
||||
}
|
||||
|
||||
public void setBjtype(String bjtype) {
|
||||
this.bjtype = bjtype;
|
||||
}
|
||||
|
||||
public String getBjtype() {
|
||||
return bjtype;
|
||||
}
|
||||
|
||||
public void setBhxh(Long bhxh) {
|
||||
this.bhxh = bhxh;
|
||||
}
|
||||
|
||||
public Long getBhxh() {
|
||||
return bhxh;
|
||||
}
|
||||
|
||||
public void setXn(String xn) {
|
||||
this.xn = xn;
|
||||
}
|
||||
|
||||
public String getXn() {
|
||||
return xn;
|
||||
}
|
||||
|
||||
public void setBjmc(String bjmc) {
|
||||
this.bjmc = bjmc;
|
||||
}
|
||||
|
||||
public String getBjmc() {
|
||||
return bjmc;
|
||||
}
|
||||
|
||||
public void setBjrych(String bjrych) {
|
||||
this.bjrych = bjrych;
|
||||
}
|
||||
|
||||
public String getBjrych() {
|
||||
return bjrych;
|
||||
}
|
||||
|
||||
public void setJbny(Date jbny) {
|
||||
this.jbny = jbny;
|
||||
}
|
||||
|
||||
public Date getJbny() {
|
||||
return jbny;
|
||||
}
|
||||
|
||||
public void setZbjs(Long zbjs) {
|
||||
this.zbjs = zbjs;
|
||||
}
|
||||
|
||||
public Long getZbjs() {
|
||||
return zbjs;
|
||||
}
|
||||
|
||||
public void setPbjs(Long pbjs) {
|
||||
this.pbjs = pbjs;
|
||||
}
|
||||
|
||||
public Long getPbjs() {
|
||||
return pbjs;
|
||||
}
|
||||
|
||||
public void setZljs(Long zljs) {
|
||||
this.zljs = zljs;
|
||||
}
|
||||
|
||||
public Long getZljs() {
|
||||
return zljs;
|
||||
}
|
||||
|
||||
public void setIsdel(String isdel) {
|
||||
this.isdel = isdel;
|
||||
}
|
||||
|
||||
public String getIsdel() {
|
||||
return isdel;
|
||||
}
|
||||
|
||||
public void setCreatetime(Date createtime) {
|
||||
this.createtime = createtime;
|
||||
}
|
||||
|
||||
public Date getCreatetime() {
|
||||
return createtime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("bjbh", getBjbh())
|
||||
.append("schoolid", getSchoolid())
|
||||
.append("bjtype", getBjtype())
|
||||
.append("bhxh", getBhxh())
|
||||
.append("xn", getXn())
|
||||
.append("bjmc", getBjmc())
|
||||
.append("bjrych", getBjrych())
|
||||
.append("jbny", getJbny())
|
||||
.append("zbjs", getZbjs())
|
||||
.append("pbjs", getPbjs())
|
||||
.append("zljs", getZljs())
|
||||
.append("isdel", getIsdel())
|
||||
.append("createtime", getCreatetime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.project.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.project.system.domain.ByClass;
|
||||
|
||||
/**
|
||||
* 班级信息Mapper接口
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2020-04-14
|
||||
*/
|
||||
public interface ByClassMapper
|
||||
{
|
||||
/**
|
||||
* 查询班级信息
|
||||
*
|
||||
* @param bjbh 班级信息ID
|
||||
* @return 班级信息
|
||||
*/
|
||||
public ByClass selectByClassById(String bjbh);
|
||||
|
||||
/**
|
||||
* 查询班级信息列表
|
||||
*
|
||||
* @param byClass 班级信息
|
||||
* @return 班级信息集合
|
||||
*/
|
||||
public List<ByClass> selectByClassList(ByClass byClass);
|
||||
|
||||
/**
|
||||
* 新增班级信息
|
||||
*
|
||||
* @param byClass 班级信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertByClass(ByClass byClass);
|
||||
|
||||
/**
|
||||
* 修改班级信息
|
||||
*
|
||||
* @param byClass 班级信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateByClass(ByClass byClass);
|
||||
|
||||
/**
|
||||
* 删除班级信息
|
||||
*
|
||||
* @param bjbh 班级信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteByClassById(String bjbh);
|
||||
|
||||
/**
|
||||
* 批量删除班级信息
|
||||
*
|
||||
* @param bjbhs 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteByClassByIds(String[] bjbhs);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.project.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.project.system.domain.ByClass;
|
||||
|
||||
/**
|
||||
* 班级信息Service接口
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2020-04-14
|
||||
*/
|
||||
public interface IByClassService
|
||||
{
|
||||
/**
|
||||
* 查询班级信息
|
||||
*
|
||||
* @param bjbh 班级信息ID
|
||||
* @return 班级信息
|
||||
*/
|
||||
public ByClass selectByClassById(String bjbh);
|
||||
|
||||
/**
|
||||
* 查询班级信息列表
|
||||
*
|
||||
* @param byClass 班级信息
|
||||
* @return 班级信息集合
|
||||
*/
|
||||
public List<ByClass> selectByClassList(ByClass byClass);
|
||||
|
||||
/**
|
||||
* 新增班级信息
|
||||
*
|
||||
* @param byClass 班级信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertByClass(ByClass byClass);
|
||||
|
||||
/**
|
||||
* 修改班级信息
|
||||
*
|
||||
* @param byClass 班级信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateByClass(ByClass byClass);
|
||||
|
||||
/**
|
||||
* 批量删除班级信息
|
||||
*
|
||||
* @param bjbhs 需要删除的班级信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteByClassByIds(String[] bjbhs);
|
||||
|
||||
/**
|
||||
* 删除班级信息信息
|
||||
*
|
||||
* @param bjbh 班级信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteByClassById(String bjbh);
|
||||
}
|
@ -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.ByClassMapper;
|
||||
import com.ruoyi.project.system.domain.ByClass;
|
||||
import com.ruoyi.project.system.service.IByClassService;
|
||||
|
||||
/**
|
||||
* 班级信息Service业务层处理
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2020-04-14
|
||||
*/
|
||||
@Service
|
||||
public class ByClassServiceImpl implements IByClassService
|
||||
{
|
||||
@Autowired
|
||||
private ByClassMapper byClassMapper;
|
||||
|
||||
/**
|
||||
* 查询班级信息
|
||||
*
|
||||
* @param bjbh 班级信息ID
|
||||
* @return 班级信息
|
||||
*/
|
||||
@Override
|
||||
public ByClass selectByClassById(String bjbh)
|
||||
{
|
||||
return byClassMapper.selectByClassById(bjbh);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询班级信息列表
|
||||
*
|
||||
* @param byClass 班级信息
|
||||
* @return 班级信息
|
||||
*/
|
||||
@Override
|
||||
public List<ByClass> selectByClassList(ByClass byClass)
|
||||
{
|
||||
return byClassMapper.selectByClassList(byClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增班级信息
|
||||
*
|
||||
* @param byClass 班级信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertByClass(ByClass byClass)
|
||||
{
|
||||
return byClassMapper.insertByClass(byClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班级信息
|
||||
*
|
||||
* @param byClass 班级信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateByClass(ByClass byClass)
|
||||
{
|
||||
return byClassMapper.updateByClass(byClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除班级信息
|
||||
*
|
||||
* @param bjbhs 需要删除的班级信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteByClassByIds(String[] bjbhs)
|
||||
{
|
||||
return byClassMapper.deleteByClassByIds(bjbhs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除班级信息信息
|
||||
*
|
||||
* @param bjbh 班级信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteByClassById(String bjbh)
|
||||
{
|
||||
return byClassMapper.deleteByClassById(bjbh);
|
||||
}
|
||||
}
|
114
ruoyi/src/main/resources/mybatis/system/ByClassMapper.xml
Normal file
114
ruoyi/src/main/resources/mybatis/system/ByClassMapper.xml
Normal file
@ -0,0 +1,114 @@
|
||||
<?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.ByClassMapper">
|
||||
|
||||
<resultMap type="ByClass" id="ByClassResult">
|
||||
<result property="bjbh" column="bjbh" />
|
||||
<result property="schoolid" column="schoolid" />
|
||||
<result property="bjtype" column="bjtype" />
|
||||
<result property="bhxh" column="bhxh" />
|
||||
<result property="xn" column="xn" />
|
||||
<result property="bjmc" column="bjmc" />
|
||||
<result property="bjrych" column="bjrych" />
|
||||
<result property="jbny" column="jbny" />
|
||||
<result property="zbjs" column="zbjs" />
|
||||
<result property="pbjs" column="pbjs" />
|
||||
<result property="zljs" column="zljs" />
|
||||
<result property="isdel" column="isdel" />
|
||||
<result property="createtime" column="createtime" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectByClassVo">
|
||||
select bjbh, schoolid, bjtype, bhxh, xn, bjmc, bjrych, jbny, zbjs, pbjs, zljs, isdel, createtime from by_class
|
||||
</sql>
|
||||
|
||||
<select id="selectByClassList" parameterType="ByClass" resultMap="ByClassResult">
|
||||
<include refid="selectByClassVo"/>
|
||||
<where>
|
||||
<if test="schoolid != null and schoolid != ''"> and schoolid = #{schoolid}</if>
|
||||
<if test="bjtype != null and bjtype != ''"> and bjtype = #{bjtype}</if>
|
||||
<if test="bhxh != null "> and bhxh = #{bhxh}</if>
|
||||
<if test="xn != null and xn != ''"> and xn = #{xn}</if>
|
||||
<if test="bjmc != null and bjmc != ''"> and bjmc = #{bjmc}</if>
|
||||
<if test="bjrych != null and bjrych != ''"> and bjrych = #{bjrych}</if>
|
||||
<if test="jbny != null "> and jbny = #{jbny}</if>
|
||||
<if test="zbjs != null "> and zbjs = #{zbjs}</if>
|
||||
<if test="pbjs != null "> and pbjs = #{pbjs}</if>
|
||||
<if test="zljs != null "> and zljs = #{zljs}</if>
|
||||
<if test="isdel != null and isdel != ''"> and isdel = #{isdel}</if>
|
||||
<if test="createtime != null "> and createtime = #{createtime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectByClassById" parameterType="String" resultMap="ByClassResult">
|
||||
<include refid="selectByClassVo"/>
|
||||
where bjbh = #{bjbh}
|
||||
</select>
|
||||
|
||||
<insert id="insertByClass" parameterType="ByClass">
|
||||
insert into by_class
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="bjbh != null and bjbh != ''">bjbh,</if>
|
||||
<if test="schoolid != null and schoolid != ''">schoolid,</if>
|
||||
<if test="bjtype != null and bjtype != ''">bjtype,</if>
|
||||
<if test="bhxh != null ">bhxh,</if>
|
||||
<if test="xn != null and xn != ''">xn,</if>
|
||||
<if test="bjmc != null and bjmc != ''">bjmc,</if>
|
||||
<if test="bjrych != null and bjrych != ''">bjrych,</if>
|
||||
<if test="jbny != null ">jbny,</if>
|
||||
<if test="zbjs != null ">zbjs,</if>
|
||||
<if test="pbjs != null ">pbjs,</if>
|
||||
<if test="zljs != null ">zljs,</if>
|
||||
<if test="isdel != null and isdel != ''">isdel,</if>
|
||||
<if test="createtime != null ">createtime,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="bjbh != null and bjbh != ''">#{bjbh},</if>
|
||||
<if test="schoolid != null and schoolid != ''">#{schoolid},</if>
|
||||
<if test="bjtype != null and bjtype != ''">#{bjtype},</if>
|
||||
<if test="bhxh != null ">#{bhxh},</if>
|
||||
<if test="xn != null and xn != ''">#{xn},</if>
|
||||
<if test="bjmc != null and bjmc != ''">#{bjmc},</if>
|
||||
<if test="bjrych != null and bjrych != ''">#{bjrych},</if>
|
||||
<if test="jbny != null ">#{jbny},</if>
|
||||
<if test="zbjs != null ">#{zbjs},</if>
|
||||
<if test="pbjs != null ">#{pbjs},</if>
|
||||
<if test="zljs != null ">#{zljs},</if>
|
||||
<if test="isdel != null and isdel != ''">#{isdel},</if>
|
||||
<if test="createtime != null ">#{createtime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateByClass" parameterType="ByClass">
|
||||
update by_class
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="schoolid != null and schoolid != ''">schoolid = #{schoolid},</if>
|
||||
<if test="bjtype != null and bjtype != ''">bjtype = #{bjtype},</if>
|
||||
<if test="bhxh != null ">bhxh = #{bhxh},</if>
|
||||
<if test="xn != null and xn != ''">xn = #{xn},</if>
|
||||
<if test="bjmc != null and bjmc != ''">bjmc = #{bjmc},</if>
|
||||
<if test="bjrych != null and bjrych != ''">bjrych = #{bjrych},</if>
|
||||
<if test="jbny != null ">jbny = #{jbny},</if>
|
||||
<if test="zbjs != null ">zbjs = #{zbjs},</if>
|
||||
<if test="pbjs != null ">pbjs = #{pbjs},</if>
|
||||
<if test="zljs != null ">zljs = #{zljs},</if>
|
||||
<if test="isdel != null and isdel != ''">isdel = #{isdel},</if>
|
||||
<if test="createtime != null ">createtime = #{createtime},</if>
|
||||
</trim>
|
||||
where bjbh = #{bjbh}
|
||||
</update>
|
||||
|
||||
<delete id="deleteByClassById" parameterType="String">
|
||||
delete from by_class where bjbh = #{bjbh}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByClassByIds" parameterType="String">
|
||||
delete from by_class where bjbh in
|
||||
<foreach item="bjbh" collection="array" open="(" separator="," close=")">
|
||||
#{bjbh}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user