package com.jwipc.contract.service.impl;

import cn.hutool.core.date.LocalDateTimeUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jwipc.contract.entity.Contract;
import com.jwipc.contract.mapper.ContractMapper;
import com.jwipc.contract.model.po.ContractPO;
import com.jwipc.contract.model.po.ContractReportPO;
import com.jwipc.contract.model.po.DigitalSealConfigDTO;
import com.jwipc.contract.model.query.ContractMangeQuery;
import com.jwipc.contract.service.IContractService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zx
 * @since 2024-03-07
 */
@Service
public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> implements IContractService {

    @Override
    public ContractPO getByQuery(String conId) {
//        return this.baseMapper.removeByRoleIdAndMenuType(conId);
//        return null;
        ContractPO contract = baseMapper.getDataById(conId);

        return contract;

    }

    @Override
    public DigitalSealConfigDTO selectESignDetail(String companyCode, String sealType) {
        return baseMapper.selectESignDetail(companyCode,sealType);
    }

    @Override
    public List<ContractReportPO> reportPage(Page<Contract> dbPage, ContractMangeQuery query) {
        if (dbPage==null){
            return baseMapper.reportPage(query);
        }
        return baseMapper.reportPage(dbPage,query);
    }
//    @Override
//    public void removeByRoleIdAndMenuType(Long roleId, Integer menuType) {
//        this.baseMapper.removeByRoleIdAndMenuType(roleId,menuType);
//    }
}
