<select id="findEvents" resultType="com.hikvision.ctm05tips.dto.EventsDto">
select * from events
<where><if test="eventsDto.eventType!=null and eventsDto.eventType!=''">
event_type=#{
eventsDto.eventType}</if><if test="eventsDto.occurTime!=null and eventsDto.occurTime!=''">
and occur_time=#{
eventsDto.occurTime}</if><if test="eventsDto.startTime!=null and eventsDto.startTime!=''">
and start_time=#{
eventsDto.startTime}</if><if test="eventsDto.endTime!=null and eventsDto.endTime!=''">
and end_time=#{
eventsDto.endTime}</if></where>
offset (#{
pageNo}-1)* #{
pageSize}
limit #{
pageSize}</select>
Service
public BaseResponse<PageBean<Events>>findEvents(@Param("pageNo")int pageNo,@Param("pageSize")int pageSize,@Param("eventsDto") EventsDto eventsDto);