家庭教育手册
This commit is contained in:
parent
7e1a6efc27
commit
0671fee1fc
ruoyi-ui/src
ruoyi/src/main
java/com/ruoyi/project/benyi
controller
domain
mapper
service
resources/mybatis/benyi
53
ruoyi-ui/src/api/benyi/familyedu.js
Normal file
53
ruoyi-ui/src/api/benyi/familyedu.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询家庭教育列表
|
||||
export function listFamilyedu(query) {
|
||||
return request({
|
||||
url: "/benyi/familyedu/list",
|
||||
method: "get",
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
// 查询家庭教育详细
|
||||
export function getFamilyedu(id) {
|
||||
return request({
|
||||
url: "/benyi/familyedu/" + id,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
// 新增家庭教育
|
||||
export function addFamilyedu(data) {
|
||||
return request({
|
||||
url: "/benyi/familyedu",
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 修改家庭教育
|
||||
export function updateFamilyedu(data) {
|
||||
return request({
|
||||
url: "/benyi/familyedu",
|
||||
method: "put",
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 删除家庭教育
|
||||
export function delFamilyedu(id) {
|
||||
return request({
|
||||
url: "/benyi/familyedu/" + id,
|
||||
method: "delete"
|
||||
});
|
||||
}
|
||||
|
||||
// 导出家庭教育
|
||||
export function exportFamilyedu(query) {
|
||||
return request({
|
||||
url: "/benyi/familyedu/export",
|
||||
method: "get",
|
||||
params: query
|
||||
});
|
||||
}
|
293
ruoyi-ui/src/views/benyi/familyedu/index.vue
Normal file
293
ruoyi-ui/src/views/benyi/familyedu/index.vue
Normal file
@ -0,0 +1,293 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
:inline="true"
|
||||
label-width="70px"
|
||||
>
|
||||
<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>
|
||||
<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:familyedu: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:familyedu: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:familyedu:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="familyeduList"
|
||||
@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="parentid" />
|
||||
<el-table-column label="标题" align="center" prop="title" />
|
||||
<el-table-column label="内容" align="center" prop="content" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="序号" align="center" prop="sort" />
|
||||
<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="['benyi:familyedu:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['benyi:familyedu: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" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="父节点" prop="parentid">
|
||||
<el-input v-model="form.parentid" placeholder="请输入父节点" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input
|
||||
v-model="form.title"
|
||||
type="textarea"
|
||||
placeholder="请输入内容"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="内容" prop="content">
|
||||
<el-input v-model="form.content" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="序号" prop="sort">
|
||||
<el-input v-model="form.sort" 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 {
|
||||
listFamilyedu,
|
||||
getFamilyedu,
|
||||
delFamilyedu,
|
||||
addFamilyedu,
|
||||
updateFamilyedu,
|
||||
} from "@/api/benyi/familyedu";
|
||||
|
||||
export default {
|
||||
name: "Familyedu",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 家庭教育表格数据
|
||||
familyeduList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
parentid: undefined,
|
||||
title: undefined,
|
||||
content: undefined,
|
||||
sort: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询家庭教育列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listFamilyedu(this.queryParams).then((response) => {
|
||||
this.familyeduList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
parentid: undefined,
|
||||
title: undefined,
|
||||
content: undefined,
|
||||
sort: 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;
|
||||
getFamilyedu(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) {
|
||||
updateFamilyedu(this.form).then((response) => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addFamilyedu(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 delFamilyedu(ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(function () {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -0,0 +1,97 @@
|
||||
package com.ruoyi.project.benyi.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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.ByFamilyedu;
|
||||
import com.ruoyi.project.benyi.service.IByFamilyeduService;
|
||||
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 2021-06-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/benyi/familyedu")
|
||||
public class ByFamilyeduController extends BaseController {
|
||||
@Autowired
|
||||
private IByFamilyeduService byFamilyeduService;
|
||||
|
||||
/**
|
||||
* 查询家庭教育列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:familyedu:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ByFamilyedu byFamilyedu) {
|
||||
startPage();
|
||||
List<ByFamilyedu> list = byFamilyeduService.selectByFamilyeduList(byFamilyedu);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出家庭教育列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:familyedu:export')")
|
||||
@Log(title = "家庭教育", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(ByFamilyedu byFamilyedu) {
|
||||
List<ByFamilyedu> list = byFamilyeduService.selectByFamilyeduList(byFamilyedu);
|
||||
ExcelUtil<ByFamilyedu> util = new ExcelUtil<ByFamilyedu>(ByFamilyedu.class);
|
||||
return util.exportExcel(list, "familyedu");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取家庭教育详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:familyedu:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(byFamilyeduService.selectByFamilyeduById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增家庭教育
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:familyedu:add')")
|
||||
@Log(title = "家庭教育", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ByFamilyedu byFamilyedu) {
|
||||
return toAjax(byFamilyeduService.insertByFamilyedu(byFamilyedu));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改家庭教育
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:familyedu:edit')")
|
||||
@Log(title = "家庭教育", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ByFamilyedu byFamilyedu) {
|
||||
return toAjax(byFamilyeduService.updateByFamilyedu(byFamilyedu));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除家庭教育
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:familyedu:remove')")
|
||||
@Log(title = "家庭教育", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(byFamilyeduService.deleteByFamilyeduByIds(ids));
|
||||
}
|
||||
}
|
@ -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_familyedu
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2021-06-20
|
||||
*/
|
||||
public class ByFamilyedu extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 父节点
|
||||
*/
|
||||
@Excel(name = "父节点")
|
||||
private Long parentid;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@Excel(name = "标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@Excel(name = "内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
@Excel(name = "序号")
|
||||
private Long sort;
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setParentid(Long parentid) {
|
||||
this.parentid = parentid;
|
||||
}
|
||||
|
||||
public Long getParentid() {
|
||||
return parentid;
|
||||
}
|
||||
|
||||
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 setSort(Long sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Long getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("parentid", getParentid())
|
||||
.append("title", getTitle())
|
||||
.append("content", getContent())
|
||||
.append("sort", getSort())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.project.benyi.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.project.benyi.domain.ByFamilyedu;
|
||||
|
||||
/**
|
||||
* 家庭教育Mapper接口
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2021-06-20
|
||||
*/
|
||||
public interface ByFamilyeduMapper {
|
||||
/**
|
||||
* 查询家庭教育
|
||||
*
|
||||
* @param id 家庭教育ID
|
||||
* @return 家庭教育
|
||||
*/
|
||||
public ByFamilyedu selectByFamilyeduById(Long id);
|
||||
|
||||
/**
|
||||
* 查询家庭教育列表
|
||||
*
|
||||
* @param byFamilyedu 家庭教育
|
||||
* @return 家庭教育集合
|
||||
*/
|
||||
public List<ByFamilyedu> selectByFamilyeduList(ByFamilyedu byFamilyedu);
|
||||
|
||||
/**
|
||||
* 新增家庭教育
|
||||
*
|
||||
* @param byFamilyedu 家庭教育
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertByFamilyedu(ByFamilyedu byFamilyedu);
|
||||
|
||||
/**
|
||||
* 修改家庭教育
|
||||
*
|
||||
* @param byFamilyedu 家庭教育
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateByFamilyedu(ByFamilyedu byFamilyedu);
|
||||
|
||||
/**
|
||||
* 删除家庭教育
|
||||
*
|
||||
* @param id 家庭教育ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteByFamilyeduById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除家庭教育
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteByFamilyeduByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.project.benyi.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.project.benyi.domain.ByFamilyedu;
|
||||
|
||||
/**
|
||||
* 家庭教育Service接口
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2021-06-20
|
||||
*/
|
||||
public interface IByFamilyeduService {
|
||||
/**
|
||||
* 查询家庭教育
|
||||
*
|
||||
* @param id 家庭教育ID
|
||||
* @return 家庭教育
|
||||
*/
|
||||
public ByFamilyedu selectByFamilyeduById(Long id);
|
||||
|
||||
/**
|
||||
* 查询家庭教育列表
|
||||
*
|
||||
* @param byFamilyedu 家庭教育
|
||||
* @return 家庭教育集合
|
||||
*/
|
||||
public List<ByFamilyedu> selectByFamilyeduList(ByFamilyedu byFamilyedu);
|
||||
|
||||
/**
|
||||
* 新增家庭教育
|
||||
*
|
||||
* @param byFamilyedu 家庭教育
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertByFamilyedu(ByFamilyedu byFamilyedu);
|
||||
|
||||
/**
|
||||
* 修改家庭教育
|
||||
*
|
||||
* @param byFamilyedu 家庭教育
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateByFamilyedu(ByFamilyedu byFamilyedu);
|
||||
|
||||
/**
|
||||
* 批量删除家庭教育
|
||||
*
|
||||
* @param ids 需要删除的家庭教育ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteByFamilyeduByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除家庭教育信息
|
||||
*
|
||||
* @param id 家庭教育ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteByFamilyeduById(Long id);
|
||||
}
|
@ -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.ByFamilyeduMapper;
|
||||
import com.ruoyi.project.benyi.domain.ByFamilyedu;
|
||||
import com.ruoyi.project.benyi.service.IByFamilyeduService;
|
||||
|
||||
/**
|
||||
* 家庭教育Service业务层处理
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2021-06-20
|
||||
*/
|
||||
@Service
|
||||
public class ByFamilyeduServiceImpl implements IByFamilyeduService {
|
||||
@Autowired
|
||||
private ByFamilyeduMapper byFamilyeduMapper;
|
||||
|
||||
/**
|
||||
* 查询家庭教育
|
||||
*
|
||||
* @param id 家庭教育ID
|
||||
* @return 家庭教育
|
||||
*/
|
||||
@Override
|
||||
public ByFamilyedu selectByFamilyeduById(Long id) {
|
||||
return byFamilyeduMapper.selectByFamilyeduById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询家庭教育列表
|
||||
*
|
||||
* @param byFamilyedu 家庭教育
|
||||
* @return 家庭教育
|
||||
*/
|
||||
@Override
|
||||
public List<ByFamilyedu> selectByFamilyeduList(ByFamilyedu byFamilyedu) {
|
||||
return byFamilyeduMapper.selectByFamilyeduList(byFamilyedu);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增家庭教育
|
||||
*
|
||||
* @param byFamilyedu 家庭教育
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertByFamilyedu(ByFamilyedu byFamilyedu) {
|
||||
byFamilyedu.setCreateTime(DateUtils.getNowDate());
|
||||
return byFamilyeduMapper.insertByFamilyedu(byFamilyedu);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改家庭教育
|
||||
*
|
||||
* @param byFamilyedu 家庭教育
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateByFamilyedu(ByFamilyedu byFamilyedu) {
|
||||
return byFamilyeduMapper.updateByFamilyedu(byFamilyedu);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除家庭教育
|
||||
*
|
||||
* @param ids 需要删除的家庭教育ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteByFamilyeduByIds(Long[] ids) {
|
||||
return byFamilyeduMapper.deleteByFamilyeduByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除家庭教育信息
|
||||
*
|
||||
* @param id 家庭教育ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteByFamilyeduById(Long id) {
|
||||
return byFamilyeduMapper.deleteByFamilyeduById(id);
|
||||
}
|
||||
}
|
76
ruoyi/src/main/resources/mybatis/benyi/ByFamilyeduMapper.xml
Normal file
76
ruoyi/src/main/resources/mybatis/benyi/ByFamilyeduMapper.xml
Normal file
@ -0,0 +1,76 @@
|
||||
<?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.ByFamilyeduMapper">
|
||||
|
||||
<resultMap type="ByFamilyedu" id="ByFamilyeduResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="parentid" column="parentid"/>
|
||||
<result property="title" column="title"/>
|
||||
<result property="content" column="content"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectByFamilyeduVo">
|
||||
select id, parentid, title, content, sort, create_time from by_familyedu
|
||||
</sql>
|
||||
|
||||
<select id="selectByFamilyeduList" parameterType="ByFamilyedu" resultMap="ByFamilyeduResult">
|
||||
<include refid="selectByFamilyeduVo"/>
|
||||
<where>
|
||||
<if test="parentid != null ">and parentid = #{parentid}</if>
|
||||
<if test="title != null and title != ''">and title = #{title}</if>
|
||||
<if test="content != null and content != ''">and content = #{content}</if>
|
||||
<if test="sort != null ">and sort = #{sort}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectByFamilyeduById" parameterType="Long" resultMap="ByFamilyeduResult">
|
||||
<include refid="selectByFamilyeduVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertByFamilyedu" parameterType="ByFamilyedu" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into by_familyedu
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="parentid != null ">parentid,</if>
|
||||
<if test="title != null and title != ''">title,</if>
|
||||
<if test="content != null and content != ''">content,</if>
|
||||
<if test="sort != null ">sort,</if>
|
||||
<if test="createTime != null ">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="parentid != null ">#{parentid},</if>
|
||||
<if test="title != null and title != ''">#{title},</if>
|
||||
<if test="content != null and content != ''">#{content},</if>
|
||||
<if test="sort != null ">#{sort},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateByFamilyedu" parameterType="ByFamilyedu">
|
||||
update by_familyedu
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="parentid != null ">parentid = #{parentid},</if>
|
||||
<if test="title != null and title != ''">title = #{title},</if>
|
||||
<if test="content != null and content != ''">content = #{content},</if>
|
||||
<if test="sort != null ">sort = #{sort},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteByFamilyeduById" parameterType="Long">
|
||||
delete from by_familyedu where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByFamilyeduByIds" parameterType="String">
|
||||
delete from by_familyedu where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user