OrderFlowService.java 1.31 KB
Newer Older
刘基明's avatar
刘基明 committed
1
package com.tanpu.community.service.other;
2 3

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
刘基明's avatar
刘基明 committed
4
import com.tanpu.community.api.enums.DeleteTagEnum;
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
import com.tanpu.community.dao.entity.user.OrderFlowEntity;
import com.tanpu.community.dao.mapper.user.OrderFlowMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

@Service
public class OrderFlowService {

    @Resource
    private OrderFlowMapper orderFlowMapper;

    public OrderFlowEntity selectById(String id){
        return orderFlowMapper.selectById(id);
    }

    public List<OrderFlowEntity> selectByIds(List<String> ids){
        if (CollectionUtils.isEmpty(ids)){
            return Collections.emptyList();
        }
        return orderFlowMapper.selectBatchIds(ids);
    }

    public OrderFlowEntity queryByUserAndProId(String proId,String userId){
        return orderFlowMapper.selectOne(new LambdaQueryWrapper<OrderFlowEntity>()
                .eq(OrderFlowEntity::getCreateby,userId)
                .eq(OrderFlowEntity::getAbProid,proId)
                .eq(OrderFlowEntity::getDeletetag, DeleteTagEnum.NOT_DELETED.getCode())
                .eq(OrderFlowEntity::getAbStatus,"SUCCESS"));
    }
}