Convert MySQL statement to mybatis statement?

CSDN Q & A 2022-01-26 19:59:17 阅读数:779

convert mysql statement mybatis statement
This is a Mysql sentence : select date_format(ordertime,'%Y-%m-%d') as date , count(1) as Number from v_order where ordertime >= date(now()) - interval 7 day group by day(ordertime) How to convert to Mybatis sentence , seek !

img




Refer to the answer 1:

img




Refer to the answer 2:



Refer to the answer 3:
 stay mybatis Of xml In the file >= It's written in >= That's all right. > It means greater than sign SELECT date_format(ordertime, '%Y-%m-%d') AS date , count(1) AS Number FROM v_orderWHERE ordertime >= date(now()) - INTERVAL 7 DAYGROUP BY DAY (ordertime)



Refer to the answer 4:
copyright:author[CSDN Q & A],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/01/202201261959152219.html