家庭教育手册
This commit is contained in:
@ -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>
|
Reference in New Issue
Block a user