package thyyxxk.webserver.dao.his.reports;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import thyyxxk.webserver.entity.reports.reportQueryCenter.ReportForms;

import java.util.List;

@Mapper
public interface ReportQueryCenterDao extends BaseMapper<ReportForms> {

    @Select("select a.id, name, page_json, type, parent_id from " +
            "report_forms a, report_forms_rules b  " +
            "where del_flag = 0 and a.id = b.rule_id and b.user_code =#{userCode}")
    List<ReportForms> selectReportForms(String userCode);

    @Select("select  id, name, page_json, type, parent_id from " +
            " report_forms " +
            " where del_flag = 0   ")
    List<ReportForms> selectReportFormsAll();


    @Select("select rule_id from report_forms_rules where user_code = #{userCode}")
    List<String> getRulesByCode(String userCode);
}
