Package org.springframework.jdbc.core.namedparam

Examples of org.springframework.jdbc.core.namedparam.SqlParameterSource


  public int updaeUserLastLogin(String userName, String lastLogin) {
    String sql = "update bu_user set last_login=:lastLogin where user_name=:userName";
    Map<String, String> map = new HashMap<String, String>();
    map.put("lastLogin", lastLogin);
    map.put("userName", userName);
    SqlParameterSource paramMap = new MapSqlParameterSource(map);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here


  public User queryUserInfoByUserName(String userName) {
    String sql = "select user_name , position_num ,email , telephone , nickname, mobile from bu_user"
        + " where user_name=:userName";
    Map<String, String> map = new HashMap<String, String>(1);
    map.put("userName", userName);
    SqlParameterSource paramMap = new MapSqlParameterSource(map);
    return namedParameterJdbcTemplate.queryForObject(sql, paramMap, new UserMapper());
  }
View Full Code Here

  public int updatePassword(String userName, String password) {
    String sql = "update bu_user set password = password(:password) where user_name = :userName";
    Map<String, String> map = new HashMap<String, String>(2);
    map.put("userName", userName);
    map.put("password", password);
    SqlParameterSource paramMap = new MapSqlParameterSource(map);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

        + "from bu_push_record where  topicid = :topicid  order by lspri desc, add_date desc,last_modify desc limit :begin,:size";
    Map<String, Object> map = new HashMap<String, Object>(3);
    map.put("topicid", topicid);
    map.put("begin", begin);
    map.put("size", size);
    SqlParameterSource paramMap = new MapSqlParameterSource(map);
    return namedParameterJdbcTemplate.query(sql, paramMap, new PushRecordMapper());
  }
View Full Code Here

   * @return
   */
  public int insertPushRecord(PushRecord pushRecord) {
    String sql = "insert into bu_push_record(indexid,docid,modelname,title,lspri,url,sub_title,add_date,last_modify,modify_user,topicid,type,img )"
        + " values(:indexid,:docid,:modelName,:title,:lspri,:url,:subTitle,now(),now(),:modifyUser,:topicid,:type,:img)";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(pushRecord);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

  public int updatePushRecord(PushRecord pushRecord) {
    String sql = "update bu_push_record set modelname=:modelName,title=:title,"
        + "lspri=:lspri,url=:url,sub_title=:subTitle,last_modify = now(),"
        + "modify_user=:modifyUser,topicid=:topicid,img=:img "
        + "where indexid=:indexid";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(pushRecord);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

   * @return
   */
  public int insertModel(Model model) {
    String sql = "insert into bu_model(model_name,content,last_modify,del,modify_user,type,url,title,keyword,topicid,extname,add_time,status)"
        + " values(:modelName,:content,now(),:delete,:modifyUser,:type,:url,:title,:keyword,:topicid,:extname,now(),status)";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(model);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

   * @return
   */
  public int insertModelRefresh(Model model) {
    String sql = "insert into bu_model_refresh(model_name,rate,time_out)"
        + " values(:modelName,:rate,:timeout)";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(model);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

   * @return
   */
  public int updateModel(Model model) {
    String sql = "update bu_model set content=:content,last_modify=:lastModify,modify_user=:modifyUser,title=:title,keyword=:keyword,extname=:extname"
        + ",status=:status,url =:url where model_name=:modelName";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(model);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

   * @param model
   * @return
   */
  public int updateModelRefresh(Model model) {
    String sql = "update bu_model_refresh set rate=:rate,time_out=:timeout where model_name = :modelName";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(model);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.core.namedparam.SqlParameterSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.