com.github.yt.mybatis.result.QueryResult Maven / Gradle / Ivy
package com.github.yt.mybatis.result;
import com.fasterxml.jackson.annotation.JsonView;
import com.github.yt.mybatis.annotations.BaseResult;
import java.util.List;
public class QueryResult {
/**
* 结果集
*/
private List data;
/**
* 总数
*/
private long recordsTotal;
public QueryResult() {
}
public QueryResult(List data) {
this.data = data;
if(null!=data){
this.recordsTotal = data.size();
}
}
@JsonView(BaseResult.class)
public List getData() {
return data;
}
public QueryResult setData(List data) {
this.data = data;
return this;
}
@JsonView(BaseResult.class)
public long getRecordsTotal() {
return recordsTotal;
}
public QueryResult setRecordsTotal(long recordsTotal) {
this.recordsTotal = recordsTotal;
return this;
}
}