select <includerefid="Base_Column_List"/> from tab_haoban_qw_moment_plan_data a left join tab_haoban_staff b on a.staff_id = b.staff_id where a.plan_id=#{planId} and a.delete_flag = 0
<iftest="null != staffNameLike">
and b.staff_name like #{staffNameLike}
</if>
<iftest="null != clerkParamsLike">
and (a.clerk_code like #{clerkParamsLike} or a.clerk_name like #{clerkParamsLike})
</if>
<iftest="type==1">
and a.like_flag = 1
<iftest="null != startTime">
and ( a.like_time >= #{startTime} and a.like_time <![CDATA[ <= ]]> #{endTime} )
</if>
</if>
<iftest="type==2">
and a.comment_flag = 1
<iftest="null != startTime">
and ( a.comment_time >= #{startTime} and a.comment_time <![CDATA[ <= ]]> #{endTime} )