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

import com.liangjian.dataplatform.member.entity.po.primary.TagRuleSecond;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.Map;

public interface TagRuleSecondRepository extends JpaRepository<TagRuleSecond,Long> ,JpaSpecificationExecutor<TagRuleSecond> {

//    @Query(nativeQuery = true,value = "select tr.*,job.disable ,job.execution_time as executionTime ,job.repeat_interval as repeatInterval" +
//            ",job.interval_unit as intervalUnit from tag_rule_second tr left join tag_rule_job job on tr.id= job.rule_id where tr.name like concat(%,:name,%) " +
//            "and job.disable= :disable" ,countQuery = "select count(1) from tag_rule_second tr join tag_rule_job job on tr.id= job.rule_id where " +
//            "tr.name like concat(%,:name,%) and job.disable= :disable")
//    Page<Map<String,Object>> getTagRuleOfPage(@Param("name") String name, @Param("disable")Boolean disable, Pageable pageable);
}
