package cn.iocoder.yudao.module.tickets.service.impl;

import cn.iocoder.yudao.module.tickets.entity.Tickets;
import cn.iocoder.yudao.module.tickets.mapper.TicketsMapper;
import cn.iocoder.yudao.module.tickets.service.TicketsService;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 小李
 * @date 9:35 2024/9/25
**/
@Service
public class TicketsServiceImpl extends ServiceImpl<TicketsMapper, Tickets> implements TicketsService {

    /**
     * 更新工单状态为已结账
     * 考虑可能有批量操作的情况，采用批量更新的方式
     *
     * @author 小李
     * @date 9:36 2024/9/25
     * @param ticketIds 工单ids
     **/
    @Override
    public void updateTickets(List<String> ticketIds){
        baseMapper.update(new LambdaUpdateWrapper<Tickets>().in(Tickets::getId, ticketIds).set(Tickets::getTicketsStatus, "02"));
    }
}
