You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SRuml/CommentMapper.java

41 lines
825 B

package com.example.mapper;
import com.example.entity.Comment;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* 操作comment相关数据接口
*/
public interface CommentMapper {
/**
* 新增
*/
int insert(Comment comment);
/**
* 删除
*/
int deleteById(Integer id);
/**
* 修改
*/
int updateById(Comment comment);
/**
* 根据ID查询
*/
Comment selectById(Integer id);
/**
* 查询所有
*/
List<Comment> selectAll(Comment comment);
@Select("select comment.*, user.avatar as userAvatar, user.name as userName from comment left join user on comment.user_id = user.id where comment.goods_id = #{id}")
List<Comment> selectByGoodsId(Integer id);
}