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

import cn.gtmap.estateplat.config.BaseTest;
import cn.gtmap.estateplat.config.service.ztxx.BdcCxBdcdyZtService;
import cn.gtmap.estateplat.model.config.BdcCxBdcdyZt;
import com.google.common.collect.Maps;
import org.apache.commons.collections.CollectionUtils;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

/**
 * @author <a href="mailto:sunchao@gtmap.cn">sunchao</a>
 * @version 1.0, 2020-06-22
 * @description
 */
public class UpdateKsYsBdcdyhTest extends BaseTest {

    @Autowired
    BdcCxBdcdyZtService bdcCxBdcdyZtService;

    @Test
    public void ss() {
        long begintime = System.currentTimeMillis();
        Map map = Maps.newHashMap();
        List<BdcCxBdcdyZt> bdcCxBdcdyZtList = bdcCxBdcdyZtService.getBdcCxBdcdyZtList(map);
        if (null != bdcCxBdcdyZtList && CollectionUtils.isNotEmpty(bdcCxBdcdyZtList)) {
            for (BdcCxBdcdyZt bdcCxBdcdyZt : bdcCxBdcdyZtList) {
                if (bdcCxBdcdyZt != null) {
                    bdcCxBdcdyZtService.updateKsYsByBdcdyh(bdcCxBdcdyZt.getBdcdyh(), 1, 1);
                }
            }
        }
        long endtinme = System.currentTimeMillis();
        long costTime = (endtinme - begintime);
        System.out.println("updateKsYsByBdcdyh执行时间：" + costTime + ",bdcCxBdcdyZtList.size:" + bdcCxBdcdyZtList.size());
    }
}
