<?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="cn.qg.qaplatform.automation.mapper.InterfaceMapper">

    <select id="getInterfaceList" resultType="cn.qg.qaplatform.automation.domain.Interface">
        select i.*,
               p.name as projectName,
               m.name as moduleName
        from interface i, project p, `module` m
        where i.project_id = p.id and i.module_id = m.id
        <if test="projectId != null">
            AND i.`project_id` = #{projectId}
        </if>
        <if test="moduleId != null">
            AND i.`module_id` = #{moduleId}
        </if>
    </select>
</mapper>