/*
* @(#)BasisClientQueryDTO.java
* @author wuting
* Copyright (c) 2015 Glacier SoftWare Company Limited. All Rights Reserved.
*/
package com.glacier.frame.dto.query.basicdatas;
import java.util.Date;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import com.glacier.frame.entity.basicdatas.BasisClient;
import com.glacier.frame.entity.basicdatas.BasisClientExample.Criteria;
/**
* @ClassName: BasisClientQueryDTO
* @Description: TODO(客户档案查询DTO)
* @author wuting
* @email 920339213@QQ.com
* @date 2015-1-9
*/
public class BasisClientQueryDTO extends BasisClient{
private Date createStartTime;
private Date createEndTime;
private Date lastStartLoginTime;
private Date lastEndLoginTime;
private String loginStartCount;
private String loginEndCount;
public Date getCreateStartTime() {
return createStartTime;
}
public void setCreateStartTime(Date createStartTime) {
this.createStartTime = createStartTime;
}
public Date getCreateEndTime() {
return createEndTime;
}
public void setCreateEndTime(Date createEndTime) {
this.createEndTime = createEndTime;
}
public Date getLastStartLoginTime() {
return lastStartLoginTime;
}
public void setLastStartLoginTime(Date lastStartLoginTime) {
this.lastStartLoginTime = lastStartLoginTime;
}
public Date getLastEndLoginTime() {
return lastEndLoginTime;
}
public void setLastEndLoginTime(Date lastEndLoginTime) {
this.lastEndLoginTime = lastEndLoginTime;
}
public String getLoginStartCount() {
return loginStartCount;
}
public void setLoginStartCount(String loginStartCount) {
this.loginStartCount = loginStartCount;
}
public String getLoginEndCount() {
return loginEndCount;
}
public void setLoginEndCount(String loginEndCount) {
this.loginEndCount = loginEndCount;
}
public void setQueryCondition(Criteria queryCriteria){
if(null != this.getClientName() && StringUtils.isNotBlank(this.getClientName())){//客户档案名称Like查询
queryCriteria.andClientNameLike("%" + this.getClientName() + "%");
}
if(null != this.getEnabled()){//状态Enum查询
queryCriteria.andEnabledEqualTo(this.getEnabled().toString());
}
if(null != createStartTime && null != createEndTime){//创建时间段查询
queryCriteria.andCreateTimeBetween(createStartTime, createEndTime);
}else{
if(null != createStartTime){
queryCriteria.andCreateTimeGreaterThanOrEqualTo(createStartTime);
}
if(null != createEndTime){
queryCriteria.andCreateTimeLessThanOrEqualTo(createEndTime);
}
}
}
@Override
public String toString() {
return ReflectionToStringBuilder.toString(this);
}
}