我指定了表名还是提示 列名 'NAME' 不明确。求大神解答

txws198737 txws198737 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
以下是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>
...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
txws198737
Java 51,407 成员 86,129 内容