Commit cb5ca3d9 by xuwenhao

11.7增加学校获奖和学生违纪模块

parent 72a9b992
package yangtz.cs.liu.campus.controller.schoolRewardsPunishments;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
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.schoolRewardsPunishments.SchoolScAwards;
import yangtz.cs.liu.campus.service.schoolRewardsPunishments.ISchoolScAwardsService;
import yangtz.cs.liu.campus.vo.schoolRewardsPunishments.SchoolScAwardsVo;
/**
* 学校获奖Controller
*
* @author ruoyi
* @date 2023-11-06
*/
@RestController
@RequestMapping("/school/awards")
public class SchoolScAwardsController extends BaseController
{
@Autowired
private ISchoolScAwardsService schoolScAwardsService;
/**
* 查询学校获奖列表
*/
@GetMapping("/list")
public TableDataInfo list(SchoolScAwardsVo schoolScAwardsVo)
{
SysUser user = SecurityUtils.getLoginUser().getUser();
//用户角色集合
List<SysRole> roles = user.getRoles();
//管理员查询全部
if (user.isAdmin()) {
startPage();
List<SchoolScAwardsVo> list = schoolScAwardsService.selectSchoolScAwardsList(schoolScAwardsVo);
return getDataTable(list);
} else if (roles.size() > 0){
for (SysRole role : roles) {
if (role.getRoleKey().equals("award_admin")){
startPage();
List<SchoolScAwardsVo> list = schoolScAwardsService.selectSchoolScAwardsList(schoolScAwardsVo);
return getDataTable(list);
}
}
}
//用户查看个人列表
schoolScAwardsVo.setApplyId(user.getUserId());
startPage();
List<SchoolScAwardsVo> list = schoolScAwardsService.selectSchoolScAwardsList(schoolScAwardsVo);
return getDataTable(list);
}
/**
* 导出学校获奖列表
*/
@Log(title = "学校获奖", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SchoolScAwardsVo schoolScAwardsVo)
{
List<SchoolScAwardsVo> list = schoolScAwardsService.selectSchoolScAwardsList(schoolScAwardsVo);
ExcelUtil<SchoolScAwardsVo> util = new ExcelUtil<SchoolScAwardsVo>(SchoolScAwardsVo.class);
util.exportExcel(response, list, "学校获奖数据");
}
/**
* 获取学校获奖详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(schoolScAwardsService.selectSchoolScAwardsById(id));
}
/**
* 新增学校获奖
*/
@Log(title = "学校获奖", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult add(@RequestBody SchoolScAwardsVo schoolScAwardsVo)
{
return toAjax(schoolScAwardsService.insertSchoolScAwards(schoolScAwardsVo));
}
/**
* 修改学校获奖
*/
@Log(title = "学校获奖", businessType = BusinessType.UPDATE)
@PutMapping("/edit")
public AjaxResult edit(@RequestBody SchoolScAwardsVo schoolScAwardsVo)
{
return toAjax(schoolScAwardsService.updateSchoolScAwards(schoolScAwardsVo));
}
/**
* 删除学校获奖
*/
@Log(title = "学校获奖", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(schoolScAwardsService.deleteSchoolScAwardsByIds(ids));
}
/**
* 提交
*/
@PutMapping("/submit")
public AjaxResult submit(@RequestBody SchoolScAwards schoolScAwards)
{
return toAjax(schoolScAwardsService.submit(schoolScAwards));
}
}
package yangtz.cs.liu.campus.controller.schoolRewardsPunishments;
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.schoolRewardsPunishments.SchoolScDiscipline;
import yangtz.cs.liu.campus.service.schoolRewardsPunishments.ISchoolScDisciplineService;
/**
* 学生违纪Controller
*
* @author ruoyi
* @date 2023-11-06
*/
@RestController
@RequestMapping("/school/discipline")
public class SchoolScDisciplineController extends BaseController
{
@Autowired
private ISchoolScDisciplineService schoolScDisciplineService;
/**
* 查询学生违纪列表
*/
@GetMapping("/list")
public TableDataInfo list(SchoolScDiscipline schoolScDiscipline)
{
startPage();
List<SchoolScDiscipline> list = schoolScDisciplineService.selectSchoolScDisciplineList(schoolScDiscipline);
return getDataTable(list);
}
/**
* 导出学生违纪列表
*/
@Log(title = "学生违纪", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SchoolScDiscipline schoolScDiscipline)
{
List<SchoolScDiscipline> list = schoolScDisciplineService.selectSchoolScDisciplineList(schoolScDiscipline);
ExcelUtil<SchoolScDiscipline> util = new ExcelUtil<SchoolScDiscipline>(SchoolScDiscipline.class);
util.exportExcel(response, list, "学生违纪数据");
}
/**
* 获取学生违纪详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(schoolScDisciplineService.selectSchoolScDisciplineById(id));
}
/**
* 新增学生违纪
*/
@Log(title = "学生违纪", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SchoolScDiscipline schoolScDiscipline)
{
return toAjax(schoolScDisciplineService.insertSchoolScDiscipline(schoolScDiscipline));
}
/**
* 修改学生违纪
*/
@Log(title = "学生违纪", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SchoolScDiscipline schoolScDiscipline)
{
return toAjax(schoolScDisciplineService.updateSchoolScDiscipline(schoolScDiscipline));
}
/**
* 删除学生违纪
*/
@Log(title = "学生违纪", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(schoolScDisciplineService.deleteSchoolScDisciplineByIds(ids));
}
/**
* 获取最新三个年级
*/
@GetMapping("/getGrade")
public AjaxResult getGrade(){
return AjaxResult.success(schoolScDisciplineService.getGrade());
}
/**
* 根据年级获取班级
*/
@GetMapping("/getClassList/{gradeId}")
public AjaxResult getClassList(@PathVariable("gradeId") Long gradeId){
return AjaxResult.success(schoolScDisciplineService.getClassList(gradeId));
}
}
package yangtz.cs.liu.campus.domain.schoolRewardsPunishments;
import com.core.domain.OurBaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 学校获奖对象 school_sc_awards
*
* @author ruoyi
* @date 2023-11-06
*/
@Data
public class SchoolScAwards extends OurBaseEntity
{
/** 比赛名称 */
@Excel(name = "比赛名称")
private String competitionName;
/** 主办单位 */
@Excel(name = "主办单位")
private String organizer;
/** 获奖名称 */
@Excel(name = "获奖名称")
private String awardsName;
/** 主管部门id */
@Excel(name = "主管部门id")
private Long competentDeptId;
/** 主管部门 */
@Excel(name = "主管部门")
private String competentDept;
/** 获奖级别(字典) */
@Excel(name = "获奖级别(字典)")
private String awardsLevel;
/** 部门主任id */
@Excel(name = "部门主任id")
private Long deptDirectorId;
/** 部门主任 */
@Excel(name = "部门主任")
private String deptDirector;
/** 获奖时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "获奖时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date awardsTime;
/** 获奖类型(字典) */
@Excel(name = "获奖类型(字典)")
private String awardsType;
/** 备注 */
@Excel(name = "备注")
private String remark;
/** 审核状态(0未提交,1审核中,2通过,3驳回) */
@Excel(name = "审核状态(0未提交,1审核中,2通过,3驳回)")
private String auditState;
/** 申请人id */
private Long applyId;
/** 申请人 */
private String applyName;
/** 申请时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date applyTime;
}
package yangtz.cs.liu.campus.domain.schoolRewardsPunishments;
import com.core.domain.OurBaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 学生违纪对象 school_sc_discipline
*
* @author ruoyi
* @date 2023-11-06
*/
@Data
public class SchoolScDiscipline extends OurBaseEntity
{
/** 学年 */
@Excel(name = "学年")
private String schoolYear;
/** 学期 */
@Excel(name = "学期")
private String semester;
/** 届别 */
@Excel(name = "届别")
private String gradeYear;
/** 年级id */
@Excel(name = "年级id")
private Long gradeId;
/** 年级 */
@Excel(name = "年级")
private String gradeName;
/** 班级id */
@Excel(name = "班级id")
private Long classId;
/** 班级 */
@Excel(name = "班级")
private String className;
/** 班级类型 */
@Excel(name = "班级类型")
private String classType;
/** 姓名 */
@Excel(name = "姓名")
private String name;
/** 性别 */
@Excel(name = "性别")
private String sex;
/** 身份证号 */
@Excel(name = "身份证号")
private String idCard;
/** 班主任 */
@Excel(name = "班主任")
private String classTeacher;
/** 级部主任 */
@Excel(name = "级部主任")
private String gradeDirector;
/** 违纪类别(字典) */
@Excel(name = "违纪类别", readConverterExp = "字=典")
private String violateType;
/** 违纪次数(字典) */
@Excel(name = "违纪次数", readConverterExp = "字=典")
private String violateNum;
/** 处分结果(字典) */
@Excel(name = "处分结果", readConverterExp = "字=典")
private String punishResult;
/** 处分时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "处分时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date punishTime;
/** 备注 */
@Excel(name = "备注")
private String remark;
/** 审核状态(0未提交,1审核中,2通过,3驳回) */
@Excel(name = "审核状态(0未提交,1审核中,2通过,3驳回)")
private String auditState;
/** 申请人id */
private Long applyId;
/** 申请人 */
private String applyName;
/** 申请时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date applyTime;
}
package yangtz.cs.liu.campus.mapper.schoolRewardsPunishments;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import yangtz.cs.liu.campus.domain.schoolRewardsPunishments.SchoolScAwards;
import yangtz.cs.liu.campus.vo.schoolRewardsPunishments.SchoolScAwardsVo;
import java.util.List;
/**
* 学校获奖Mapper接口
*
* @author ruoyi
* @date 2023-11-06
*/
public interface SchoolScAwardsMapper extends BaseMapper<SchoolScAwards>
{
/**
* 查询学校获奖
*
* @param id 学校获奖主键
* @return 学校获奖
*/
public SchoolScAwardsVo selectSchoolScAwardsById(Long id);
/**
* 查询学校获奖列表
*
* @param schoolScAwardsVo 学校获奖
* @return 学校获奖集合
*/
public List<SchoolScAwardsVo> selectSchoolScAwardsList(SchoolScAwardsVo schoolScAwardsVo);
/**
* 新增学校获奖
*
* @param schoolScAwardsVo 学校获奖
* @return 结果
*/
public int insertSchoolScAwards(SchoolScAwardsVo schoolScAwardsVo);
/**
* 修改学校获奖
*
* @param schoolScAwardsVo 学校获奖
* @return 结果
*/
public int updateSchoolScAwards(SchoolScAwardsVo schoolScAwardsVo);
/**
* 删除学校获奖
*
* @param id 学校获奖主键
* @return 结果
*/
public int deleteSchoolScAwardsById(Long id);
/**
* 批量删除学校获奖
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSchoolScAwardsByIds(Long[] ids);
/**
* 批量新增附件信息
*
* @param schoolAccessoryList 附件信息列表
* @return 结果
*/
public int batchSchoolAccessory(List<SchoolAccessory> schoolAccessoryList);
/**
* 批量删除附件信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSchoolAccessoryByBusinessIds(Long[] ids);
/**
* 通过学校获奖主键删除附件信息信息
*
* @param id 学校获奖ID
* @return 结果
*/
public int deleteSchoolAccessoryByBusinessId(Long id);
/**
* 获取所有学校获奖附件
* @return
*/
public List<SchoolAccessory> selectAccessoryList();
}
package yangtz.cs.liu.campus.mapper.schoolRewardsPunishments;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import yangtz.cs.liu.campus.domain.schoolRewardsPunishments.SchoolScDiscipline;
import java.util.List;
import java.util.Map;
/**
* 学生违纪Mapper接口
*
* @author ruoyi
* @date 2023-11-06
*/
public interface SchoolScDisciplineMapper extends BaseMapper<SchoolScDiscipline>
{
/**
* 查询学生违纪
*
* @param id 学生违纪主键
* @return 学生违纪
*/
public SchoolScDiscipline selectSchoolScDisciplineById(Long id);
/**
* 查询学生违纪列表
*
* @param schoolScDiscipline 学生违纪
* @return 学生违纪集合
*/
public List<SchoolScDiscipline> selectSchoolScDisciplineList(SchoolScDiscipline schoolScDiscipline);
/**
* 新增学生违纪
*
* @param schoolScDiscipline 学生违纪
* @return 结果
*/
public int insertSchoolScDiscipline(SchoolScDiscipline schoolScDiscipline);
/**
* 修改学生违纪
*
* @param schoolScDiscipline 学生违纪
* @return 结果
*/
public int updateSchoolScDiscipline(SchoolScDiscipline schoolScDiscipline);
/**
* 删除学生违纪
*
* @param id 学生违纪主键
* @return 结果
*/
public int deleteSchoolScDisciplineById(Long id);
/**
* 批量删除学生违纪
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSchoolScDisciplineByIds(Long[] ids);
/**
* 获取最新三个年级
* @return
*/
List<Map<String, Object>> getGrade();
/**
* 根据年级获取班级
* @param gradeId
* @return
*/
List<Map<String, Object>> getClassList(Long gradeId);
}
package yangtz.cs.liu.campus.service.impl.schoolRewardsPunishments;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import yangtz.cs.liu.campus.domain.schoolRewardsPunishments.SchoolScAwards;
import yangtz.cs.liu.campus.mapper.schoolRewardsPunishments.SchoolScAwardsMapper;
import yangtz.cs.liu.campus.service.schoolRewardsPunishments.ISchoolScAwardsService;
import yangtz.cs.liu.campus.vo.schoolRewardsPunishments.SchoolScAwardsVo;
import java.util.ArrayList;
import java.util.List;
/**
* 学校获奖Service业务层处理
*
* @author ruoyi
* @date 2023-11-06
*/
@Service
public class SchoolScAwardsServiceImpl extends ServiceImpl<SchoolScAwardsMapper,SchoolScAwards> implements ISchoolScAwardsService
{
@Autowired
private SchoolScAwardsMapper schoolScAwardsMapper;
/**
* 查询学校获奖
*
* @param id 学校获奖主键
* @return 学校获奖
*/
@Override
public SchoolScAwardsVo selectSchoolScAwardsById(Long id)
{
return schoolScAwardsMapper.selectSchoolScAwardsById(id);
}
/**
* 查询学校获奖列表
*
* @param schoolScAwardsVo 学校获奖
* @return 学校获奖
*/
@Override
public List<SchoolScAwardsVo> selectSchoolScAwardsList(SchoolScAwardsVo schoolScAwardsVo)
{
List<SchoolScAwardsVo> schoolScAwardsVos = schoolScAwardsMapper.selectSchoolScAwardsList(schoolScAwardsVo);
List<SchoolAccessory> schoolAccessoryList = new ArrayList<>();
//获取学校获奖所有附件
List<SchoolAccessory> schoolAccessories = schoolScAwardsMapper.selectAccessoryList();
schoolScAwardsVos.forEach(schoolScAwardsVo1 -> {
for (SchoolAccessory schoolAccessory : schoolAccessories) {
if (schoolAccessory.getBusinessId().equals(schoolScAwardsVo1.getId())){
schoolAccessoryList.add(schoolAccessory);
}
}
if (schoolAccessoryList.size() > 0){
schoolScAwardsVo1.setSchoolAccessoryList(schoolAccessoryList);
}
});
return schoolScAwardsVos;
}
/**
* 新增学校获奖
*
* @param schoolScAwardsVo 学校获奖
* @return 结果
*/
@Transactional
@Override
public int insertSchoolScAwards(SchoolScAwardsVo schoolScAwardsVo)
{
SysUser user = SecurityUtils.getLoginUser().getUser();
schoolScAwardsVo.setApplyId(user.getUserId());
schoolScAwardsVo.setApplyName(user.getUserName());
schoolScAwardsVo.setApplyTime(DateUtils.getNowDate());
schoolScAwardsVo.setCreateBy(user.getUserName());
schoolScAwardsVo.setCreateTime(DateUtils.getNowDate());
int i = schoolScAwardsMapper.insertSchoolScAwards(schoolScAwardsVo);
insertSchoolAccessory(schoolScAwardsVo);
return i;
}
/**
* 修改学校获奖
*
* @param schoolScAwardsVo 学校获奖
* @return 结果
*/
@Transactional
@Override
public int updateSchoolScAwards(SchoolScAwardsVo schoolScAwardsVo)
{
schoolScAwardsVo.setUpdateBy(SecurityUtils.getUsername());
schoolScAwardsVo.setUpdateTime(DateUtils.getNowDate());
schoolScAwardsMapper.deleteSchoolAccessoryByBusinessId(schoolScAwardsVo.getId());
insertSchoolAccessory(schoolScAwardsVo);
return schoolScAwardsMapper.updateSchoolScAwards(schoolScAwardsVo);
}
/**
* 批量删除学校获奖
*
* @param ids 需要删除的学校获奖主键
* @return 结果
*/
@Override
public int deleteSchoolScAwardsByIds(Long[] ids)
{
//删除附件
schoolScAwardsMapper.deleteSchoolAccessoryByBusinessIds(ids);
return schoolScAwardsMapper.deleteSchoolScAwardsByIds(ids);
}
/**
* 删除学校获奖信息
*
* @param id 学校获奖主键
* @return 结果
*/
@Override
public int deleteSchoolScAwardsById(Long id)
{
return schoolScAwardsMapper.deleteSchoolScAwardsById(id);
}
/**
* 提交
* @param schoolScAwards
* @return
*/
@Override
public int submit(SchoolScAwards schoolScAwards) {
return schoolScAwardsMapper.updateById(schoolScAwards);
}
/**
* 新增附件信息信息
*
* @param schoolScAwardsVo 学校获奖对象
*/
public void insertSchoolAccessory(SchoolScAwardsVo schoolScAwardsVo)
{
List<SchoolAccessory> schoolAccessoryList = schoolScAwardsVo.getSchoolAccessoryList();
Long id = schoolScAwardsVo.getId();
if (StringUtils.isNotNull(schoolAccessoryList))
{
List<SchoolAccessory> list = new ArrayList<SchoolAccessory>();
for (SchoolAccessory schoolAccessory : schoolAccessoryList)
{
schoolAccessory.setBusinessId(id);
schoolAccessory.setModuleName("获奖与违纪-学校获奖");
schoolAccessory.setAccessoryType("学校获奖附件");
schoolAccessory.setCreateBy(SecurityUtils.getUsername());
schoolAccessory.setCreateTime(DateUtils.getNowDate());
list.add(schoolAccessory);
}
if (list.size() > 0)
{
schoolScAwardsMapper.batchSchoolAccessory(list);
}
}
}
}
package yangtz.cs.liu.campus.service.impl.schoolRewardsPunishments;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yangtz.cs.liu.campus.domain.schoolRewardsPunishments.SchoolScDiscipline;
import yangtz.cs.liu.campus.mapper.schoolRewardsPunishments.SchoolScDisciplineMapper;
import yangtz.cs.liu.campus.service.schoolRewardsPunishments.ISchoolScDisciplineService;
import java.util.List;
import java.util.Map;
/**
* 学生违纪Service业务层处理
*
* @author ruoyi
* @date 2023-11-06
*/
@Service
public class SchoolScDisciplineServiceImpl extends ServiceImpl<SchoolScDisciplineMapper,SchoolScDiscipline> implements ISchoolScDisciplineService
{
@Autowired
private SchoolScDisciplineMapper schoolScDisciplineMapper;
/**
* 查询学生违纪
*
* @param id 学生违纪主键
* @return 学生违纪
*/
@Override
public SchoolScDiscipline selectSchoolScDisciplineById(Long id)
{
return schoolScDisciplineMapper.selectSchoolScDisciplineById(id);
}
/**
* 查询学生违纪列表
*
* @param schoolScDiscipline 学生违纪
* @return 学生违纪
*/
@Override
public List<SchoolScDiscipline> selectSchoolScDisciplineList(SchoolScDiscipline schoolScDiscipline)
{
return schoolScDisciplineMapper.selectSchoolScDisciplineList(schoolScDiscipline);
}
/**
* 新增学生违纪
*
* @param schoolScDiscipline 学生违纪
* @return 结果
*/
@Override
public int insertSchoolScDiscipline(SchoolScDiscipline schoolScDiscipline)
{
schoolScDiscipline.setCreateTime(DateUtils.getNowDate());
return schoolScDisciplineMapper.insertSchoolScDiscipline(schoolScDiscipline);
}
/**
* 修改学生违纪
*
* @param schoolScDiscipline 学生违纪
* @return 结果
*/
@Override
public int updateSchoolScDiscipline(SchoolScDiscipline schoolScDiscipline)
{
schoolScDiscipline.setUpdateTime(DateUtils.getNowDate());
return schoolScDisciplineMapper.updateSchoolScDiscipline(schoolScDiscipline);
}
/**
* 批量删除学生违纪
*
* @param ids 需要删除的学生违纪主键
* @return 结果
*/
@Override
public int deleteSchoolScDisciplineByIds(Long[] ids)
{
return schoolScDisciplineMapper.deleteSchoolScDisciplineByIds(ids);
}
/**
* 删除学生违纪信息
*
* @param id 学生违纪主键
* @return 结果
*/
@Override
public int deleteSchoolScDisciplineById(Long id)
{
return schoolScDisciplineMapper.deleteSchoolScDisciplineById(id);
}
/**
* 获取最新三个年级
* @return
*/
@Override
public List<Map<String, Object>> getGrade() {
return schoolScDisciplineMapper.getGrade();
}
/**
* 根据年级获取班级
* @param gradeId
* @return
*/
@Override
public List<Map<String, Object>> getClassList(Long gradeId) {
return schoolScDisciplineMapper.getClassList(gradeId);
}
}
package yangtz.cs.liu.campus.service.schoolRewardsPunishments;
import com.baomidou.mybatisplus.extension.service.IService;
import yangtz.cs.liu.campus.domain.schoolRewardsPunishments.SchoolScAwards;
import yangtz.cs.liu.campus.vo.schoolRewardsPunishments.SchoolScAwardsVo;
import java.util.List;
/**
* 学校获奖Service接口
*
* @author ruoyi
* @date 2023-11-06
*/
public interface ISchoolScAwardsService extends IService<SchoolScAwards>
{
/**
* 查询学校获奖
*
* @param id 学校获奖主键
* @return 学校获奖
*/
public SchoolScAwardsVo selectSchoolScAwardsById(Long id);
/**
* 查询学校获奖列表
*
* @param schoolScAwardsVo 学校获奖
* @return 学校获奖集合
*/
public List<SchoolScAwardsVo> selectSchoolScAwardsList(SchoolScAwardsVo schoolScAwardsVo);
/**
* 新增学校获奖
*
* @param schoolScAwardsVo 学校获奖
* @return 结果
*/
public int insertSchoolScAwards(SchoolScAwardsVo schoolScAwardsVo);
/**
* 修改学校获奖
*
* @param schoolScAwardsVo 学校获奖
* @return 结果
*/
public int updateSchoolScAwards(SchoolScAwardsVo schoolScAwardsVo);
/**
* 批量删除学校获奖
*
* @param ids 需要删除的学校获奖主键集合
* @return 结果
*/
public int deleteSchoolScAwardsByIds(Long[] ids);
/**
* 删除学校获奖信息
*
* @param id 学校获奖主键
* @return 结果
*/
public int deleteSchoolScAwardsById(Long id);
/**
* 提交
* @param schoolScAwards
* @return
*/
int submit(SchoolScAwards schoolScAwards);
}
package yangtz.cs.liu.campus.service.schoolRewardsPunishments;
import com.baomidou.mybatisplus.extension.service.IService;
import yangtz.cs.liu.campus.domain.schoolRewardsPunishments.SchoolScDiscipline;
import java.util.List;
import java.util.Map;
/**
* 学生违纪Service接口
*
* @author ruoyi
* @date 2023-11-06
*/
public interface ISchoolScDisciplineService extends IService<SchoolScDiscipline>
{
/**
* 查询学生违纪
*
* @param id 学生违纪主键
* @return 学生违纪
*/
public SchoolScDiscipline selectSchoolScDisciplineById(Long id);
/**
* 查询学生违纪列表
*
* @param schoolScDiscipline 学生违纪
* @return 学生违纪集合
*/
public List<SchoolScDiscipline> selectSchoolScDisciplineList(SchoolScDiscipline schoolScDiscipline);
/**
* 新增学生违纪
*
* @param schoolScDiscipline 学生违纪
* @return 结果
*/
public int insertSchoolScDiscipline(SchoolScDiscipline schoolScDiscipline);
/**
* 修改学生违纪
*
* @param schoolScDiscipline 学生违纪
* @return 结果
*/
public int updateSchoolScDiscipline(SchoolScDiscipline schoolScDiscipline);
/**
* 批量删除学生违纪
*
* @param ids 需要删除的学生违纪主键集合
* @return 结果
*/
public int deleteSchoolScDisciplineByIds(Long[] ids);
/**
* 删除学生违纪信息
*
* @param id 学生违纪主键
* @return 结果
*/
public int deleteSchoolScDisciplineById(Long id);
/**
* 获取最新三个年级
* @return
*/
List<Map<String,Object>> getGrade();
/**
* 根据年级获取班级
* @param gradeId
* @return
*/
List<Map<String,Object>> getClassList(Long gradeId);
}
package yangtz.cs.liu.campus.vo.schoolRewardsPunishments;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.core.domain.OurBaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import java.util.Date;
import java.util.List;
@Data
public class SchoolScAwardsVo
{
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/** 比赛名称 */
@Excel(name = "比赛名称")
private String competitionName;
/** 主办单位 */
@Excel(name = "主办单位")
private String organizer;
/** 获奖名称 */
@Excel(name = "获奖名称")
private String awardsName;
/** 主管部门id */
private Long competentDeptId;
/** 主管部门 */
@Excel(name = "主管部门")
private String competentDept;
/** 获奖级别(字典) */
@Excel(name = "获奖级别")
private String awardsLevel;
/** 部门主任id */
private Long deptDirectorId;
/** 部门主任 */
@Excel(name = "部门主任")
private String deptDirector;
/** 获奖时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "获奖时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date awardsTime;
/** 获奖类型(字典) */
@Excel(name = "获奖类型")
private String awardsType;
/** 备注 */
@Excel(name = "备注")
private String remark;
/** 审核状态(0未提交,1审核中,2通过,3驳回) */
@Excel(name = "审核状态")
private String auditState;
/** 申请人id */
private Long applyId;
/** 申请人 */
private String applyName;
/** 申请时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date applyTime;
/** 创建者 */
@TableField(fill = FieldFill.INSERT)
private String createBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/** 更新者 */
@TableField(fill = FieldFill.INSERT_UPDATE)
private String updateBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
/** 是否删除 */
@TableField(fill = FieldFill.INSERT)
private String delFlag;
//图片附件
private List<SchoolAccessory> schoolAccessoryList;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date startTime;
/** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date endTime;
}
<?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.schoolRewardsPunishments.SchoolScAwardsMapper">
<resultMap type="SchoolScAwardsVo" id="SchoolScAwardsVoResult">
<result property="id" column="id" />
<result property="competitionName" column="competition_name" />
<result property="organizer" column="organizer" />
<result property="awardsName" column="awards_name" />
<result property="competentDeptId" column="competent_dept_id" />
<result property="competentDept" column="competent_dept" />
<result property="awardsLevel" column="awards_level" />
<result property="deptDirectorId" column="dept_director_id" />
<result property="deptDirector" column="dept_director" />
<result property="awardsTime" column="awards_time" />
<result property="awardsType" column="awards_type" />
<result property="remark" column="remark" />
<result property="auditState" column="audit_state" />
<result property="applyId" column="apply_id" />
<result property="applyName" column="apply_name" />
<result property="applyTime" column="apply_time" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<resultMap id="SchoolScAwardsSchoolAccessoryResult" type="SchoolScAwardsVo" extends="SchoolScAwardsVoResult">
<collection property="schoolAccessoryList" notNullColumn="sub_id" javaType="java.util.List" resultMap="SchoolAccessoryResult" />
</resultMap>
<resultMap type="SchoolAccessory" id="SchoolAccessoryResult">
<result property="id" column="sub_id" />
<result property="businessId" column="sub_business_id" />
<result property="moduleName" column="sub_module_name" />
<result property="accessoryType" column="sub_accessory_type" />
<result property="accessoryUrl" column="sub_accessory_url" />
<result property="accessoryName" column="sub_accessory_name" />
</resultMap>
<sql id="selectSchoolScAwardsVo">
select id, competition_name, organizer, awards_name, competent_dept_id, competent_dept,
awards_level, dept_director_id, dept_director, awards_time, awards_type, remark,
audit_state, apply_id, apply_name, apply_time, create_by, create_time, update_by,
update_time, del_flag
from school_sc_awards
</sql>
<select id="selectSchoolScAwardsList" parameterType="SchoolScAwardsVo" resultMap="SchoolScAwardsVoResult">
<include refid="selectSchoolScAwardsVo"/>
<where>
del_flag = '0'
<if test="competitionName != null and competitionName != ''"> and competition_name like concat('%', #{competitionName}, '%')</if>
<if test="organizer != null and organizer != ''"> and organizer = #{organizer}</if>
<if test="awardsName != null and awardsName != ''"> and awards_name like concat('%', #{awardsName}, '%')</if>
<if test="competentDeptId != null "> and competent_dept_id = #{competentDeptId}</if>
<if test="competentDept != null and competentDept != ''"> and competent_dept = #{competentDept}</if>
<if test="awardsLevel != null and awardsLevel != ''"> and awards_level = #{awardsLevel}</if>
<if test="deptDirectorId != null "> and dept_director_id = #{deptDirectorId}</if>
<if test="deptDirector != null and deptDirector != ''"> and dept_director = #{deptDirector}</if>
<if test="awardsTime != null "> and awards_time = #{awardsTime}</if>
<if test="awardsType != null and awardsType != ''"> and awards_type = #{awardsType}</if>
<if test="auditState != null and auditState != ''"> and audit_state = #{auditState}</if>
<if test="applyId != null "> and apply_id = #{applyId}</if>
<if test="startTime != null and endTime != null and startTime != '' and endTime != ''">and DATE_FORMAT(awards_time,'%Y-%m-%d') between #{startTime} and #{endTime}</if>
</where>
</select>
<select id="selectSchoolScAwardsById" parameterType="Long" resultMap="SchoolScAwardsSchoolAccessoryResult">
select a.id, a.competition_name, a.organizer, a.awards_name, a.competent_dept_id, a.competent_dept,
a.awards_level, a.dept_director_id, a.dept_director, a.awards_time, a.awards_type, a.remark,
a.audit_state, a.apply_id, a.apply_name, a.apply_time, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag,
b.id as sub_id, b.business_id as sub_business_id, b.module_name as sub_module_name, b.accessory_type as sub_accessory_type,
b.accessory_url as sub_accessory_url, b.accessory_name as sub_accessory_name
from school_sc_awards a
left join school_accessory b on b.business_id = a.id and b.accessory_type = "学校获奖附件"
where a.id = #{id}
</select>
<insert id="insertSchoolScAwards" parameterType="SchoolScAwardsVo" useGeneratedKeys="true" keyProperty="id">
insert into school_sc_awards
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="competitionName != null">competition_name,</if>
<if test="organizer != null">organizer,</if>
<if test="awardsName != null">awards_name,</if>
<if test="competentDeptId != null">competent_dept_id,competent_dept,</if>
<if test="awardsLevel != null">awards_level,</if>
<if test="deptDirectorId != null">dept_director_id,dept_director,</if>
<if test="awardsTime != null">awards_time,</if>
<if test="awardsType != null">awards_type,</if>
<if test="remark != null">remark,</if>
<if test="auditState != null">audit_state,</if>
<if test="applyId != null">apply_id,</if>
<if test="applyName != null">apply_name,</if>
<if test="applyTime != null">apply_time,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="competitionName != null">#{competitionName},</if>
<if test="organizer != null">#{organizer},</if>
<if test="awardsName != null">#{awardsName},</if>
<if test="competentDeptId != null">#{competentDeptId},(select dept_name from sys_dept where dept_id = #{competentDeptId}),</if>
<if test="awardsLevel != null">#{awardsLevel},</if>
<if test="deptDirectorId != null">#{deptDirectorId},(select user_name from sys_user where user_id = #{deptDirectorId}),</if>
<if test="awardsTime != null">#{awardsTime},</if>
<if test="awardsType != null">#{awardsType},</if>
<if test="remark != null">#{remark},</if>
<if test="auditState != null">#{auditState},</if>
<if test="applyId != null">#{applyId},</if>
<if test="applyName != null">#{applyName},</if>
<if test="applyTime != null">#{applyTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateSchoolScAwards" parameterType="SchoolScAwardsVo">
update school_sc_awards
<trim prefix="SET" suffixOverrides=",">
<if test="competitionName != null">competition_name = #{competitionName},</if>
<if test="organizer != null">organizer = #{organizer},</if>
<if test="awardsName != null">awards_name = #{awardsName},</if>
<if test="competentDeptId != null">competent_dept_id = #{competentDeptId},competent_dept = (select dept_name from sys_dept where dept_id = #{competentDeptId}),</if>
<if test="awardsLevel != null">awards_level = #{awardsLevel},</if>
<if test="deptDirectorId != null">dept_director_id = #{deptDirectorId},dept_director = (select user_name from sys_user where user_id = #{deptDirectorId}),</if>
<if test="awardsTime != null">awards_time = #{awardsTime},</if>
<if test="awardsType != null">awards_type = #{awardsType},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="auditState != null">audit_state = #{auditState},</if>
<if test="applyId != null">apply_id = #{applyId},</if>
<if test="applyName != null">apply_name = #{applyName},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<update id="deleteSchoolScAwardsById" parameterType="Long">
update school_sc_awards set del_flag = '1' where id = #{id}
</update>
<update id="deleteSchoolScAwardsByIds" parameterType="String">
update school_sc_awards set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<insert id="batchSchoolAccessory">
insert into school_accessory( id, business_id, module_name, accessory_type, accessory_url, accessory_name, create_by, create_time) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.businessId}, #{item.moduleName}, #{item.accessoryType}, #{item.accessoryUrl}, #{item.accessoryName}, #{item.createBy}, #{item.createTime})
</foreach>
</insert>
<delete id="deleteSchoolAccessoryByBusinessIds" parameterType="String">
delete from school_accessory where accessory_type = "学校获奖附件" and business_id in
<foreach item="businessId" collection="array" open="(" separator="," close=")">
#{businessId}
</foreach>
</delete>
<delete id="deleteSchoolAccessoryByBusinessId" parameterType="Long">
delete from school_accessory where accessory_type = "学校获奖附件" and business_id = #{businessId}
</delete>
<select id="selectAccessoryList" resultType="SchoolAccessory">
select id, business_id, module_name, accessory_type, accessory_url, accessory_name, create_by, create_time
from school_accessory where accessory_type = "学校获奖附件" and del_flag = '0'
</select>
</mapper>
<?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.system.mapper.schoolRewardsPunishments.SchoolScDisciplineMapper">
<resultMap type="SchoolScDiscipline" id="SchoolScDisciplineResult">
<result property="id" column="id" />
<result property="schoolYear" column="school_year" />
<result property="semester" column="semester" />
<result property="gradeYear" column="grade_year" />
<result property="gradeId" column="grade_id" />
<result property="gradeName" column="grade_name" />
<result property="classId" column="class_id" />
<result property="className" column="class_name" />
<result property="classType" column="class_type" />
<result property="name" column="name" />
<result property="sex" column="sex" />
<result property="idCard" column="id_card" />
<result property="classTeacher" column="class_teacher" />
<result property="gradeDirector" column="grade_director" />
<result property="violateType" column="violate_type" />
<result property="violateNum" column="violate_num" />
<result property="punishResult" column="punish_result" />
<result property="punishTime" column="punish_time" />
<result property="remark" column="remark" />
<result property="auditState" column="audit_state" />
<result property="applyId" column="apply_id" />
<result property="applyName" column="apply_name" />
<result property="applyTime" column="apply_time" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectSchoolScDisciplineVo">
select id, school_year, semester, grade_year, grade_id, grade_name, class_id, class_name,
class_type, name, sex, id_card, class_teacher, grade_director, violate_type, violate_num,
punish_result, punish_time, remark, audit_state, apply_id, apply_name, apply_time, create_by,
create_time, update_by, update_time, del_flag
from school_sc_discipline
</sql>
<select id="selectSchoolScDisciplineList" parameterType="SchoolScDiscipline" resultMap="SchoolScDisciplineResult">
<include refid="selectSchoolScDisciplineVo"/>
<where>
<if test="schoolYear != null and schoolYear != ''"> and school_year = #{schoolYear}</if>
<if test="semester != null and semester != ''"> and semester = #{semester}</if>
<if test="gradeYear != null and gradeYear != ''"> and grade_year = #{gradeYear}</if>
<if test="gradeId != null "> and grade_id = #{gradeId}</if>
<if test="gradeName != null and gradeName != ''"> and grade_name like concat('%', #{gradeName}, '%')</if>
<if test="classId != null "> and class_id = #{classId}</if>
<if test="className != null and className != ''"> and class_name like concat('%', #{className}, '%')</if>
<if test="classType != null and classType != ''"> and class_type = #{classType}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="sex != null and sex != ''"> and sex = #{sex}</if>
<if test="idCard != null and idCard != ''"> and id_card like concat('%', #{idCard}, '%')</if>
<if test="classTeacher != null and classTeacher != ''"> and class_teacher like concat('%', #{classTeacher}, '%')</if>
<if test="gradeDirector != null and gradeDirector != ''"> and grade_director = #{gradeDirector}</if>
<if test="violateType != null and violateType != ''"> and violate_type = #{violateType}</if>
<if test="violateNum != null and violateNum != ''"> and violate_num = #{violateNum}</if>
<if test="punishResult != null and punishResult != ''"> and punish_result = #{punishResult}</if>
<if test="punishTime != null "> and punish_time = #{punishTime}</if>
<if test="auditState != null and auditState != ''"> and audit_state = #{auditState}</if>
<if test="applyId != null "> and a.apply_id = #{applyId}</if>
</where>
</select>
<select id="selectSchoolScDisciplineById" parameterType="Long" resultMap="SchoolScDisciplineResult">
<include refid="selectSchoolScDisciplineVo"/>
where id = #{id}
</select>
<insert id="insertSchoolScDiscipline" parameterType="SchoolScDiscipline" useGeneratedKeys="true" keyProperty="id">
insert into school_sc_discipline
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="schoolYear != null">school_year,</if>
<if test="semester != null">semester,</if>
<if test="gradeYear != null">grade_year,</if>
<if test="gradeId != null">grade_id,</if>
<if test="gradeName != null">grade_name,</if>
<if test="classId != null">class_id,</if>
<if test="className != null">class_name,</if>
<if test="classType != null">class_type,</if>
<if test="name != null">name,</if>
<if test="sex != null">sex,</if>
<if test="idCard != null">id_card,</if>
<if test="classTeacher != null">class_teacher,</if>
<if test="gradeDirector != null">grade_director,</if>
<if test="violateType != null">violate_type,</if>
<if test="violateNum != null">violate_num,</if>
<if test="punishResult != null">punish_result,</if>
<if test="punishTime != null">punish_time,</if>
<if test="remark != null">remark,</if>
<if test="auditState != null">audit_state,</if>
<if test="applyId != null">apply_id,</if>
<if test="applyName != null">apply_name,</if>
<if test="applyTime != null">apply_time,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="schoolYear != null">#{schoolYear},</if>
<if test="semester != null">#{semester},</if>
<if test="gradeYear != null">#{gradeYear},</if>
<if test="gradeId != null">#{gradeId},</if>
<if test="gradeName != null">#{gradeName},</if>
<if test="classId != null">#{classId},</if>
<if test="className != null">#{className},</if>
<if test="classType != null">#{classType},</if>
<if test="name != null">#{name},</if>
<if test="sex != null">#{sex},</if>
<if test="idCard != null">#{idCard},</if>
<if test="classTeacher != null">#{classTeacher},</if>
<if test="gradeDirector != null">#{gradeDirector},</if>
<if test="violateType != null">#{violateType},</if>
<if test="violateNum != null">#{violateNum},</if>
<if test="punishResult != null">#{punishResult},</if>
<if test="punishTime != null">#{punishTime},</if>
<if test="remark != null">#{remark},</if>
<if test="auditState != null">#{auditState},</if>
<if test="applyId != null">#{applyId},</if>
<if test="applyName != null">#{applyName},</if>
<if test="applyTime != null">#{applyTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateSchoolScDiscipline" parameterType="SchoolScDiscipline">
update school_sc_discipline
<trim prefix="SET" suffixOverrides=",">
<if test="schoolYear != null">school_year = #{schoolYear},</if>
<if test="semester != null">semester = #{semester},</if>
<if test="gradeYear != null">grade_year = #{gradeYear},</if>
<if test="gradeId != null">grade_id = #{gradeId},</if>
<if test="gradeName != null">grade_name = #{gradeName},</if>
<if test="classId != null">class_id = #{classId},</if>
<if test="className != null">class_name = #{className},</if>
<if test="classType != null">class_type = #{classType},</if>
<if test="name != null">name = #{name},</if>
<if test="sex != null">sex = #{sex},</if>
<if test="idCard != null">id_card = #{idCard},</if>
<if test="classTeacher != null">class_teacher = #{classTeacher},</if>
<if test="gradeDirector != null">grade_director = #{gradeDirector},</if>
<if test="violateType != null">violate_type = #{violateType},</if>
<if test="violateNum != null">violate_num = #{violateNum},</if>
<if test="punishResult != null">punish_result = #{punishResult},</if>
<if test="punishTime != null">punish_time = #{punishTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="auditState != null">audit_state = #{auditState},</if>
<if test="applyId != null">apply_id = #{applyId},</if>
<if test="applyName != null">apply_name = #{applyName},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSchoolScDisciplineById" parameterType="Long">
delete from school_sc_discipline where id = #{id}
</delete>
<delete id="deleteSchoolScDisciplineByIds" parameterType="String">
delete from school_sc_discipline where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="getGrade" resultType="Map">
SELECT id as gradeId, grade_value as gradeValue, school_year as schoolYear, grade_year as gradeYear,
grade_name as gradeName, remark as remark
FROM `school_grade` ORDER BY grade_year DESC LIMIT 3
</select>
<select id="getClassList" resultType="Map">
</select>
</mapper>
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