ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiran vuppla <kirankumar_vup...@yahoo.com>
Subject Re: How to prepare a parameter map with an List property?
Date Wed, 05 Nov 2008 18:22:56 GMT
You should add the list attribute inside the <iterate> tag.

<select
id="Team"
 parameterMap="Gold"
  resultClass="resultTO">
 
  SELECT
YEAR(T.TIMEKEY) AS year,MONTH(T.TIMEKEY) AS
month,
  SUM(S.SPLTFACACCTCNT) AS dataCount
FROM
  TAB1 S,TAB2 T
  WHERE S.TIMEKEY=T.TIMEKEY AND
T.TIMEKEY BETWEEN #previousDate# AND #currentDate#
  <iterate property="list" open=" AND S.KEY IN ("
   close=")"
conjunction=",">
    #keyList[]#
  </iterate>
  AND
T.MO IN ('03','06','09','12')  GROUP BY T.TIMEKEY ORDER BY T.TIMEKEY WITH
UR
 
 </select>

-Kiran


--- On Wed, 11/5/08, ankit.khujneri@wipro.com <ankit.khujneri@wipro.com> wrote:
From: ankit.khujneri@wipro.com <ankit.khujneri@wipro.com>
Subject: How to prepare a parameter map with an List property?
To: user-java@ibatis.apache.org
Date: Wednesday, November 5, 2008, 5:36 AM



 
Hi,
 
I want to prepare
a parameter map that has a list property also.
 
<parameterMap
id = "Gold" class = "requestVO">
   
 
 <parameter property = "previousDate" jdbcType = "DATE" javaType =
"java.lang.String"/>
   <parameter property = "currentDate"
jdbcType = "DATE" javaType = "java.lang.String"/>
 
 <parameter property = "keyList" jdbcType = "INTEGER" javaType =
"java.lang.Integer"/>
   
 
 </parameterMap>
 
 <select
id="Team"
 parameterMap="Gold"
  resultClass="resultTO">
 
  SELECT
YEAR(T.TIMEKEY) AS year,MONTH(T.TIMEKEY) AS
month,
  SUM(S.SPLTFACACCTCNT) AS dataCount
FROM
  TAB1 S,TAB2 T
  WHERE S.TIMEKEY=T.TIMEKEY AND
T.TIMEKEY BETWEEN ? AND
  ?
  AND  S.KEY
IN
  <iterate open="("
   close=")"
conjunction=",">
   ?
  </iterate>
  AND
T.MO IN ('03','06','09','12')  GROUP BY T.TIMEKEY ORDER BY T.TIMEKEY WITH
UR
 
 </select>
 
Thanks in
Advance
 
Regards
Ankit Please do not print this email unless it is absolutely necessary.  


 The information contained in this electronic message and any attachments to this message
are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential
or privileged information. If you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and destroy all copies
of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email
and any attachments for the presence of viruses. The company accepts no liability for any
damage caused by any virus transmitted by this email. 

www.wipro.com




      
Mime
View raw message