select date(p.create_time) as one_day,sum(a-b) as total,
p.cashier from pay_order p where p.create_time between date_format('2019-08-12 08:08:08','%Y%m%d')
and date_format('2019-08-13 08:08:08','%Y%m%d') group by one_day order by one_day desc;
如果查询数据库,使用入参实体类和出参实体类,需要@Filed注解且name与查询到的名字一致
@Table(name = "查询报表输出实体,不挂具体表")
public class ReportOutParam extends BaseEntity {
@JsonProperty("oneDay")
@JsonPropertyDescription("日期")
@Field(name = "one_day")
private String oneDay;
public String getOneDay() {
return oneDay;
}
public void setOneDay(String oneDay) {
this.oneDay = oneDay;
}
}