新增园历管理(班级)部分功能
This commit is contained in:
@ -0,0 +1,126 @@
|
||||
package com.ruoyi.project.benyi.controller;
|
||||
|
||||
import java.util.Date;
|
||||
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.BySchoolcalendarClass;
|
||||
import com.ruoyi.project.benyi.service.IBySchoolcalendarClassService;
|
||||
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-05-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/benyi/schoolcalendarclass")
|
||||
public class BySchoolcalendarClassController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBySchoolcalendarClassService bySchoolcalendarClassService;
|
||||
|
||||
//导入学校公用类
|
||||
@Autowired
|
||||
private SchoolCommon schoolCommon;
|
||||
|
||||
/**
|
||||
* 查询园历管理(班级)列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:schoolcalendarclass:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BySchoolcalendarClass bySchoolcalendarClass)
|
||||
{
|
||||
startPage();
|
||||
List<BySchoolcalendarClass> list = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出园历管理(班级)列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:schoolcalendarclass:export')")
|
||||
@Log(title = "园历管理(班级)", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(BySchoolcalendarClass bySchoolcalendarClass)
|
||||
{
|
||||
List<BySchoolcalendarClass> list = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass);
|
||||
ExcelUtil<BySchoolcalendarClass> util = new ExcelUtil<BySchoolcalendarClass>(BySchoolcalendarClass.class);
|
||||
return util.exportExcel(list, "schoolcalendarclass");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取园历管理(班级)详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:schoolcalendarclass:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(bySchoolcalendarClassService.selectBySchoolcalendarClassById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增园历管理(班级)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:schoolcalendarclass:add')")
|
||||
@Log(title = "园历管理(班级)", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BySchoolcalendarClass bySchoolcalendarClass)
|
||||
{
|
||||
String strClassId = schoolCommon.getClassId();
|
||||
if(!schoolCommon.isStringEmpty(strClassId)) {
|
||||
//设置创建时间为当前时间
|
||||
bySchoolcalendarClass.setCreatetime(new Date());
|
||||
//设置学年信息 从学校公共类调取方法 传入活动时间进行判断
|
||||
bySchoolcalendarClass.setXnxq(schoolCommon.getCurrentXnXq(bySchoolcalendarClass.getActivitytime()));
|
||||
//设置创建人id
|
||||
bySchoolcalendarClass.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
|
||||
//设置部门id
|
||||
bySchoolcalendarClass.setDeptid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
|
||||
bySchoolcalendarClass.setClassid(strClassId);
|
||||
return toAjax(bySchoolcalendarClassService.insertBySchoolcalendarClass(bySchoolcalendarClass));
|
||||
}else {
|
||||
return AjaxResult.error("当前用户下没有班级,无法创建园历");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改园历管理(班级)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:schoolcalendarclass:edit')")
|
||||
@Log(title = "园历管理(班级)", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BySchoolcalendarClass bySchoolcalendarClass)
|
||||
{
|
||||
return toAjax(bySchoolcalendarClassService.updateBySchoolcalendarClass(bySchoolcalendarClass));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除园历管理(班级)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:schoolcalendarclass:remove')")
|
||||
@Log(title = "园历管理(班级)", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(bySchoolcalendarClassService.deleteBySchoolcalendarClassByIds(ids));
|
||||
}
|
||||
}
|
@ -172,6 +172,7 @@ public class BySchoolcalendarController extends BaseController {
|
||||
bySchoolcalendar.setXnxq(strXnxq);
|
||||
bySchoolcalendar.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
|
||||
bySchoolcalendar.setDeptid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
|
||||
|
||||
return toAjax(bySchoolcalendarService.insertBySchoolcalendar(bySchoolcalendar));
|
||||
} else {
|
||||
return AjaxResult.error("当前用户非幼儿园,无法创建园历");
|
||||
|
@ -0,0 +1,155 @@
|
||||
package com.ruoyi.project.benyi.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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_schoolcalendar_class
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2020-05-06
|
||||
*/
|
||||
public class BySchoolcalendarClass extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 标识 */
|
||||
private Long id;
|
||||
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
|
||||
/** 活动类型 */
|
||||
@Excel(name = "活动类型")
|
||||
private String type;
|
||||
|
||||
/** 所属班级 */
|
||||
@Excel(name = "所属班级")
|
||||
private String classid;
|
||||
|
||||
/** 学年学期 */
|
||||
@Excel(name = "学年学期")
|
||||
private String xnxq;
|
||||
|
||||
/** 所属学校 */
|
||||
@Excel(name = "所属学校")
|
||||
private Long deptid;
|
||||
|
||||
/** 活动时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date activitytime;
|
||||
|
||||
/** 创建人 */
|
||||
@Excel(name = "创建人")
|
||||
private Long createuserid;
|
||||
|
||||
/** 创建时间 */
|
||||
@Excel(name = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createtime;
|
||||
|
||||
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setClassid(String classid)
|
||||
{
|
||||
this.classid = classid;
|
||||
}
|
||||
|
||||
public String getClassid()
|
||||
{
|
||||
return classid;
|
||||
}
|
||||
public void setXnxq(String xnxq)
|
||||
{
|
||||
this.xnxq = xnxq;
|
||||
}
|
||||
|
||||
public String getXnxq()
|
||||
{
|
||||
return xnxq;
|
||||
}
|
||||
public void setDeptid(Long deptid)
|
||||
{
|
||||
this.deptid = deptid;
|
||||
}
|
||||
|
||||
public Long getDeptid()
|
||||
{
|
||||
return deptid;
|
||||
}
|
||||
public void setActivitytime(Date activitytime)
|
||||
{
|
||||
this.activitytime = activitytime;
|
||||
}
|
||||
|
||||
public Date getActivitytime()
|
||||
{
|
||||
return activitytime;
|
||||
}
|
||||
public void setCreateuserid(Long createuserid)
|
||||
{
|
||||
this.createuserid = createuserid;
|
||||
}
|
||||
|
||||
public Long getCreateuserid()
|
||||
{
|
||||
return createuserid;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("type", getType())
|
||||
.append("classid", getClassid())
|
||||
.append("xnxq", getXnxq())
|
||||
.append("deptid", getDeptid())
|
||||
.append("activitytime", getActivitytime())
|
||||
.append("createuserid", getCreateuserid())
|
||||
.append("createtime", getCreatetime())
|
||||
.toString();
|
||||
}
|
||||
|
||||
public Date getCreatetime() {
|
||||
return createtime;
|
||||
}
|
||||
|
||||
public void setCreatetime(Date createtime) {
|
||||
this.createtime = createtime;
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.project.benyi.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.project.benyi.domain.BySchoolcalendarClass;
|
||||
|
||||
/**
|
||||
* 园历管理(班级)Mapper接口
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2020-05-06
|
||||
*/
|
||||
public interface BySchoolcalendarClassMapper
|
||||
{
|
||||
/**
|
||||
* 查询园历管理(班级)
|
||||
*
|
||||
* @param id 园历管理(班级)ID
|
||||
* @return 园历管理(班级)
|
||||
*/
|
||||
public BySchoolcalendarClass selectBySchoolcalendarClassById(Long id);
|
||||
|
||||
/**
|
||||
* 查询园历管理(班级)列表
|
||||
*
|
||||
* @param bySchoolcalendarClass 园历管理(班级)
|
||||
* @return 园历管理(班级)集合
|
||||
*/
|
||||
public List<BySchoolcalendarClass> selectBySchoolcalendarClassList(BySchoolcalendarClass bySchoolcalendarClass);
|
||||
|
||||
/**
|
||||
* 新增园历管理(班级)
|
||||
*
|
||||
* @param bySchoolcalendarClass 园历管理(班级)
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBySchoolcalendarClass(BySchoolcalendarClass bySchoolcalendarClass);
|
||||
|
||||
/**
|
||||
* 修改园历管理(班级)
|
||||
*
|
||||
* @param bySchoolcalendarClass 园历管理(班级)
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBySchoolcalendarClass(BySchoolcalendarClass bySchoolcalendarClass);
|
||||
|
||||
/**
|
||||
* 删除园历管理(班级)
|
||||
*
|
||||
* @param id 园历管理(班级)ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBySchoolcalendarClassById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除园历管理(班级)
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBySchoolcalendarClassByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.project.benyi.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.project.benyi.domain.BySchoolcalendarClass;
|
||||
|
||||
/**
|
||||
* 园历管理(班级)Service接口
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2020-05-06
|
||||
*/
|
||||
public interface IBySchoolcalendarClassService
|
||||
{
|
||||
/**
|
||||
* 查询园历管理(班级)
|
||||
*
|
||||
* @param id 园历管理(班级)ID
|
||||
* @return 园历管理(班级)
|
||||
*/
|
||||
public BySchoolcalendarClass selectBySchoolcalendarClassById(Long id);
|
||||
|
||||
/**
|
||||
* 查询园历管理(班级)列表
|
||||
*
|
||||
* @param bySchoolcalendarClass 园历管理(班级)
|
||||
* @return 园历管理(班级)集合
|
||||
*/
|
||||
public List<BySchoolcalendarClass> selectBySchoolcalendarClassList(BySchoolcalendarClass bySchoolcalendarClass);
|
||||
|
||||
/**
|
||||
* 新增园历管理(班级)
|
||||
*
|
||||
* @param bySchoolcalendarClass 园历管理(班级)
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBySchoolcalendarClass(BySchoolcalendarClass bySchoolcalendarClass);
|
||||
|
||||
/**
|
||||
* 修改园历管理(班级)
|
||||
*
|
||||
* @param bySchoolcalendarClass 园历管理(班级)
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBySchoolcalendarClass(BySchoolcalendarClass bySchoolcalendarClass);
|
||||
|
||||
/**
|
||||
* 批量删除园历管理(班级)
|
||||
*
|
||||
* @param ids 需要删除的园历管理(班级)ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBySchoolcalendarClassByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除园历管理(班级)信息
|
||||
*
|
||||
* @param id 园历管理(班级)ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBySchoolcalendarClassById(Long id);
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.ruoyi.project.benyi.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.project.benyi.mapper.BySchoolcalendarClassMapper;
|
||||
import com.ruoyi.project.benyi.domain.BySchoolcalendarClass;
|
||||
import com.ruoyi.project.benyi.service.IBySchoolcalendarClassService;
|
||||
|
||||
/**
|
||||
* 园历管理(班级)Service业务层处理
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2020-05-06
|
||||
*/
|
||||
@Service
|
||||
public class BySchoolcalendarClassServiceImpl implements IBySchoolcalendarClassService
|
||||
{
|
||||
@Autowired
|
||||
private BySchoolcalendarClassMapper bySchoolcalendarClassMapper;
|
||||
|
||||
/**
|
||||
* 查询园历管理(班级)
|
||||
*
|
||||
* @param id 园历管理(班级)ID
|
||||
* @return 园历管理(班级)
|
||||
*/
|
||||
@Override
|
||||
public BySchoolcalendarClass selectBySchoolcalendarClassById(Long id)
|
||||
{
|
||||
return bySchoolcalendarClassMapper.selectBySchoolcalendarClassById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询园历管理(班级)列表
|
||||
*
|
||||
* @param bySchoolcalendarClass 园历管理(班级)
|
||||
* @return 园历管理(班级)
|
||||
*/
|
||||
@Override
|
||||
public List<BySchoolcalendarClass> selectBySchoolcalendarClassList(BySchoolcalendarClass bySchoolcalendarClass)
|
||||
{
|
||||
return bySchoolcalendarClassMapper.selectBySchoolcalendarClassList(bySchoolcalendarClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增园历管理(班级)
|
||||
*
|
||||
* @param bySchoolcalendarClass 园历管理(班级)
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBySchoolcalendarClass(BySchoolcalendarClass bySchoolcalendarClass)
|
||||
{
|
||||
return bySchoolcalendarClassMapper.insertBySchoolcalendarClass(bySchoolcalendarClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改园历管理(班级)
|
||||
*
|
||||
* @param bySchoolcalendarClass 园历管理(班级)
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBySchoolcalendarClass(BySchoolcalendarClass bySchoolcalendarClass)
|
||||
{
|
||||
return bySchoolcalendarClassMapper.updateBySchoolcalendarClass(bySchoolcalendarClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除园历管理(班级)
|
||||
*
|
||||
* @param ids 需要删除的园历管理(班级)ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBySchoolcalendarClassByIds(Long[] ids)
|
||||
{
|
||||
return bySchoolcalendarClassMapper.deleteBySchoolcalendarClassByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除园历管理(班级)信息
|
||||
*
|
||||
* @param id 园历管理(班级)ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBySchoolcalendarClassById(Long id)
|
||||
{
|
||||
return bySchoolcalendarClassMapper.deleteBySchoolcalendarClassById(id);
|
||||
}
|
||||
}
|
@ -2,10 +2,15 @@ package com.ruoyi.project.common;
|
||||
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.framework.security.LoginUser;
|
||||
import com.ruoyi.framework.web.domain.server.Sys;
|
||||
import com.ruoyi.project.system.domain.ByClass;
|
||||
import com.ruoyi.project.system.domain.BySchool;
|
||||
import com.ruoyi.project.system.domain.SysDept;
|
||||
import com.ruoyi.project.system.domain.SysUser;
|
||||
import com.ruoyi.project.system.service.IByClassService;
|
||||
import com.ruoyi.project.system.service.IBySchoolService;
|
||||
import com.ruoyi.project.system.service.ISysDeptService;
|
||||
import com.ruoyi.project.system.service.ISysUserService;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -20,7 +25,11 @@ public class SchoolCommon {
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
@Autowired
|
||||
private IBySchoolService schoolService;
|
||||
@Autowired
|
||||
private IByClassService byClassService;
|
||||
|
||||
/**
|
||||
* 部门id转学校id
|
||||
@ -58,6 +67,15 @@ public class SchoolCommon {
|
||||
return sysDept;
|
||||
}
|
||||
|
||||
public SysUser getUser() {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
Long userId = loginUser.getUser().getUserId();
|
||||
System.out.println("用户id======:" + userId);
|
||||
System.out.println("sys_user.user_id======:" + loginUser.getUser().getUserId());
|
||||
SysUser sysUser = userService.selectUserById(userId);
|
||||
return sysUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前用户是否为学校
|
||||
**/
|
||||
@ -77,6 +95,20 @@ public class SchoolCommon {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getClassId() {
|
||||
SysUser sysUser = getUser();
|
||||
ByClass byClass = new ByClass();
|
||||
byClass.setZbjs(sysUser.getUserId());
|
||||
byClass.setPbjs(sysUser.getUserId());
|
||||
byClass.setZljs(sysUser.getUserId());
|
||||
ByClass byClass1 = byClassService.selectByClassByUserId(byClass);
|
||||
if(byClass1 != null) {
|
||||
return byClass1.getBjbh();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String getCurrentXnXq() {
|
||||
Calendar date = Calendar.getInstance();
|
||||
Integer iYear = date.get(Calendar.YEAR);
|
||||
|
@ -27,6 +27,9 @@ public interface ByClassMapper
|
||||
*/
|
||||
public List<ByClass> selectByClassList(ByClass byClass);
|
||||
|
||||
//通过userID查询class
|
||||
public ByClass selectByClassByUserId(ByClass byClass);
|
||||
|
||||
/**
|
||||
* 新增班级信息
|
||||
*
|
||||
|
@ -19,6 +19,9 @@ public interface IByClassService
|
||||
*/
|
||||
public ByClass selectByClassById(String bjbh);
|
||||
|
||||
//查询通过userid查询班级信息
|
||||
public ByClass selectByClassByUserId(ByClass byClass);
|
||||
|
||||
/**
|
||||
* 查询班级信息列表
|
||||
*
|
||||
|
@ -33,6 +33,11 @@ public class ByClassServiceImpl implements IByClassService
|
||||
return byClassMapper.selectByClassById(bjbh);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByClass selectByClassByUserId(ByClass byClass) {
|
||||
return byClassMapper.selectByClassByUserId(byClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询班级信息列表
|
||||
*
|
||||
|
@ -0,0 +1,94 @@
|
||||
<?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.BySchoolcalendarClassMapper">
|
||||
|
||||
<resultMap type="BySchoolcalendarClass" id="BySchoolcalendarClassResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="classid" column="classid" />
|
||||
<result property="xnxq" column="xnxq" />
|
||||
<result property="deptid" column="deptId" />
|
||||
<result property="activitytime" column="activitytime" />
|
||||
<result property="createuserid" column="createuserid" />
|
||||
<result property="createtime" column="createtime" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBySchoolcalendarClassVo">
|
||||
select id, name, type, classid, xnxq, deptId, activitytime, createuserid, createtime from by_schoolcalendar_class
|
||||
</sql>
|
||||
|
||||
<select id="selectBySchoolcalendarClassList" parameterType="BySchoolcalendarClass" resultMap="BySchoolcalendarClassResult">
|
||||
<include refid="selectBySchoolcalendarClassVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="classid != null and classid != ''"> and classid = #{classid}</if>
|
||||
<if test="xnxq != null and xnxq != ''"> and xnxq = #{xnxq}</if>
|
||||
<if test="deptid != null "> and deptId = #{deptid}</if>
|
||||
<if test="activitytime != null "> and activitytime = #{activitytime}</if>
|
||||
<if test="createuserid != null "> and createuserid = #{createuserid}</if>
|
||||
<if test="createtime != null "> and createtime = #{createtime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBySchoolcalendarClassById" parameterType="Long" resultMap="BySchoolcalendarClassResult">
|
||||
<include refid="selectBySchoolcalendarClassVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBySchoolcalendarClass" parameterType="BySchoolcalendarClass">
|
||||
insert into by_schoolcalendar_class
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null ">id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
<if test="classid != null and classid != ''">classid,</if>
|
||||
<if test="xnxq != null and xnxq != ''">xnxq,</if>
|
||||
<if test="deptid != null ">deptId,</if>
|
||||
<if test="activitytime != null ">activitytime,</if>
|
||||
<if test="createuserid != null ">createuserid,</if>
|
||||
<if test="createtime != null ">createtime,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null ">#{id},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="classid != null and classid != ''">#{classid},</if>
|
||||
<if test="xnxq != null and xnxq != ''">#{xnxq},</if>
|
||||
<if test="deptid != null ">#{deptid},</if>
|
||||
<if test="activitytime != null ">#{activitytime},</if>
|
||||
<if test="createuserid != null ">#{createuserid},</if>
|
||||
<if test="createtime != null ">#{createtime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBySchoolcalendarClass" parameterType="BySchoolcalendarClass">
|
||||
update by_schoolcalendar_class
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
<if test="classid != null and classid != ''">classid = #{classid},</if>
|
||||
<if test="xnxq != null and xnxq != ''">xnxq = #{xnxq},</if>
|
||||
<if test="deptid != null ">deptId = #{deptid},</if>
|
||||
<if test="activitytime != null ">activitytime = #{activitytime},</if>
|
||||
<if test="createuserid != null ">createuserid = #{createuserid},</if>
|
||||
<if test="createtime != null ">createtime = #{createtime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBySchoolcalendarClassById" parameterType="Long">
|
||||
delete from by_schoolcalendar_class where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBySchoolcalendarClassByIds" parameterType="String">
|
||||
delete from by_schoolcalendar_class where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -25,7 +25,7 @@
|
||||
|
||||
<sql id="selectByClassVo">
|
||||
select bjbh, dept_id, bjtype, bhxh, xn, bjmc, bjrych, jbny,
|
||||
zbjs,(select nick_name from sys_user where sys_user.user_id=zbjs) zbjsxm,
|
||||
zbjs, (select nick_name from sys_user where sys_user.user_id=zbjs) zbjsxm,
|
||||
pbjs, (select nick_name from sys_user where sys_user.user_id=pbjs) pbjsxm,
|
||||
zljs, (select nick_name from sys_user where sys_user.user_id=zljs) zljsxm,
|
||||
isdel, createtime from by_class d
|
||||
@ -60,6 +60,17 @@
|
||||
where bjbh = #{bjbh}
|
||||
</select>
|
||||
|
||||
<select id="selectByClassByUserId" parameterType="ByClass" resultMap="ByClassResult">
|
||||
<include refid="selectByClassVo"/>
|
||||
<where>
|
||||
<if test="zbjs != null ">and zbjs = #{zbjs}</if>
|
||||
<if test="pbjs != null ">and pbjs = #{pbjs}</if>
|
||||
<if test="zljs != null ">and zljs = #{zljs}</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${dataScope}
|
||||
</select>
|
||||
|
||||
<insert id="insertByClass" parameterType="ByClass">
|
||||
insert into by_class
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
@ -35,7 +35,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="leader" column="leader" />
|
||||
<result property="status" column="dept_status" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
<resultMap id="RoleResult" type="SysRole">
|
||||
<id property="roleId" column="role_id" />
|
||||
<result property="roleName" column="role_name" />
|
||||
|
Reference in New Issue
Block a user