一个不是很的查询语句用ibatis

1:  <select id="getTenderProcess" parameterClass="java.util.HashMap" resultClass="TenderVO">
select tender_accnt_nbr "encryptTenderId",
       tender_cd "tenderCd",
   tender_amt "tenderAmt",
   return_item_id "returnItemId"  
from return_item_tender
where return_item_id in
<isNotEmpty property="tendermap">
<iterate property="tendermap" open="(" close=")" conjunction=",">
<![CDATA[
Trim(#tendermap[].returnItemId#)
]]>
</iterate>
</isNotEmpty>
</select>

2: 
<delete id="delete_dbpurge_return_cust" parameterClass="Integer">
delete b from  return_cust b
join return_auth a on a.return_cust_id= b.return_cust_id
where a.status_cd in ('C','R') and  To_Days(sysdate()) -To_Days( a.update_dt)>#value#;
</delete>

3:  <sqlMap>
    <sql id="InsertFields">
        <![CDATA[   
            create_id,
            create_dt,           
            update_id,
            update_dt
        ]]>
    </sql>
   
    <sql id="InsertValues">
        <![CDATA[   
            'RI5System',
            SYSDATE(),
            'RI5System',
            SYSDATE()
        ]]>
    </sql>
   
    <sql id="UpdateSql">
        <![CDATA[
            update_id = 'RI5System',
            update_dt = SYSDATE()
        ]]>
    </sql>
</sqlMap>
4:  和上面这个应该相对应的
<update id="cancelAuthorization" parameterClass="authDO">
        update
            return_auth
        set
            status_cd= #statusCd#,
<include refid="UpdateSql" />
        where
            return_auth_id = #returnAuthorizationId#
</update>


5: 
<select id="queryMiscNOByDivNO" parameterClass="java.util.List" resultClass="DivMiscVO">
select
div_no "divNo",
misc_accnt_no "miscAcctNo"
from ref_div_miscaccnt
<dynamic prepend="where">
<isNotEmpty>
div_no in
<iterate open="(" close=")" conjunction=",">
#[]#
</iterate>
</isNotEmpty>
</dynamic>
</select>

6:  这里插点切面
  <aop:config>
<aop:advisor
pointcut="execution(* com.shc.rrs.returns.domain.*Impl.*(..))||execution(* com.shc.rrs.returns.dao.*Impl.*(..))"
advice-ref="txAdvice" />
</aop:config>

<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="tran*" propagation="REQUIRED" rollback-for="Exception" />
</tx:attributes>
</tx:advice>


7: <select id="getUpdateData" parameterClass="PendingReturnVO"
resultClass="TransacationVO">
Select a.return_auth_id "returnAuthorizationId", b.upd_trans_id
"transId", a.misc_amt "miscAmt", a.status_cd "statusCd" from
return_auth a left join auth_update_details b on
a.return_auth_id=b.return_auth_id and b.upd_trans_id = #transId#
where a.return_auth_id = #returnAuthorizationId# and
b.upd_trans_id = null or a.return_auth_id =
#returnAuthorizationId#;
</select>
8:  SELECT EML FROM
(
SELECT distinct USR_ID,EML FROM TRP,SITE_SRC_LOC,USR
        WHERE
            TRP_ID=#tripNumber#
        AND
        <isEqual property="checkFlag"
compareValue="true">
(TRP.CARR_ID=SITE_SRC_LOC.SCAC_CD OR TRP.DTC_LOC_CARR=SITE_SRC_LOC.SCAC_CD
OR SITE_SRC_LOC.SCAC_CD IN (SELECT RESP_TC FROM TRP_STOP WHERE TRP_ID=#tripNumber#))
</isEqual>
<isNotEqual property="checkFlag"
compareValue="true">
TRP.NEW_DTC=SITE_SRC_LOC.SCAC_CD
</isNotEqual>
        AND
            (USR.SITE_SRC_ID=SITE_SRC_LOC.SITE_SRC_ID OR USR.SITE_SRC_ID IS NULL)
        AND
        EML IS NOT NULL
        AND
            ROLE_ID in                  
      <iterate property="acessLevelList" open="(" close=")" conjunction=",">
        $acessLevelList[]$
      </iterate>
)


你可能感兴趣的:(C++,c,ibatis,C#)