package cn.stylefeng.guns.zjxl.dao;

import cn.stylefeng.guns.zjxl.model.ZjxlArticleContent;
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: ZjxlArticleContentDao
 * @Description:
 * @Auther: shi kejing
 * @Date: 2020/11/3 17:40
 */
public interface ZjxlArticleContentDao extends PagingAndSortingRepository<ZjxlArticleContent,Long>, JpaSpecificationExecutor<ZjxlArticleContent> {

    @Modifying
    @Query("delete from ZjxlArticleContent a where a.articleContentId = ?1")
    int deleteByArticleContentId(String id);

    @Modifying
    @Query("update ZjxlArticleContent a set a.articleContentIsLine = ?2 where a.articleContentId = ?1 ")
    int updateByArticleContentId(String id,Integer isLine);
}
