1.模糊查询FORM
@Data
public class FuzzyQueryFORM {
@ApiModelProperty(value = "关键词(匹配用)")
private String keyWord;
}
2.分页FORM
@Data
@ApiModel(value = "分页查询")
public class PageQueryForm<T> implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "当前页码")
private Integer pageIndex;
@ApiModelProperty(value = "分页大小")
private Integer pageSize;
@ApiModelProperty(value = "排序字段")
private String sortBy;
@ApiModelProperty(value = "排序方式")
private String orderBy;
@Valid
@ApiModelProperty(value = "查询条件")
private List<T> conditions;
@ApiModelProperty(value = "排序字段映射map")
private HashMap<String, String> sortFieldMap;
public HashMap<String, String> getSortFieldMap() {
if(sortFieldMap == null){
sortFieldMap = new HashMap<String, String>(16);
}
return sortFieldMap;
}
public String transform(String key){
return Optional.ofNullable(sortFieldMap.get(key)).orElse(key);
}
}
3.单字段下拉框VO
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SinglePullingBean {
private String name;
}
4.双字段下拉框VO
@Data
@NoArgsConstructor
public class PullingBean {
private String number;
private String name;
public PullingBean(String number, String name){
this.number = number;
this.name = number + " " + name;
}
public PullingBean(String number, String name, Integer type){
this.number = number;
this.name = name;
}
}
5.统计任务进度VO
@Data
@NoArgsConstructor
public class AppTaskScheduleVO<T> extends Page<T> {
public AppTaskScheduleVO(
IPage<T> page, BigDecimal completedTasks, BigDecimal totalTasks){
this.setCurrent(page.getCurrent());
this.setSize(page.getSize());
this.setTotal(page.getTotal());
this.setPages(page.getPages());
this.setRecords(page.getRecords());
this.completedTasks = completedTasks;
this.totalTasks = totalTasks;
}
@ApiModelProperty(value = "已完成任务数")
private BigDecimal completedTasks;
@ApiModelProperty(value = "总任务数")
private BigDecimal totalTasks;
}