1、逻辑删除sql
update contacts set status = '2' where id = #{id}
2、多条件更新sql
update contacts
<set>
<if test="name != null">
name = #{name},
</if>
<if test="phone != null">
phone = #{phone}
</if>
</set>
where id = #{id}
3、多条件查询sql
select * from contacts where id = #{id} and status = '1'