Merge branch 'master' of http://bdgit.educoder.net/pffzhcjsv/p98hlntaf
commit
03b7d322b5
@ -1,18 +1,19 @@
|
|||||||
package com.book.demo.mapper;
|
package com.book.demo.mapper;
|
||||||
|
|
||||||
import com.book.demo.entity.Cart;
|
import com.book.demo.entity.Cart;
|
||||||
import org.apache.ibatis.annotations.Delete;
|
import org.apache.ibatis.annotations.*;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.apache.ibatis.annotations.Select;
|
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface CartMapper {
|
public interface CartMapper {
|
||||||
@Select("select * from user_cart where id=#{id} and username=#{username}")
|
@Insert("insert into user_cart values (#{username},#{bookname})")
|
||||||
int insertItem(String username,int id);
|
int insertItem(String username,String bookname);
|
||||||
@Delete("delete from user_cart where username=#{username}")
|
@Delete("delete from user_cart where username=#{username}")
|
||||||
void clearCart(String username);
|
void clearCart(String username);
|
||||||
@Select("select * from user_cart where username=#{username}")
|
@Select("select * from user_cart where username=#{username}")
|
||||||
Cart queryByName(String username);
|
Cart queryByName(String username);
|
||||||
|
@Update({"update user_cart set username=#{username}", "update user_cart set bookname=#{bookname}", "update user_cart set count=#{count}"})
|
||||||
|
int updateCount(String username,String bookname,int count);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue