-
myBatis - foreach 사용법Spring 2018. 10. 1. 23:09123456789101112131415@RequestMapping(value = "test")public String test(HttpServletRequest request) throws Exception{String no = request.getParameter("no");List<?> memberSeqList = memberDTO.selectMembers(no);HashMap<String, Object> hashMap = new HashMap<String, Object>();hashMap.put("seq", memberSeqList );List<?> list = memberService.getMemberUserInfo(hashMap);return "board/boardList";}
cs 1234567891011121314<select id="getMemberUserInfo" parameterType="java.util.Map" resultType="aaaa.bbbb.MemberDTO">SELECT NAME, AGE, ADDRFROM MEMBERWHERE MEMEBER_SEQ IN<foreach collection="seq" item="seq" index="index" open="(" close=")" separator=",">#{seq}</foreach></select>cs 'Spring' 카테고리의 다른 글
[Spring Security] ajax요청시 403 에러 발생 처리방법 (0) 2018.11.18 [Spring] REST API 개발시 ajax로 DELETE,PATCH,PUT 요청시 파라미터 NULL문제 (1) 2018.11.18 RedirectAttributes (0) 2018.10.01 [Spring] 이전 URL로 리다이랙트 시키기 (0) 2018.10.01 DispatcherServlet (0) 2018.10.01