1.1 service 业务层
@Override
public List
1.2 repository 层
@Query(value = "select \n" +
"sum(elect.value) as electValue ,\n" +
"sum(fiscal.output_value) as monthValue ,\n" +
"fiscal.year as years,\n" +
"fiscal.months as months ,\n" +
"sum(fiscal.trade_income) as tradeIncome \n" +
"from enterprise enterprise \n" +
"left join enterprise_fiscal fiscal on fiscal.enterprise_id = enterprise.id \n" +
"left join enterprise_elect elect on elect.enterprise_id = enterprise.id \n" +
"group by months , years \n" +
"order by months , years desc",nativeQuery = true)
List> getDistrictCounty();
spring:
jpa:
hibernate:
#create 每次运行程序,没有表格会新建表格,表格内数据会清空
#create-drop 每次运行结束的时候回清空表
#update 每次运行程序,没有表格会新建表格,没有表格不会清空,只会更新
#validate 每次运行程序会效验数据与数据库字段类型是否相同,不同会报错
ddl-auto: validate#是否输出SQL,工作台里面是否输出
show-sql: false
open-in-view: false