Java

映射器Sql元素

2017-12-04  本文已影响0人  Xr丶_c967

<sql id="roleClos">

id,role_name as roleName,note

<sql>

select   <include refid="roleClos"></include>

 from role  where role_name like concat('%', #{rn},'%')

and note like concat('%', #{note},'%')


<sql id="roleAlias">

${ali}.id,${ali}.role_name ,${ali}.note

</sql>

select   

<inlcule refid="roleAlias">

<properte name="ali"  value="r">

</include>

from role  r

 where role_name like concat('%', #{rn},'%')

and note like concat('%', #{note},'%')

在 include 中定义了一个名为ali的变量,其值为SQL表role的表名r,然后Sql元素就行使用这个变量名了

上一篇下一篇

猜你喜欢

热点阅读