package com.greenorange.promotion.service.course.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.greenorange.promotion.model.dto.coursePromotionCommissionPending.CoursePromotionCommissionPendingQueryRequest;
import com.greenorange.promotion.model.entity.CoursePromotionCommissionPending;
import com.greenorange.promotion.service.course.CoursePromotionCommissionPendingService;
import com.greenorange.promotion.mapper.CoursePromotionCommissionPendingMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
* @author 35880
* @description 针对表【course_promotion_commission_pending(课程推广待提成记录)】的数据库操作Service实现
* @createDate 2025-07-01 09:22:57
*/
@Service
public class CoursePromotionCommissionPendingServiceImpl extends ServiceImpl<CoursePromotionCommissionPendingMapper, CoursePromotionCommissionPending>
    implements CoursePromotionCommissionPendingService{


    /**
     * 获取查询条件
     */
    @Override
    public QueryWrapper<CoursePromotionCommissionPending> getQueryWrapper(CoursePromotionCommissionPendingQueryRequest coursePromotionCommissionPendingQueryRequest) {
        String name = coursePromotionCommissionPendingQueryRequest.getName();
        String type = coursePromotionCommissionPendingQueryRequest.getType();
        String commissionStatus = coursePromotionCommissionPendingQueryRequest.getCommissionStatus();
        QueryWrapper<CoursePromotionCommissionPending> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq(StringUtils.isNotBlank(name), "name", name);
        queryWrapper.eq(StringUtils.isNotBlank(type), "type", type);
        queryWrapper.eq(StringUtils.isNotBlank(commissionStatus), "commissionStatus", commissionStatus);
        return queryWrapper;
    }
}




