package com.hfkj.service.impl;

import com.hfkj.dao.BsMerContractRecordMsgMapper;
import com.hfkj.entity.BsMerContractRecordMsg;
import com.hfkj.service.BsMerContractRecordMsgService;
import com.hfkj.sysenum.PlatformTypeEnum;
import org.springframework.stereotype.Service;

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

@Service("merContractRecordMsgService")
public class BsMerContractRecordMsgServiceImpl implements BsMerContractRecordMsgService {

    @Resource
    private BsMerContractRecordMsgMapper merContractRecordMsgMapper;

    @Override
    public void insertRecordMsg(BsMerContractRecordMsg recordMsg) {
        recordMsg.setCreateTime(new Date());
        merContractRecordMsgMapper.insert(recordMsg);
    }

    @Override
    public Map<String, Object> getMerContractRecordMsg(Long merId, PlatformTypeEnum platformType) {
        return merContractRecordMsgMapper.selectMerContractRecordMsg(merId, platformType!=null?platformType.getNumber():null);
    }
}
