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

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.greenorange.promotion.constant.CommonConstant;
import com.greenorange.promotion.model.dto.withdrawalApply.WithdrawalApplyQueryRequest;
import com.greenorange.promotion.model.entity.Project;
import com.greenorange.promotion.model.entity.WithdrawalApply;
import com.greenorange.promotion.service.settle.WithdrawalApplyService;
import com.greenorange.promotion.mapper.WithdrawalApplyMapper;
import com.greenorange.promotion.utils.SqlUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
* @author 35880
* @description 针对表【withdrawal_apply(提现申请记录表)】的数据库操作Service实现
* @createDate 2025-05-10 20:42:35
*/
@Service
public class WithdrawalApplyServiceImpl extends ServiceImpl<WithdrawalApplyMapper, WithdrawalApply>
    implements WithdrawalApplyService{

    /**
     * 获取查询条件
     */
    @Override
    public QueryWrapper<WithdrawalApply> getQueryWrapper(WithdrawalApplyQueryRequest withdrawalApplyQueryRequest) {
        String withdrawalStatus = withdrawalApplyQueryRequest.getWithdrawalStatus();
        String sortField = withdrawalApplyQueryRequest.getSortField();
        String sortOrder = withdrawalApplyQueryRequest.getSortOrder();
        QueryWrapper<WithdrawalApply> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq(StringUtils.isNotBlank(withdrawalStatus), "withdrawalStatus", withdrawalStatus);
        queryWrapper.orderBy(SqlUtils.validSortField(sortField), sortOrder.equals(CommonConstant.SORT_ORDER_ASC), sortField);
        return null;
    }
}




