|
|
|
@ -3,6 +3,10 @@ package com.hxhq.business.service.impl; |
|
|
|
import java.util.List; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.hxhq.business.dto.study.StudyListDto; |
|
|
|
import com.hxhq.business.form.study.StudySearchForm; |
|
|
|
import com.hxhq.common.core.utils.DateUtils; |
|
|
|
import com.hxhq.common.core.utils.StringUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import com.hxhq.business.mapper.StudyMapper; |
|
|
|
import com.hxhq.business.domain.Study; |
|
|
|
@ -21,14 +25,33 @@ public class StudyServiceImpl extends ServiceImpl implements |
|
|
|
/** |
|
|
|
* 查询试验列表 |
|
|
|
* |
|
|
|
* @param study 试验 |
|
|
|
* @param form 试验 |
|
|
|
* @return 试验 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<Study> queryList(Study study) |
|
|
|
public List<StudyListDto> queryList(StudySearchForm form) |
|
|
|
{ |
|
|
|
QueryWrapper<Study> queryWrapper = Wrappers.query(); |
|
|
|
return this.list(queryWrapper); |
|
|
|
QueryWrapper<StudyListDto> queryWrapper = Wrappers.query(); |
|
|
|
queryWrapper.eq("s.del_flag","0"); |
|
|
|
if(StringUtils.isNoneBlank(form.getName())){ |
|
|
|
queryWrapper.like("s.name",form.getName()); |
|
|
|
} |
|
|
|
if(StringUtils.isNoneBlank(form.getSn())){ |
|
|
|
queryWrapper.like("s.sn",form.getSn()); |
|
|
|
} |
|
|
|
if(StringUtils.isNoneBlank(form.getLeaderName())){ |
|
|
|
queryWrapper.like("u.nick_name",form.getLeaderName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNoneBlank(form.getStartDate())) { |
|
|
|
queryWrapper.ge("s.create_time", form.getStartDate()); |
|
|
|
} |
|
|
|
if (StringUtils.isNoneBlank(form.getEndDate())) { |
|
|
|
queryWrapper.lt("s.create_time", DateUtils.dateTime(DateUtils.addDays(DateUtils.parseDate(form.getEndDate()),1))); |
|
|
|
} |
|
|
|
if(form.getStatus()!=null && form.getStatus().intValue()>0){ |
|
|
|
queryWrapper.eq("s.status",form.getStatus()); |
|
|
|
} |
|
|
|
return baseMapper.queryList(queryWrapper); |
|
|
|
} |
|
|
|
|
|
|
|
} |