<if test="timeFlag == 0"> AND CREATE_TIME>=DATE_SUB(CURDATE(),INTERVAL 7 DAY) </if> <if test="timeFlag == 1"> AND CREATE_TIME>=DATE_SUB(CURDATE(),INTERVAL 15 DAY) </if> <if test="timeFlag == 2"> AND CREATE_TIME>=DATE_SUB(CURDATE(),INTERVAL 30 DAY) </if> <if test="startTime != null"> AND CREATE_TIME <![CDATA[>=]]> #{startTime} </if> <if test="endTime != null"> AND CREATE_TIME <![CDATA[<=]]> #{endTime} </if> <if test="userIds != null"> AND USER_ID IN <foreach collection="userIds" item="item" open="(" close=")" separator=","> #{item} </foreach> </if>