/*
* @(#)ParClientSourceQueryDTO.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.ParClientSource;
import com.glacier.frame.entity.basicdatas.ParClientSourceExample.Criteria;
/**
* @ClassName: ParClientSourceQueryDTO
* @Description: TODO(客户来源查询DTO)
* @author wuting
* @email 920339213@QQ.com
* @date 2015-1-13
*/
public class ParClientSourceQueryDTO extends ParClientSource{
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.getClientSourceName() && StringUtils.isNotBlank(this.getClientSourceName())){//客户来源名称Like查询
queryCriteria.andClientSourceNameLike("%" + this.getClientSourceName() + "%");
}
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);
}
}