首页>代码>ssm(spring+spring mvc+mybatis+maven)高仿bilibili视频网站项目实例>/bilibili/src/main/java/com/sf/dao/impl/MessageImpl.java
package com.sf.dao.impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.sf.dao.MessageDao; import com.sf.db.Data_jdbcTemplate; import com.sf.entity.ShoppingCart; import com.sf.entity.forumEntity; import com.sf.entity.forumreplyEntity; import com.sf.entity.messageEntity; import com.sf.entity.ordertableEntity; @Component public class MessageImpl implements MessageDao { @Autowired Data_jdbcTemplate jdbcTemplate;//得到模板 public int message(messageEntity message) { //String chaxunSql="insert into user(userID,userName,passWord,userPhone,userState,userEmial,userHand,userPaypassword) values(?,?,?,?,?,?,?,?)"; String sql="insert into message(messageID,messagevideoID," + "messageuserID,messageuserName,message," + "messageTime,messageHand) values(?,?,?,?,?,?,?)"; int num = jdbcTemplate.getJdbcTemplate().update(sql, new Object[]{message.getMessageID(), message.getMessagevideoID(),message.getMessageuserID() ,message.getMessageuserName(), message.getMessage(),message.getMessageTime(),message.getMessageHand()}); return num; } @Override public int Shoppingcart(ShoppingCart shoppingCart) { String sql = "insert into shoppingcart(cartID,userName,shoopingID,shoopingName,shoopingImg,shoopingjiage) values (?,?,?,?,?,?)"; int num = jdbcTemplate.getJdbcTemplate().update(sql,new Object[]{shoppingCart.getCartID(),shoppingCart.getUserName(),shoppingCart.getShoopingID(),shoppingCart.getShoopingName(),shoppingCart.getShoopingImg(),shoppingCart.getShoopingjiage()}); return num; } @Override public int forumfuck(forumEntity forument) { String sql = "insert into forum(forumID,forumBT,forummessage,forumuserName,forumTime,forumliebie,forumAmount,firumhand) values (?,?,?,?,?,?,?,?)"; int num = jdbcTemplate.getJdbcTemplate().update(sql,new Object[]{forument.getForumID(),forument.getForumBT(),forument.getForummessage(),forument.getForumuserName(),forument.getForumTime(),forument.getForumliebie(),forument.getForumAmount(),forument.getFirumhand()}); return num; } @Override public int forumreply(forumreplyEntity forumreply) {/* public String replyid;//回复ID public String replyneirong;//回帖内容 public String replytime;//回帖时间 public String replyhand;//回帖人头像 public String replytieziid;//回复帖子的ID */ String sql = "insert into forumreply (replyid,replyneirong,replytime,replyhand,replytieziid,replyname) values (?,?,?,?,?,?)"; int num = jdbcTemplate.getJdbcTemplate().update(sql,new Object[]{forumreply.getReplyid(),forumreply.getReplyneirong(),forumreply.getReplytime(),forumreply.getReplyhand(),forumreply.getReplytieziid(),forumreply.getReplyname()}); return num; } }

微信网友_7044194812350464 LV8
2024年9月13日
Guiyun LV2
2024年3月15日
四季镇 LV9
2023年10月11日
feibin LV1
2023年3月29日
janefilion LV3
2023年2月19日
Boss绝 LV10
2023年2月7日
快乐的程序员 LV25
2023年1月21日
Soratosiro LV6
2022年9月29日
小谢xxxxxxx LV4
2022年5月20日
loveMiku LV3
2022年5月19日

背上书包上学校 LV7
昨天
2022102154 LV1
3月27日
三秋桂子 LV1
2024年12月22日
sjwc88 LV4
2024年12月4日
JokerTang LV1
2024年12月3日
s4dmcc LV1
2024年9月17日
微信网友_7044194812350464 LV8
2024年9月13日
CCCCWWWW LV4
2024年3月27日
15103432984 LV2
2024年3月16日
Guiyun LV2
2024年3月15日