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