package com.panzhihua.common.model.dtos.grid; import java.util.Date; import javax.validation.constraints.Max; import javax.validation.constraints.Pattern; import org.hibernate.validator.constraints.Length; import com.fasterxml.jackson.annotation.JsonFormat; import com.google.common.base.CaseFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * 分页查询表单 * * @author cedoo email:cedoo(a)qq.com * @version 1.0 * @since 1.0 * @date 2021-05-26 */ @Data @ApiModel("查询事件处理流转记录请求参数") public class PageEventTransferRecordDTO { @ApiModelProperty(value = "分页-当前页数", example = "1") private Long pageNum = 1L; @ApiModelProperty(value = "分页-每页记录数", example = "10") private Long pageSize = 10L; @ApiModelProperty(value = "排序字段, 默认createAt", example = "createAt") private String sortAttr = "createAt"; @ApiModelProperty(value = "排序方式: asc/desc(默认)", example = "desc") @Pattern(regexp = "asc|desc|ASC|DESC") private String sortType = "desc"; @Max(9223372036854775807L) @ApiModelProperty(value = "id", hidden = false, example = "1") private Long id; @Max(9223372036854775807L) @ApiModelProperty(value = "事件ID", hidden = false, example = "1") private Long eventId; @Max(127) @ApiModelProperty(value = "来源类型(1、网格员2、社区3、是街道)", hidden = false, example = "1") private Integer fromType; @Max(9223372036854775807L) @ApiModelProperty(value = "事件来源机构或网格员", hidden = false, example = "1") private Long from; @Length(max = 255) @ApiModelProperty(value = "转交办理人路径名称", hidden = false, example = "") private String fromName; @Max(127) @ApiModelProperty(value = "转交类型(1、网格员2、社区3、是街道)", hidden = false, example = "1") private Integer toType; @Max(9223372036854775807L) @ApiModelProperty(value = "事件下游机构或网格员", hidden = false, example = "1") private Long to; @Length(max = 255) @ApiModelProperty(value = "需要办理人路径名称", hidden = false, example = "") private String toName; @Length(max = 255) @ApiModelProperty(value = "处理结果", hidden = false, example = "") private String processResult; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @ApiModelProperty(value = "处理时间-开始时间", hidden = false, example = "2021-05-01 18:05:50") private Date processDateBegin; @ApiModelProperty(value = "处理时间-结束时间", hidden = false, example = "2021-05-01 18:05:50") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date processDateEnd; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @ApiModelProperty(value = "创建时间-开始时间", hidden = false, example = "2021-05-01 18:05:50") private Date createAtBegin; @ApiModelProperty(value = "创建时间-结束时间", hidden = false, example = "2021-05-01 18:05:50") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createAtEnd; @ApiModelProperty(value = "(当前操作)用户ID", hidden = true, example = "1") private Long userId; public String getSortColumns() { String dbColumn = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sortAttr); return dbColumn; } }