Commit 728ea388 by baochunxin

#添加学生获奖信息

parent cc5f141a
import request from '@/utils/request'
// 查询学生获奖-办公室列表
export function listBhs(query) {
return request({
url: '/awarkbhs/list',
method: 'get',
params: query
})
}
// 查询学生获奖-办公室详细
export function getBhs(id) {
return request({
url: '/awarkbhs/' + id,
method: 'get'
})
}
// 新增学生获奖-办公室
export function addBhs(data) {
return request({
url: '/awarkbhs',
method: 'post',
data: data
})
}
// 修改学生获奖-办公室
export function updateBhs(data) {
return request({
url: '/awarkbhs',
method: 'put',
data: data
})
}
// 删除学生获奖-办公室
export function delBhs(id) {
return request({
url: '/awarkbhs/' + id,
method: 'delete'
})
}
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="届" prop="session">
<el-select v-model="queryParams.session" placeholder="请选择届" clearable>
<el-option
v-for="dict in dict.type.rankda"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="年级" prop="grade">
<el-select v-model="queryParams.grade" placeholder="请选择年级" clearable>
<el-option
v-for="dict in dict.type.Grade"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="班级名称" prop="className">
<el-select v-model="queryParams.className" placeholder="请选择班级名称" clearable>
<el-option
v-for="dict in dict.type.Class"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="获奖级别" prop="awardType">
<el-select v-model="queryParams.awardType" placeholder="请选择获奖级别" clearable>
<el-option
v-for="dict in dict.type.student_award_rank"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="单位" prop="schoolUnit">
<el-input
v-model="queryParams.schoolUnit"
placeholder="请输入单位"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="指导老师" prop="guidanceTeacher">
<el-input
v-model="queryParams.guidanceTeacher"
placeholder="请输入指导老师"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="获奖时间" prop="awardTime">
<el-date-picker clearable
v-model="queryParams.awardTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择获奖时间">
</el-date-picker>
</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"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:bhs:add']"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:bhs:edit']"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:bhs:remove']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:bhs:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="bhsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<!-- <el-table-column label="${id}" align="center" prop="id"/>-->
<el-table-column label="届" align="center" prop="session">
<template slot-scope="scope">
<dict-tag :options="dict.type.rankda" :value="scope.row.session"/>
</template>
</el-table-column>
<el-table-column label="年级" align="center" prop="grade">
<template slot-scope="scope">
<dict-tag :options="dict.type.Grade" :value="scope.row.grade"/>
</template>
</el-table-column>
<el-table-column label="班级名称" align="center" prop="className">
<template slot-scope="scope">
<dict-tag :options="dict.type.Class" :value="scope.row.className"/>
</template>
</el-table-column>
<el-table-column label="获奖级别" align="center" prop="awardType">
<template slot-scope="scope">
<dict-tag :options="dict.type.student_award_rank" :value="scope.row.awardType"/>
</template>
</el-table-column>
<el-table-column label="名称" align="center" prop="name"/>
<el-table-column label="单位" align="center" prop="schoolUnit"/>
<el-table-column label="指导老师" align="center" prop="guidanceTeacher"/>
<el-table-column label="获奖时间" align="center" prop="awardTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.awardTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="附件" align="center" prop="file"/>
<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:bhs:edit']"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:bhs: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="800x" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="届" prop="session">
<el-select v-model="form.session" placeholder="请选择届" style="width: 100%;">
<el-option
v-for="dict in dict.type.rankda"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="年级" prop="grade">
<el-select v-model="form.grade" placeholder="请选择年级" style="width: 100%;">
<el-option
v-for="dict in dict.type.Grade"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="班级名称" prop="className">
<el-select v-model="form.className" placeholder="请选择班级名称" style="width: 100%;">
<el-option
v-for="dict in dict.type.Class"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="获奖级别" prop="awardType">
<el-select v-model="form.awardType" placeholder="请选择获奖级别" style="width: 100%;">
<el-option
v-for="dict in dict.type.student_award_rank"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="请输入名称" style="width: 100%;"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="schoolUnit">
<el-input v-model="form.schoolUnit" placeholder="请输入单位" style="width: 100%;"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="指导老师" prop="guidanceTeacher">
<el-input v-model="form.guidanceTeacher" placeholder="请输入指导老师" style="width: 100%;"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="获奖时间" prop="awardTime">
<el-date-picker clearable v-model="form.awardTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择获奖时间" style="width: 100%;"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<!-- 如果附件项需要单独一行,可以不放在 el-row -->
<el-form-item label="附件">
<file-upload v-model="form.file"></file-upload>
</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 {listBhs, getBhs, delBhs, addBhs, updateBhs} from "@/api/smartSchool/studenAwark/bhs";
export default {
name: "Bhs",
dicts: ['Class', 'Grade', 'rankda', 'student_award_rank'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 学生获奖-办公室表格数据
bhsList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
session: null,
grade: null,
className: null,
awardType: null,
name: null,
schoolUnit: null,
guidanceTeacher: null,
awardTime: null,
file: null
},
// 表单参数
form: {},
// 表单校验
rules: {
session: [
{required: true, message: "届不能为空", trigger: "change"}
],
grade: [
{required: true, message: "年级不能为空", trigger: "change"}
],
className: [
{required: true, message: "班级名称不能为空", trigger: "change"}
],
awardType: [
{required: true, message: "获奖级别不能为空", trigger: "change"}
],
name: [
{required: true, message: "名称不能为空", trigger: "blur"}
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询学生获奖-办公室列表 */
getList() {
this.loading = true;
listBhs(this.queryParams).then(response => {
this.bhsList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
session: null,
grade: null,
className: null,
awardType: null,
name: null,
schoolUnit: null,
guidanceTeacher: null,
awardTime: null,
file: null
};
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
getBhs(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改学生获奖-办公室";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateBhs(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addBhs(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除学生获奖-办公室编号为"' + ids + '"的数据项?').then(function () {
return delBhs(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/bhs/export', {
...this.queryParams
}, `bhs_${new Date().getTime()}.xlsx`)
}
}
};
</script>
package yangtz.cs.liu.campus.controller.studenAwardBgs;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import yangtz.cs.liu.campus.domain.studenAwardBgs.SchoolStudentAwardBhs;
import yangtz.cs.liu.campus.service.studenAwardBgs.ISchoolStudentAwardBhsService;
/**
* 学生获奖-办公室Controller
*
* @author ruoyi
* @date 2025-03-17
*/
@RestController
@RequestMapping("/awarkbhs")
public class SchoolStudentAwardBhsController extends BaseController
{
@Autowired
private ISchoolStudentAwardBhsService schoolStudentAwardBhsService;
/**
* 查询学生获奖-办公室列表
*/
@GetMapping("/list")
public TableDataInfo list(SchoolStudentAwardBhs schoolStudentAwardBhs)
{
startPage();
List<SchoolStudentAwardBhs> list = schoolStudentAwardBhsService.selectSchoolStudentAwardBhsList(schoolStudentAwardBhs);
return getDataTable(list);
}
/**
* 导出学生获奖-办公室列表
*/
@Log(title = "学生获奖-办公室", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SchoolStudentAwardBhs schoolStudentAwardBhs)
{
List<SchoolStudentAwardBhs> list = schoolStudentAwardBhsService.selectSchoolStudentAwardBhsList(schoolStudentAwardBhs);
ExcelUtil<SchoolStudentAwardBhs> util = new ExcelUtil<SchoolStudentAwardBhs>(SchoolStudentAwardBhs.class);
util.exportExcel(response, list, "学生获奖-办公室数据");
}
/**
* 获取学生获奖-办公室详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(schoolStudentAwardBhsService.selectSchoolStudentAwardBhsById(id));
}
/**
* 新增学生获奖-办公室
*/
@Log(title = "学生获奖-办公室", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SchoolStudentAwardBhs schoolStudentAwardBhs)
{
return toAjax(schoolStudentAwardBhsService.insertSchoolStudentAwardBhs(schoolStudentAwardBhs));
}
/**
* 修改学生获奖-办公室
*/
@Log(title = "学生获奖-办公室", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SchoolStudentAwardBhs schoolStudentAwardBhs)
{
return toAjax(schoolStudentAwardBhsService.updateSchoolStudentAwardBhs(schoolStudentAwardBhs));
}
/**
* 删除学生获奖-办公室
*/
@Log(title = "学生获奖-办公室", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(schoolStudentAwardBhsService.deleteSchoolStudentAwardBhsByIds(ids));
}
}
package yangtz.cs.liu.campus.domain.studenAwardBgs;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 学生获奖-办公室对象 school_student_award_bhs
*
* @author ruoyi
* @date 2025-03-17
*/
public class SchoolStudentAwardBhs extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* $column.columnComment
*/
private Long id;
/**
* 届
*/
@Excel(name = "届")
private String session;
/**
* 年级
*/
@Excel(name = "年级")
private String grade;
/**
* 班级名称
*/
@Excel(name = "班级名称")
private String className;
/**
* 获奖级别
*/
@Excel(name = "获奖级别")
private String awardType;
/**
* 名称
*/
@Excel(name = "名称")
private String name;
/**
* 单位
*/
@Excel(name = "单位")
private String schoolUnit;
/**
* 指导老师
*/
@Excel(name = "指导老师")
private String guidanceTeacher;
/**
* 获奖时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "获奖时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date awardTime;
/**
* 附件
*/
@Excel(name = "附件")
private String file;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setSession(String session) {
this.session = session;
}
public String getSession() {
return session;
}
public void setGrade(String grade) {
this.grade = grade;
}
public String getGrade() {
return grade;
}
public void setClassName(String className) {
this.className = className;
}
public String getClassName() {
return className;
}
public void setAwardType(String awardType) {
this.awardType = awardType;
}
public String getAwardType() {
return awardType;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setSchoolUnit(String schoolUnit) {
this.schoolUnit = schoolUnit;
}
public String getSchoolUnit() {
return schoolUnit;
}
public void setGuidanceTeacher(String guidanceTeacher) {
this.guidanceTeacher = guidanceTeacher;
}
public String getGuidanceTeacher() {
return guidanceTeacher;
}
public void setAwardTime(Date awardTime) {
this.awardTime = awardTime;
}
public Date getAwardTime() {
return awardTime;
}
public void setFile(String file) {
this.file = file;
}
public String getFile() {
return file;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("session", getSession())
.append("grade", getGrade())
.append("className", getClassName())
.append("awardType", getAwardType())
.append("name", getName())
.append("schoolUnit", getSchoolUnit())
.append("guidanceTeacher", getGuidanceTeacher())
.append("awardTime", getAwardTime())
.append("file", getFile())
.toString();
}
}
package yangtz.cs.liu.campus.mapper.studenAwardBgs;
import java.util.List;
import yangtz.cs.liu.campus.domain.studenAwardBgs.SchoolStudentAwardBhs;
/**
* 学生获奖-办公室Mapper接口
*
* @author ruoyi
* @date 2025-03-17
*/
public interface SchoolStudentAwardBhsMapper
{
/**
* 查询学生获奖-办公室
*
* @param id 学生获奖-办公室主键
* @return 学生获奖-办公室
*/
public SchoolStudentAwardBhs selectSchoolStudentAwardBhsById(Long id);
/**
* 查询学生获奖-办公室列表
*
* @param schoolStudentAwardBhs 学生获奖-办公室
* @return 学生获奖-办公室集合
*/
public List<SchoolStudentAwardBhs> selectSchoolStudentAwardBhsList(SchoolStudentAwardBhs schoolStudentAwardBhs);
/**
* 新增学生获奖-办公室
*
* @param schoolStudentAwardBhs 学生获奖-办公室
* @return 结果
*/
public int insertSchoolStudentAwardBhs(SchoolStudentAwardBhs schoolStudentAwardBhs);
/**
* 修改学生获奖-办公室
*
* @param schoolStudentAwardBhs 学生获奖-办公室
* @return 结果
*/
public int updateSchoolStudentAwardBhs(SchoolStudentAwardBhs schoolStudentAwardBhs);
/**
* 删除学生获奖-办公室
*
* @param id 学生获奖-办公室主键
* @return 结果
*/
public int deleteSchoolStudentAwardBhsById(Long id);
/**
* 批量删除学生获奖-办公室
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSchoolStudentAwardBhsByIds(Long[] ids);
}
package yangtz.cs.liu.campus.service.impl.studenAwardBgs;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yangtz.cs.liu.campus.domain.studenAwardBgs.SchoolStudentAwardBhs;
import yangtz.cs.liu.campus.mapper.studenAwardBgs.SchoolStudentAwardBhsMapper;
import yangtz.cs.liu.campus.service.studenAwardBgs.ISchoolStudentAwardBhsService;
/**
* 学生获奖-办公室Service业务层处理
*
* @author ruoyi
* @date 2025-03-17
*/
@Service
public class SchoolStudentAwardBhsServiceImpl implements ISchoolStudentAwardBhsService
{
@Autowired
private SchoolStudentAwardBhsMapper schoolStudentAwardBhsMapper;
/**
* 查询学生获奖-办公室
*
* @param id 学生获奖-办公室主键
* @return 学生获奖-办公室
*/
@Override
public SchoolStudentAwardBhs selectSchoolStudentAwardBhsById(Long id)
{
return schoolStudentAwardBhsMapper.selectSchoolStudentAwardBhsById(id);
}
/**
* 查询学生获奖-办公室列表
*
* @param schoolStudentAwardBhs 学生获奖-办公室
* @return 学生获奖-办公室
*/
@Override
public List<SchoolStudentAwardBhs> selectSchoolStudentAwardBhsList(SchoolStudentAwardBhs schoolStudentAwardBhs)
{
return schoolStudentAwardBhsMapper.selectSchoolStudentAwardBhsList(schoolStudentAwardBhs);
}
/**
* 新增学生获奖-办公室
*
* @param schoolStudentAwardBhs 学生获奖-办公室
* @return 结果
*/
@Override
public int insertSchoolStudentAwardBhs(SchoolStudentAwardBhs schoolStudentAwardBhs)
{
return schoolStudentAwardBhsMapper.insertSchoolStudentAwardBhs(schoolStudentAwardBhs);
}
/**
* 修改学生获奖-办公室
*
* @param schoolStudentAwardBhs 学生获奖-办公室
* @return 结果
*/
@Override
public int updateSchoolStudentAwardBhs(SchoolStudentAwardBhs schoolStudentAwardBhs)
{
return schoolStudentAwardBhsMapper.updateSchoolStudentAwardBhs(schoolStudentAwardBhs);
}
/**
* 批量删除学生获奖-办公室
*
* @param ids 需要删除的学生获奖-办公室主键
* @return 结果
*/
@Override
public int deleteSchoolStudentAwardBhsByIds(Long[] ids)
{
return schoolStudentAwardBhsMapper.deleteSchoolStudentAwardBhsByIds(ids);
}
/**
* 删除学生获奖-办公室信息
*
* @param id 学生获奖-办公室主键
* @return 结果
*/
@Override
public int deleteSchoolStudentAwardBhsById(Long id)
{
return schoolStudentAwardBhsMapper.deleteSchoolStudentAwardBhsById(id);
}
}
package yangtz.cs.liu.campus.service.studenAwardBgs;
import yangtz.cs.liu.campus.domain.studenAwardBgs.SchoolStudentAwardBhs;
import java.util.List;
/**
* 学生获奖-办公室Service接口
*
* @author ruoyi
* @date 2025-03-17
*/
public interface ISchoolStudentAwardBhsService
{
/**
* 查询学生获奖-办公室
*
* @param id 学生获奖-办公室主键
* @return 学生获奖-办公室
*/
public SchoolStudentAwardBhs selectSchoolStudentAwardBhsById(Long id);
/**
* 查询学生获奖-办公室列表
*
* @param schoolStudentAwardBhs 学生获奖-办公室
* @return 学生获奖-办公室集合
*/
public List<SchoolStudentAwardBhs> selectSchoolStudentAwardBhsList(SchoolStudentAwardBhs schoolStudentAwardBhs);
/**
* 新增学生获奖-办公室
*
* @param schoolStudentAwardBhs 学生获奖-办公室
* @return 结果
*/
public int insertSchoolStudentAwardBhs(SchoolStudentAwardBhs schoolStudentAwardBhs);
/**
* 修改学生获奖-办公室
*
* @param schoolStudentAwardBhs 学生获奖-办公室
* @return 结果
*/
public int updateSchoolStudentAwardBhs(SchoolStudentAwardBhs schoolStudentAwardBhs);
/**
* 批量删除学生获奖-办公室
*
* @param ids 需要删除的学生获奖-办公室主键集合
* @return 结果
*/
public int deleteSchoolStudentAwardBhsByIds(Long[] ids);
/**
* 删除学生获奖-办公室信息
*
* @param id 学生获奖-办公室主键
* @return 结果
*/
public int deleteSchoolStudentAwardBhsById(Long id);
}
<?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="yangtz.cs.liu.campus.mapper.studenAwardBgs.SchoolStudentAwardBhsMapper">
<resultMap type="SchoolStudentAwardBhs" id="SchoolStudentAwardBhsResult">
<result property="id" column="id" />
<result property="session" column="session" />
<result property="grade" column="grade" />
<result property="className" column="class_name" />
<result property="awardType" column="award_type" />
<result property="name" column="name" />
<result property="schoolUnit" column="school_unit" />
<result property="guidanceTeacher" column="guidance_teacher" />
<result property="awardTime" column="award_time" />
<result property="file" column="file" />
</resultMap>
<sql id="selectSchoolStudentAwardBhsVo">
select id, session, grade, class_name, award_type, name, school_unit, guidance_teacher, award_time, file from school_student_award_bhs
</sql>
<select id="selectSchoolStudentAwardBhsList" parameterType="SchoolStudentAwardBhs" resultMap="SchoolStudentAwardBhsResult">
<include refid="selectSchoolStudentAwardBhsVo"/>
<where>
<if test="session != null and session != ''"> and session = #{session}</if>
<if test="grade != null and grade != ''"> and grade = #{grade}</if>
<if test="className != null and className != ''"> and class_name like concat('%', #{className}, '%')</if>
<if test="awardType != null and awardType != ''"> and award_type = #{awardType}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="schoolUnit != null and schoolUnit != ''"> and school_unit = #{schoolUnit}</if>
<if test="guidanceTeacher != null and guidanceTeacher != ''"> and guidance_teacher = #{guidanceTeacher}</if>
<if test="awardTime != null "> and award_time = #{awardTime}</if>
<if test="file != null and file != ''"> and file = #{file}</if>
</where>
</select>
<select id="selectSchoolStudentAwardBhsById" parameterType="Long" resultMap="SchoolStudentAwardBhsResult">
<include refid="selectSchoolStudentAwardBhsVo"/>
where id = #{id}
</select>
<insert id="insertSchoolStudentAwardBhs" parameterType="SchoolStudentAwardBhs" useGeneratedKeys="true" keyProperty="id">
insert into school_student_award_bhs
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="session != null and session != ''">session,</if>
<if test="grade != null and grade != ''">grade,</if>
<if test="className != null and className != ''">class_name,</if>
<if test="awardType != null and awardType != ''">award_type,</if>
<if test="name != null and name != ''">name,</if>
<if test="schoolUnit != null">school_unit,</if>
<if test="guidanceTeacher != null">guidance_teacher,</if>
<if test="awardTime != null">award_time,</if>
<if test="file != null">file,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="session != null and session != ''">#{session},</if>
<if test="grade != null and grade != ''">#{grade},</if>
<if test="className != null and className != ''">#{className},</if>
<if test="awardType != null and awardType != ''">#{awardType},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="schoolUnit != null">#{schoolUnit},</if>
<if test="guidanceTeacher != null">#{guidanceTeacher},</if>
<if test="awardTime != null">#{awardTime},</if>
<if test="file != null">#{file},</if>
</trim>
</insert>
<update id="updateSchoolStudentAwardBhs" parameterType="SchoolStudentAwardBhs">
update school_student_award_bhs
<trim prefix="SET" suffixOverrides=",">
<if test="session != null and session != ''">session = #{session},</if>
<if test="grade != null and grade != ''">grade = #{grade},</if>
<if test="className != null and className != ''">class_name = #{className},</if>
<if test="awardType != null and awardType != ''">award_type = #{awardType},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="schoolUnit != null">school_unit = #{schoolUnit},</if>
<if test="guidanceTeacher != null">guidance_teacher = #{guidanceTeacher},</if>
<if test="awardTime != null">award_time = #{awardTime},</if>
<if test="file != null">file = #{file},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSchoolStudentAwardBhsById" parameterType="Long">
delete from school_student_award_bhs where id = #{id}
</delete>
<delete id="deleteSchoolStudentAwardBhsByIds" parameterType="String">
delete from school_student_award_bhs where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment