班级管理
parent
86472ce30b
commit
e8ae7079c8
6
pom.xml
6
pom.xml
|
@ -177,6 +177,12 @@
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 业务模块-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-business</artifactId>
|
||||||
|
<version>${ruoyi.version}</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
|
|
@ -76,10 +76,17 @@
|
||||||
<artifactId>ruoyi-generator</artifactId>
|
<artifactId>ruoyi-generator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 测试 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 业务模块-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-business</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -4,6 +4,7 @@ import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
|
import org.springframework.context.annotation.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动程序
|
* 启动程序
|
||||||
|
@ -11,6 +12,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
||||||
|
@MapperScan("com.ruoyi.*.mapper")
|
||||||
public class RuoYiApplication {
|
public class RuoYiApplication {
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
SpringApplication.run(RuoYiApplication.class, args);
|
SpringApplication.run(RuoYiApplication.class, args);
|
||||||
|
|
|
@ -0,0 +1,116 @@
|
||||||
|
package com.ruoyi.web.controller.business;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.*;
|
||||||
|
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.Result;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.business.domain.Clazz;
|
||||||
|
import com.ruoyi.business.domain.req.ClazzQueryReq;
|
||||||
|
import com.ruoyi.business.domain.req.ClazzSaveReq;
|
||||||
|
import com.ruoyi.business.domain.req.ClazzEditReq;
|
||||||
|
import com.ruoyi.business.service.ClazzService;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级Controller
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-04-22
|
||||||
|
*/
|
||||||
|
@Api(tags = "班级")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/business/clazz")
|
||||||
|
public class ClazzController extends BaseController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注入班级Service接口
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private ClazzService clazzService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询班级列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取班级列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('business:clazz:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public Result<TableDataInfo<Clazz>> list(ClazzQueryReq clazzQueryReq) {
|
||||||
|
startPage();
|
||||||
|
List<Clazz> list = clazzService.list(Clazz.queryBuild(clazzQueryReq));
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出班级列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("导出班级列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('business:clazz:export')")
|
||||||
|
@Log(title = "班级", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, Clazz clazz) {
|
||||||
|
List<Clazz> list = clazzService.list(clazz);
|
||||||
|
ExcelUtil<Clazz> util = new ExcelUtil<Clazz>(Clazz.class);
|
||||||
|
util.exportExcel(response, list, "班级数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取班级详细信息
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取班级详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('business:clazz:query')")
|
||||||
|
@GetMapping(value = "/{clazzId}")
|
||||||
|
@ApiImplicitParam(name = "clazzId", value = "clazzId", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||||
|
public Result<Clazz> getInfo(@PathVariable("clazzId") Long clazzId) {
|
||||||
|
return Result.success(clazzService.getById(clazzId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增班级
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('business:clazz:add')")
|
||||||
|
@Log(title = "班级", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
@ApiOperation("新增班级")
|
||||||
|
public Result<String> add(@RequestBody ClazzSaveReq clazzSaveReq) {
|
||||||
|
return toAjax(clazzService.save(Clazz.saveBuild(clazzSaveReq)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改班级
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('business:clazz:edit')")
|
||||||
|
@Log(title = "班级", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/{clazzId}")
|
||||||
|
@ApiOperation("修改班级")
|
||||||
|
public Result<String> edit(@PathVariable Long clazzId, @RequestBody ClazzEditReq clazzEditReq) {
|
||||||
|
return toAjax(clazzService.updateById(Clazz.editBuild(clazzId,clazzEditReq)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除班级
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('business:clazz:remove')")
|
||||||
|
@Log(title = "班级", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{clazzIds}")
|
||||||
|
@ApiOperation("删除班级")
|
||||||
|
@ApiImplicitParam(name = "clazzId", value = "clazzId", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||||
|
public Result<String> remove(@PathVariable List<Long> clazzIds) {
|
||||||
|
return toAjax(clazzService.removeBatchByIds(clazzIds));
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,6 +16,7 @@
|
||||||
<module>ruoyi-framework</module>
|
<module>ruoyi-framework</module>
|
||||||
<module>ruoyi-system</module>
|
<module>ruoyi-system</module>
|
||||||
<module>ruoyi-common</module>
|
<module>ruoyi-common</module>
|
||||||
|
<module>ruoyi-business</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>ruoyi-basic</artifactId>
|
||||||
|
<version>3.8.6</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-business</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
business业务模块
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- 通用工具-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>ruoyi-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,82 @@
|
||||||
|
package com.ruoyi.business.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.business.domain.req.ClazzQueryReq;
|
||||||
|
import com.ruoyi.business.domain.req.ClazzSaveReq;
|
||||||
|
import com.ruoyi.business.domain.req.ClazzEditReq;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级对象 t_clazz
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-04-22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName("t_clazz")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel(value = "Clazz", description = "班级")
|
||||||
|
public class Clazz extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 班级ID */
|
||||||
|
@TableId(value = "clazz_id",type = IdType.AUTO)
|
||||||
|
@ApiModelProperty(name = "班级ID", value = "班级ID")
|
||||||
|
private Long clazzId;
|
||||||
|
|
||||||
|
/** 班级名称 */
|
||||||
|
@Excel(name = "班级名称")
|
||||||
|
@ApiModelProperty(name = "班级名称", value = "班级名称")
|
||||||
|
private String clazzName;
|
||||||
|
|
||||||
|
/** 状态 */
|
||||||
|
@Excel(name = "状态")
|
||||||
|
@ApiModelProperty(name = "状态", value = "状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询构造器
|
||||||
|
*/
|
||||||
|
public static Clazz queryBuild( ClazzQueryReq clazzQueryReq){
|
||||||
|
return Clazz.builder()
|
||||||
|
.clazzId(clazzQueryReq.getClazzId())
|
||||||
|
.clazzName(clazzQueryReq.getClazzName())
|
||||||
|
.status(clazzQueryReq.getStatus())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加构造器
|
||||||
|
*/
|
||||||
|
public static Clazz saveBuild(ClazzSaveReq clazzSaveReq){
|
||||||
|
return Clazz.builder()
|
||||||
|
.clazzName(clazzSaveReq.getClazzName())
|
||||||
|
.status(clazzSaveReq.getStatus())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改构造器
|
||||||
|
*/
|
||||||
|
public static Clazz editBuild(Long clazzId, ClazzEditReq clazzEditReq){
|
||||||
|
return Clazz.builder()
|
||||||
|
.clazzId(clazzId)
|
||||||
|
.clazzName(clazzEditReq.getClazzName())
|
||||||
|
.status(clazzEditReq.getStatus())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.ruoyi.business.domain.req;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级对象 t_clazz
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-04-22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "ClazzEditReq", description = "班级")
|
||||||
|
public class ClazzEditReq extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 班级名称 */
|
||||||
|
@ApiModelProperty(name = "班级名称", value = "班级名称")
|
||||||
|
private String clazzName;
|
||||||
|
|
||||||
|
/** 状态 */
|
||||||
|
@ApiModelProperty(name = "状态", value = "状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.ruoyi.business.domain.req;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级对象 t_clazz
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-04-22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "ClazzQueryReq", description = "班级")
|
||||||
|
public class ClazzQueryReq extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 班级ID */
|
||||||
|
@TableId(value = "clazzId",type = IdType.AUTO)
|
||||||
|
@ApiModelProperty(name = "班级ID", value = "班级ID")
|
||||||
|
private Long clazzId;
|
||||||
|
|
||||||
|
/** 班级名称 */
|
||||||
|
@ApiModelProperty(name = "班级名称", value = "班级名称")
|
||||||
|
private String clazzName;
|
||||||
|
|
||||||
|
/** 状态 */
|
||||||
|
@ApiModelProperty(name = "状态", value = "状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.ruoyi.business.domain.req;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级对象 t_clazz
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-04-22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "ClazzSaveReq", description = "班级")
|
||||||
|
public class ClazzSaveReq extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 班级ID */
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "班级ID", value = "班级ID")
|
||||||
|
private Long clazzId;
|
||||||
|
|
||||||
|
/** 班级名称 */
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "班级名称", value = "班级名称")
|
||||||
|
private String clazzName;
|
||||||
|
|
||||||
|
/** 状态 */
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "状态", value = "状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.ruoyi.business.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.*;
|
||||||
|
import com.ruoyi.business.domain.*;
|
||||||
|
import org.springframework.stereotype.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级Mapper接口
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-04-22
|
||||||
|
*/
|
||||||
|
public interface ClazzMapper extends BaseMapper<Clazz> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.ruoyi.business.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.*;
|
||||||
|
import com.ruoyi.business.domain.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级Service接口
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-04-22
|
||||||
|
*/
|
||||||
|
public interface ClazzService extends IService<Clazz> {
|
||||||
|
/**
|
||||||
|
* 查询班级列表
|
||||||
|
*
|
||||||
|
* @param clazz 班级
|
||||||
|
* @return 班级集合
|
||||||
|
*/
|
||||||
|
public List<Clazz> list(Clazz clazz);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.ruoyi.business.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.*;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.*;
|
||||||
|
import com.ruoyi.business.domain.*;
|
||||||
|
import com.ruoyi.business.mapper.*;
|
||||||
|
import com.ruoyi.business.service.*;
|
||||||
|
import com.ruoyi.common.utils.*;
|
||||||
|
import lombok.extern.slf4j.*;
|
||||||
|
import org.springframework.stereotype.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级Service业务层处理
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-04-22
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class ClazzServiceImpl extends ServiceImpl<ClazzMapper, Clazz> implements ClazzService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询班级列表
|
||||||
|
*
|
||||||
|
* @param clazz 班级
|
||||||
|
* @return 班级
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Clazz> list(Clazz clazz) {
|
||||||
|
LambdaQueryWrapper<Clazz> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
if (ObjUtils.notNull(clazz.getClazzId())) {
|
||||||
|
queryWrapper.eq(Clazz::getClazzId, clazz.getClazzId());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjUtils.notNull(clazz.getClazzName())) {
|
||||||
|
queryWrapper.like(Clazz::getClazzName, clazz.getClazzName());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjUtils.notNull(clazz.getStatus())) {
|
||||||
|
queryWrapper.eq(Clazz::getStatus, clazz.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
return list(queryWrapper);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?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.business.mapper.ClazzMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.business.domain.Clazz" id="ClazzResult">
|
||||||
|
<result property="clazzId" column="clazz_id" />
|
||||||
|
<result property="clazzName" column="clazz_name" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<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="remark" column="remark" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectClazzVo">
|
||||||
|
select clazz_id, clazz_name, status, create_by, create_time, update_by, update_time, remark from t_clazz
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue