feat: 鱼测云经销商管理后台,代码提交。
This commit is contained in:
29
fishery-demo/pom.xml
Normal file
29
fishery-demo/pom.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.limap</groupId>
|
||||
<artifactId>fishery_base</artifactId>
|
||||
<version>3.8.5</version>
|
||||
</parent>
|
||||
<artifactId>fishery-demo</artifactId>
|
||||
<description>demo演示模块</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- 核心模块 -->
|
||||
<dependency>
|
||||
<groupId>com.limap</groupId>
|
||||
<artifactId>fishery-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 日志记录 -->
|
||||
<dependency>
|
||||
<groupId>com.limap</groupId>
|
||||
<artifactId>fishery-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.limap.demo.controller;
|
||||
|
||||
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.limap.common.core.controller.BaseController;
|
||||
import com.limap.common.core.domain.AjaxResult;
|
||||
import com.limap.common.enums.BusinessType;
|
||||
import com.limap.common.log.annotation.Log;
|
||||
import com.limap.demo.domain.DemoClasses;
|
||||
import com.limap.demo.service.IDemoClassesService;
|
||||
import com.limap.common.utils.poi.ExcelUtil;
|
||||
import com.limap.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 主子表演示Controller
|
||||
*
|
||||
* @author metaee
|
||||
* @date 2023-02-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/demo/classes")
|
||||
public class DemoClassesController extends BaseController {
|
||||
@Autowired
|
||||
private IDemoClassesService demoClassesService;
|
||||
|
||||
/**
|
||||
* 查询主子表演示列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:classes:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DemoClasses demoClasses) {
|
||||
startPage();
|
||||
List<DemoClasses> list = demoClassesService.selectDemoClassesList(demoClasses);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出主子表演示列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:classes:export')")
|
||||
@Log(title = "主子表演示", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DemoClasses demoClasses) {
|
||||
List<DemoClasses> list = demoClassesService.selectDemoClassesList(demoClasses);
|
||||
ExcelUtil<DemoClasses> util = new ExcelUtil<DemoClasses>(DemoClasses.class);
|
||||
util.exportExcel(response, list, "主子表演示数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主子表演示详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:classes:query')")
|
||||
@GetMapping(value = "/{classesId}")
|
||||
public AjaxResult getInfo(@PathVariable("classesId") Long classesId) {
|
||||
return success(demoClassesService.selectDemoClassesByClassesId(classesId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增主子表演示
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:classes:add')")
|
||||
@Log(title = "主子表演示", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DemoClasses demoClasses) {
|
||||
return toAjax(demoClassesService.insertDemoClasses(demoClasses));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改主子表演示
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:classes:edit')")
|
||||
@Log(title = "主子表演示", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DemoClasses demoClasses) {
|
||||
return toAjax(demoClassesService.updateDemoClasses(demoClasses));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除主子表演示
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:classes:remove')")
|
||||
@Log(title = "主子表演示", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{classesIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] classesIds) {
|
||||
return toAjax(demoClassesService.deleteDemoClassesByClassesIds(classesIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.limap.demo.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
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.limap.common.core.controller.BaseController;
|
||||
import com.limap.common.core.domain.AjaxResult;
|
||||
import com.limap.common.enums.BusinessType;
|
||||
import com.limap.common.log.annotation.Log;
|
||||
import com.limap.demo.domain.DemoSchool;
|
||||
import com.limap.demo.service.IDemoSchoolService;
|
||||
import com.limap.common.utils.poi.ExcelUtil;
|
||||
|
||||
/**
|
||||
* 树表演示Controller
|
||||
*
|
||||
* @author metaee
|
||||
* @date 2023-02-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/demo/school")
|
||||
public class DemoSchoolController extends BaseController {
|
||||
@Autowired
|
||||
private IDemoSchoolService demoSchoolService;
|
||||
|
||||
/**
|
||||
* 查询树表演示列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:school:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(DemoSchool demoSchool) {
|
||||
List<DemoSchool> list = demoSchoolService.selectDemoSchoolList(demoSchool);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出树表演示列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:school:export')")
|
||||
@Log(title = "树表演示", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DemoSchool demoSchool) {
|
||||
List<DemoSchool> list = demoSchoolService.selectDemoSchoolList(demoSchool);
|
||||
ExcelUtil<DemoSchool> util = new ExcelUtil<DemoSchool>(DemoSchool.class);
|
||||
util.exportExcel(response, list, "树表演示数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取树表演示详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:school:query')")
|
||||
@GetMapping(value = "/{schoolId}")
|
||||
public AjaxResult getInfo(@PathVariable("schoolId") Long schoolId) {
|
||||
return success(demoSchoolService.getById(schoolId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增树表演示
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:school:add')")
|
||||
@Log(title = "树表演示", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DemoSchool demoSchool) {
|
||||
return toAjax(demoSchoolService.save(demoSchool));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改树表演示
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:school:edit')")
|
||||
@Log(title = "树表演示", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DemoSchool demoSchool) {
|
||||
return toAjax(demoSchoolService.updateById(demoSchool));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除树表演示
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:school:remove')")
|
||||
@Log(title = "树表演示", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{schoolIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] schoolIds) {
|
||||
return toAjax(demoSchoolService.removeByIds(Arrays.asList(schoolIds)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.limap.demo.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
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.limap.common.core.controller.BaseController;
|
||||
import com.limap.common.core.domain.AjaxResult;
|
||||
import com.limap.common.enums.BusinessType;
|
||||
import com.limap.common.log.annotation.Log;
|
||||
import com.limap.demo.domain.DemoStudent;
|
||||
import com.limap.demo.service.IDemoStudentService;
|
||||
import com.limap.common.utils.poi.ExcelUtil;
|
||||
import com.limap.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 单表演示Controller
|
||||
*
|
||||
* @author metaee
|
||||
* @date 2023-02-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/demo/student")
|
||||
public class DemoStudentController extends BaseController {
|
||||
@Autowired
|
||||
private IDemoStudentService demoStudentService;
|
||||
|
||||
/**
|
||||
* 查询单表演示列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:student:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DemoStudent demoStudent) {
|
||||
startPage();
|
||||
List<DemoStudent> list = demoStudentService.selectDemoStudentList(demoStudent);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出单表演示列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:student:export')")
|
||||
@Log(title = "单表演示", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DemoStudent demoStudent) {
|
||||
List<DemoStudent> list = demoStudentService.selectDemoStudentList(demoStudent);
|
||||
ExcelUtil<DemoStudent> util = new ExcelUtil<DemoStudent>(DemoStudent.class);
|
||||
util.exportExcel(response, list, "单表演示数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单表演示详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:student:query')")
|
||||
@GetMapping(value = "/{studentId}")
|
||||
public AjaxResult getInfo(@PathVariable("studentId") Long studentId) {
|
||||
return success(demoStudentService.getById(studentId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增单表演示
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:student:add')")
|
||||
@Log(title = "单表演示", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DemoStudent demoStudent) {
|
||||
return toAjax(demoStudentService.save(demoStudent));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改单表演示
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:student:edit')")
|
||||
@Log(title = "单表演示", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DemoStudent demoStudent) {
|
||||
return toAjax(demoStudentService.updateById(demoStudent));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单表演示
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('demo:student:remove')")
|
||||
@Log(title = "单表演示", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{studentIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] studentIds) {
|
||||
return toAjax(demoStudentService.removeByIds(Arrays.asList(studentIds)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.limap.demo.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.limap.common.annotation.Excel;
|
||||
import com.limap.common.core.domain.BasePlusEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 主子表演示对象 demo_classes
|
||||
*
|
||||
* @author metaee
|
||||
* @date 2023-02-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "demo_classes")
|
||||
public class DemoClasses extends BasePlusEntity {
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long classesId;
|
||||
|
||||
/** 班级名称 */
|
||||
@Excel(name = "班级名称")
|
||||
private String classesName;
|
||||
|
||||
/** 班级年级 */
|
||||
@Excel(name = "班级年级")
|
||||
private Long classesGrade;
|
||||
|
||||
/** 班主任 */
|
||||
@Excel(name = "班主任")
|
||||
private String classesTeacher;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 单表演示信息 */
|
||||
@TableField(exist = false)
|
||||
private List<DemoStudent> demoStudentList;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.limap.demo.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.limap.common.annotation.Excel;
|
||||
import com.limap.common.core.domain.TreePlusEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 树表演示对象 demo_school
|
||||
*
|
||||
* @author metaee
|
||||
* @date 2023-02-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "demo_school")
|
||||
public class DemoSchool extends TreePlusEntity {
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long schoolId;
|
||||
|
||||
/** 学生名称 */
|
||||
@Excel(name = "学生名称")
|
||||
private String schoolName;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.limap.demo.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.limap.common.annotation.Excel;
|
||||
import com.limap.common.core.domain.BasePlusEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 单表演示对象 demo_student
|
||||
*
|
||||
* @author metaee
|
||||
* @date 2023-02-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "demo_student")
|
||||
public class DemoStudent extends BasePlusEntity {
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long studentId;
|
||||
|
||||
/** 所属班级ID */
|
||||
@Excel(name = "所属班级ID")
|
||||
private Long classesId;
|
||||
|
||||
/** 学生名称 */
|
||||
@Excel(name = "学生名称")
|
||||
private String studentName;
|
||||
|
||||
/** 年龄 */
|
||||
@Excel(name = "年龄")
|
||||
private Long studentAge;
|
||||
|
||||
/** 性别(0男 1女 2未知) */
|
||||
@Excel(name = "性别", readConverterExp = "0=男,1=女,2=未知")
|
||||
private String studentSex;
|
||||
|
||||
/** 生日 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date studentBirthday;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.limap.demo.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.limap.demo.domain.DemoClasses;
|
||||
|
||||
/**
|
||||
* 主子表演示Mapper接口
|
||||
*
|
||||
* @author metaee
|
||||
* @date 2023-02-28
|
||||
*/
|
||||
public interface DemoClassesMapper extends BaseMapper<DemoClasses> {
|
||||
/**
|
||||
* 查询主子表演示
|
||||
*
|
||||
* @param classesId 主子表演示主键
|
||||
* @return 主子表演示
|
||||
*/
|
||||
public DemoClasses selectDemoClassesByClassesId(Long classesId);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.limap.demo.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.limap.demo.domain.DemoSchool;
|
||||
|
||||
/**
|
||||
* 树表演示Mapper接口
|
||||
*
|
||||
* @author metaee
|
||||
* @date 2023-02-28
|
||||
*/
|
||||
public interface DemoSchoolMapper extends BaseMapper<DemoSchool> {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.limap.demo.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.limap.demo.domain.DemoStudent;
|
||||
|
||||
/**
|
||||
* 单表演示Mapper接口
|
||||
*
|
||||
* @author metaee
|
||||
* @date 2023-02-28
|
||||
*/
|
||||
public interface DemoStudentMapper extends BaseMapper<DemoStudent> {
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.limap.demo.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.limap.demo.domain.DemoClasses;
|
||||
|
||||
/**
|
||||
* 主子表演示Service接口
|
||||
*
|
||||
* @author metaee
|
||||
* @date 2023-02-28
|
||||
*/
|
||||
public interface IDemoClassesService extends IService<DemoClasses> {
|
||||
/**
|
||||
* 查询主子表演示列表
|
||||
*
|
||||
* @param demoClasses 主子表演示
|
||||
* @return 主子表演示集合
|
||||
*/
|
||||
public List<DemoClasses> selectDemoClassesList(DemoClasses demoClasses);
|
||||
/**
|
||||
* 查询主子表演示
|
||||
*
|
||||
* @param classesId 主子表演示主键
|
||||
* @return 主子表演示
|
||||
*/
|
||||
public DemoClasses selectDemoClassesByClassesId(Long classesId);
|
||||
|
||||
/**
|
||||
* 新增主子表演示
|
||||
*
|
||||
* @param demoClasses 主子表演示
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDemoClasses(DemoClasses demoClasses);
|
||||
|
||||
/**
|
||||
* 修改主子表演示
|
||||
*
|
||||
* @param demoClasses 主子表演示
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDemoClasses(DemoClasses demoClasses);
|
||||
|
||||
/**
|
||||
* 批量删除主子表演示
|
||||
*
|
||||
* @param classesIds 需要删除的主子表演示主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDemoClassesByClassesIds(Long[] classesIds);
|
||||
|
||||
/**
|
||||
* 删除主子表演示信息
|
||||
*
|
||||
* @param classesId 主子表演示主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDemoClassesByClassesId(Long classesId);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.limap.demo.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.limap.demo.domain.DemoSchool;
|
||||
|
||||
/**
|
||||
* 树表演示Service接口
|
||||
*
|
||||
* @author metaee
|
||||
* @date 2023-02-28
|
||||
*/
|
||||
public interface IDemoSchoolService extends IService<DemoSchool> {
|
||||
/**
|
||||
* 查询树表演示列表
|
||||
*
|
||||
* @param demoSchool 树表演示
|
||||
* @return 树表演示集合
|
||||
*/
|
||||
public List<DemoSchool> selectDemoSchoolList(DemoSchool demoSchool);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.limap.demo.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.limap.demo.domain.DemoStudent;
|
||||
|
||||
/**
|
||||
* 单表演示Service接口
|
||||
*
|
||||
* @author metaee
|
||||
* @date 2023-02-28
|
||||
*/
|
||||
public interface IDemoStudentService extends IService<DemoStudent> {
|
||||
/**
|
||||
* 查询单表演示列表
|
||||
*
|
||||
* @param demoStudent 单表演示
|
||||
* @return 单表演示集合
|
||||
*/
|
||||
public List<DemoStudent> selectDemoStudentList(DemoStudent demoStudent);
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package com.limap.demo.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.limap.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.limap.common.utils.StringUtils;
|
||||
import java.util.Arrays;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.limap.demo.domain.DemoStudent;
|
||||
import com.limap.demo.mapper.DemoStudentMapper;
|
||||
import com.limap.demo.mapper.DemoClassesMapper;
|
||||
import com.limap.demo.domain.DemoClasses;
|
||||
import com.limap.demo.service.IDemoClassesService;
|
||||
|
||||
/**
|
||||
* 主子表演示Service业务层处理
|
||||
*
|
||||
* @author metaee
|
||||
* @date 2023-02-28
|
||||
*/
|
||||
@Service
|
||||
public class DemoClassesServiceImpl extends ServiceImpl<DemoClassesMapper, DemoClasses> implements IDemoClassesService {
|
||||
@Autowired
|
||||
private DemoClassesMapper demoClassesMapper;
|
||||
|
||||
@Autowired
|
||||
private DemoStudentMapper demoStudentMapper;
|
||||
|
||||
/**
|
||||
* 查询主子表演示列表
|
||||
*
|
||||
* @param demoClasses 主子表演示
|
||||
* @return 主子表演示
|
||||
*/
|
||||
@Override
|
||||
public List<DemoClasses> selectDemoClassesList(DemoClasses demoClasses) {
|
||||
LambdaQueryWrapper<DemoClasses> queryWrapper = Wrappers.lambdaQuery();
|
||||
if (StringUtils.isNotEmpty(demoClasses.getClassesName())) {
|
||||
queryWrapper.like(DemoClasses::getClassesName, demoClasses.getClassesName());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(demoClasses.getStatus())) {
|
||||
queryWrapper.eq(DemoClasses::getStatus, demoClasses.getStatus());
|
||||
}
|
||||
return demoClassesMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询主子表演示
|
||||
*
|
||||
* @param classesId 主子表演示主键
|
||||
* @return 主子表演示
|
||||
*/
|
||||
@Override
|
||||
public DemoClasses selectDemoClassesByClassesId(Long classesId) {
|
||||
return demoClassesMapper.selectDemoClassesByClassesId(classesId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增主子表演示
|
||||
*
|
||||
* @param demoClasses 主子表演示
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insertDemoClasses(DemoClasses demoClasses) {
|
||||
demoClasses.setCreateTime(DateUtils.getNowDate());
|
||||
int rows = demoClassesMapper.insert(demoClasses);
|
||||
insertDemoStudent(demoClasses);
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改主子表演示
|
||||
*
|
||||
* @param demoClasses 主子表演示
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int updateDemoClasses(DemoClasses demoClasses) {
|
||||
demoClasses.setUpdateTime(DateUtils.getNowDate());
|
||||
LambdaQueryWrapper<DemoStudent> queryWrapper = Wrappers.lambdaQuery();
|
||||
queryWrapper.eq(DemoStudent::getClassesId, demoClasses.getClassesId());
|
||||
demoStudentMapper.delete(queryWrapper);
|
||||
|
||||
insertDemoStudent(demoClasses);
|
||||
return demoClassesMapper.updateById(demoClasses);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除主子表演示
|
||||
*
|
||||
* @param classesIds 需要删除的主子表演示主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteDemoClassesByClassesIds(Long[] classesIds) {
|
||||
LambdaQueryWrapper<DemoStudent> queryWrapper = Wrappers.lambdaQuery();
|
||||
queryWrapper.in(DemoStudent::getClassesId, Arrays.asList(classesIds));
|
||||
demoStudentMapper.delete(queryWrapper);
|
||||
return demoClassesMapper.deleteBatchIds(Arrays.asList(classesIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除主子表演示信息
|
||||
*
|
||||
* @param classesId 主子表演示主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteDemoClassesByClassesId(Long classesId) {
|
||||
LambdaQueryWrapper<DemoStudent> queryWrapper = Wrappers.lambdaQuery();
|
||||
queryWrapper.eq(DemoStudent::getClassesId, classesId);
|
||||
demoStudentMapper.delete(queryWrapper);
|
||||
return demoClassesMapper.deleteById(classesId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增单表演示信息
|
||||
*
|
||||
* @param demoClasses 主子表演示对象
|
||||
*/
|
||||
public void insertDemoStudent(DemoClasses demoClasses) {
|
||||
List<DemoStudent> demoStudentList = demoClasses.getDemoStudentList();
|
||||
Long classesId = demoClasses.getClassesId();
|
||||
if (StringUtils.isNotNull(demoStudentList)) {
|
||||
for (DemoStudent demoStudent : demoStudentList) {
|
||||
demoStudent.setClassesId(classesId);
|
||||
demoStudentMapper.insert(demoStudent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.limap.demo.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.limap.common.utils.StringUtils;
|
||||
import com.limap.demo.mapper.DemoSchoolMapper;
|
||||
import com.limap.demo.domain.DemoSchool;
|
||||
import com.limap.demo.service.IDemoSchoolService;
|
||||
|
||||
/**
|
||||
* 树表演示Service业务层处理
|
||||
*
|
||||
* @author metaee
|
||||
* @date 2023-02-28
|
||||
*/
|
||||
@Service
|
||||
public class DemoSchoolServiceImpl extends ServiceImpl<DemoSchoolMapper, DemoSchool> implements IDemoSchoolService {
|
||||
@Autowired
|
||||
private DemoSchoolMapper demoSchoolMapper;
|
||||
|
||||
/**
|
||||
* 查询树表演示列表
|
||||
*
|
||||
* @param demoSchool 树表演示
|
||||
* @return 树表演示
|
||||
*/
|
||||
@Override
|
||||
public List<DemoSchool> selectDemoSchoolList(DemoSchool demoSchool) {
|
||||
LambdaQueryWrapper<DemoSchool> queryWrapper = Wrappers.lambdaQuery();
|
||||
if (StringUtils.isNotEmpty(demoSchool.getSchoolName())) {
|
||||
queryWrapper.like(DemoSchool::getSchoolName, demoSchool.getSchoolName());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(demoSchool.getStatus())) {
|
||||
queryWrapper.eq(DemoSchool::getStatus, demoSchool.getStatus());
|
||||
}
|
||||
return demoSchoolMapper.selectList(queryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.limap.demo.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.limap.common.utils.StringUtils;
|
||||
import com.limap.demo.mapper.DemoStudentMapper;
|
||||
import com.limap.demo.domain.DemoStudent;
|
||||
import com.limap.demo.service.IDemoStudentService;
|
||||
|
||||
/**
|
||||
* 单表演示Service业务层处理
|
||||
*
|
||||
* @author metaee
|
||||
* @date 2023-02-28
|
||||
*/
|
||||
@Service
|
||||
public class DemoStudentServiceImpl extends ServiceImpl<DemoStudentMapper, DemoStudent> implements IDemoStudentService {
|
||||
@Autowired
|
||||
private DemoStudentMapper demoStudentMapper;
|
||||
|
||||
/**
|
||||
* 查询单表演示列表
|
||||
*
|
||||
* @param demoStudent 单表演示
|
||||
* @return 单表演示
|
||||
*/
|
||||
@Override
|
||||
public List<DemoStudent> selectDemoStudentList(DemoStudent demoStudent) {
|
||||
LambdaQueryWrapper<DemoStudent> queryWrapper = Wrappers.lambdaQuery();
|
||||
if (StringUtils.isNotEmpty(demoStudent.getStudentName())) {
|
||||
queryWrapper.like(DemoStudent::getStudentName, demoStudent.getStudentName());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(demoStudent.getStudentSex())) {
|
||||
queryWrapper.eq(DemoStudent::getStudentSex, demoStudent.getStudentSex());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(demoStudent.getStatus())) {
|
||||
queryWrapper.eq(DemoStudent::getStatus, demoStudent.getStatus());
|
||||
}
|
||||
return demoStudentMapper.selectList(queryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?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.limap.demo.mapper.DemoClassesMapper">
|
||||
<resultMap type="DemoClasses" id="DemoClassesResult">
|
||||
<result property="classesId" column="classes_id" />
|
||||
<result property="classesName" column="classes_name" />
|
||||
<result property="classesGrade" column="classes_grade" />
|
||||
<result property="classesTeacher" column="classes_teacher" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<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>
|
||||
|
||||
<resultMap id="DemoClassesDemoStudentResult" type="DemoClasses" extends="DemoClassesResult">
|
||||
<collection property="demoStudentList" notNullColumn="sub_student_id" javaType="java.util.List" resultMap="DemoStudentResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="DemoStudent" id="DemoStudentResult">
|
||||
<result property="studentId" column="sub_student_id" />
|
||||
<result property="classesId" column="sub_classes_id" />
|
||||
<result property="studentName" column="sub_student_name" />
|
||||
<result property="studentAge" column="sub_student_age" />
|
||||
<result property="studentSex" column="sub_student_sex" />
|
||||
<result property="studentBirthday" column="sub_student_birthday" />
|
||||
<result property="status" column="sub_status" />
|
||||
<result property="delFlag" column="sub_del_flag" />
|
||||
<result property="createBy" column="sub_create_by" />
|
||||
<result property="createTime" column="sub_create_time" />
|
||||
<result property="updateBy" column="sub_update_by" />
|
||||
<result property="updateTime" column="sub_update_time" />
|
||||
<result property="remark" column="sub_remark" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectDemoClassesByClassesId" parameterType="Long" resultMap="DemoClassesDemoStudentResult">
|
||||
select a.classes_id, a.classes_name, a.classes_grade, a.classes_teacher, a.status, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
|
||||
b.student_id as sub_student_id, b.classes_id as sub_classes_id, b.student_name as sub_student_name, b.student_age as sub_student_age, b.student_sex as sub_student_sex, b.student_birthday as sub_student_birthday, b.status as sub_status, b.del_flag as sub_del_flag, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time, b.remark as sub_remark
|
||||
from demo_classes a
|
||||
left join demo_student b on b.classes_id = a.classes_id
|
||||
where a.classes_id = #{classesId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?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.limap.demo.mapper.DemoSchoolMapper">
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?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.limap.demo.mapper.DemoStudentMapper">
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user