diff --git a/ruoyi-ui/src/api/benyi/recruitstudentsnotice.js b/ruoyi-ui/src/api/benyi/recruitstudentsnotice.js new file mode 100644 index 000000000..40e629a4f --- /dev/null +++ b/ruoyi-ui/src/api/benyi/recruitstudentsnotice.js @@ -0,0 +1,61 @@ +import request from '@/utils/request' + +// 查询入园通知书列表 +export function listNotice(query) { + return request({ + url: '/benyi/recruitstudentsnotice/list', + method: 'get', + params: query + }) +} + +// 查询入园通知书详细 +export function getNotice(id) { + return request({ + url: '/benyi/recruitstudentsnotice/' + id, + method: 'get' + }) +} + +// 新增入园通知书 +export function addNotice(data) { + return request({ + url: '/benyi/recruitstudentsnotice', + method: 'post', + data: data + }) +} + +// 修改入园通知书 +export function updateNotice(data) { + return request({ + url: '/benyi/recruitstudentsnotice', + method: 'put', + data: data + }) +} + +// 删除入园通知书 +export function delNotice(id) { + return request({ + url: '/benyi/recruitstudentsnotice/' + id, + method: 'delete' + }) +} + +// 复制入园通知书 +export function copyNotice(id) { + return request({ + url: '/benyi/recruitstudentsnotice/copy/' + id, + method: 'post' + }) +} + +// 导出入园通知书 +export function exportNotice(query) { + return request({ + url: '/benyi/recruitstudentsnotice/export', + method: 'get', + params: query + }) +} diff --git a/ruoyi-ui/src/views/benyi/recruitstudentsnotice/index.vue b/ruoyi-ui/src/views/benyi/recruitstudentsnotice/index.vue new file mode 100644 index 000000000..f2abec320 --- /dev/null +++ b/ruoyi-ui/src/views/benyi/recruitstudentsnotice/index.vue @@ -0,0 +1,336 @@ +<template> + <div class="app-container"> + <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"> + <el-form-item label="标题" prop="title"> + <el-input + v-model="queryParams.title" + placeholder="请输入标题" + clearable + size="small" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="类型" prop="type"> + <el-select v-model="queryParams.type" placeholder="请选择"> + <el-option + v-for="dict in typeOptions" + :key="dict.dictValue" + :label="dict.dictLabel" + :value="dict.dictValue" + ></el-option> + </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="['benyi:recruitstudentsnotice: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="['benyi:recruitstudentsnotice: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="['benyi:recruitstudentsnotice:remove']" + >删除</el-button> + </el-col>--> + </el-row> + + <el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" align="center" /> + <el-table-column label="编号" align="center" prop="id" /> + <el-table-column label="标题" align="center" prop="title" /> + <el-table-column label="类型" align="center" prop="type" :formatter="typeFormat" /> + <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="handleCopy(scope.row)" + v-hasPermi="['benyi:recruitstudentsnotice:edit']" + v-show="!selectable(scope.row)" + >复制</el-button> + <el-button + size="mini" + type="text" + icon="el-icon-edit" + @click="handleUpdate(scope.row)" + v-hasPermi="['benyi:recruitstudentsnotice:edit']" + v-show="selectable(scope.row)" + >修改</el-button> + <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete(scope.row)" + v-hasPermi="['benyi:recruitstudentsnotice:remove']" + v-show="selectable(scope.row)" + >删除</el-button> + <el-button + size="mini" + type="text" + icon="el-icon-view" + @click="handleView(scope.row,scope.index)" + v-hasPermi="['benyi:recruitstudentsnotice:query']" + >详细</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="800px" append-to-body> + <el-form ref="form" :model="form" :rules="rules" label-width="80px"> + <el-form-item label="标题" prop="title"> + <el-input v-model="form.title" placeholder="请输入标题" /> + </el-form-item> + <el-form-item label="内容" prop="content"> + <Editor v-model="form.content" placeholder="请输入内容" /> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" v-show="isshow" @click="submitForm">确 定</el-button> + <el-button @click="cancel">取 消</el-button> + </div> + </el-dialog> + </div> +</template> + +<script> +import { + listNotice, + getNotice, + delNotice, + addNotice, + updateNotice, + copyNotice, +} from "@/api/benyi/recruitstudentsnotice"; + +import Editor from "@/components/Editor"; + +export default { + name: "Notice", + components: { + Editor, + }, + data() { + return { + // 遮罩层 + loading: true, + // 选中数组 + ids: [], + // 非单个禁用 + single: true, + // 非多个禁用 + multiple: true, + // 总条数 + total: 0, + // 入园通知书表格数据 + noticeList: [], + //字典翻译 + typeOptions: [], + // 弹出层标题 + title: "", + // 是否显示弹出层 + open: false, + isshow: true, + // 查询参数 + queryParams: { + pageNum: 1, + pageSize: 10, + title: undefined, + content: undefined, + type: undefined, + schoolid: undefined, + }, + // 表单参数 + form: {}, + // 表单校验 + rules: {}, + }; + }, + created() { + this.getList(); + this.getDicts("sys_dm_noticetype").then((response) => { + this.typeOptions = response.data; + }); + }, + methods: { + //能否选中 + selectable(row) { + if (row.type == "1") { + return false; + } else { + return true; + } + }, + // 字典翻译 + typeFormat(row, column) { + return this.selectDictLabel(this.typeOptions, row.type); + }, + /** 查询入园通知书列表 */ + getList() { + this.loading = true; + listNotice(this.queryParams).then((response) => { + this.noticeList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + // 取消按钮 + cancel() { + this.open = false; + this.reset(); + }, + // 表单重置 + reset() { + this.form = { + id: undefined, + title: undefined, + content: undefined, + type: undefined, + schoolid: 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; + }, + /** 详细按钮操作 */ + handleView(row) { + this.reset(); + const id = row.id || this.ids; + getNotice(id).then((response) => { + this.form = response.data; + this.open = true; + this.title = "入园通知书详情"; + this.isshow = false; + }); + }, + /** 新增按钮操作 */ + handleAdd() { + this.reset(); + this.open = true; + this.title = "添加入园通知书"; + this.isshow = true; + }, + /** 修改按钮操作 */ + handleUpdate(row) { + this.reset(); + const id = row.id || this.ids; + getNotice(id).then((response) => { + this.form = response.data; + this.open = true; + this.title = "修改入园通知书"; + this.isshow = true; + }); + }, + /** 提交按钮 */ + submitForm: function () { + this.$refs["form"].validate((valid) => { + if (valid) { + if (this.form.id != undefined) { + updateNotice(this.form).then((response) => { + if (response.code === 200) { + this.msgSuccess("修改成功"); + this.open = false; + this.getList(); + } + }); + } else { + addNotice(this.form).then((response) => { + if (response.code === 200) { + this.msgSuccess("新增成功"); + this.open = false; + this.getList(); + } + }); + } + } + }); + }, + /** 删除按钮操作 */ + handleDelete(row) { + const ids = row.id || this.ids; + this.$confirm( + '是否确认删除入园通知书编号为"' + ids + '"的数据项?', + "警告", + { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + } + ) + .then(function () { + return delNotice(ids); + }) + .then(() => { + this.getList(); + this.msgSuccess("删除成功"); + }) + .catch(function () {}); + }, + /** 复制按钮操作 */ + handleCopy(row) { + const id = row.id || this.ids; + this.$confirm('确认复制入园通知书编号为"' + id + '"的数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(function () { + return copyNotice(id); + }) + .then(() => { + this.getList(); + this.msgSuccess("复制成功"); + }) + .catch(function () {}); + }, + }, +}; +</script> \ No newline at end of file diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByRecruitstudentsNoticeController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByRecruitstudentsNoticeController.java new file mode 100644 index 000000000..9ef681a99 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByRecruitstudentsNoticeController.java @@ -0,0 +1,136 @@ +package com.ruoyi.project.benyi.controller; + +import java.util.List; + +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.project.common.SchoolCommon; +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.benyi.domain.ByRecruitstudentsNotice; +import com.ruoyi.project.benyi.service.IByRecruitstudentsNoticeService; +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-07-28 + */ +@RestController +@RequestMapping("/benyi/recruitstudentsnotice") +public class ByRecruitstudentsNoticeController extends BaseController { + @Autowired + private IByRecruitstudentsNoticeService byRecruitstudentsNoticeService; + @Autowired + private SchoolCommon schoolCommon; + + /** + * 查询入园通知书列表 + */ + @PreAuthorize("@ss.hasPermi('benyi:recruitstudentsnotice:list')") + @GetMapping("/list") + public TableDataInfo list(ByRecruitstudentsNotice byRecruitstudentsNotice) { + byRecruitstudentsNotice.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId()); + startPage(); + List<ByRecruitstudentsNotice> list = byRecruitstudentsNoticeService.selectByRecruitstudentsNoticeList(byRecruitstudentsNotice); + return getDataTable(list); + } + + /** + * 导出入园通知书列表 + */ + @PreAuthorize("@ss.hasPermi('benyi:recruitstudentsnotice:export')") + @Log(title = "入园通知书", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ByRecruitstudentsNotice byRecruitstudentsNotice) { + List<ByRecruitstudentsNotice> list = byRecruitstudentsNoticeService.selectByRecruitstudentsNoticeList(byRecruitstudentsNotice); + ExcelUtil<ByRecruitstudentsNotice> util = new ExcelUtil<ByRecruitstudentsNotice>(ByRecruitstudentsNotice.class); + return util.exportExcel(list, "notice"); + } + + /** + * 获取入园通知书详细信息 + */ + @PreAuthorize("@ss.hasPermi('benyi:recruitstudentsnotice:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(byRecruitstudentsNoticeService.selectByRecruitstudentsNoticeById(id)); + } + + /** + * 新增入园通知书 + */ + @PreAuthorize("@ss.hasPermi('benyi:recruitstudentsnotice:add')") + @Log(title = "入园通知书", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ByRecruitstudentsNotice byRecruitstudentsNotice) { + //首先判断当前账户是否为幼儿园账号 + if (schoolCommon.isSchool()) { + byRecruitstudentsNotice.setType("2"); + byRecruitstudentsNotice.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId()); + } else { + byRecruitstudentsNotice.setType("1"); + } + return toAjax(byRecruitstudentsNoticeService.insertByRecruitstudentsNotice(byRecruitstudentsNotice)); + } + + /** + * 修改入园通知书 + */ + @PreAuthorize("@ss.hasPermi('benyi:recruitstudentsnotice:edit')") + @Log(title = "入园通知书", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ByRecruitstudentsNotice byRecruitstudentsNotice) { + return toAjax(byRecruitstudentsNoticeService.updateByRecruitstudentsNotice(byRecruitstudentsNotice)); + } + + /** + * 删除入园通知书 + */ + @PreAuthorize("@ss.hasPermi('benyi:recruitstudentsnotice:edit')") + @Log(title = "入园通知书", businessType = BusinessType.INSERT) + @PostMapping("/copy/{id}") + public AjaxResult copy(@PathVariable Long id) { + System.out.println("id===" + id); + ByRecruitstudentsNotice byRecruitstudentsNotice = byRecruitstudentsNoticeService.selectByRecruitstudentsNoticeById(id); + ByRecruitstudentsNotice byRecruitstudentsNoticeCopy = new ByRecruitstudentsNotice(); + byRecruitstudentsNoticeCopy.setType("2"); + byRecruitstudentsNoticeCopy.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId()); + byRecruitstudentsNoticeCopy.setContent(byRecruitstudentsNotice.getContent()); + byRecruitstudentsNoticeCopy.setTitle(byRecruitstudentsNotice.getTitle()); + + return toAjax(byRecruitstudentsNoticeService.insertByRecruitstudentsNotice(byRecruitstudentsNoticeCopy)); + } + + /** + * 删除入园通知书 + */ + @PreAuthorize("@ss.hasPermi('benyi:recruitstudentsnotice:remove')") + @Log(title = "入园通知书", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + //判断id是否为系统定义 + for (int i = 0; i < ids.length; i++) { + Long id = ids[i]; + ByRecruitstudentsNotice byRecruitstudentsNotice = byRecruitstudentsNoticeService.selectByRecruitstudentsNoticeById(id); + if (byRecruitstudentsNotice.getType() == "1") { + return AjaxResult.error("包含系统通知书,无法删除"); + } + } + + return toAjax(byRecruitstudentsNoticeService.deleteByRecruitstudentsNoticeByIds(ids)); + } +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByRecruitstudentsNotice.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByRecruitstudentsNotice.java new file mode 100644 index 000000000..2be654f7f --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByRecruitstudentsNotice.java @@ -0,0 +1,97 @@ +package com.ruoyi.project.benyi.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; + +/** + * 入园通知书对象 by_recruitstudents_notice + * + * @author tsbz + * @date 2020-07-28 + */ +public class ByRecruitstudentsNotice extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 编号 + */ + private Long id; + + /** + * 标题 + */ + @Excel(name = "标题") + private String title; + + /** + * 内容 + */ + @Excel(name = "内容") + private String content; + + /** + * 类型 + */ + @Excel(name = "类型") + private String type; + + /** + * 所属学校 + */ + @Excel(name = "所属学校") + private Long schoolid; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getTitle() { + return title; + } + + public void setContent(String content) { + this.content = content; + } + + public String getContent() { + return content; + } + + public void setType(String type) { + this.type = type; + } + + public String getType() { + return type; + } + + public void setSchoolid(Long schoolid) { + this.schoolid = schoolid; + } + + public Long getSchoolid() { + return schoolid; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("title", getTitle()) + .append("content", getContent()) + .append("type", getType()) + .append("schoolid", getSchoolid()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByRecruitstudentsNoticeMapper.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByRecruitstudentsNoticeMapper.java new file mode 100644 index 000000000..209cdfe60 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByRecruitstudentsNoticeMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.benyi.mapper; + +import java.util.List; +import com.ruoyi.project.benyi.domain.ByRecruitstudentsNotice; + +/** + * 入园通知书Mapper接口 + * + * @author tsbz + * @date 2020-07-28 + */ +public interface ByRecruitstudentsNoticeMapper +{ + /** + * 查询入园通知书 + * + * @param id 入园通知书ID + * @return 入园通知书 + */ + public ByRecruitstudentsNotice selectByRecruitstudentsNoticeById(Long id); + + /** + * 查询入园通知书列表 + * + * @param byRecruitstudentsNotice 入园通知书 + * @return 入园通知书集合 + */ + public List<ByRecruitstudentsNotice> selectByRecruitstudentsNoticeList(ByRecruitstudentsNotice byRecruitstudentsNotice); + + /** + * 新增入园通知书 + * + * @param byRecruitstudentsNotice 入园通知书 + * @return 结果 + */ + public int insertByRecruitstudentsNotice(ByRecruitstudentsNotice byRecruitstudentsNotice); + + /** + * 修改入园通知书 + * + * @param byRecruitstudentsNotice 入园通知书 + * @return 结果 + */ + public int updateByRecruitstudentsNotice(ByRecruitstudentsNotice byRecruitstudentsNotice); + + /** + * 删除入园通知书 + * + * @param id 入园通知书ID + * @return 结果 + */ + public int deleteByRecruitstudentsNoticeById(Long id); + + /** + * 批量删除入园通知书 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteByRecruitstudentsNoticeByIds(Long[] ids); +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByRecruitstudentsNoticeService.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByRecruitstudentsNoticeService.java new file mode 100644 index 000000000..1fb696305 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByRecruitstudentsNoticeService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.benyi.service; + +import java.util.List; + +import com.ruoyi.project.benyi.domain.ByRecruitstudentsNotice; + +/** + * 入园通知书Service接口 + * + * @author tsbz + * @date 2020-07-28 + */ +public interface IByRecruitstudentsNoticeService { + /** + * 查询入园通知书 + * + * @param id 入园通知书ID + * @return 入园通知书 + */ + public ByRecruitstudentsNotice selectByRecruitstudentsNoticeById(Long id); + + /** + * 查询入园通知书列表 + * + * @param byRecruitstudentsNotice 入园通知书 + * @return 入园通知书集合 + */ + public List<ByRecruitstudentsNotice> selectByRecruitstudentsNoticeList(ByRecruitstudentsNotice byRecruitstudentsNotice); + + /** + * 新增入园通知书 + * + * @param byRecruitstudentsNotice 入园通知书 + * @return 结果 + */ + public int insertByRecruitstudentsNotice(ByRecruitstudentsNotice byRecruitstudentsNotice); + + /** + * 修改入园通知书 + * + * @param byRecruitstudentsNotice 入园通知书 + * @return 结果 + */ + public int updateByRecruitstudentsNotice(ByRecruitstudentsNotice byRecruitstudentsNotice); + + /** + * 批量删除入园通知书 + * + * @param ids 需要删除的入园通知书ID + * @return 结果 + */ + public int deleteByRecruitstudentsNoticeByIds(Long[] ids); + + /** + * 删除入园通知书信息 + * + * @param id 入园通知书ID + * @return 结果 + */ + public int deleteByRecruitstudentsNoticeById(Long id); +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByRecruitstudentsNoticeServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByRecruitstudentsNoticeServiceImpl.java new file mode 100644 index 000000000..70a01d0dd --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByRecruitstudentsNoticeServiceImpl.java @@ -0,0 +1,89 @@ +package com.ruoyi.project.benyi.service.impl; + +import java.util.List; + +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.benyi.mapper.ByRecruitstudentsNoticeMapper; +import com.ruoyi.project.benyi.domain.ByRecruitstudentsNotice; +import com.ruoyi.project.benyi.service.IByRecruitstudentsNoticeService; + +/** + * 入园通知书Service业务层处理 + * + * @author tsbz + * @date 2020-07-28 + */ +@Service +public class ByRecruitstudentsNoticeServiceImpl implements IByRecruitstudentsNoticeService { + @Autowired + private ByRecruitstudentsNoticeMapper byRecruitstudentsNoticeMapper; + + /** + * 查询入园通知书 + * + * @param id 入园通知书ID + * @return 入园通知书 + */ + @Override + public ByRecruitstudentsNotice selectByRecruitstudentsNoticeById(Long id) { + return byRecruitstudentsNoticeMapper.selectByRecruitstudentsNoticeById(id); + } + + /** + * 查询入园通知书列表 + * + * @param byRecruitstudentsNotice 入园通知书 + * @return 入园通知书 + */ + @Override + public List<ByRecruitstudentsNotice> selectByRecruitstudentsNoticeList(ByRecruitstudentsNotice byRecruitstudentsNotice) { + return byRecruitstudentsNoticeMapper.selectByRecruitstudentsNoticeList(byRecruitstudentsNotice); + } + + /** + * 新增入园通知书 + * + * @param byRecruitstudentsNotice 入园通知书 + * @return 结果 + */ + @Override + public int insertByRecruitstudentsNotice(ByRecruitstudentsNotice byRecruitstudentsNotice) { + byRecruitstudentsNotice.setCreateTime(DateUtils.getNowDate()); + return byRecruitstudentsNoticeMapper.insertByRecruitstudentsNotice(byRecruitstudentsNotice); + } + + /** + * 修改入园通知书 + * + * @param byRecruitstudentsNotice 入园通知书 + * @return 结果 + */ + @Override + public int updateByRecruitstudentsNotice(ByRecruitstudentsNotice byRecruitstudentsNotice) { + return byRecruitstudentsNoticeMapper.updateByRecruitstudentsNotice(byRecruitstudentsNotice); + } + + /** + * 批量删除入园通知书 + * + * @param ids 需要删除的入园通知书ID + * @return 结果 + */ + @Override + public int deleteByRecruitstudentsNoticeByIds(Long[] ids) { + return byRecruitstudentsNoticeMapper.deleteByRecruitstudentsNoticeByIds(ids); + } + + /** + * 删除入园通知书信息 + * + * @param id 入园通知书ID + * @return 结果 + */ + @Override + public int deleteByRecruitstudentsNoticeById(Long id) { + return byRecruitstudentsNoticeMapper.deleteByRecruitstudentsNoticeById(id); + } +} diff --git a/ruoyi/src/main/resources/mybatis/benyi/ByRecruitstudentsNoticeMapper.xml b/ruoyi/src/main/resources/mybatis/benyi/ByRecruitstudentsNoticeMapper.xml new file mode 100644 index 000000000..f23c4a70c --- /dev/null +++ b/ruoyi/src/main/resources/mybatis/benyi/ByRecruitstudentsNoticeMapper.xml @@ -0,0 +1,77 @@ +<?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.benyi.mapper.ByRecruitstudentsNoticeMapper"> + + <resultMap type="ByRecruitstudentsNotice" id="ByRecruitstudentsNoticeResult"> + <result property="id" column="id"/> + <result property="title" column="title"/> + <result property="content" column="content"/> + <result property="type" column="type"/> + <result property="schoolid" column="schoolid"/> + <result property="createTime" column="create_time"/> + </resultMap> + + <sql id="selectByRecruitstudentsNoticeVo"> + select id, title, content, type, schoolid, create_time from by_recruitstudents_notice + </sql> + + <select id="selectByRecruitstudentsNoticeList" parameterType="ByRecruitstudentsNotice" + resultMap="ByRecruitstudentsNoticeResult"> + <include refid="selectByRecruitstudentsNoticeVo"/> + where type='1' + <if test="title != null and title != ''">and title like concat('%', #{title}, '%')</if> + <if test="content != null and content != ''">and content = #{content}</if> + <if test="type != null and type != ''">and type = #{type}</if> + <if test="schoolid != null ">or schoolid = #{schoolid}</if> + </select> + + <select id="selectByRecruitstudentsNoticeById" parameterType="Long" resultMap="ByRecruitstudentsNoticeResult"> + <include refid="selectByRecruitstudentsNoticeVo"/> + where id = #{id} + </select> + + <insert id="insertByRecruitstudentsNotice" parameterType="ByRecruitstudentsNotice" useGeneratedKeys="true" + keyProperty="id"> + insert into by_recruitstudents_notice + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="title != null and title != ''">title,</if> + <if test="content != null and content != ''">content,</if> + <if test="type != null and type != ''">type,</if> + <if test="schoolid != null ">schoolid,</if> + <if test="createTime != null ">create_time,</if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="title != null and title != ''">#{title},</if> + <if test="content != null and content != ''">#{content},</if> + <if test="type != null and type != ''">#{type},</if> + <if test="schoolid != null ">#{schoolid},</if> + <if test="createTime != null ">#{createTime},</if> + </trim> + </insert> + + <update id="updateByRecruitstudentsNotice" parameterType="ByRecruitstudentsNotice"> + update by_recruitstudents_notice + <trim prefix="SET" suffixOverrides=","> + <if test="title != null and title != ''">title = #{title},</if> + <if test="content != null and content != ''">content = #{content},</if> + <if test="type != null and type != ''">type = #{type},</if> + <if test="schoolid != null ">schoolid = #{schoolid},</if> + <if test="createTime != null ">create_time = #{createTime},</if> + </trim> + where id = #{id} + </update> + + <delete id="deleteByRecruitstudentsNoticeById" parameterType="Long"> + delete from by_recruitstudents_notice where id = #{id} + </delete> + + <delete id="deleteByRecruitstudentsNoticeByIds" parameterType="String"> + delete from by_recruitstudents_notice where id in + <foreach item="id" collection="array" open="(" separator="," close=")"> + #{id} + </foreach> + </delete> + +</mapper> \ No newline at end of file