package com.jxy.marketall.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jxy.common.core.utils.StringUtils;
import com.jxy.common.core.web.Result.AjaxResult;
import com.jxy.marketall.entity.Jzr60;
import com.jxy.marketall.mapper.Jzr60Mapper;
import com.jxy.marketall.service.Jzr60Service;
import com.jxy.marketall.vo.QueryVo;
import org.springframework.stereotype.Service;


/**
 * @Description Jzr60查询业务处理
 * @Date 2022/6/21  11:51
 * @Author 杜懿
 */
@Service
public class Jzr60ServiceImpl extends ServiceImpl<Jzr60Mapper, Jzr60> implements Jzr60Service {

    @Override
    public AjaxResult findJzr60ByTime(QueryVo queryVo) {

        LambdaQueryWrapper<Jzr60> Jzr60LambdaQueryWrapper = new LambdaQueryWrapper<>();
        Jzr60LambdaQueryWrapper.ge(!StringUtils.isEmpty(queryVo.getStart()),Jzr60::getDate,queryVo.getStart())
                .le(!StringUtils.isEmpty(queryVo.getEnd()),Jzr60::getDate,queryVo.getEnd()).orderByAsc(Jzr60::getDate);
        return AjaxResult.success(baseMapper.selectList(Jzr60LambdaQueryWrapper));
    }
}
