我指定了表名还是提示 列名 'NAME' 不明确。求大神解答
以下是SQL代码:
<![CDATA[
select * from (select row_.*, ROW_NUMBER()over(order by row_.id desc) rownum_ from (
]]>
select TOP 100 PERCENT siteUser.ID,siteUser.NAME,siteUser.GENDER,siteUser.BIRTHDAY,siteUser.POLITICAL,siteUser.NATION,siteUser.TITLE,siteUser.PDA,siteUser.RADIO,siteUser.OTHER,siteUser.PHONE,siteUser.PHOTO,siteUser.SITEID,site.NAME SITE_NAME
from SYS_SITE_USER siteUser left join SYS_SITE site
on siteUser.SITEID = site.ID
<where>
<include refid = "other-condition"/>
</where>
order by id
<![CDATA[
)row_ )t where t.rownum_ between #{startrow} and #{endrow}
]]>
<sql id="other-condition">
<if test="name != null"> and NAME like #{name,javaType=String}</if>
<if test="gender != null"> and GENDER = #{gender,javaType=String}</if>
<if test="birthday != null"> and BIRTHDAY = #{birthday,javaType=Date}</if>
<if test="political != null"> and POLITICAL = #{political,javaType=String}</if>
<if test="nation != null"> and NATION = #{nation,javaType=String}</if>
<if test="title != null"> and TITLE = #{title,javaType=VARCHAR}</if>
<if test="pda != null"> and PDA = #{pda,javaType=String}</if>
<if test="radio != null"> and RADIO = #{radio,javaType=String}</if>
<if test="other != null"> and OTHER = #{other,javaType=String}</if>
<if test="phone != null"> and PHONE = #{phone,javaType=String}</if>
<if test="photo != null"> and PHOTO = #{photo,javaType=String}</if>
<if test="siteId != null"> and SITEID = #{siteId,javaType=Integer}</if>
<if test="siteName != null"> and SITE_NAME = #{siteName,javaType=String}</if>
</sql>