无关风月
4 天以前 df4733091b30b0434a04dacd0e844663114d4cfe
cloud-server-management/src/main/resources/mapper/DeptMapper.xml
@@ -24,7 +24,20 @@
      'false'
      END
      ) as isOpen from sys_dept where 1=1
        and objectType =#{type} and objectId =#{id}
        <if test="type == 3">
            and  objectType = 3 and objectId =#{id}
        </if>
        <if test="type == 2">
            and (objectType = 2 and objectId =#{id}
            or
            <if test="storeIds != null and storeIds.size()>0">
                objectId IN
                <foreach collection="storeIds" separator="," item="id" open="(" close=")">
                    #{id}
                </foreach>
            </if>
            )
        </if>
   </select>
    <select id="list" resultType="java.util.Map">
            select * from sys_dept where 1=1
@@ -34,9 +47,19 @@
            <if test="objectType == 3">
                and  objectType = 3 and objectId =#{objectId}
            </if>
            <if test="objectType == 1">
                and  objectType = 1
            <if test="objectType == 2">
                and (objectType = 2 and objectId =#{objectId}
                or
                <if test="storeIds != null and storeIds.size()>0">
                    objectId IN
                    <foreach collection="storeIds" separator="," item="id" open="(" close=")">
                        #{id}
                    </foreach>
            </if>
                )
            </if>
            order by num ASC
    </select>