mybatis注解sql判断是否为空

xiaoxiao2025-09-17  94

@Options(useGeneratedKeys=true,keyProperty = "id",keyColumn = "id")     @Update("<script> update "+Gather.TABLE_NAME+" set status = #{status} <if test='remark!=null'> , remark = #{remark} </if> where id = #{id} </script>")     int updateStatus(@Param("id")Integer id, @Param("status")Integer status,@Param("remark")String remark); @Param("id")别名,对应sql中的#{id}

 

转载请注明原文地址: https://www.6miu.com/read-5036488.html

最新回复(0)