java中日期增加一天

        String startTimeStr = "";
		String endTimeStr = "";
        String start = String.valueOf(query.get("startTime"));
        if (!"".equals(start) && start != null) {
        	startTimeStr = start + " 00:00:00";
		}
        String end = String.valueOf(query.get("endTime"));
        if (!"".equals(end) && end != null) {
			endTimeStr = end + " 23:59:59";
		}
        query.put("startTime",startTimeStr);
        query.put("endTime",endTimeStr);
<select id="activitylist" resultType="com.bootdo.activityResgister.vo.InfoVo">
	SELECT
		a.`activity_id`,
		a.`activity_name`,
		a.`province`,
		a.`office_place`,
		a.`office_leader`, 
		c.`activity_type_name`,
		a.`activity_type_id`,
		a.`activity_place`,
		DATE_FORMAT( a.`activity_time`, '%Y-%m-%d' ) activityTime,
		a.`person_num`,
		a.`activity_sum`,
		a.office_leader,
		b.`username` createName
	FROM
		activity_info a LEFT JOIN
		sys_user b ON a.user_id=b.user_id
		LEFT JOIN
		activity_type_info c ON c.activity_type_id=a.activity_type_id
        <where>  
		  		 <if test="activityName != null and activityName != ''"> and activity_name = #{activityName} </if>
		  		  <if test="activityId != null and activityId != ''"> and activity_id = #{activityId} </if>
		  		  <if test="province != null and province != ''"> and province = #{province} </if>
		  		  <if test="officePlace != null and officePlace != ''"> and office_place = #{officePlace} </if>
		  		  <if test="activityTypeName != null and activityTypeName != ''"> and activity_type_name = #{activityTypeName} </if>
		  		  <if test="activityPlace != null and activityPlace != ''"> and activity_place = #{activityPlace} </if>
		  		  <if test="activityTime != null and activityTime != ''"> and activity_time = #{activityTime} </if>
		  		  <if test="personNum != null and personNum != ''"> and person_num = #{personNum} </if>
		  		  <if test="activitySum != null and activitySum != ''"> and activity_sum = #{activitySum} </if>
		  		  <if test="createName != null and createName != ''"> and username = #{createName} </if>
		  		  and a.enable=1
		</where>
        <choose>
            <when test="sort != null and sort.trim() != ''">
                order by ${sort} ${order}
            </when>
			<otherwise>
                order by activity_id desc
			</otherwise>
        </choose>
		<if test="offset != null and limit != null">
			limit #{offset}, #{limit}
		</if>
	</select>

猜你喜欢

转载自blog.csdn.net/weixin_40205234/article/details/85695604