除了利用时间段进行查询外,还有一个方法:
利用mybatis中的函数,将datetime转为date
<if test="purch_date!= null and purch_date!=''"> date(purch_date) = #{purch_date} </if>