Mysql 日期大小比较
mysql 时间参数 年月日 时分秒 比较大小
<select id="checkTimeRepeatNum" parameterType="HomepageAdvertisement" resultType="int"> SELECT COUNT(*) FROM qs_study_homepage_advertisement WHERE is_valid=1 <if test="id != null "> and id != #{id}</if> <if test="examId != null "> AND exam_id = #{examId}</if> <if test="year != null "> AND year = #{year}</if> AND DATE_FORMAT(#{paramTime},'%Y-%m-%d %T') >= DATE_FORMAT(start_time,'%Y-%m-%d %T') AND DATE_FORMAT(end_time,'%Y-%m-%d %T') >= DATE_FORMAT(#{paramTime},'%Y-%m-%d %T') </select>
mysql 时间参数 年月日 比较大小
<select id="selectLatelyUserDayScheduleByUserExtendId" resultMap="UserDayScheduleResult"> <include refid="selectUserDayScheduleVo"/> WHERE user_extend_id = #{userExtendId} AND is_valid=1 AND DATE(schedule_date) >= DATE(#{nowDate}) ORDER BY schedule_date ASC LIMIT 1 </select>