I want to select a result according to the search number parameter,for example, if I pass 7, I want the sql statement like select * from student where DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(CREATETIME),Now in Mybatis,I try to write like this,and also change ${pd.intervalDay} to #{pd.intervalDay},but it is wrong.How to change it?
<!-- pd is hasmap type -->
<select id="selectstudentresult" parameterType="page" resultType="pd">
select * from student
<where>
<if test="pd.intervalDay!=null">
and DATE_SUB(CURDATE(), INTERVAL ${pd.intervalDay} DAY) <= date(a.UPDATETIME)