首页>代码>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;
	}




}
最近下载更多
Guiyun  LV1 3月15日
四季镇  LV9 2023年10月11日
feibin  LV1 2023年3月29日
janefilion  LV3 2023年2月19日
Boss绝  LV8 2023年2月7日
快乐的程序员  LV25 2023年1月21日
Soratosiro  LV6 2022年9月29日
小谢xxxxxxx  LV4 2022年5月20日
loveMiku  LV3 2022年5月19日
thythythythhy  LV2 2022年5月12日
最近浏览更多
CCCCWWWW  LV4 3月27日
15103432984  LV2 3月16日
Guiyun  LV1 3月15日
sbyhm111 3月14日
暂无贡献等级
admin_z  LV22 1月28日
qwe6002  LV9 1月12日
李林112233  LV2 1月12日
1273082356 1月12日
暂无贡献等级
夜起星河  LV8 2023年12月29日
颜伟峰  LV1 2023年12月20日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友