<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.stm.audit.mapper.AuditInnerCtrlMapper">
    <select id="queryRuleItems" resultType="java.util.Map">
        SELECT A.name,A.id,A.tp ,B.id AS checkid,B.content AS checkContent,B.des as  checkDes,B.is_public AS isPublic,
               D.item,D.content AS itemContent,E.file_tp AS fileTp,E.file_path AS filePath,
               E.file_name AS fileName,E.id AS fileId
        FROM audit_check_method_item A
        INNER JOIN audit_check_method B ON A.checkid = B. id
        INNER JOIN audit_item_rel_check C ON B.id = C.checkid
        INNER JOIN audit_compliane_item D ON C.citemid = D.id
        LEFT JOIN  doc_files E ON D.file_id = E.id
        order by A.id desc
    </select>

    <select id="queryCtrlOrderRuleItems" resultType="java.util.Map">
        SELECT A.name,A.id,A.tp ,B.id AS checkid,B.content AS checkContent,B.des AS  checkDes,B.is_public AS isPublic,
               D.item,D.content AS itemContent,E.file_tp AS fileTp,E.file_path AS filePath,
               E.file_name AS fileName,E.id AS fileId
        FROM audit_inner_order_checkmethod_item A
         INNER JOIN audit_inner_order_checkmethod B ON A.checkid = B. id
         INNER JOIN audit_inner_order_rel_check C ON B.id = C.checkid
         INNER JOIN `audit_inner_order` D ON C.citemid = D.id
         LEFT JOIN  doc_files E ON D.file_id = E.id
        ORDER BY A.id DESC
    </select>


</mapper>