The-sharp number cannot be used within the mybatis forach tag, but you can use $

mybatis foreach tag

<if test="map.itemNos!=null and map.itemNos.size()>0">
            AND EXISTS (SELECT 1 FROM COM_INV_ITEMS WHERE INVENTORY_ITEM_ID= h.INVENTORY_ITEM_ID AND SEGMENT1 IN
            <foreach item="itemNo" index="index" collection="map.itemNos"  open="(" separator="," close=")">
                -sharp{itemNo}
            </foreach>
            )
</if>

the following error will be reported when using the above method,

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter "__frch_item_0" not found. Available parameters are [param1, param2, page, map]
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
    org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    com.huaqin.hfw.web.filter.Acl.doFilter(Acl.java:268)
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
    org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
    com.huaqin.fcstrp.filter.OidcAuthenticationFilter.doFilter(OidcAuthenticationFilter.java:35)
    com.huaqin.hfw.log.ContextFilter.doFilter(ContextFilter.java:33)

but with the same code, there is no problem simply replacing-sharp {itemNo} with ${itemNo}. Why? Baidu google has been searched all over, and no one has ever encountered such a problem

Mar.04,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e485fb-43967.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e485fb-43967.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?