package com.hfkj.service.impl;

import com.hfkj.dao.BsStoreContractRecordMapper;
import com.hfkj.entity.BsStoreContractRecord;
import com.hfkj.service.BsStoreContractRecordService;
import org.springframework.stereotype.Service;

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

/**
 * @className: BsStoreContractRecordServiceImpl
 * @author: HuRui
 * @date: 2022/12/3
 **/
@Service("storeContractRecordService")
public class BsStoreContractRecordServiceImpl implements BsStoreContractRecordService {

    @Resource
    private BsStoreContractRecordMapper storeContractRecordMapper;

    @Override
    public void editContractRecord(BsStoreContractRecord storeContractRecord) {
        if (storeContractRecord.getId() == null) {
            storeContractRecord.setCreateTime(new Date());
            storeContractRecordMapper.insert(storeContractRecord);
        } else {
            storeContractRecordMapper.updateByPrimaryKey(storeContractRecord);
        }
    }
}
