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/GoodsMapper.java

50 lines
1002 B

package com.example.mapper;
import com.example.entity.Goods;
import com.example.entity.Type;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* 操作goods相关数据接口
*/
public interface GoodsMapper {
/**
* 新增
*/
int insert(Goods goods);
/**
* 删除
*/
int deleteById(Integer id);
/**
* 修改
*/
int updateById(Goods goods);
/**
* 根据ID查询
*/
Goods selectById(Integer id);
/**
* 查询所有
*/
List<Goods> selectAll(Goods goods);
@Select("select * from goods order by count desc limit 15")
List<Goods> selectTop15();
@Select("select * from goods where type_id = #{id}")
List<Goods> selectByTypeId(Integer id);
@Select("select * from goods where business_id = #{id}")
List<Goods> selectByBusinessId(Integer id);
@Select("select * from goods where name like concat('%', #{name}, '%')")
List<Goods> selectByName(String name);
}