package com.mijiaokj.sys.dal.repository;

import com.mijiaokj.sys.common.util.Page;
import com.mijiaokj.sys.dal.repository.mapper.BaseMapper;
import com.mijiaokj.sys.dal.repository.mapper.RecommenderIncomeMapper;
import com.mijiaokj.sys.dal.repository.query.RecommenderIncomeCriteria;
import com.mijiaokj.sys.domain.RecommenderIncome;
import com.mijiaokj.sys.domain.vo.RecommenderIncomeVo;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by wb-scg178938 on 2017/7/3.
 */
@Repository
public class RecommenderIncomeRepository extends BaseRepository<RecommenderIncome>{
    @Resource
    private RecommenderIncomeMapper recommenderIncomeMapper;
    @Override
    protected BaseMapper<RecommenderIncome> getMapper() {
        return recommenderIncomeMapper;
    }

    public Map<String,Object> executeQueryForPage(RecommenderIncomeCriteria criteria){
        Map<String,Object> pageMap = new HashMap<>();
        List<RecommenderIncome> datas = recommenderIncomeMapper.selectPageByMap(criteria);
        Integer count = recommenderIncomeMapper.pageCountByMap(criteria);
        pageMap.put("datas",datas);
        pageMap.put("count",count);
        return pageMap;
    }

    /*public Page<RecommenderIncomeVo> executeQueryForPage(RecommenderIncomeCriteria criteria){
        List<RecommenderIncome> datas = recommenderIncomeMapper.selectPageByMap(criteria);
        Integer count = recommenderIncomeMapper.pageCountByMap(criteria);
        List<RecommenderIncomeVo> rows = new ArrayList<RecommenderIncomeVo>();
        if(null!=datas && !datas.isEmpty()){
            for (RecommenderIncome recommenderIncome : datas){
                RecommenderIncomeVo recommenderIncomeVo = new RecommenderIncomeVo();
                recommenderIncomeVo.setEntrant(recommenderIncome.getEntrantId().toString());
                recommenderIncomeVo.setFee(recommenderIncome.getFee());
                recommenderIncomeVo.setGmtWithdrawals(recommenderIncome.getGmtWithdrawals());
                recommenderIncomeVo.setId(recommenderIncome.getId());
                recommenderIncomeVo.setGmtCreate(recommenderIncome.getGmtCreate());
                recommenderIncomeVo.setRecommender(recommenderIncome.getRecommenderId().toString());
                recommenderIncomeVo.setWithdrawals(recommenderIncome.getWithdrawalsType().toString());
                rows.add(recommenderIncomeVo);
            }
        }
        return new Page<>(rows, criteria.getStartRow(), criteria.getPageSize(), count);
    }*/

}

@@ -39,50 +39,8 @@
 y;%0A%0A
-import com.mijiaokj.sys.common.util.Page;%0A
 impo
@@ -85,32 +85,32 @@
 per.BaseMapper;%0A
+
 import com.mijia
@@ -290,63 +290,8 @@
 me;%0A
-import com.mijiaokj.sys.domain.vo.RecommenderIncomeVo;%0A
 impo
@@ -375,36 +375,8 @@
 ce;%0A
-import java.util.ArrayList;%0A
 impo
@@ -1225,18 +1225,19 @@
 erIncome
-Vo
+DTO
 %3E execut
@@ -1482,18 +1482,19 @@
 erIncome
-Vo
+DTO
 %3E rows =
@@ -1525,18 +1525,19 @@
 erIncome
-Vo
+DTO
 %3E();%0A   
@@ -1674,18 +1674,19 @@
 erIncome
-Vo
+DTO
  recomme
@@ -1721,18 +1721,19 @@
 erIncome
-Vo
+DTO
 ();%0A    

update dto