package com.fufan.mtsaas.modules.base.company.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.fufan.mtsaas.modules.base.company.dao.TCompanyContactDao;
import com.fufan.mtsaas.modules.base.company.model.TCompanyContact;
import com.fufan.mtsaas.modules.base.company.service.TCompanyContactSvc;
import com.fufan.mtsaas.modules.common.bo.response.RequestPojo;
import com.fufan.mtsaas.modules.common.bo.response.ResStatus;

import com.baomidou.mybatisplus.plugins.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.fufan.mtsaas.modules.common.bo.response.Result;

import java.util.*;
/**
 * <p>
 * 企业联系信息表 服务实现类
 * </p>
 *
 * @author Liby
 * @since 2022-03-16
 */
@Service("TCompanyContactSvcImpl")
@Slf4j
@Primary
public class TCompanyContactSvcImpl extends ServiceImpl<TCompanyContactDao, TCompanyContact> implements TCompanyContactSvc {
    @Autowired
    private TCompanyContactDao entitymDao;

    /**
     * 查询
     *
     * @param map
     * @return Result.class
     * */
    @Override
    public Result doQueryPage(Map<String, String> map) {
        Result result = new Result();
        //分页查询企业联系信息表
        Page page = new Page();
        if(!StringUtils.isEmpty(map.get("pageSize")) && !StringUtils.isEmpty(map.get("currentPage"))) {
            page.setSize(Integer.parseInt(map.get("pageSize")));
            page.setCurrent(Integer.parseInt(map.get("currentPage")));
        }
        List<TCompanyContact> entitys = null;

        page.setRecords(entitys);
        result.setResStatus(ResStatus.STATUS_SUCCESS);
        result.setResMsg(ResStatus.STATUS_SUCCESS_MSG);
        result.setResData(page);

        return result;
    }

    /**
     * 新增
     *
     * @param entitym
     * @param requestPojo
     * @return Result.class
     */
    @Override
    @Transactional
    public Result doSave(TCompanyContact entitym, RequestPojo requestPojo) {
        Result result = new Result();

        return result;

    }

    /**
     * 修改
     *
     * @param entitym
     * @param requestPojo
     * @return Result.class
     */
    @Override
    @Transactional
    public Result doUpdate(TCompanyContact entitym, RequestPojo requestPojo) {
        Result result = new Result();

        return result;

    }

    /**
     * 删除
     *
     * @param map
     * @return Result.class
     * */
    @Override
    @Transactional
    public Result doDelete(Map<String, String> map,RequestPojo requestPojo) {
        Result result = new Result();


        return result;

    }
}
