多条件有选择的查询
<select id="queryall">
select* from comment
//可以选择条件 id cid
<trim prefix="where" prefixOverrides="and|or">
<if test="id!=null and id!=''">
and id=#{id}
</if>
<if test="cid!=null and cid!=''">
and cid=#{id}
</if>
</trim>
<select>