package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;

import cn.estsh.i3plus.pojo.platform.bean.SysConfig;
import cn.estsh.i3plus.pojo.platform.repository.SysConfigRepository;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description :
 * @Reference :
 * @Author : yunhao
 * @CreateDate : 2018-12-20 17:02
 * @Modify:
 **/
public class TestMathOper extends cn.estsh.i3plus.core.apiservice.serviceimpl.busi.TestBase {

    @Test
    public void test(){
        System.out.println("Hello World !~");
    }

    @Autowired
    private SysConfigRepository sysConfigRDao;

    String propertyName = "configType";
    String groupByName = "configType";
    String[] param = new String[]{"configType"};
    Object[] paramValue = new Object[]{1};


    @Test
    public void testMax(){
        // max
        System.out.println(sysConfigRDao.findMaxByProperties(propertyName,groupByName,param,paramValue));
        System.out.println(sysConfigRDao.findMaxByProperty(propertyName,groupByName,param[0],paramValue[0]));
    }

    @Test
    public void testMin(){
        // min
        System.out.println(sysConfigRDao.findMinByProperties(propertyName,groupByName,param,paramValue));
        System.out.println(sysConfigRDao.findMinByProperty(propertyName,groupByName,param[0],paramValue[0]));
    }

    @Test
    public void testSum(){
        //sum
        System.out.println(sysConfigRDao.findSumByProperties(propertyName,groupByName,param,paramValue));
        System.out.println(sysConfigRDao.findSumByProperty(propertyName,groupByName,param[0],paramValue[0]));
    }
    @Test
    public void testAvg(){
        //avg
        System.out.println(sysConfigRDao.findAvgByProperties(propertyName,groupByName,param,paramValue));
        System.out.println(sysConfigRDao.findAvgByProperty(propertyName,groupByName,param[0],paramValue[0]));
    }

}
