首页>代码>spring MVC+spring+mybatis整合增删改查入门实例>/smm/src/com/qm/smm/mapper/UserMapper.java
package com.qm.smm.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import com.qm.smm.entity.User;

/**
 * 用户映射
 * @author quanmin
 *
 */
@Repository(value="userMapper")
public interface UserMapper {
	
	@Select("select * from user where id = #{0}")
	public User selectUser(int id);
	
	@Select("select id,name,pwd from user")
	public List<User> findUserList();
	
	@Insert("insert into user(name,pwd) values(#{0},#{1})")
	public void add(String name,String pwd);
	
	@Select("select * from user where name = #{0} and pwd = #{1}")
	public User login(String name,String pwd);
	
	@Update("update user set pwd=#{1} where id=#{0}")
	public void update(int id);
	
	@Delete("delete from user where id=#{0}")
	public void delete(int id);
}
最近下载更多
李亮  LV19 2023年3月7日
我睡觉时不困  LV7 2022年11月19日
小白jmhuang  LV12 2022年1月6日
myfz0662  LV10 2021年12月17日
543666826  LV33 2021年11月18日
457229171  LV7 2021年7月4日
不吃胡萝卜卜卜  LV6 2021年6月4日
hwshws  LV9 2021年5月19日
宣123456  LV8 2021年2月2日
jbjbccc  LV2 2020年11月10日
最近浏览更多
2578233069 前天
暂无贡献等级
yolo_light  LV1 2023年12月21日
wwwww816  LV3 2023年12月19日
zhumeng168  LV5 2023年7月8日
gecongkai  LV8 2023年6月22日
神经蛙- 2023年5月17日
暂无贡献等级
微信网友_6442588254851072  LV2 2023年4月22日
李亮  LV19 2023年3月6日
云龙123456  LV7 2023年2月21日
qwer123978ca  LV1 2022年12月19日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友