package cn.stylefeng.guns.zjxl.dao;

import cn.stylefeng.guns.zjxl.model.ZjxlBanner;
import cn.stylefeng.guns.zjxl.model.ZjxlPartner;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

/***
 * @ClassName: ZjxlPartnerDao
 * @Description:
 * @Auther: shi kejing
 * @Date: 2020/11/3 14:59
 */
public interface ZjxlPartnerDao extends PagingAndSortingRepository<ZjxlPartner, Long>, JpaSpecificationExecutor<ZjxlPartner> {

    @Modifying
    @Query("update ZjxlPartner a set a.partnerIsLine = ?2 where a.partnerId = ?1")
    int updatePartner(String id,Integer isLine);

    @Modifying
    @Query("delete from ZjxlPartner p where p.partnerId = ?1")
    int deleteById(String id);

}
