mysql、JPA查询某年某月的数据
# 1、查询2021年的数据
# 账单表tb_bill,保存时间的列bill_time
select * from tb_bill b where year(b.bill_time)='2021' ;
# 2、查询3月份的数据
select * from tb_bill b where month(b.bill_time)='03';
3、查询2021年3月份的数据
select * from tb_bill b where year(b.bill_time)='2021' and month(b.bill_time)='03';
JPA中dao:
/**
* @author chushiyan
* @email chushiyan0415@163.com
* @description 记账表dao
*/
public interface BillDao extends JpaRepository<Bill, String