首页 > 其他分享 >XML转移符

XML转移符

时间:2023-05-03 16:14:21浏览次数:31  
标签:XML node ip hostName id 转移

XML转移符

这种方式看起来将不会太直观

符号 转义 说明
> > 大于
< &lt; 小于
& &amp;
' &apos; 单引号
" &quot; 双引号

<![CDATA[ ……]]>

这种方式看起来就会直观很多

  1. 大于等于 <![CDATA[ >= ]]>
  2. 小于等于 <![CDATA[ <= ]]>

示例

<select id="getAgentList" resultType="com.wht.demo.dao.vo.AgentVo">  
	select 
		t.node_id as nodeId,
		t.host_name as hostName,
		t.address_ip as addressIp
	from 
	t_node_agent t 
	<where> 
		<if test='appId !=null and appId != "" '>
			and t.app_id= #{appId}  
		</if>
		<if test='osType!=null and osType!= "" '>
			and t.os_type= #{osType}  
		</if>
		<if test="createTime!= null and createTime!= ''">
		     and create_time >= #{createTime}
		</if>
	</where>
</select> 

这种动态SQL编译就会报错,XML解析不了>号,按照上面转移符改造即可。

<select id="getAgentList" resultType="com.wht.demo.dao.vo.AgentVo">  
	select 
		t.node_id as nodeId,
		t.host_name as hostName,
		t.address_ip as addressIp
	from 
	t_node_agent t 
	<where> 
		<if test='appId !=null and appId != "" '>
			and t.app_id= #{appId}  
		</if>
		<if test='osType!=null and osType!= "" '>
			and t.os_type= #{osType}  
		</if>
		<if test="createTime!= null and createTime!= ''">
		     and create_time <![CDATA[ >=]]> #{createTime}
		</if>
	</where>
</select> 

标签:XML,node,ip,hostName,id,转移
From: https://www.cnblogs.com/hcgk/p/17369172.html

相关文章

  • 数据交换格式:XML、JSON
    XMLXML是什么可扩展标记语言(XML)是存储和交换数据的重要方法。它文档的形式类似于HTML,不过比HTML低级,都是标签里放内容。XML只包含少量的预定义标签,其他都由程序员来定义,只要数据的读者和编写者都知道标签的含义,标签就可以包含任何设计者希望的有用信息。XML的标签有单双,双标签包......
  • odoo xmlrpc
    importxmlrpc.client#info=xmlrpc.client.ServerProxy('http://127.0.0.1:8069/').start()#url,db,username,password=info['host'],info['database'],info['user'],info['password']##uid=common.au......
  • WordPress extended XML-RPC MetaWeblog API
    XML-RPCMetaWeblogAPI«WordPressCodexWordPress.orgWordPress.orgPluginsThemesPatternsLearnSupportDocumentationForumsNewsAboutGetInvolvedFivefortheFutureShowcaseMobileHostingOpenverseGetWordPressSearch......
  • The GitHub Project xm-rpc-el/xml-rpc-el README.org
    Commentary:ThisisanXML-RPCclientimplementationinelisp,capableofbothsynchronousandasynchronousmethodcalls(usingtheurlpackage'sasyncretrievalfunctionality).XML-RPCisremoteprocedurecallsoverHTTPusingXMLtodescribethefu......
  • XML-RPC Specification
    转载于http://xmlrpc.com/spec.md。:::{#idMenubar.divMenubar}:::{.topbar-wrapperstyle="z-index:5;"}:::{.navbar.navbar-fixed-topdropdown="dropdown"}:::divVersionNumber[]{#idPublishStatus}[]{#idSavedStatus} []{#idVersionNumber}......
  • xml 序列化
    usingSystem.Text;usingSystem.Xml;usingSystem.Xml.Serialization;varp=newPerson{Id=1,Name="Furion",Items=newList<string>{"Furion","百小僧"}};varxml=XmlSerialize(p);Console.ReadKe......
  • MAVEN 配置nexus setting.xml 配置
    MAVEN配置nexussetting.xml配置 <mirror> <id>nexus</id> <mirrorOf>*</mirrorOf> <url>http://192.168.1.104:8081/nexus/content/groups/public/</url> </mirror> <profile> <id>nexus&......
  • web.xml报错
    web.xml报错 Thecontentofelementtype"web-app"mustmatch"(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,err......
  • XMLHttpRequest发请求的步骤
    /*具体来说,AJAX包括以下几个步骤。以下是AJAX发请求的步骤1.创建XMLHttpRequest实例2.发出HTTP请求3.接收服务器传回的数据4.更新网页数据*///实例化一个对象xhrvarxhr=newXMLHttpRequest(),method="GET",url="https://www.baidu......
  • Spring XML配置的12个技巧
    Spring是一个强有力的java程序框架,其被广泛应用于java的程序中。它用POJO提供了企业级服务。Spring利用依赖注入可以获得简单而有效的测试能力。Springbeans,依赖关系,以及服务所需要的bean都将在配置文件中予以描述,配置文件一般采用XML格式。然而XML配置文件冗长而不易使用,在你进......