
package com.zcloud.service.integratedmanagement.access.impl;

import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.integratedmanagement.GateCarRecordMapper;
import com.zcloud.mapper.datasource.integratedmanagement.GatePeopleRecordMapper;
import com.zcloud.service.integratedmanagement.access.GateCarRecordService;
import com.zcloud.service.integratedmanagement.access.GatePeopleRecordService;
import com.zcloud.util.InitPageDataUtil;
import com.zcloud.util.Jurisdiction;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

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

@Service
public class GateCarRecordServiceImpl implements GateCarRecordService {

    @Resource
    private GateCarRecordMapper gateCarRecordMapper;
    @Resource
    private InitPageDataUtil initPageDataUtil;

    @Override
    public PageData findById(PageData pageData) {
        return gateCarRecordMapper.findById(pageData);
    }

    @Override
    public List<PageData> list(Page page) {
        return gateCarRecordMapper.datalistPage(page);
    }

    @Override
    @Transactional
    public void edit(PageData pageData) {
        initPageDataUtil.initEdit(pageData);
        gateCarRecordMapper.edit(pageData);
    }

    @Override
    @Transactional
    public void save(PageData pageData) {
        initPageDataUtil.initSave(pageData, "RECORD_ID");
        pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
        gateCarRecordMapper.save(pageData);
    }

    @Override
    public List<PageData> getBICarFieldCondition(PageData pd) {
        return gateCarRecordMapper.getBICarFieldCondition(pd);
    }
}
