MySQL查询当前系统时间在 开始时间和结束时间之间的方法
方法一:
SELECT *
from c_test
where startTime < CURRENT_DATE and endTime > CURRENT_DATE
方法二:
@Select("select SUM(total_num) from main_order where end_time > #{time1} and end_time <#{time2}")
Integer getCollect(@Param("time1") String time1, @Param("time2") String time2 , @Param("postId") Integer id );
查询create_time这个月的
@Select("select * from recharge where phone=#{phone} and DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT( CURDATE() , '%Y%m' ) ")
List<Recharge> getNewRecharge(String phone);