Package org.springframework.jdbc.core.namedparam

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


   * @return
   */
  public List<Topic> queryTopTopicList() {
    String sql = "select * from bu_topic where parent_topic is null order by topic_name desc";
    Map<String, String> map = new HashMap<String, String>();
    SqlParameterSource paramMap = new MapSqlParameterSource(map);
    return namedParameterJdbcTemplate.query(sql, paramMap, new TopicMapper());
  }
View Full Code Here


   * @return
   */
  public int insertTopic(Topic topic) {
    String sql = "insert into bu_topic(topicid,topic_name,last_modify,modify_user,topic_tree,parent_topic,topic_nav)"
        + " values (:topicId,:topicName,now(),:modifyUser,:topicTree,:parentTopic,:topicNav)";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(topic);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

   * @return
   */
  public int updateTopic(Topic topic) {
    String sql = "update bu_topic set topic_name = :topicName, topic_nav = :topicNav, modify_user=:modifyUser,last_modify = now() "
        + "where topicid=:topicId";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(topic);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

  public int insertPosition(String positionName, String descript) {
    String sql = "insert into bu_position (position_name,descript) values(:positionName,:descript)";
    Map<String, String> map = new HashMap<String, String>();
    map.put("positionName", positionName);
    map.put("descript", descript);
    SqlParameterSource paramMap = new MapSqlParameterSource(map);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

   * @param positionNum
   * @return
   */
  public int deletePosition(String positionNum) {
    String sql = "delete from bu_position where position_num = :positionNum";
    SqlParameterSource paramMap = new MapSqlParameterSource("positionNum", positionNum);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

   * @return
   */
  public int insertModelLog(ModelLog modelLog) {
    String sql = "insert into sys_model_log(model_name,user_name,time,content,model_content)"
        + " values(:modelName,:userName,now(),:content,:modelContent)";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(modelLog);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

   * @param docLog
   * @return
   */
  public int insertDocLog(DocLog docLog) {
    String sql = "insert into sys_doc_log(docid,user_name,time,content) values(:docid,:userName,:time,:content)";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(docLog);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

   * @param doc
   */
  public int insertDoc(Doc doc) {
    String sql = "insert into bu_doc(docid,title,content,digest,modify_user,del,reporter,last_modify,url,type,keyword,model_name,status) "
        + "values(:docid,:title,:content,:digest,:modifyUser,'0',:reporter,now(),:url,:type,:keyword,:modelName,status)";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(doc);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

   */
  public int updateDoc(Doc doc) {
    String sql = "update bu_doc set title=:title"
        + ",content=:content,digest=:digest,modify_user=:modifyUser,"
        + "reporter=:reporter,url=:url,type=:type,keyword=:keyword,model_name=:modelName,status=:status,last_modify = now() where docid =:docid";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(doc);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

   * @param docid
   * @param status
   */
  public int updateDocStatus(Doc doc) {
    String sql = "update bu_doc set status  = :status where docid = :docid";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(doc);
    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.