/*
 * Author: wangjian
 * 生成ServiceImpl
 */
package com.tofly.xrtygis.service.callCenter.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.tofly.xrtygis.entity.callCenter.CallSearch;
import com.tofly.xrtygis.entity.callCenter.PltCalllist1000;
import com.tofly.xrtygis.entity.callCenter.ServiceList1000;
import com.tofly.xrtygis.callCenterMapper.ServiceList1000Mapper;
import com.tofly.xrtygis.service.callCenter.service.ServiceList1000Service;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * 转接记录表1、保存呼入的转接全过程2、保存呼出的转接全过程3、预拨号数据不记录
 *
 * @author wangjieliu
 * @date Fri Jun 18 00:00:00 CST 2021
 */
@Service("serviceList1000Service")
public class ServiceList1000ServiceImpl extends ServiceImpl<ServiceList1000Mapper, ServiceList1000> implements ServiceList1000Service {

    @Override
    public IPage<ServiceList1000> getServicelist(Page page, CallSearch search) {
        return this.page(page, Wrappers.<ServiceList1000>lambdaQuery()
                .eq(StringUtils.isNotBlank(search.getTransferNo()),ServiceList1000::getTransferNo,search.getTransferNo())
                .ge(search.getStartTime() != null,ServiceList1000::getCallTime,search.getStartTime())
                .le(search.getEndTime() != null,ServiceList1000::getCallTime,search.getEndTime())
                .ge(StringUtils.isNotBlank(search.getTelephone()),ServiceList1000::getTelephone,search.getTelephone()));
    }

}
