首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

sql 语句查询字段列表时的映射有关问题

2012-09-23 
sql 语句查询字段列表时的映射问题我写了一个IBATIS select 语句如下 select idquery.company paramet

sql 语句查询字段列表时的映射问题
我写了一个IBATIS select 语句如下
<select id="query.company" parameterproperty="seqTci">
          tci.SEQ_TCI=#seqTci#
        </isNotEmpty>
<isNotEmpty prepend="AND" property="nameCh">
tci.NAME_CH=#nameCh#
</isNotEmpty>
<isNotEmpty prepend="AND" property="nameEn">
tci.NAME_EN=#nameEn#
</isNotEmpty>
<isNotEmpty prepend="AND" property="logoPhoto">
tci.LOGO_PHOTO=#logoPhoto#
</isNotEmpty>
<isNotEmpty prepend="AND" property="introductionCh">
tci.INTRODUCTION_CH=#introductionCh#
</isNotEmpty>
<isNotEmpty prepend="AND" property="introductionEn">
tci.INTRODUCTION_EN=#introductionEn#
</isNotEmpty>
<isNotEmpty prepend="AND" property="establishDate">
tci.ESTABLISH_DATE=#establishDate#
</isNotEmpty>
<isNotEmpty prepend="AND" property="caddress">
tci.CADDRESS=#caddress#
</isNotEmpty>
<isNotEmpty prepend="AND" property="eaddress">
tci.EADDRESS=#eaddress#
</isNotEmpty>
<isNotEmpty prepend="AND" property="telephone">
tci.TELEPHONE=#telephone#
</isNotEmpty>
<isNotEmpty prepend="AND" property="fax">
tci.FAX=#fax#
</isNotEmpty>
<isNotEmpty prepend="AND" property="webAddress">
tci.WEB_ADDRESS=#webAddress#
</isNotEmpty>
<isNotEmpty  prepend="AND" property="email">
tci.EMAIL=#email#
</isNotEmpty>
<isNotEmpty prepend="AND" property="cpFzr">
tci.CP_FZR=#cpFzr#
</isNotEmpty>
<isNotEmpty prepend="AND" property="fzrPhoto">
tci.FZR_PHOTO=#fzrPhoto#
</isNotEmpty>
<isNotEmpty prepend="AND" property="fzrTele">
tci.FZR_TELE=#fzrTele#
</isNotEmpty>
<isNotEmpty prepend="AND" property="zjlName">
tci.ZJL_NAME=#zjlName#
</isNotEmpty>
<isNotEmpty prepend="AND" property="zjlTele">
tci.ZJL_TELE=#zjlTele#
</isNotEmpty>
<isNotEmpty prepend="AND" property="cwName">
tci.CW_NAME=#cwName#
</isNotEmpty>
<isNotEmpty prepend="AND" property="cwTele">
tci.CW_TELE=#cwTele#
</isNotEmpty>
<isNotEmpty prepend="AND" property="wmName">
tci.WM_NAME=#wmName#
</isNotEmpty>
<isNotEmpty prepend="AND" property="wmTele">
tci.WM_TELE=#wmTele#
</isNotEmpty>
<isNotEmpty prepend="AND" property="companyType">
tci.COMPANY_TYPE=#companyType#
</isNotEmpty>
<isNotEmpty prepend="AND" property="hasJckjyPower">
tci.HAS_JCKJY_POWER=#hasJckjyPower#
</isNotEmpty>
<isNotEmpty prepend="AND" property="hasJmLicense">
tci.HAS_JM_LICENSE=#hasJmLicense#
</isNotEmpty>
<isNotEmpty prepend="AND" property="hasDwLicense">
tci.HAS_DW_LICENSE=#hasDwLicense#
</isNotEmpty>
<isNotEmpty prepend="AND" property="isHighTechCp">
tci.IS_HIGH_TECH_CP=#isHighTechCp#
</isNotEmpty>
<isNotEmpty prepend="AND" property="whLiquBank">
tci.WH_LIQU_BANK=#whLiquBank#
</isNotEmpty>
<isNotEmpty prepend="AND" property="creditStatus">
tci.CREDIT_STATUS=#creditStatus#
</isNotEmpty>
<isNotEmpty prepend="AND" property="isoInfo">
tci.ISO_INFO=#isoInfo#
</isNotEmpty>
<isNotEmpty prepend="AND" property="prizeInfo">
tci.PRIZE_INFO=#prizeInfo#
</isNotEmpty>
<isNotEmpty prepend="AND" property="regMoney">
tci.REG_MONEY=#regMoney#
</isNotEmpty>
<isNotEmpty prepend="AND" property="productMoney">
tci.PRODUCT_MONEY=#productMoney#
</isNotEmpty>
<isNotEmpty prepend="AND" property="taxMoney">
tci.TAX_MONEY=#taxMoney#
</isNotEmpty>
<isNotEmpty prepend="AND" property="jntz">
tci.JNTZ=#jntz#
</isNotEmpty>
<isNotEmpty prepend="AND" property="jwtz">
tci.JWTZ=#jwtz#
</isNotEmpty>
<isNotEmpty prepend="AND" property="rzType">
tci.RZ_TYPE=#rzType#
</isNotEmpty>
<isNotEmpty prepend="AND" property="deptNames">
tci.DEPT_NAMES=#deptNames#
</isNotEmpty>
<isNotEmpty prepend="AND" property="prodAreaType">
tci.PROD_AREA_TYPE=#prodAreaType#
</isNotEmpty>
<isNotEmpty prepend="AND" property="prodArea">
tci.PROD_AREA=#prodArea#
</isNotEmpty>
<isNotEmpty prepend="AND" property="officeAreaType">
tci.OFFICE_AREA_TYPE=#officeAreaType#
</isNotEmpty>
<isNotEmpty prepend="AND" property="officeArea">
tci.OFFICE_AREA=#officeArea#
</isNotEmpty>
<isNotEmpty prepend="AND" property="fzxz">
tci.FZXZ=#fzxz#
</isNotEmpty>
<isNotEmpty prepend="AND" property="fzyj">
tci.FZYJ=#fzyj#
</isNotEmpty>
<isNotEmpty prepend="AND" property="hasOa">
tci.HAS_OA=#hasOa#
</isNotEmpty>
<isNotEmpty prepend="AND" property="hasWb">
tci.HAS_WEB=#hasWb#
</isNotEmpty>
<isNotEmpty prepend="AND" property="isUseEp">
tci.IS_USE_EP=#isUseEp#
</isNotEmpty>
<isNotEmpty prepend="AND" property="hgCode">
tci.HG_CODE=#hgCode#
</isNotEmpty>
<isNotEmpty prepend="AND" property="cpZzjgdm">
tci.CP_ZZJGDM=#cpZzjgdm#
</isNotEmpty>
<isNotEmpty prepend="AND" property="cpZch">
tci.CP_ZCH=#cpZch#
</isNotEmpty>
<isEmpty prepend="and" property="state">
tci.STATE='1'
</isEmpty>
</dynamic>
order by tci.SEQ_TCI limit #start#,#pageSize#
</select>

其中的$fields$ 是动态的与用户权限有关,查询在页面显示时,不是报错就是要显示的列没有查询出来。
刚开始以为是缓存有问题,清空缓存后还是不行,后来在书上找了下原来是映射问题
在select 中加上remapResults="true" 就可以了

热点排行