珠海企业网站建设社群运营的经典案例
目录
- 1 需求
- 2 实现
1 需求
数据库时间字段类型是timestamp,前端传的开始时间和结束时间是字符串,那么代码如何写,可以实现 时间段查询
2 实现
实体类里面的字段是String
xml 里面是
</if><if test="startTime !=null and startTime !=''">and update_time <![CDATA[ >= ]]> #{startTime,jdbcType=TIMESTAMP}</if><if test="endTime !=null and endTime !=''">and update_time <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}</if>