`
peonyzzdx
  • 浏览: 592060 次
  • 性别: Icon_minigender_2
  • 来自: 杭州
社区版块
存档分类
最新评论

java.sql.SQLException: 列名无效

 
阅读更多


seachIssueNew.xml

<select id="searchDoneIssues" parameterClass="SearchIssueVoNew"
resultMap="issueNewResult.issueViewResult">
<![CDATA[
select iu.id as issueId,iu.serialnumber,iu.subject,iu.status,iu.occurdate,iu.currentorgdisplayname,iu.occurorg,iu.sourceperson,iu.sourcekind,
iu.sourcemobile,iu.urgent,il.id as issueLogId,il.dealtime,il.supervisionstate,il.dealState,il.targeOrgId,iu.lastOrg from issuesnew iu,issuelogsnew il where il.targeorgid=#targeOrgId#
and il.dealstate in ]]>
<iterate property="dealStateList" open="(" close=")"
conjunction=",">
#dealStateList[]#
</iterate>
<![CDATA[
and iu.id=il.issueid and iu.id not in(select issueid from historicalIssues where orgId=#targeOrgId#)
]]>
<include refid="sqlWhere" />
<dynamic prepend="order by">
<isPropertyAvailable property="sortField">
<isNotNull property="sortField">$sortField$</isNotNull>
<isNotNull property="order">$order$</isNotNull>
</isPropertyAvailable>
</dynamic>
</select>


IssueNewResult.xml

<resultMap id="issueViewResult" class="IssueViewObject">
    <result property="id" column="id" />
<result property="issueId" column="issueId" />
<result property="serialNumber" column="serialNumber" />
<result property="subject" column="subject" />
<result property="status" column="status" />
<result property="occurDate" column="occurDate" />
<result property="currentOrgDisplayName" column="currentOrgDisplayName" />
<result property="occurOrg.id" column="occurOrg" />
<result property="dealTime" column="dealTime" />
<result property="sourcePerson" column="sourcePerson" />
<result property="sourceKind.id" column="sourceKind" />
<result property="sourceMobile" column="sourceMobile" />
<result property="issueLogId" column="issueLogId" />
<result property="supervisionState" column="supervisionState" />
<result property="urgent" column="urgent" />
<result property="dealState" column="dealState" />
<result property="targeOrg.id" column="targeOrgId" />
<result property="lastOrg.id" column="lastOrg" />
<result property="createDate" column="createDate" />
<result property="command" column="command" />
<result property="dealOrgId" column="dealOrgId" />
<result property="commandState" column="commandState" />
<result property="orglevelInternalid" column="orglevelInternalid" />
<result property="orgtypeInternalid" column="orgtypeInternalid" />
</resultMap>

解决:查询结果中没有id,改正如下

seachIssueNew.xml

<select id="searchDoneIssues" parameterClass="SearchIssueVoNew"
resultMap="issueNewResult.issueViewResult">
<![CDATA[
select il.id,iu.id as issueId,iu.serialnumber,iu.subject,iu.status,iu.occurdate,iu.currentorgdisplayname,iu.occurorg,iu.sourceperson,iu.sourcekind,
iu.sourcemobile,iu.urgent,il.id as issueLogId,il.dealtime,il.supervisionstate,il.dealState,il.targeOrgId,iu.lastOrg from issuesnew iu,issuelogsnew il where il.targeorgid=#targeOrgId#
and il.dealstate in ]]>
<iterate property="dealStateList" open="(" close=")"
conjunction=",">
#dealStateList[]#
</iterate>
<![CDATA[
and iu.id=il.issueid and iu.id not in(select issueid from historicalIssues where orgId=#targeOrgId#)
]]>
<include refid="sqlWhere" />
<dynamic prepend="order by">
<isPropertyAvailable property="sortField">
<isNotNull property="sortField">$sortField$</isNotNull>
<isNotNull property="order">$order$</isNotNull>
</isPropertyAvailable>
</dynamic>
</select>
  • 大小: 244.7 KB
0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics