解决xml sql多层()不能解析问题

mybatis 多层括号(超过三层)解析不了,加<![CDATA[ ]]>即可,要么用存视图,应用在局部也可

 

 

<select id="selectfirm" resultType="com.esteel.web.entity.CusFirmBean" parameterType="com.esteel.web.beanvo.CusFirmBeanVo">

<![CDATA[ 

select a.*,a.customer_name as customerName from tb_cus_firm a where a.market_key =   #{marketKey} order by customer_key

]]>

</select>

 

<select id="getEmailCount" parameterType="map" resultMap="account1Map">

 SELECT * FROM TB_CUS_USER WHERE 1=1

  <if test="EMAIL!=null and EMAIL!=''">

  and EMAIL=#{EMAIL} 

  </if>

  <if test="CUS_TRADE_KIND!=null and CUS_TRADE_KIND!=''">

  and CUS_TRADE_KIND =#{CUS_TRADE_KIND}

  </if>

  <if test="CUS_USER_KEY!=null and CUS_USER_KEY!=''">

   and cus_user_key <![CDATA[<>]]> #{CUS_USER_KEY}

  </if> 

</select>

 

猜你喜欢

转载自yuhuiblog6338999322098842.iteye.com/blog/2314823