各列表查询条件
This commit is contained in:
parent
e359147876
commit
07b2122871
|
@ -128,6 +128,10 @@ public class SysOssPersonController extends BaseController {
|
|||
return toAjax(sysOssPersonService.moveByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("file:person:download")
|
||||
@PostMapping("/download/{id}")
|
||||
public void download(@PathVariable Long id, HttpServletResponse response) throws Exception {
|
||||
|
|
|
@ -135,6 +135,11 @@ public class SysOssResourceController extends BaseController {
|
|||
public R<Void> move(@RequestBody SysOssResourceBo bo) {
|
||||
return toAjax(sysOssResourceService.moveByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("file:resource:download")
|
||||
@PostMapping("/download/{id}")
|
||||
public void download(@PathVariable Long id, HttpServletResponse response) throws Exception {
|
||||
|
|
|
@ -138,6 +138,10 @@ public class SysOssTextbookController extends BaseController {
|
|||
return toAjax(sysOssTextbookService.moveByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("file:textbook:download")
|
||||
@PostMapping("/download/{id}")
|
||||
public void download(@PathVariable Long id, HttpServletResponse response) throws Exception {
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
package org.dromara.system.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
|
@ -47,6 +50,11 @@ public class SysHomeShow extends TenantEntity {
|
|||
*/
|
||||
private Long sort;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private Long avatar;
|
||||
|
||||
/**
|
||||
* 教师介绍
|
||||
*/
|
||||
|
|
|
@ -48,5 +48,10 @@ public class SysOssPerson extends TenantEntity {
|
|||
*/
|
||||
private String filePath;
|
||||
|
||||
/**
|
||||
* 文件后缀名
|
||||
*/
|
||||
private String fileSuffix;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -40,6 +40,11 @@ public class SysOssResource extends TenantEntity {
|
|||
*/
|
||||
private String filePath;
|
||||
|
||||
/**
|
||||
* 文件后缀名
|
||||
*/
|
||||
private String fileSuffix;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
|
|
|
@ -39,6 +39,11 @@ public class SysOssTextbook extends TenantEntity {
|
|||
*/
|
||||
private String filePath;
|
||||
|
||||
/**
|
||||
* 文件后缀名
|
||||
*/
|
||||
private String fileSuffix;
|
||||
|
||||
/**
|
||||
* 1课件,2课堂,3作业,4试卷
|
||||
*/
|
||||
|
|
|
@ -49,6 +49,12 @@ public class SysHomeShowBo extends BaseEntity {
|
|||
@NotNull(message = "排序不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long sort;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@NotNull(message = "头像不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long avatar;
|
||||
|
||||
/**
|
||||
* 教师介绍
|
||||
*/
|
||||
|
|
|
@ -31,11 +31,10 @@ public class SysOssPersonBo extends BaseEntity {
|
|||
|
||||
@NotBlank(message = "文件名不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件路径
|
||||
* 文件后缀名
|
||||
*/
|
||||
private String filePath;
|
||||
private String fileSuffix;
|
||||
|
||||
private Integer status;
|
||||
|
||||
|
|
|
@ -33,6 +33,11 @@ public class SysOssResourceBo extends BaseEntity {
|
|||
@NotNull(message = "文件名不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件后缀名
|
||||
*/
|
||||
private String fileSuffix;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
|
|
|
@ -33,9 +33,9 @@ public class SysOssTextbookBo extends BaseEntity {
|
|||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件路径
|
||||
* 文件后缀名
|
||||
*/
|
||||
private String filePath;
|
||||
private String fileSuffix;
|
||||
|
||||
/**
|
||||
* 1课件,2课堂,3作业,4试卷
|
||||
|
|
|
@ -47,6 +47,11 @@ public class SysHomeShowVo implements Serializable {
|
|||
*/
|
||||
private Long sort;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private Long avatar;
|
||||
|
||||
/**
|
||||
* 教师介绍
|
||||
*/
|
||||
|
|
|
@ -75,7 +75,6 @@ public class SysHomeShowServiceImpl implements ISysHomeShowService {
|
|||
lqw.like(StringUtils.isNotBlank(bo.getGradeName()), SysHomeShow::getGradeName, bo.getGradeName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSubjectName()), SysHomeShow::getSubjectName, bo.getSubjectName());
|
||||
lqw.eq(bo.getSort() != null, SysHomeShow::getSort, bo.getSort());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), SysHomeShow::getContent, bo.getContent());
|
||||
lqw.eq(bo.getStatus() != null, SysHomeShow::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
|
|
@ -72,11 +72,10 @@ public class SysHomeTrendServiceImpl implements ISysHomeTrendService {
|
|||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<SysHomeTrend> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getType() != null, SysHomeTrend::getType, bo.getType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTitle()), SysHomeTrend::getTitle, bo.getTitle());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUrl()), SysHomeTrend::getUrl, bo.getUrl());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getTitle()), SysHomeTrend::getTitle, bo.getTitle());
|
||||
lqw.eq(bo.getSort() != null, SysHomeTrend::getSort, bo.getSort());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), SysHomeTrend::getContent, bo.getContent());
|
||||
lqw.eq(bo.getStatus() != null, SysHomeTrend::getStatus, bo.getStatus());
|
||||
lqw.eq(bo.getCreateTime() !=null,SysHomeTrend::getCreateTime,bo.getCreateTime());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import lombok.RequiredArgsConstructor;
|
|||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
||||
|
@ -85,7 +86,9 @@ public class SysOssPersonServiceImpl implements ISysOssPersonService {
|
|||
|
||||
private Wrapper<SysOssPerson> buildQueryWrapper(SysOssPersonBo bo) {
|
||||
QueryWrapper<SysOssPerson> wrapper = Wrappers.query();
|
||||
wrapper.eq("op.create_by", bo.getCreateBy())
|
||||
wrapper.eq(ObjectUtil.isNotNull(bo.getCreateBy()),"op.create_by", bo.getCreateBy())
|
||||
.eq(StringUtils.isNotEmpty(bo.getFileSuffix()),"op.file_suffix", bo.getFileSuffix())
|
||||
.like(StringUtils.isNotEmpty(bo.getFileName()),"op.file_name", bo.getFileName())
|
||||
.and(ObjectUtil.isNotNull(bo.getCatalogId()), w -> {
|
||||
List<SysCatalogPerson> list = catalogService.selectList(new LambdaQueryWrapper<SysCatalogPerson>()
|
||||
.select(SysCatalogPerson::getCatalogId)
|
||||
|
@ -107,6 +110,9 @@ public class SysOssPersonServiceImpl implements ISysOssPersonService {
|
|||
public Boolean insertByBo(SysOssPersonBo bo) {
|
||||
SysOssPerson add = MapstructUtils.convert(bo, SysOssPerson.class);
|
||||
validEntityBeforeSave(add);
|
||||
String fileName = add.getFileName();
|
||||
String suffix = StringUtils.substring(fileName, fileName.lastIndexOf("."), fileName.length());
|
||||
add.setFileSuffix(suffix);
|
||||
String path = catalogService.selectCatalogNameById(add.getCatalogId());
|
||||
add.setFilePath(path);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
|
|
|
@ -11,6 +11,7 @@ import lombok.RequiredArgsConstructor;
|
|||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
||||
|
@ -75,7 +76,9 @@ public class SysOssResourceServiceImpl implements ISysOssResourceService {
|
|||
@Override
|
||||
public TableDataInfo<SysOssResourceVo> queryAwaitPageList(SysOssResourceBo bo, PageQuery pageQuery) {
|
||||
QueryWrapper<SysOssTextbook> wrapper = Wrappers.query();
|
||||
wrapper.le("r.status", 0);
|
||||
wrapper.le("r.status", 0)
|
||||
.eq(StringUtils.isNotEmpty(bo.getFileSuffix()),"r.file_suffix", bo.getFileSuffix())
|
||||
.like(StringUtils.isNotEmpty(bo.getFileName()),"r.file_name", bo.getFileName());
|
||||
Page<SysOssResourceVo> result = baseMapper.selectPageAwaitList(pageQuery.build(), wrapper);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
@ -94,6 +97,8 @@ public class SysOssResourceServiceImpl implements ISysOssResourceService {
|
|||
private Wrapper<SysOssResource> buildQueryWrapper(SysOssResourceBo bo) {
|
||||
QueryWrapper<SysOssResource> wrapper = Wrappers.query();
|
||||
wrapper.eq(ObjectUtil.isNotNull(bo.getStatus()), "r.status", bo.getStatus())
|
||||
.eq(StringUtils.isNotEmpty(bo.getFileSuffix()), "r.file_suffix", bo.getFileSuffix())
|
||||
.like(StringUtils.isNotEmpty(bo.getFileName()), "r.file_name", bo.getFileName())
|
||||
.and(ObjectUtil.isNotNull(bo.getCatalogId()), w -> {
|
||||
List<SysCatalogResource> deptList = catalogService.selectList(new LambdaQueryWrapper<SysCatalogResource>()
|
||||
.select(SysCatalogResource::getCatalogId)
|
||||
|
@ -115,6 +120,9 @@ public class SysOssResourceServiceImpl implements ISysOssResourceService {
|
|||
public Boolean insertByBo(SysOssResourceBo bo) {
|
||||
SysOssResource add = MapstructUtils.convert(bo, SysOssResource.class);
|
||||
validEntityBeforeSave(add);
|
||||
String fileName = add.getFileName();
|
||||
String suffix = StringUtils.substring(fileName, fileName.lastIndexOf("."), fileName.length());
|
||||
add.setFileSuffix(suffix);
|
||||
String path = catalogService.selectCatalogNameById(add.getCatalogId());
|
||||
add.setFilePath(path);
|
||||
add.setStatus(-1);
|
||||
|
|
|
@ -11,6 +11,7 @@ import lombok.RequiredArgsConstructor;
|
|||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
||||
|
@ -74,7 +75,9 @@ public class SysOssTextbookServiceImpl implements ISysOssTextbookService {
|
|||
@Override
|
||||
public TableDataInfo<SysOssTextbookVo> queryAwaitPageList(SysOssTextbookBo bo, PageQuery pageQuery) {
|
||||
QueryWrapper<SysOssTextbook> wrapper = Wrappers.query();
|
||||
wrapper.le("ot.status", 0);
|
||||
wrapper.le("ot.status", 0)
|
||||
.eq(StringUtils.isNotEmpty(bo.getFileSuffix()), "ot.file_suffix", bo.getFileSuffix())
|
||||
.like(StringUtils.isNotEmpty(bo.getFileName()), "ot.file_name", bo.getFileName());
|
||||
Page<SysOssTextbookVo> result = baseMapper.selectPageAwaitList(pageQuery.build(), wrapper);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
@ -94,6 +97,8 @@ public class SysOssTextbookServiceImpl implements ISysOssTextbookService {
|
|||
QueryWrapper<SysOssTextbook> wrapper = Wrappers.query();
|
||||
wrapper.eq(ObjectUtil.isNotNull(bo.getType()), "ot.type", bo.getType())
|
||||
.eq(ObjectUtil.isNotNull(bo.getStatus()), "ot.status", bo.getStatus())
|
||||
.eq(StringUtils.isNotEmpty(bo.getFileSuffix()), "ot.file_suffix", bo.getFileSuffix())
|
||||
.like(StringUtils.isNotEmpty(bo.getFileName()), "ot.file_name", bo.getFileName())
|
||||
.and(ObjectUtil.isNotNull(bo.getCatalogId()), w -> {
|
||||
List<SysCatalogTextbook> list = catalogService.selectList(new LambdaQueryWrapper<SysCatalogTextbook>()
|
||||
.select(SysCatalogTextbook::getCatalogId)
|
||||
|
@ -115,6 +120,9 @@ public class SysOssTextbookServiceImpl implements ISysOssTextbookService {
|
|||
public Boolean insertByBo(SysOssTextbookBo bo) {
|
||||
SysOssTextbook add = MapstructUtils.convert(bo, SysOssTextbook.class);
|
||||
validEntityBeforeSave(add);
|
||||
String fileName = add.getFileName();
|
||||
String suffix = StringUtils.substring(fileName, fileName.lastIndexOf("."), fileName.length());
|
||||
add.setFileSuffix(suffix);
|
||||
String path = catalogService.selectCatalogNameById(add.getCatalogId());
|
||||
add.setFilePath(path);
|
||||
add.setStatus(-1);
|
||||
|
|
|
@ -5,7 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<mapper namespace="org.dromara.system.mapper.SysOssPersonMapper">
|
||||
|
||||
<select id="selectPageList" resultType="org.dromara.system.domain.vo.SysOssPersonVo">
|
||||
select op.*, o.file_suffix, o.volume
|
||||
select op.*, o.volume
|
||||
from sys_oss_person op
|
||||
left join sys_oss o on o.oss_id = op.oss_id
|
||||
${ew.getCustomSqlSegment}
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.system.mapper.SysOssResourceMapper">
|
||||
<select id="selectPageList" resultType="org.dromara.system.domain.vo.SysOssResourceVo">
|
||||
select r.*, o.file_suffix, o.volume
|
||||
select r.*, o.volume
|
||||
from sys_oss_resource r
|
||||
left join sys_oss o on o.oss_id = r.oss_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectPageAwaitList" resultType="org.dromara.system.domain.vo.SysOssResourceVo">
|
||||
select r.*, o.file_suffix, o.volume
|
||||
select r.*, o.volume
|
||||
from sys_oss_resource r
|
||||
left join sys_oss o on o.oss_id = r.oss_id
|
||||
${ew.getCustomSqlSegment}
|
||||
|
|
|
@ -5,14 +5,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<mapper namespace="org.dromara.system.mapper.SysOssTextbookMapper">
|
||||
|
||||
<select id="selectPageList" resultType="org.dromara.system.domain.vo.SysOssTextbookVo">
|
||||
select ot.*, o.file_suffix, o.volume
|
||||
select ot.*, o.volume
|
||||
from sys_oss_textbook ot
|
||||
left join sys_oss o on o.oss_id = ot.oss_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectPageAwaitList" resultType="org.dromara.system.domain.vo.SysOssTextbookVo">
|
||||
select ot.*, o.file_suffix, o.volume
|
||||
select ot.*, o.volume
|
||||
from sys_oss_textbook ot
|
||||
|
||||
left join sys_oss o on o.oss_id = ot.oss_id
|
||||
|
|
Loading…
Reference in New Issue