package com.hfkj.service.order.impl;

import com.hfkj.dao.BsOrderAfterSalesOpRecordMapper;
import com.hfkj.entity.BsOrderAfterSalesOpRecord;
import com.hfkj.entity.BsOrderAfterSalesOpRecordExample;
import com.hfkj.service.order.BsOrderAfterSalesOpRecordService;
import org.springframework.stereotype.Service;

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

/**
 * @className: BsOrderAfterSalesOpRecordServiceImpl
 * @author: HuRui
 * @date: 2024/5/15
 **/
@Service("orderAfterSalesOpRecordService")
public class BsOrderAfterSalesOpRecordServiceImpl implements BsOrderAfterSalesOpRecordService {
    @Resource
    private BsOrderAfterSalesOpRecordMapper orderAfterSalesOpRecordMapper;

    @Override
    public void create(BsOrderAfterSalesOpRecord data) {
        data.setCreateTime(new Date());
        orderAfterSalesOpRecordMapper.insert(data);
    }

    @Override
    public List<BsOrderAfterSalesOpRecord> getRecordList(String applyNo) {
        BsOrderAfterSalesOpRecordExample example = new BsOrderAfterSalesOpRecordExample();
        example.createCriteria().andApplyNoEqualTo(applyNo);
        example.setOrderByClause("create_time desc");
        return orderAfterSalesOpRecordMapper.selectByExample(example);
    }


}
