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, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
From: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Subject: How to prepare a parameter map with an List property?
To: [email protected]
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