mybatis中foreach遍历报错not iterable问题解决方法

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression ‘deptIds’. Return value (1,939,956,961,964,966,969,972,975,978,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,928,929,930,941,942,946,948,949,950,951,954,957,960,962,965,967,970,973,976,979,984,985,1071,1074,694,696,705,713,724,726,741,759,782,794,804,818,826,833,840,935,697,706,714,725,727,742,760,783,795,805,819,827,834,841,934,698,707,715,728,743,761,784,796,806,820,828,835,842,699,708,716,729,744,762,785,797,807,821,829,836,843,700,709,717,730,745,763,786,798,808,822,830,837,701,710,718,731,746,764,787,799,809,823,831,838,702,711,719,732,747,765,788,800,810,824,832,839,703,712,720,733,748,766,789,801,811,825,932,704,721,734,749,767,790,802,812,931,722,735,750,768,791,803,813,936,723,736,751,769,792,814,737,752,770,793,815,738,753,771,816,739,754,772,817,740,755,773,756,774,757,775,758,776,777,778,779,780,781,1008,959,963,968,971,974,977,980,981,982,983,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1072,1073,1075,844,845,849,850,857,859,860,864,871,872,874,875,876,877,878,879,885,887,888,896,903,913,918,921,925,933,695,846,851,858,861,865,873,880,886,889,897,904,914,919,922,926,847,852,862,866,881,890,898,905,915,920,923,927,848,853,863,867,882,891,899,906,916,924,854,868,883,892,900,907,917,937,938,855,869,884,893,901,908,856,870,894,902,909,895,910,911,912) was not iterable.
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)
at org.mybatis.spring.SqlSessionTemplate S q l S e s s i o n I n t e r c e p t o r . i n v o k e ( S q l S e s s i o n T e m p l a t e . j a v a : 446 ) a t c o m . s u n . p r o x y . SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) at com.sun.proxy. SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)atcom.sun.proxy.Proxy83.selectList(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)
at com.baomidou.mybatisplus.core.override.PageMapperMethod.executeForMany(PageMapperMethod.java:173)
at com.baomidou.mybatisplus.core.override.PageMapperMethod.execute(PageMapperMethod.java:86)
at com.baomidou.mybatisplus.core.override.PageMapperProxy.invoke(PageMapperProxy.java:64)
at com.sun.proxy.$Proxy225.getDisposalResultList(Unknown Source)
at com.xxgk.modules.statistic.service.impl.DisposeQualityStatisticsServiceImpl.disposeSituation(DisposeQualityStatisticsServiceImpl.java:326)
at com.xxgk.modules.statistic.ReportServiceImpl.getDisposeQuality(ReportServiceImpl.java:1350)
at com.xxgk.modules.statistic.ReportServiceImpl.genReport(ReportServiceImpl.java:229)
at com.xxgk.modules.statistic.ReportController.genReport(ReportController.java:130)
at sun.reflect.GeneratedMethodAccessor1642.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:45005)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:908)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:112)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.xxgk.common.xss.XssFilter.doFilter(XssFilter.java:31)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilterKaTeX parse error: Expected group after '_' at position 2612: …rdContextValve._̲_invoke(Standar…ConnectionHandler.process(AbstractProtocol.java:834)
at org.apache.tomcat.util.net.NioEndpoint S o c k e t P r o c e s s o r . d o R u n ( N i o E n d p o i n t . j a v a : 1415 ) a t o r g . a p a c h e . t o m c a t . u t i l . n e t . S o c k e t P r o c e s s o r B a s e . r u n ( S o c k e t P r o c e s s o r B a s e . j a v a : 49 ) a t j a v a . u t i l . c o n c u r r e n t . T h r e a d P o o l E x e c u t o r . r u n W o r k e r ( T h r e a d P o o l E x e c u t o r . j a v a : 1149 ) a t j a v a . u t i l . c o n c u r r e n t . T h r e a d P o o l E x e c u t o r SocketProcessor.doRun(NioEndpoint.java:1415) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor SocketProcessor.doRun(NioEndpoint.java:1415)atorg.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)atjava.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread W r a p p i n g R u n n a b l e . r u n ( T a s k T h r e a d . j a v a : 61 ) a t j a v a . l a n g . T h r e a d . r u n ( T h r e a d . j a v a : 748 ) C a u s e d b y : o r g . a p a c h e . i b a t i s . b u i l d e r . B u i l d e r E x c e p t i o n : E r r o r e v a l u a t i n g e x p r e s s i o n ′ d e p t I d s ′ . R e t u r n v a l u e ( 1 , 939 , 956 , 961 , 964 , 966 , 969 , 972 , 975 , 978 , 675 , 676 , 677 , 678 , 679 , 680 , 681 , 682 , 683 , 684 , 685 , 686 , 687 , 688 , 689 , 690 , 691 , 692 , 693 , 928 , 929 , 930 , 941 , 942 , 946 , 948 , 949 , 950 , 951 , 954 , 957 , 960 , 962 , 965 , 967 , 970 , 973 , 976 , 979 , 984 , 985 , 1071 , 1074 , 694 , 696 , 705 , 713 , 724 , 726 , 741 , 759 , 782 , 794 , 804 , 818 , 826 , 833 , 840 , 935 , 697 , 706 , 714 , 725 , 727 , 742 , 760 , 783 , 795 , 805 , 819 , 827 , 834 , 841 , 934 , 698 , 707 , 715 , 728 , 743 , 761 , 784 , 796 , 806 , 820 , 828 , 835 , 842 , 699 , 708 , 716 , 729 , 744 , 762 , 785 , 797 , 807 , 821 , 829 , 836 , 843 , 700 , 709 , 717 , 730 , 745 , 763 , 786 , 798 , 808 , 822 , 830 , 837 , 701 , 710 , 718 , 731 , 746 , 764 , 787 , 799 , 809 , 823 , 831 , 838 , 702 , 711 , 719 , 732 , 747 , 765 , 788 , 800 , 810 , 824 , 832 , 839 , 703 , 712 , 720 , 733 , 748 , 766 , 789 , 801 , 811 , 825 , 932 , 704 , 721 , 734 , 749 , 767 , 790 , 802 , 812 , 931 , 722 , 735 , 750 , 768 , 791 , 803 , 813 , 936 , 723 , 736 , 751 , 769 , 792 , 814 , 737 , 752 , 770 , 793 , 815 , 738 , 753 , 771 , 816 , 739 , 754 , 772 , 817 , 740 , 755 , 773 , 756 , 774 , 757 , 775 , 758 , 776 , 777 , 778 , 779 , 780 , 781 , 1008 , 959 , 963 , 968 , 971 , 974 , 977 , 980 , 981 , 982 , 983 , 987 , 988 , 989 , 990 , 991 , 992 , 993 , 994 , 995 , 996 , 997 , 998 , 999 , 1000 , 1001 , 1002 , 1003 , 1004 , 1005 , 1006 , 1007 , 1009 , 1010 , 1011 , 1012 , 1013 , 1014 , 1015 , 1016 , 1017 , 1018 , 1019 , 1020 , 1021 , 1022 , 1023 , 1024 , 1025 , 1026 , 1027 , 1028 , 1029 , 1030 , 1031 , 1032 , 1033 , 1034 , 1035 , 1036 , 1037 , 1038 , 1039 , 1040 , 1041 , 1042 , 1043 , 1044 , 1045 , 1046 , 1047 , 1048 , 1049 , 1050 , 1051 , 1052 , 1053 , 1054 , 1055 , 1056 , 1057 , 1058 , 1059 , 1060 , 1061 , 1062 , 1063 , 1064 , 1065 , 1066 , 1067 , 1068 , 1069 , 1070 , 1072 , 1073 , 1075 , 844 , 845 , 849 , 850 , 857 , 859 , 860 , 864 , 871 , 872 , 874 , 875 , 876 , 877 , 878 , 879 , 885 , 887 , 888 , 896 , 903 , 913 , 918 , 921 , 925 , 933 , 695 , 846 , 851 , 858 , 861 , 865 , 873 , 880 , 886 , 889 , 897 , 904 , 914 , 919 , 922 , 926 , 847 , 852 , 862 , 866 , 881 , 890 , 898 , 905 , 915 , 920 , 923 , 927 , 848 , 853 , 863 , 867 , 882 , 891 , 899 , 906 , 916 , 924 , 854 , 868 , 883 , 892 , 900 , 907 , 917 , 937 , 938 , 855 , 869 , 884 , 893 , 901 , 908 , 856 , 870 , 894 , 902 , 909 , 895 , 910 , 911 , 912 ) w a s n o t i t e r a b l e . a t o r g . a p a c h e . i b a t i s . s c r i p t i n g . x m l t a g s . E x p r e s s i o n E v a l u a t o r . e v a l u a t e I t e r a b l e ( E x p r e s s i o n E v a l u a t o r . j a v a : 65 ) a t o r g . a p a c h e . i b a t i s . s c r i p t i n g . x m l t a g s . F o r E a c h S q l N o d e . a p p l y ( F o r E a c h S q l N o d e . j a v a : 55 ) a t o r g . a p a c h e . i b a t i s . s c r i p t i n g . x m l t a g s . M i x e d S q l N o d e . a p p l y ( M i x e d S q l N o d e . j a v a : 33 ) a t o r g . a p a c h e . i b a t i s . s c r i p t i n g . x m l t a g s . I f S q l N o d e . a p p l y ( I f S q l N o d e . j a v a : 35 ) a t o r g . a p a c h e . i b a t i s . s c r i p t i n g . x m l t a g s . M i x e d S q l N o d e . a p p l y ( M i x e d S q l N o d e . j a v a : 33 ) a t o r g . a p a c h e . i b a t i s . s c r i p t i n g . x m l t a g s . T r i m S q l N o d e . a p p l y ( T r i m S q l N o d e . j a v a : 55 ) a t o r g . a p a c h e . i b a t i s . s c r i p t i n g . x m l t a g s . M i x e d S q l N o d e . a p p l y ( M i x e d S q l N o d e . j a v a : 33 ) a t o r g . a p a c h e . i b a t i s . s c r i p t i n g . x m l t a g s . D y n a m i c S q l S o u r c e . g e t B o u n d S q l ( D y n a m i c S q l S o u r c e . j a v a : 41 ) a t o r g . a p a c h e . i b a t i s . m a p p i n g . M a p p e d S t a t e m e n t . g e t B o u n d S q l ( M a p p e d S t a t e m e n t . j a v a : 292 ) a t o r g . a p a c h e . i b a t i s . e x e c u t o r . B a s e E x e c u t o r . q u e r y ( B a s e E x e c u t o r . j a v a : 134 ) a t o r g . a p a c h e . i b a t i s . s e s s i o n . d e f a u l t s . D e f a u l t S q l S e s s i o n . s e l e c t L i s t ( D e f a u l t S q l S e s s i o n . j a v a : 148 ) a t o r g . a p a c h e . i b a t i s . s e s s i o n . d e f a u l t s . D e f a u l t S q l S e s s i o n . s e l e c t L i s t ( D e f a u l t S q l S e s s i o n . j a v a : 141 ) a t s u n . r e f l e c t . G e n e r a t e d M e t h o d A c c e s s o r 385. i n v o k e ( U n k n o w n S o u r c e ) a t s u n . r e f l e c t . D e l e g a t i n g M e t h o d A c c e s s o r I m p l . i n v o k e ( D e l e g a t i n g M e t h o d A c c e s s o r I m p l . j a v a : 45005 ) a t j a v a . l a n g . r e f l e c t . M e t h o d . i n v o k e ( M e t h o d . j a v a : 498 ) a t o r g . m y b a t i s . s p r i n g . S q l S e s s i o n T e m p l a t e WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'deptIds'. Return value (1,939,956,961,964,966,969,972,975,978,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,928,929,930,941,942,946,948,949,950,951,954,957,960,962,965,967,970,973,976,979,984,985,1071,1074,694,696,705,713,724,726,741,759,782,794,804,818,826,833,840,935,697,706,714,725,727,742,760,783,795,805,819,827,834,841,934,698,707,715,728,743,761,784,796,806,820,828,835,842,699,708,716,729,744,762,785,797,807,821,829,836,843,700,709,717,730,745,763,786,798,808,822,830,837,701,710,718,731,746,764,787,799,809,823,831,838,702,711,719,732,747,765,788,800,810,824,832,839,703,712,720,733,748,766,789,801,811,825,932,704,721,734,749,767,790,802,812,931,722,735,750,768,791,803,813,936,723,736,751,769,792,814,737,752,770,793,815,738,753,771,816,739,754,772,817,740,755,773,756,774,757,775,758,776,777,778,779,780,781,1008,959,963,968,971,974,977,980,981,982,983,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1072,1073,1075,844,845,849,850,857,859,860,864,871,872,874,875,876,877,878,879,885,887,888,896,903,913,918,921,925,933,695,846,851,858,861,865,873,880,886,889,897,904,914,919,922,926,847,852,862,866,881,890,898,905,915,920,923,927,848,853,863,867,882,891,899,906,916,924,854,868,883,892,900,907,917,937,938,855,869,884,893,901,908,856,870,894,902,909,895,910,911,912) was not iterable. at org.apache.ibatis.scripting.xmltags.ExpressionEvaluator.evaluateIterable(ExpressionEvaluator.java:65) at org.apache.ibatis.scripting.xmltags.ForEachSqlNode.apply(ForEachSqlNode.java:55) at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:33) at org.apache.ibatis.scripting.xmltags.IfSqlNode.apply(IfSqlNode.java:35) at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:33) at org.apache.ibatis.scripting.xmltags.TrimSqlNode.apply(TrimSqlNode.java:55) at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:33) at org.apache.ibatis.scripting.xmltags.DynamicSqlSource.getBoundSql(DynamicSqlSource.java:41) at org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:292) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:134) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) at sun.reflect.GeneratedMethodAccessor385.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:45005) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate WrappingRunnable.run(TaskThread.java:61)atjava.lang.Thread.run(Thread.java:748)Causedby:org.apache.ibatis.builder.BuilderException:ErrorevaluatingexpressiondeptIds.Returnvalue(1,939,956,961,964,966,969,972,975,978,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,928,929,930,941,942,946,948,949,950,951,954,957,960,962,965,967,970,973,976,979,984,985,1071,1074,694,696,705,713,724,726,741,759,782,794,804,818,826,833,840,935,697,706,714,725,727,742,760,783,795,805,819,827,834,841,934,698,707,715,728,743,761,784,796,806,820,828,835,842,699,708,716,729,744,762,785,797,807,821,829,836,843,700,709,717,730,745,763,786,798,808,822,830,837,701,710,718,731,746,764,787,799,809,823,831,838,702,711,719,732,747,765,788,800,810,824,832,839,703,712,720,733,748,766,789,801,811,825,932,704,721,734,749,767,790,802,812,931,722,735,750,768,791,803,813,936,723,736,751,769,792,814,737,752,770,793,815,738,753,771,816,739,754,772,817,740,755,773,756,774,757,775,758,776,777,778,779,780,781,1008,959,963,968,971,974,977,980,981,982,983,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1072,1073,1075,844,845,849,850,857,859,860,864,871,872,874,875,876,877,878,879,885,887,888,896,903,913,918,921,925,933,695,846,851,858,861,865,873,880,886,889,897,904,914,919,922,926,847,852,862,866,881,890,898,905,915,920,923,927,848,853,863,867,882,891,899,906,916,924,854,868,883,892,900,907,917,937,938,855,869,884,893,901,908,856,870,894,902,909,895,910,911,912)wasnotiterable.atorg.apache.ibatis.scripting.xmltags.ExpressionEvaluator.evaluateIterable(ExpressionEvaluator.java:65)atorg.apache.ibatis.scripting.xmltags.ForEachSqlNode.apply(ForEachSqlNode.java:55)atorg.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:33)atorg.apache.ibatis.scripting.xmltags.IfSqlNode.apply(IfSqlNode.java:35)atorg.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:33)atorg.apache.ibatis.scripting.xmltags.TrimSqlNode.apply(TrimSqlNode.java:55)atorg.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:33)atorg.apache.ibatis.scripting.xmltags.DynamicSqlSource.getBoundSql(DynamicSqlSource.java:41)atorg.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:292)atorg.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:134)atorg.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)atorg.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)atsun.reflect.GeneratedMethodAccessor385.invoke(UnknownSource)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:45005)atjava.lang.reflect.Method.invoke(Method.java:498)atorg.mybatis.spring.SqlSessionTemplateSqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
… 86 more
程序中报错遇见这个问题,首先先检查一下传入的值是否为一个List,以下参数明显为一个用逗号拼接的String,但是在程序中当作了list进行处理

(1,939,956,961,964,966,969,972,975,978,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,928,929,930,941,942,946,948,949,950,951,954,957,960,962,965,967,970,973,976,979,984,985,1071,1074,694,696,705,713,724,726,741,759,782,794,804,818,826,833,840,935,697,706,714,725,727,742,760,783,795,805,819,827,834,841,934,698,707,715,728,743,761,784,796,806,820,828,835,842,699,708,716,729,744,762,785,797,807,821,829,836,843,700,709,717,730,745,763,786,798,808,822,830,837,701,710,718,731,746,764,787,799,809,823,831,838,702,711,719,732,747,765,788,800,810,824,832,839,703,712,720,733,748,766,789,801,811,825,932,704,721,734,749,767,790,802,812,931,722,735,750,768,791,803,813,936,723,736,751,769,792,814,737,752,770,793,815,738,753,771,816,739,754,772,817,740,755,773,756,774,757,775,758,776,777,778,779,780,781,1008,959,963,968,971,974,977,980,981,982,983,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1072,1073,1075,844,845,849,850,857,859,860,864,871,872,874,875,876,877,878,879,885,887,888,896,903,913,918,921,925,933,695,846,851,858,861,865,873,880,886,889,897,904,914,919,922,926,847,852,862,866,881,890,898,905,915,920,923,927,848,853,863,867,882,891,899,906,916,924,854,868,883,892,900,907,917,937,938,855,869,884,893,901,908,856,870,894,902,909,895,910,911,912)

<select id="getDisposalResultList" resultType="java.util.Map">
        SELECT
           a.disposal_result_id as 'disposalResultId',
           a.id AS 'reportId'
        FROM
        <include refid="allListJoins" />
        <where>
            <include refid="commonCondition" /> 
            <if test="deptIds!=null ">
                AND dis.dept_id
                IN (
                <foreach collection="deptIds" separator="," item="tempDeptId">
                    #{tempDeptId}
                </foreach>
                )
            </if>
        </where>
    </select>

修改mybatis的xml文件为以下代码即可正常运行

   <if test="deptIds!=null ">
        AND dis.dept_id
        IN  ${deptIds} 
    </if> 

你可能感兴趣的:(mybatis中foreach遍历报错not iterable问题解决方法)