资料中心 接口 以及sql
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.dao;
|
||||
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterial;
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterialPage;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
@@ -16,4 +19,7 @@ public interface FileMaterialDao extends BaseMapper<FileMaterial> {
|
||||
|
||||
|
||||
int topping(@Param("id") String id);
|
||||
|
||||
|
||||
IPage<FileMaterial> getFileMaterialPage(IPage<FileMaterial> page, @Param("flieM") FileMaterialPage fileMaterialPage);
|
||||
}
|
||||
|
||||
@@ -67,4 +67,8 @@ public class FileMaterial extends BaseEntity {
|
||||
@ApiModelProperty(value = "删除标志")
|
||||
@TableLogic(value = "0",delval = "1")
|
||||
private String delFlag;
|
||||
|
||||
@ApiModelProperty(value = "删除标志")
|
||||
@TableField("is_show")
|
||||
private String isShow;
|
||||
}
|
||||
|
||||
+2
@@ -18,6 +18,8 @@ public class FileMaterialPage {
|
||||
|
||||
private String endDataUploadTime;
|
||||
|
||||
private String treeId;
|
||||
|
||||
|
||||
private Integer page;
|
||||
|
||||
|
||||
+2
-25
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -32,37 +33,13 @@ public class FileMaterialServiceImpl extends ServiceImpl<FileMaterialDao, FileMa
|
||||
|
||||
@Override
|
||||
public IPage<FileMaterial> getFileMaterial(FileMaterialPage queryPage) {
|
||||
|
||||
QueryWrapper<FileMaterial> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
if (queryPage.getDataType()!=null){
|
||||
queryWrapper.eq("data_type",queryPage.getDataType());
|
||||
}
|
||||
|
||||
if (queryPage.getDataTitle()!=null){
|
||||
queryWrapper.like("data_title",queryPage.getDataTitle());
|
||||
}
|
||||
|
||||
if (queryPage.getStartDataUploadTime()!=null && queryPage.getEndDataUploadTime()!=null){
|
||||
|
||||
|
||||
String strDateFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
|
||||
queryWrapper.between("data_upload_time", queryPage.getStartDataUploadTime(),
|
||||
queryPage.getEndDataUploadTime());
|
||||
}
|
||||
|
||||
if (queryPage.getId()!=null && !"".equals(queryPage.getId()) ){
|
||||
queryWrapper.eq("id",queryPage.getId());
|
||||
}
|
||||
IPage<FileMaterial> page=null;
|
||||
if (queryPage.getPage()==null || queryPage .getPageSize()==null){
|
||||
page=new Page<>(1,1);
|
||||
}else {
|
||||
page=new Page<>(queryPage.getPage(),queryPage.getPageSize());
|
||||
}
|
||||
|
||||
return this.page(page,queryWrapper);
|
||||
return fileMaterialDao.getFileMaterialPage(page,queryPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user