Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the The error may involve defaultParameterMap error in Mybatis

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to solve The error may involve defaultParameterMap errors in Mybatis". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to solve the The error may involve defaultParameterMap error in Mybatis.

Today, when writing a multi-conditional link query, there was a The error may involve defaultParameterMap error.

It turned out that the sql statement wrote

SELECT

D.device_unique_id,d.position_id, d.device_name,c.hardware_version

C.software_version,c.longitude,c.latitude,c.height

FROM device d

INNER JOIN # {deviceType} c

ON d.device_unique_id=c.device_unique_id

And d.project_id=# {projectId}

It is right for SQL to put this error into Navicat, but it keeps reporting this error in the program.

I know it's a parameter configuration error, but I've been looking for it for a long time. It turns out that when I passed in a parameter, I used the

# {} accepted the parameter, but the parameter is the table name, so the parameter is always wrong. Because # {} will add "" to the parameter to become a string. Later changed to ${} to accept parameters. This can be carried out.

That is, you should use ${} to accept the table name and # {} to accept other parameters.

Finally, it was changed to

SELECT

D.device_unique_id,d.position_id, d.device_name,c.hardware_version

C.software_version,c.longitude,c.latitude,c.height

FROM device d

INNER JOIN ${deviceType} c

ON d.device_unique_id=c.device_unique_id

And d.project_id=# {projectId}

You can query normally.

At this point, I believe you have a deeper understanding of "how to solve The error may involve defaultParameterMap errors in Mybatis". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report