上代码
<select id="page" resultType="com.sky.entity.Orders">
select * from orders
<where>
<if test="number!=null and number!=''">
and number like concat('%',#{number},'%')
</if>
<if test="phone!=null and phone!=''">
and phone like concat('%',#{phone},'%')
</if>
<if test="status!=null">
and status = #{status}
</if>
<if test="beginTime!=null">
and order_time >= #{beginTime}
</if>
<if test="endTime!=null">
and #{endTime} >= order_time
</if>
</where>
order by order_time desc
</select>