package com.miaxis.train.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.stereotype.Service;
import org.apache.commons.lang3.StringUtils;
import com.miaxis.train.mapper.TMTrainRecordMapper;
import com.miaxis.train.domain.TMTrainRecord;
import com.miaxis.train.service.ITMTrainRecordService;

/**
 * 训练明细（终端上次明细）Service业务层处理
 *
 * @author miaxis
 * @date 2021-01-14
 */
@Service
public class TMTrainRecordServiceImpl extends ServiceImpl<TMTrainRecordMapper, TMTrainRecord> implements ITMTrainRecordService {
    @Override
    public List<TMTrainRecord> queryList(TMTrainRecord tMTrainRecord) {
        LambdaQueryWrapper<TMTrainRecord> lqw = Wrappers.lambdaQuery();
                        if (StringUtils.isNotBlank(tMTrainRecord.getRnum())){
            lqw.eq(TMTrainRecord::getRnum ,tMTrainRecord.getRnum());
        }
                                    if (StringUtils.isNotBlank(tMTrainRecord.getCoachnum())){
            lqw.eq(TMTrainRecord::getCoachnum ,tMTrainRecord.getCoachnum());
        }
                                    if (StringUtils.isNotBlank(tMTrainRecord.getStunum())){
            lqw.eq(TMTrainRecord::getStunum ,tMTrainRecord.getStunum());
        }
                                    if (tMTrainRecord.getUploadtype() != null){
            lqw.eq(TMTrainRecord::getUploadtype ,tMTrainRecord.getUploadtype());
        }
                                    if (tMTrainRecord.getLessonid() != null){
            lqw.eq(TMTrainRecord::getLessonid ,tMTrainRecord.getLessonid());
        }
                                    if (StringUtils.isNotBlank(tMTrainRecord.getRecordtime())){
            lqw.eq(TMTrainRecord::getRecordtime ,tMTrainRecord.getRecordtime());
        }
                                    if (StringUtils.isNotBlank(tMTrainRecord.getTrainlesson())){
            lqw.eq(TMTrainRecord::getTrainlesson ,tMTrainRecord.getTrainlesson());
        }
                                    if (tMTrainRecord.getRecordstatus() != null){
            lqw.eq(TMTrainRecord::getRecordstatus ,tMTrainRecord.getRecordstatus());
        }
                                    if (tMTrainRecord.getMaxspeed() != null){
            lqw.eq(TMTrainRecord::getMaxspeed ,tMTrainRecord.getMaxspeed());
        }
                                    if (tMTrainRecord.getMiles() != null){
            lqw.eq(TMTrainRecord::getMiles ,tMTrainRecord.getMiles());
        }
                                    if (tMTrainRecord.getGpsid() != null){
            lqw.eq(TMTrainRecord::getGpsid ,tMTrainRecord.getGpsid());
        }
                                    if (tMTrainRecord.getCrdate() != null){
            lqw.eq(TMTrainRecord::getCrdate ,tMTrainRecord.getCrdate());
        }
                                    if (tMTrainRecord.getIsCount() != null){
            lqw.eq(TMTrainRecord::getIsCount ,tMTrainRecord.getIsCount());
        }
                                    if (tMTrainRecord.getAuditStatus() != null){
            lqw.eq(TMTrainRecord::getAuditStatus ,tMTrainRecord.getAuditStatus());
        }
                                    if (StringUtils.isNotBlank(tMTrainRecord.getAuditReason())){
            lqw.eq(TMTrainRecord::getAuditReason ,tMTrainRecord.getAuditReason());
        }
                                    if (tMTrainRecord.getAuditType() != null){
            lqw.eq(TMTrainRecord::getAuditType ,tMTrainRecord.getAuditType());
        }
                                    if (StringUtils.isNotBlank(tMTrainRecord.getStuname())){
            lqw.like(TMTrainRecord::getStuname ,tMTrainRecord.getStuname());
        }
                                    if (StringUtils.isNotBlank(tMTrainRecord.getCoachname())){
            lqw.like(TMTrainRecord::getCoachname ,tMTrainRecord.getCoachname());
        }
                                    if (StringUtils.isNotBlank(tMTrainRecord.getInscode())){
            lqw.eq(TMTrainRecord::getInscode ,tMTrainRecord.getInscode());
        }
                                    if (StringUtils.isNotBlank(tMTrainRecord.getInsname())){
            lqw.like(TMTrainRecord::getInsname ,tMTrainRecord.getInsname());
        }
                                    if (tMTrainRecord.getStageId() != null){
            lqw.eq(TMTrainRecord::getStageId ,tMTrainRecord.getStageId());
        }
                                    if (tMTrainRecord.getTraintime() != null){
            lqw.eq(TMTrainRecord::getTraintime ,tMTrainRecord.getTraintime());
        }
                                    if (tMTrainRecord.getPhoto() != null){
            lqw.eq(TMTrainRecord::getPhoto ,tMTrainRecord.getPhoto());
        }
                                    if (tMTrainRecord.getLat() != null){
            lqw.eq(TMTrainRecord::getLat ,tMTrainRecord.getLat());
        }
                                    if (tMTrainRecord.getLng() != null){
            lqw.eq(TMTrainRecord::getLng ,tMTrainRecord.getLng());
        }
                                    if (tMTrainRecord.getEngineRpm() != null){
            lqw.eq(TMTrainRecord::getEngineRpm ,tMTrainRecord.getEngineRpm());
        }
                                    if (tMTrainRecord.getGpsspeed() != null){
            lqw.eq(TMTrainRecord::getGpsspeed ,tMTrainRecord.getGpsspeed());
        }
                                    if (tMTrainRecord.getDriverspeed() != null){
            lqw.eq(TMTrainRecord::getDriverspeed ,tMTrainRecord.getDriverspeed());
        }
                                    if (tMTrainRecord.getGpsStatus() != null){
            lqw.eq(TMTrainRecord::getGpsStatus ,tMTrainRecord.getGpsStatus());
        }
                                    if (tMTrainRecord.getIsPhotoSync() != null){
            lqw.eq(TMTrainRecord::getIsPhotoSync ,tMTrainRecord.getIsPhotoSync());
        }
                                    if (tMTrainRecord.getIsSyncDate() != null){
            lqw.eq(TMTrainRecord::getIsSyncDate ,tMTrainRecord.getIsSyncDate());
        }
                                    if (StringUtils.isNotBlank(tMTrainRecord.getLicnum())){
            lqw.eq(TMTrainRecord::getLicnum ,tMTrainRecord.getLicnum());
        }
                                    if (tMTrainRecord.getAuditDate() != null){
            lqw.eq(TMTrainRecord::getAuditDate ,tMTrainRecord.getAuditDate());
        }
                                    if (tMTrainRecord.getIsAnalyze() != null){
            lqw.eq(TMTrainRecord::getIsAnalyze ,tMTrainRecord.getIsAnalyze());
        }
                                    if (tMTrainRecord.getAuditReasonId() != null){
            lqw.eq(TMTrainRecord::getAuditReasonId ,tMTrainRecord.getAuditReasonId());
        }
                                    if (tMTrainRecord.getIsAbnormal() != null){
            lqw.eq(TMTrainRecord::getIsAbnormal ,tMTrainRecord.getIsAbnormal());
        }
                                    if (StringUtils.isNotBlank(tMTrainRecord.getCarnum())){
            lqw.eq(TMTrainRecord::getCarnum ,tMTrainRecord.getCarnum());
        }
                                    if (StringUtils.isNotBlank(tMTrainRecord.getStuIdcard())){
            lqw.eq(TMTrainRecord::getStuIdcard ,tMTrainRecord.getStuIdcard());
        }
                                    if (StringUtils.isNotBlank(tMTrainRecord.getCoachIdcard())){
            lqw.eq(TMTrainRecord::getCoachIdcard ,tMTrainRecord.getCoachIdcard());
        }
                                    if (StringUtils.isNotBlank(tMTrainRecord.getDevnum())){
            lqw.eq(TMTrainRecord::getDevnum ,tMTrainRecord.getDevnum());
        }
                                    if (StringUtils.isNotBlank(tMTrainRecord.getAbnormalSeq())){
            lqw.eq(TMTrainRecord::getAbnormalSeq ,tMTrainRecord.getAbnormalSeq());
        }
                    return this.list(lqw);
    }
}
