package com.huiju.estateagents.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huiju.estateagents.base.ResponseBean;
import com.huiju.estateagents.entity.TaOrg;
import com.huiju.estateagents.mapper.TaOrgMapper;
import com.huiju.estateagents.service.ITaOrgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 公司表  服务实现类
 * </p>
 *
 * @author jobob
 * @since 2019-09-11
 */
@Service
public class TaOrgServiceImpl extends ServiceImpl<TaOrgMapper, TaOrg> implements ITaOrgService {

    @Autowired
    private TaOrgMapper taOrgMapper;

    @Override
    public ResponseBean listOrgForContract(Integer pageNum, Integer pageSize, String orgName, String miniAppName) {
        ResponseBean responseBean = new ResponseBean();

        IPage<TaOrg> pg = new Page<>(pageNum, pageSize);
        pg = taOrgMapper.listOrgForContract(pg,orgName,miniAppName);
        responseBean.addSuccess(pg);
        return responseBean;
    }
}
