You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
interface ViewDb {
List listDecodersByRosterID(List array)
List ListWithCvs(Vector decoderID, List cvs, Boolean listAll)
}
The mapper:
SELECT
b.id,
b.decoderid,
a.dccAddress,
a.roadName AS roadName,
a.roadNumber AS roadNumber,
cvNumber AS cvNumber,
cvValue AS cvValue
FROM
( SELECT
*
FROM
cvvalues
#{item}
AND cvNumber IN ('1',
'2', '3', '4', '5' , '6',
'7', '8', '9', '10', '11',
'12', '13', '14', '15', '16',
'17', '18', '19')
#{item,jdbcType=VARCHAR}
) AS b
INNER JOIN
decoder a
ON
a.id = b.decoderId
ORDER BY
b.decoderid,
cvNumber
With arg1 null and the second parameter is false, I get the collection "CvValues" populated as expected. When I pass in arg0 and arg1, the log shows the expected values, but the results act as if only the first value in the arg1 array was used:
DEBUG 2025-01-27 20:56:27,466 ViewDb.ListWithCvs ==> Preparing: SELECT b.id, b.decoderid, a.dccAddress, a.roadName AS roadName, a.roadNumber AS roadNumber, cvNumber AS cvNumber, cvValue AS cvValue FROM ( SELECT * FROM cvvalues WHERE decoderid in (7, 8, 9) AND cvNumber IN ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) ) AS b INNER JOIN decoder a ON a.id = b.decoderId ORDER BY b.decoderid, cvNumber
DEBUG 2025-01-27 20:56:27,470 ViewDb.ListWithCvs ==> Parameters: 2(String), 3(String), 4(String), 5(String), 6(String), 7(String), 8(String), 9(String), 0.255.285(String), 0.255.286(String), 0.255.287(String)
TRACE 2025-01-27 20:56:27,475 ViewDb.ListWithCvs <== Columns: ID, DECODERID, DCCADDRESS, ROADNAME, ROADNUMBER, CVNUMBER, CVVALUE
TRACE 2025-01-27 20:56:27,476 ViewDb.ListWithCvs <== Row: 6639, 7, 4390, PRR, 4390, 2, 2
TRACE 2025-01-27 20:56:27,479 ViewDb.ListWithCvs <== Row: 6831, 8, 5432, PRR, 5432, 2, 2
TRACE 2025-01-27 20:56:27,480 ViewDb.ListWithCvs <== Row: 6928, 9, 5754, Pennsylvania, 5754, 2, 2
DEBUG 2025-01-27 20:56:27,480 ViewDb.ListWithCvs <== Total: 3
If I select the same query with dbVisualizer with the same parameters I get 257 (which Mybatis would roll up into 3 rows with the values in cvValues array.
I have tried many times to get this to work but no matter how I phrase the query, I can't get Mybatis to enter all the values unless I use literals. Is this a bug?
The text was updated successfully, but these errors were encountered:
The interface (written in Groovy):
interface ViewDb {
List listDecodersByRosterID(List array)
List ListWithCvs(Vector decoderID, List cvs, Boolean listAll)
}
The mapper:
SELECT b.id, b.decoderid, a.dccAddress, a.roadName AS roadName, a.roadNumber AS roadNumber, cvNumber AS cvNumber, cvValue AS cvValue FROM ( SELECT * FROM cvvalues #{item} AND cvNumber IN ('1', '2', '3', '4', '5' , '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19') #{item,jdbcType=VARCHAR} ) AS b INNER JOIN decoder a ON a.id = b.decoderId ORDER BY b.decoderid, cvNumberWith arg1 null and the second parameter is false, I get the collection "CvValues" populated as expected. When I pass in arg0 and arg1, the log shows the expected values, but the results act as if only the first value in the arg1 array was used:
DEBUG 2025-01-27 20:56:27,466 ViewDb.ListWithCvs ==> Preparing: SELECT b.id, b.decoderid, a.dccAddress, a.roadName AS roadName, a.roadNumber AS roadNumber, cvNumber AS cvNumber, cvValue AS cvValue FROM ( SELECT * FROM cvvalues WHERE decoderid in (7, 8, 9) AND cvNumber IN ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) ) AS b INNER JOIN decoder a ON a.id = b.decoderId ORDER BY b.decoderid, cvNumber
DEBUG 2025-01-27 20:56:27,470 ViewDb.ListWithCvs ==> Parameters: 2(String), 3(String), 4(String), 5(String), 6(String), 7(String), 8(String), 9(String), 0.255.285(String), 0.255.286(String), 0.255.287(String)
TRACE 2025-01-27 20:56:27,475 ViewDb.ListWithCvs <== Columns: ID, DECODERID, DCCADDRESS, ROADNAME, ROADNUMBER, CVNUMBER, CVVALUE
TRACE 2025-01-27 20:56:27,476 ViewDb.ListWithCvs <== Row: 6639, 7, 4390, PRR, 4390, 2, 2
TRACE 2025-01-27 20:56:27,479 ViewDb.ListWithCvs <== Row: 6831, 8, 5432, PRR, 5432, 2, 2
TRACE 2025-01-27 20:56:27,480 ViewDb.ListWithCvs <== Row: 6928, 9, 5754, Pennsylvania, 5754, 2, 2
DEBUG 2025-01-27 20:56:27,480 ViewDb.ListWithCvs <== Total: 3
If I select the same query with dbVisualizer with the same parameters I get 257 (which Mybatis would roll up into 3 rows with the values in cvValues array.
I have tried many times to get this to work but no matter how I phrase the query, I can't get Mybatis to enter all the values unless I use literals. Is this a bug?
The text was updated successfully, but these errors were encountered: