package com.liangjian.dataplatform.member.dao.primary;

import com.liangjian.dataplatform.member.entity.po.primary.TagRuleJob;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface TagRuleJobRepository extends JpaRepository<TagRuleJob,Long> ,JpaSpecificationExecutor<TagRuleJob>{


    @Query(nativeQuery = true,value = "select * from tag_rule_second tr join tag_rule_job job on tr.id= job.rule_id where disable=false and " +
            "execution_state not in (1,3) and (disrepeat=false or (disrepeat=true and execution_state=0))")
    List<TagRuleJob> getTagRuleJobOfAble();

}
