본문 바로가기

프로그래밍/Spring

중복체크

//등록업체코드 체크 --- controller

@RequestMapping(value="/franchises/codeCheckForm.do")

public ModelAndView codeCheck(HttpServletRequest request, FranchisesDTO franchises) {

String searchValue = request.getParameter("searchValue");

ModelAndView mav = new ModelAndView();

if(searchValue != null && !"".equals(searchValue.trim())) {

Map<String, String> map = new HashMap<String, String>();

map.put("searchValue", searchValue);

List<FranchisesDTO> codeCheck = franchisesService.getCorpCodeCheck(map);

mav.setViewName("franchises/ocs03_franchises_codeCheck");

mav.addObject("codeCheck", codeCheck);

mav.addObject("searchValue", searchValue);

return mav;

}

mav.setViewName("franchises/ocs03_franchises_codeCheck");

return mav;

}




//service

public List<FranchisesDTO> getCorpCodeCheck(Map<String, String> map);




//serviceImpl

@Override

public List<FranchisesDTO> getCorpCodeCheck(Map<String, String> map) {

return franchisesDAO.getCorpCodeCheck(map);

}



//dao

public List<FranchisesDTO> getCorpCodeCheck(Map<String, String> map);




//daoImpl

@Override

public List<FranchisesDTO> getCorpCodeCheck(Map<String, String> map) {

return (List<FranchisesDTO>)getSqlMapClientTemplate().queryForList("franchises.getCorpCodeCheck", map);

}



//SQLquery

<!-- 등록업체 코드조회 -->

<select id="getCorpCodeCheck" parameterClass="map" resultMap="getFranchisesList-resultMap">

SELECT *

FROM mntcorp

WHERE corpCode

LIKE #searchValue#

</select>

'프로그래밍 > Spring' 카테고리의 다른 글

이클립스 xsql 을 xml로 읽게 만들기  (0) 2012.10.22
log4j.jar 에 대하여  (0) 2012.06.04