xieb
2024-12-11 c0e0761eec99d3642b6a1acdcdb5e2b51a481aaf
skjcmanager/skjcmanager-service/skjcmanager-system/src/main/java/cn/gistack/system/mapper/DeptMapper.xml
@@ -76,6 +76,37 @@
        ORDER BY sort
    </select>
    <select id="treeByParentId" resultMap="treeNodeResultMap">
        select id, parent_id, dept_name as title, id as "value", id as "key" from blade_dept where is_deleted = 0
        <if test="parentIds!=null and parentIds!=''">
            and
            <foreach item="id" collection="parentIds" open="(" separator="or" close=")">
                id = #{id} or parent_id = #{id} or parent_id in (
                select b.id from blade_dept b where b.is_deleted = 0 and b.PARENT_ID = #{id}
                )
            </foreach>
        </if>
        ORDER BY sort
    </select>
    <select id="treeByParentIdNew" resultMap="treeNodeResultMap">
        select id, parent_id, dept_name as title, id as "value", id as "key" from blade_dept where is_deleted = 0 and precinct=#{precinct}
        <if test="parentIds!=null and parentIds!=''">
            and
            <foreach item="id" collection="parentIds" open="(" separator="or" close=")">
                id = #{id} or parent_id = #{id} or parent_id in (
                select b.id from blade_dept b where b.is_deleted = 0 and b.PARENT_ID = #{id}
                )
            </foreach>
        </if>
        ORDER BY sort
    </select>
    <select id="lazyTree" resultMap="treeNodeResultMap" >
        SELECT
            dept.id,
@@ -94,7 +125,10 @@
        FROM
            blade_dept dept
        WHERE
            dept.parent_id = #{param2} AND dept.is_deleted = 0
        <foreach item="id" collection="param2" open="(" separator="or" close=")">
            dept.parent_id = #{id}
        </foreach>
             AND dept.is_deleted = 0
        <if test="param1!=null and param1!=''">
            and dept.tenant_id = #{param1}
        </if>
@@ -190,5 +224,15 @@
            and bu.dept_id like concat(concat('%',#{treeNode.id}),'%')
        </if>
    </select>
    <select id="getResDept" resultType="java.lang.String">
        SELECT WM_CONCAT(res_guid)
        FROM blade_dept where res_guid is not null and res_guid != ''
        and id in
        <foreach collection="deptIds.split(',')" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </select>
</mapper>