package com.gkhy.safePlatform.specialWork.service.baseService.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.gkhy.safePlatform.commons.enums.ResultCodes; import com.gkhy.safePlatform.commons.exception.BusinessException; import com.gkhy.safePlatform.specialWork.entity.WorkApplyRecordInfo; import com.gkhy.safePlatform.specialWork.model.query.db.WorkApplyRecordListDBQuery; import com.gkhy.safePlatform.specialWork.repository.WorkApplyRecordInfoRepository; import com.gkhy.safePlatform.specialWork.service.baseService.WorkApplyRecordInfoService; import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service("workApplyRecordInfoService") public class WorkApplyRecordInfoServiceImpl extends ServiceImpl implements WorkApplyRecordInfoService { @Autowired private WorkApplyRecordInfoRepository workApplyRecordInfoRepository; @Override public List listByConditions(WorkApplyRecordListDBQuery dbQuery) { if (dbQuery == null) { throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); } return workApplyRecordInfoRepository.selectList(new LambdaQueryWrapper() .eq(WorkApplyRecordInfo::getWorkApplyId, dbQuery.getWorkApplyId()) .eq(WorkApplyRecordInfo::getSysten,dbQuery.isSystemEnable()) .eq(!ObjectUtils.isEmpty(dbQuery.getStepId()), WorkApplyRecordInfo::getStepId, dbQuery.getStepId()) .like(!ObjectUtils.isEmpty(dbQuery.getOperatorName()), WorkApplyRecordInfo::getOperatorUname, dbQuery.getOperatorName()) .orderByAsc(WorkApplyRecordInfo::getOperationTime)); } }