示例#1
0
 @Override
 public ServicePara getService(String name, Integer appId) {
   Map<String, Object> map = new HashMap<String, Object>();
   map.put("name", name);
   map.put("appId", appId);
   return (ServicePara) sqlSession.selectOne("getServiceByName", map);
 }
 @SuppressWarnings("unchecked")
 @Override
 public <R> R executeQueryUnique(String sqlNamespace, String queryName, Object parameterObj) {
   String query = makeQueryName(sqlNamespace, queryName);
   Object obj = template.selectOne(query, parameterObj);
   try {
     return (R) obj;
   } catch (ClassCastException e) {
     throw new IllegalArgumentException("Return type of query does not match expected type.", e);
   }
 }
示例#3
0
  /**
   * @name : checkCoupon
   * @date : 2015. 7. 15.
   * @author : 황준
   * @description :쿠폰 등록한 업체 체크
   */
  @Override
  public int checkCoupon(String member_id, String coupon_no) {
    HashMap<String, Object> hMap = new HashMap<String, Object>();
    hMap.put("member_id", member_id);
    hMap.put("coupon_no", coupon_no);

    int check = 0;
    String checkId = sqlSession.selectOne("dao.BoardMapper.checkCoupon", hMap);
    if (checkId != null) check = 2;

    return check;
  }
  /**
   * {@inheritDoc}
   *
   * <p>Only one return value is allowed and is checked to prevent <tt>null</tt> returns.
   */
  @Override
  public Long executeCountQuery(String sqlNamespace, String queryName, Object parameterObj) {
    String query = makeQueryName(sqlNamespace, queryName);
    try {
      Long result = template.selectOne(query, parameterObj);
      if (result == null) {
        result = 0L;
      }

      // Done
      if (logger.isDebugEnabled()) {
        logger.debug(
            "Executed query: \n"
                + "   Query:  "
                + query
                + "\n"
                + "   Params: "
                + parameterObj
                + "\n"
                + "   Result: "
                + result);
      }
      return result;
    } catch (ClassCastException e) {
      throw new QueryException(
          "Count query results must return exactly one Long value: \n"
              + "   Query:  "
              + query
              + "\n"
              + "   Params: "
              + parameterObj,
          e);
    } catch (Throwable e) {
      throw new QueryException(
          "Failed to execute query: \n"
              + "   Query:  "
              + query
              + "\n"
              + "   Params: "
              + parameterObj,
          e);
    }
  }
示例#5
0
 @Override
 public MemberDTO getMemberInfo(String queryId, String id) throws DataAccessException {
   printQueryId(queryId);
   return sqlMap.selectOne("selectMember", id);
 }
示例#6
0
 public int mainBoardCnt() {
   return template.selectOne("main.mainboardcnt");
 }
 @Override
 public String checkNickname(String nickname) {
   // TODO Auto-generated method stub
   return sqlSession.selectOne("member.dao.mapper.checkNickname", nickname);
 }
 /**
  * @name : getFile
  * @date : 2015. 6. 25.
  * @author : 이명진
  * @description : 회원번호를 통해 해당 회원의 프로필사진 경로를 가져오는 메소드
  */
 @Override
 public String getFile(int memberNum) {
   // TODO Auto-generated method stub
   return sqlSession.selectOne("member.dao.mapper.getFile", memberNum);
 }
 @Override
 public String findPassword(String email) {
   // TODO Auto-generated method stub
   return sqlSession.selectOne("member.dao.mapper.findPassword", email);
 }
示例#10
0
 @Override
 public App selectById(long id) {
   return sqlSession.selectOne("selectAppById", id);
 }
 @Override
 public T findOne(ID id) {
   Map<String, ID> params = new HashMap<>();
   params.put("pk", id);
   return sessionTemplate.selectOne(mappedStatementId, params);
 }
示例#12
0
 public StoreDTO dbStoreDetail(int storeId) {
   StoreDTO dto = sql.selectOne("store.detail", storeId);
   return dto;
 }
示例#13
0
 public int dbCount(String skey, String sval) {
   logger.info("BoardDAO class BoardDTO dbCount(skey, sval)");
   dto.setSkey(skey);
   dto.setSval(sval);
   return sqlSession.selectOne("count", dto);
 } // end dbCount
示例#14
0
 public BoardDTO dbDetail(int idx) {
   logger.info("BoardDAO class BoardDTO dbDetail(int)");
   return sqlSession.selectOne("detail", idx);
 } // end dbDetail
示例#15
0
 public SaveVO selectsave() {
   return template.selectOne("main.selectsave");
 }
示例#16
0
 public int mainAniamlrCnt() {
   return template.selectOne("main.mainanimalcnt");
 }
示例#17
0
 @Override
 public ServicePara getOneService(String id) {
   return (ServicePara) sqlSession.selectOne("getServiceById", id);
 }
 /**
  * 查询出一个对象
  *
  * @param statement SQL语句的Id号(命名空间+name)
  * @return (JavaBean or Map or String,Integer..)
  */
 public <T> T queryForObject(String statement) {
   return sqlSession.selectOne(statement);
 }
 /**
  * @name : loginOk
  * @date : 2015. 6. 25.
  * @author : 이명진
  * @description : 로그인 시 해당하는 아이디, 비밀번호와 일치하는 데이터를 DB에서 찾는 메소드
  */
 @Override
 public MemberDto loginOk(HashMap<String, String> hMap) {
   // TODO Auto-generated method stub
   return sqlSession.selectOne("member.dao.mapper.loginOk", hMap);
 }
 /**
  * 查询出一个对象。<br>
  * 当查询的结果多于1条时,抛出异常。
  *
  * @param statement SQL语句的Id号(命名空间+name)
  * @param parameter 参数
  * @return (JavaBean or Map or String,Integer..)
  */
 public <T> T queryForObject(String statement, Object parameter) {
   return sqlSession.selectOne(statement, parameter);
 }
 /**
  * @name : getMember
  * @date : 2015. 6. 25.
  * @author : 이명진
  * @description : 해당하는 회원번호로 회원의 정보를 가져오는 메소드
  */
 @Override
 public MemberDto getMember(int memberNum) {
   return sqlSession.selectOne("member.dao.mapper.getMember", memberNum);
 }
示例#22
0
 public Image getImage(Integer id) {
   return sqlSessionTemplate.selectOne("getImage", id);
 }
 @Override
 public String checkEmail(String email) {
   // TODO Auto-generated method stub
   return sqlSession.selectOne("member.dao.mapper.checkEmail", email);
 }
示例#24
0
 public Object selectOne(String queryId, Object params) {
   printQueryId(queryId);
   return sqlSession.selectOne(queryId, params);
 }
示例#25
0
 public int getDisabledAllPageCount() {
   return sqlSession.selectOne("appclient.getDisabledAllPageCount");
 }
示例#26
0
 public EmployeeDto getEmp(String id) {
   return sqlSession.selectOne("appclient.getEmp", id);
 }
示例#27
0
  /** @함수이름 : myPagePointSelect @작성일 : 2015. 12. 11. @개발자 : 오주석 @설명 : */
  @Override
  public int myPagePointSelect(String member_id) {

    return sqlSessionTemplate.selectOne("dao.myPageMapper.myPagePointSelect", member_id);
  }
示例#28
0
 public int mainMemberCnt() {
   return template.selectOne("main.mainmembercnt");
 }