<select id="list" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from loginuser
where
type = #{type}
<if test='"0".equals(examine)' >
and (examine is null or examine='0')
</if>
<if test='"1".equals(examine)' >
and examine='1'
</if>
</select>
Element sqlElm = (Element) doc.selectSingleNode(String.format("/mapper/*[@id='%s']",sqlId));;
System.out.println(sqlElm.getData());
System.out.println(sqlElm.getText());
System.out.println(sqlElm.getDocument());
String sqlContent = sqlElm.getStringValue();
获得 id=list 的时候里面的标签都没了,我需要里面的标签怎么获得,就像jquery 里的 html() 方法一样。
Node.asXML(),以String的形式返回当前节点的所有内容。
然后使用DocumentHelper.parseText(String text),将字符串解析成一个Document对象