package cn.gtmap.estateplat.config.core.service.impl;

import cn.gtmap.estateplat.config.core.service.BdcZjjzwxxService;
import cn.gtmap.estateplat.core.support.mybatis.mapper.EntityMapper;
import cn.gtmap.estateplat.core.support.mybatis.mapper.Example;
import cn.gtmap.estateplat.model.server.core.BdcZjjzwxx;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @version 1.0, 2017/6/29.
 * @auto <a href="mailto:zhouwanqing@gtmap.cn">zhouwanqing</a>
 * @description
 */
@Service
public class BdcZjjzwxxServiceImpl implements BdcZjjzwxxService {

    @Autowired
    EntityMapper entityMapper;

    @Override
    public List<BdcZjjzwxx> getBdcZjjzwxxByBdcdyh(String bdcdyh) {
        List<BdcZjjzwxx> bdcZjjzwxxList = null;
        if (StringUtils.isNotBlank(bdcdyh)) {
            Example example = new Example(BdcZjjzwxx.class);
            example.createCriteria().andEqualTo("bdcdyh", bdcdyh);
            bdcZjjzwxxList = entityMapper.selectByExample(example);
        }
        return bdcZjjzwxxList;
    }

    @Override
    public List<BdcZjjzwxx> getBdcZjjzwxxByBdcdyhAndDyzt(String bdcdyh, String dyzt) {
        List<BdcZjjzwxx> bdcZjjzwxxList = null;
        if (StringUtils.isNotBlank(bdcdyh) && StringUtils.isNotBlank(dyzt)) {
            Example example = new Example(BdcZjjzwxx.class);
            example.createCriteria().andEqualTo("bdcdyh", bdcdyh).andEqualTo("dyzt", dyzt);
            bdcZjjzwxxList = entityMapper.selectByExample(example);
        }
        return bdcZjjzwxxList;
    }
}
