
package cn.ysk.cashier.repository.shop;

import cn.ysk.cashier.pojo.shop.TbShopInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * @author lyf
 * @website https://eladmin.vip
 * @date 2023-11-07
 **/
public interface TbShopInfoRepository extends JpaRepository<TbShopInfo, Integer>, JpaSpecificationExecutor<TbShopInfo> {

    @Query("select info from TbShopInfo info where info.account = :account")
    TbShopInfo findByAccount(@Param("account") String account);

    @Modifying
    @Query("update TbShopInfo info set info.status=0 where info.account = :account")
    void updateByAcc(@Param("account") String account);

}