Solve the problem that xml sql multi-layer () cannot be parsed

Mybatis multi-layer brackets (more than three layers) cannot be parsed, just add <![CDATA[ ]]>, or use the storage view, or apply it locally

 

 

<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>

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326488483&siteId=291194637