package priv.jesse.mall.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import priv.jesse.mall.entity.Order;

import javax.transaction.Transactional;
import java.util.List;

public interface OrderDao extends JpaRepository<Order, Integer> {

    /**
     * 更改订单状态
     * @param state
     * @param id
     */
    @Modifying
    @Transactional
    @Query(value = "update `order` o set o.state=?1 where o.id=?2",nativeQuery = true)
    void updateState(int state,int id);

    /**
     * 查找用户的订单
     * @param userId
     * @return
     */
    List<Order> findByUserId(int userId);
}
最近下载更多
dane168  LV10 2月17日
212828939  LV16 2024年3月13日
www3209  LV1 2024年3月2日
wbw123  LV7 2024年3月1日
3175665836  LV2 2023年12月7日
SDLFJL  LV6 2023年8月15日
zy3344  LV1 2023年7月3日
yzshabzbbdvw  LV4 2023年4月20日
微信网友_5988700142981120  LV2 2023年4月12日
计算机暴龙战士  LV19 2023年4月2日
最近浏览更多
奋斗的小蚂蚁  LV17 11月7日
yangctz  LV25 10月29日
denliv_hui  LV14 8月7日
陈小灏  LV18 2月21日
dane168  LV10 2月17日
王愉悦  LV4 2024年12月3日
颜菜菜  LV2 2024年9月8日
cy5201 2024年6月24日
暂无贡献等级
dageyi 2024年6月12日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友