<?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.AuditComplianeItemMapper">

    <select id="queryAllActForItems" resultType="java.util.Map">
        SELECT distinct A.checkid,A.citemid,B.act_id AS actId,C.ca_name AS caName
        FROM audit_item_rel_check A
            INNER JOIN audit_act_rel_others B ON A.checkid=B.tid and B.tp=5
            INNER JOIN audit_act C ON B.act_id=C.id
        <where>
            B.tp = 5
            <if test="idList != null and idList.size() > 0">
                and A.citemid in
                <foreach item="id" collection="idList" open="(" separator="," close=")">
                    #{id}
                </foreach>
            </if>
        </where>
        order by A.citemid
    </select>

</mapper>