package com.sdcet.mapper; MenuMapper接口 import com.sdcet.entity.Menu; import com.sdcet.entity.User; import org.apache.ibatis.annotations.*; import java.util.Date; import java.util.List; @Mapper public interface MenuMapper { //@Insert @Insert("INSERT INTO menu(name,`desc`,count,picture,price,create_time,update_time) VALUES (#{name},#{desc},#{count},#{picture},#{price},#{createTime},#{updateTime})") int save(Menu menu); //@Delete @Delete("DELETE FROM menu WHERE id=#{id}") int delete(Long id); //@Update @Update("UPDATE menu SET name = #{name}, `desc` = #{desc}, count = #{count},price = #{price}, picture = #{picture}, create_time = #{createTime}, update_time = #{updateTime}") int update(Menu menu); //@Select @Select("SELECT `name` FROM menu WHERE id=#{id}") String selectMenuById(Long id); @Select("SELECT id, name, `desc`, count,price,picture, create_time,update_time FROM menu WHERE `name` = #{name}") List<Menu> selectMenuByName(String name); }
2021-05-24
最新推荐文章于 2022-01-26 22:26:06 发布