每天学习一点点 编程PDF电子书、视频教程免费下载:
http://www.shitanlife.com/code

 

 

    <!-- 查询机构的所有子机构 -->
    <select id="queryOrgEduAndChildrenForList" parameterType="java.util.Map"
        resultType="com.tianwen.springcloud.microservice.user.entity.OrgEdu">
            WITH RECURSIVE cte AS (
                SELECT
                    edu.*
                FROM
                    t_e_org_edu edu 
                where edu.orgId = #{orgId}
                AND edu.status = '1'
                UNION ALL
                    SELECT
                        b.*
                    FROM
                        t_e_org_edu b
                    INNER JOIN cte C ON b.parentorgid = C .orgid
                    WHERE
                        b.status = '1'
            ) SELECT
                *
            FROM
                cte
            WHERE
                 1 = 1
            <if test="orgType != null">
                and orgtype = #{orgType}
            </if>
    </select>

 

相关文章:

  • 2021-12-19
  • 2021-10-21
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
  • 2022-12-23
  • 2021-09-24
相关资源
相似解决方案