吉安感知网项目-后端
linwei
2026-04-02 63b484f3fceb54cf545b3c8b722a6f0fceae1689
sql改造其他模块改造
12 files modified
144 ■■■■ changed files
drone-ops/drone-resource/src/main/java/org/sxkj/resource/mapper/AttachMapper.xml 2 ●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwAreaDivideMapper.xml 68 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseSceneManageMapper.xml 8 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseSceneMapper.xml 6 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseZoneMapper.xml 4 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/detection/mapper/FwEffectEvalMapper.xml 8 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/detection/mapper/FwTaskScheduleMapper.xml 2 ●●● patch | view | raw | blame | history
drone-service/drone-system/src/main/java/org/sxkj/system/mapper/DeptMapper.xml 2 ●●● patch | view | raw | blame | history
drone-service/drone-system/src/main/java/org/sxkj/system/mapper/MenuMapper.xml 4 ●●●● patch | view | raw | blame | history
drone-service/drone-system/src/main/java/org/sxkj/system/mapper/RoleMapper.xml 37 ●●●●● patch | view | raw | blame | history
drone-service/drone-system/src/main/resources/application-dev.yml 1 ●●●● patch | view | raw | blame | history
drone-task/drone-odm/src/main/java/org/sxkj/odm/mapper/OdmTaskInfoMapper.xml 2 ●●● patch | view | raw | blame | history
drone-ops/drone-resource/src/main/java/org/sxkj/resource/mapper/AttachMapper.xml
@@ -829,7 +829,7 @@
            wayline_job j ON a.wayline_job_id = j.job_id::VARCHAR
        WHERE
            (
                FIND_IN_SET(#{lotInfoId}, j.lot_info_id) > 0
                #{lotInfoId} = ANY(string_to_array(j.lot_info_id, ',')::bigint[])
                OR j.lot_info_id = #{lotInfoId}
            )
          AND a.result_type = 0  -- 根据您的需求,只查询成果类型为 0 (图片) 的数据
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwAreaDivideMapper.xml
@@ -79,7 +79,7 @@
            <if test="param2.areaTypeKeyList != null and param2.areaTypeKeyList.size > 0">
                and (
                    <foreach collection="param2.areaTypeKeyList" item="key" separator=" or ">
                        find_in_set(#{key}, ad.area_type_keys)
                        ARRAY_POSITION(string_to_array(ad.area_type_keys, ','), #{key}) IS NOT NULL
                    </foreach>
                )
            </if>
@@ -116,7 +116,7 @@
                    where ds.is_deleted = 0
                      and ds.area_divide_ids is not null
                      and ds.area_divide_ids != ''
                      and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', ''))
                      and ad.id = ANY(string_to_array(replace(ds.area_divide_ids, ' ', ''), ',')::bigint[])
                )
            </if>
            <if test="isSetSceneManage != null and isSetSceneManage == 1 and flyTime != null">
@@ -127,7 +127,7 @@
                    where ds.is_deleted = 0
                      and ds.area_divide_ids is not null
                      and ds.area_divide_ids != ''
                      and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', ''))
                      and ad.id = ANY(string_to_array(replace(ds.area_divide_ids, ' ', ''), ',')::bigint[])
                      and (dsm.effective_date_start is null or dsm.effective_date_start &lt;= #{flyTime})
                      and (dsm.effective_date_end is null or dsm.effective_date_end &gt;= #{flyTime})
                )
@@ -140,7 +140,7 @@
                        where ds.is_deleted = 0
                          and ds.area_divide_ids is not null
                          and ds.area_divide_ids != ''
                          and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', ''))
                          and ad.id = ANY(string_to_array(replace(ds.area_divide_ids, ' ', ''), ',')::bigint[])
                    )
                    <if test="sceneId != null">
                        or exists (
@@ -150,7 +150,7 @@
                              and ds.id = #{sceneId}
                              and ds.area_divide_ids is not null
                              and ds.area_divide_ids != ''
                              and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', ''))
                              and ad.id = ANY(string_to_array(replace(ds.area_divide_ids, ' ', ''), ',')::bigint[])
                        )
                    </if>
                )
@@ -163,13 +163,13 @@
                      and ds.id = #{sceneId}
                      and ds.area_divide_ids is not null
                      and ds.area_divide_ids != ''
                      and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', ''))
                      and ad.id = ANY(string_to_array(replace(ds.area_divide_ids, ' ', ''), ',')::bigint[])
                )
            </if>
            <if test="areaTypeKeyList != null and areaTypeKeyList.size > 0">
                and (
                    <foreach collection="areaTypeKeyList" item="key" separator=" or ">
                        find_in_set(#{key}, ad.area_type_keys)
                        ARRAY_POSITION(string_to_array(ad.area_type_keys, ','), #{key}) IS NOT NULL
                    </foreach>
                )
            </if>
@@ -189,7 +189,7 @@
            <if test="deviceIds != null and deviceIds.size > 0">
                and (
                    <foreach collection="deviceIds" item="deviceId" separator=" or ">
                        find_in_set(#{deviceId}, replace(ad.device_ids, ' ', ''))
                        #{deviceId} = ANY(string_to_array(replace(ad.device_ids, ' ', ''), ',')::bigint[])
                    </foreach>
                )
            </if>
@@ -209,7 +209,7 @@
            <if test="areaIds != null and areaIds.size > 0">
                and (
                    <foreach collection="areaIds" item="areaId" separator=" or ">
                        find_in_set(#{areaId}, replace(ds.area_divide_ids, ' ', ''))
                        #{areaId} = ANY(string_to_array(replace(ds.area_divide_ids, ' ', ''), ',')::bigint[])
                    </foreach>
                )
            </if>
@@ -223,7 +223,7 @@
            ad.is_deleted = 0
            and ad.device_ids is not null
            and ad.device_ids != ''
            and find_in_set(#{deviceId}, replace(ad.device_ids, ' ', ''))
            and #{deviceId} = ANY(string_to_array(replace(ad.device_ids, ' ', ''), ',')::bigint[])
        </where>
    </select>
@@ -266,14 +266,14 @@
                from ja_fw_defense_scene ds
                join ja_fw_defense_scene_manage dsm on dsm.defense_scene_id = ds.id::VARCHAR and dsm.is_deleted = 0
                where ds.is_deleted = 0
                  and find_in_set(ad.id, ds.area_divide_ids)
                  and ad.id = ANY(string_to_array(ds.area_divide_ids, ',')::bigint[])
            ) as scene_name,
            (
                select group_concat(distinct ds.scene_type)
                select string_agg(distinct ds.scene_type, ',')
                from ja_fw_defense_scene ds
                join ja_fw_defense_scene_manage dsm on dsm.defense_scene_id = ds.id::VARCHAR and dsm.is_deleted = 0
                where ds.is_deleted = 0
                  and find_in_set(ad.id, ds.area_divide_ids)
                  and ad.id = ANY(string_to_array(ds.area_divide_ids, ',')::bigint[])
            ) as scene_type,
            case
                when ad.device_ids is null or trim(ad.device_ids) = '' then 0
@@ -286,7 +286,7 @@
                    from ja_fw_drone_alarm_record ar
                    join ja_fw_device d on d.id = ar.device_id::VARCHAR and d.is_deleted = 0
                    where ar.is_deleted = 0
                      and find_in_set(d.id, replace(ad.device_ids, ' ', ''))
                      and d.id = ANY(string_to_array(replace(ad.device_ids, ' ', ''), ',')::bigint[])
                )
            end as alarm_count,
            case
@@ -296,7 +296,7 @@
                    from ja_fw_effect_eval ee
                    join ja_fw_device d on d.id = ee.device_id::VARCHAR and d.is_deleted = 0
                    where ee.is_deleted = 0
                      and find_in_set(d.id, replace(ad.device_ids, ' ', ''))
                      and d.id = ANY(string_to_array(replace(ad.device_ids, ' ', ''), ',')::bigint[])
                )
            end as counter_count,
            case
@@ -307,7 +307,7 @@
                    join ja_fw_device d on d.id = ee.device_id::VARCHAR and d.is_deleted = 0
                    where ee.is_deleted = 0
                      and ee.counter_effect = '1'
                      and find_in_set(d.id, replace(ad.device_ids, ' ', ''))
                      and d.id = ANY(string_to_array(replace(ad.device_ids, ' ', ''), ',')::bigint[])
                )
            end as counter_success_count
            from ja_fw_area_divide ad
@@ -318,7 +318,7 @@
                    from ja_fw_defense_scene ds
                    join ja_fw_defense_scene_manage dsm on dsm.defense_scene_id = ds.id::VARCHAR and dsm.is_deleted = 0
                    where ds.is_deleted = 0
                      and find_in_set(ad.id, ds.area_divide_ids)
                      and ad.id = ANY(string_to_array(ds.area_divide_ids, ',')::bigint[])
                )
                <if test="param2.id != null and param2.id != ''">
                    and ad.id = #{param2.id}
@@ -331,7 +331,7 @@
                        select 1
                        from ja_fw_defense_scene ds
                        where ds.is_deleted = 0
                          and find_in_set(ad.id, ds.area_divide_ids)
                          and ad.id = ANY(string_to_array(ds.area_divide_ids, ',')::bigint[])
                          and ds.scene_type = #{param2.sceneType}
                    )
                </if>
@@ -341,7 +341,7 @@
                <if test="param2.areaTypeKeyList != null and param2.areaTypeKeyList.size > 0">
                    and (
                        <foreach collection="param2.areaTypeKeyList" item="key" separator=" or ">
                            find_in_set(#{key}, ad.area_type_keys)
                            ARRAY_POSITION(string_to_array(ad.area_type_keys, ','), #{key}) IS NOT NULL
                        </foreach>
                    )
                </if>
@@ -378,16 +378,16 @@
        ad.area_name,
        ad.area_type_keys,
        (
            select group_concat(distinct ds.scene_name)
            select string_agg(distinct ds.scene_name, ',')
            from ja_fw_defense_scene ds
                where ds.is_deleted = 0
                  and find_in_set(ad.id, ds.area_divide_ids)
                  and ad.id = ANY(string_to_array(ds.area_divide_ids, ',')::bigint[])
            ) as scene_name,
            (
                select group_concat(distinct ds.scene_type)
                select string_agg(distinct ds.scene_type, ',')
                from ja_fw_defense_scene ds
                where ds.is_deleted = 0
                  and find_in_set(ad.id, ds.area_divide_ids)
                  and ad.id = ANY(string_to_array(ds.area_divide_ids, ',')::bigint[])
            ) as scene_type,
            case
                when ad.device_ids is null or trim(ad.device_ids) = '' then 0
@@ -400,7 +400,7 @@
                    from ja_fw_drone_alarm_record ar
                    join ja_fw_device d on d.id = ar.device_id::VARCHAR and d.is_deleted = 0
                    where ar.is_deleted = 0
                      and find_in_set(d.id, replace(ad.device_ids, ' ', ''))
                      and d.id = ANY(string_to_array(replace(ad.device_ids, ' ', ''), ',')::bigint[])
                )
            end as alarm_count,
            case
@@ -410,7 +410,7 @@
                    from ja_fw_effect_eval ee
                    join ja_fw_device d on d.id = ee.device_id::VARCHAR and d.is_deleted = 0
                    where ee.is_deleted = 0
                      and find_in_set(d.id, replace(ad.device_ids, ' ', ''))
                      and d.id = ANY(string_to_array(replace(ad.device_ids, ' ', ''), ',')::bigint[])
                )
            end as counter_count,
            case
@@ -421,7 +421,7 @@
                    join ja_fw_device d on d.id = ee.device_id::VARCHAR and d.is_deleted = 0
                    where ee.is_deleted = 0
                      and ee.counter_effect = 'success'
                      and find_in_set(d.id, replace(ad.device_ids, ' ', ''))
                      and d.id = ANY(string_to_array(replace(ad.device_ids, ' ', ''), ',')::bigint[])
                )
            end as counter_success_count
            from ja_fw_area_divide ad
@@ -490,7 +490,7 @@
                </if>
                GROUP BY
                    d.id
        ) dd on find_in_set(dd.id, ad.device_ids)
        ) dd on dd.id = ANY(string_to_array(replace(ad.device_ids, ' ', ''), ',')::bigint[])
        <where>
            ad.is_deleted = 0
            <if test="isSetSceneManage != null and isSetSceneManage == 1">
@@ -501,7 +501,7 @@
                where ds.is_deleted = 0
                and ds.area_divide_ids is not null
                and ds.area_divide_ids != ''
                and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', ''))
                and ad.id = ANY(string_to_array(replace(ds.area_divide_ids, ' ', ''), ',')::bigint[])
                )
            </if>
            <if test="isSetSceneManage != null and isSetSceneManage == 1 and flyTime != null">
@@ -512,7 +512,7 @@
                where ds.is_deleted = 0
                and ds.area_divide_ids is not null
                and ds.area_divide_ids != ''
                and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', ''))
                and ad.id = ANY(string_to_array(replace(ds.area_divide_ids, ' ', ''), ',')::bigint[])
                and (dsm.effective_date_start is null or dsm.effective_date_start &lt;= #{flyTime})
                and (dsm.effective_date_end is null or dsm.effective_date_end &gt;= #{flyTime})
                )
@@ -525,7 +525,7 @@
                where ds.is_deleted = 0
                and ds.area_divide_ids is not null
                and ds.area_divide_ids != ''
                and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', ''))
                and ad.id = ANY(string_to_array(replace(ds.area_divide_ids, ' ', ''), ',')::bigint[])
                )
                <if test="sceneId != null">
                    or exists (
@@ -535,7 +535,7 @@
                    and ds.id = #{sceneId}
                    and ds.area_divide_ids is not null
                    and ds.area_divide_ids != ''
                    and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', ''))
                    and ad.id = ANY(string_to_array(replace(ds.area_divide_ids, ' ', ''), ',')::bigint[])
                    )
                </if>
                )
@@ -548,13 +548,13 @@
                and ds.id = #{sceneId}
                and ds.area_divide_ids is not null
                and ds.area_divide_ids != ''
                and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', ''))
                and ad.id = ANY(string_to_array(replace(ds.area_divide_ids, ' ', ''), ',')::bigint[])
                )
            </if>
            <if test="areaTypeKeyList != null and areaTypeKeyList.size > 0">
                and (
                <foreach collection="areaTypeKeyList" item="key" separator=" or ">
                    find_in_set(#{key}, ad.area_type_keys)
                    ARRAY_POSITION(string_to_array(ad.area_type_keys, ','), #{key}) IS NOT NULL
                </foreach>
                )
            </if>
@@ -567,7 +567,7 @@
        from ja_fw_defense_scene_manage dsm
        left join ja_fw_defense_scene ds on ds.id = dsm.defense_scene_id::VARCHAR and ds.is_deleted = 0
        where ds.is_deleted = 0
        and find_in_set(#{areaId}, ds.area_divide_ids)
        and #{areaId} = ANY(string_to_array(ds.area_divide_ids, ',')::bigint[])
        and dsm.is_deleted = 0
    </select>
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseSceneManageMapper.xml
@@ -69,7 +69,7 @@
        ), 0)
        from ja_fw_area_divide ad
        where ad.is_deleted = 0
        and find_in_set(ad.id, ds.area_divide_ids) > 0
        and ad.id = ANY(string_to_array(ds.area_divide_ids, ',')::bigint[])
        ) as device_count
        from ja_fw_defense_scene_manage dsm
        left join ja_fw_defense_scene ds on ds.id = dsm.defense_scene_id::VARCHAR and ds.is_deleted = 0
@@ -103,7 +103,7 @@
                ad.device_ids
            FROM ja_fw_defense_scene_manage dsm
            LEFT JOIN ja_fw_defense_scene ds ON ds.id = dsm.defense_scene_id::VARCHAR AND ds.is_deleted = 0
            LEFT JOIN ja_fw_area_divide ad ON FIND_IN_SET(ad.id, ds.area_divide_ids) > 0 AND ad.is_deleted = 0
            LEFT JOIN ja_fw_area_divide ad ON ad.id = ANY(string_to_array(ds.area_divide_ids, ',')::bigint[]) AND ad.is_deleted = 0
            WHERE dsm.id = #{id}
        ) ad ON CHAR_LENGTH(ad.device_ids) - CHAR_LENGTH(REPLACE(ad.device_ids, ',', '')) >= numbers.n - 1
        WHERE ad.device_ids IS NOT NULL AND ad.device_ids != ''
@@ -115,7 +115,7 @@
        ds.scene_name as defense_scene_name
        from ja_fw_defense_scene_manage dsm
        left join ja_fw_defense_scene ds on ds.id = dsm.defense_scene_id::VARCHAR and ds.is_deleted = 0
        left join ja_fw_area_divide ad on FIND_IN_SET(ad.id, ds.area_divide_ids) > 0 and ad.is_deleted = 0
        left join ja_fw_area_divide ad on ad.id = ANY(string_to_array(ds.area_divide_ids, ',')::bigint[]) and ad.is_deleted = 0
        inner join (
                SELECT
                    d.id
@@ -138,7 +138,7 @@
                </if>
                GROUP BY
                d.id
            ) dd on find_in_set(dd.id, ad.device_ids)
            ) dd on dd.id = ANY(string_to_array(replace(ad.device_ids, ' ', ''), ',')::bigint[])
        <where>
            dsm.is_deleted = 0
            <if test="time != null">
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseSceneMapper.xml
@@ -89,7 +89,7 @@
                        where dz.is_deleted = 0
                          and dz.defense_scene_ids is not null
                          and dz.defense_scene_ids != ''
                          and find_in_set(ds.id, dz.defense_scene_ids)
                          and ds.id = ANY(string_to_array(dz.defense_scene_ids, ',')::bigint[])
                    )
                    <if test="zoneId != null">
                        or exists (
@@ -99,7 +99,7 @@
                              and dz.id = #{zoneId}
                              and dz.defense_scene_ids is not null
                              and dz.defense_scene_ids != ''
                              and find_in_set(ds.id, dz.defense_scene_ids)
                              and ds.id = ANY(string_to_array(dz.defense_scene_ids, ',')::bigint[])
                        )
                    </if>
                )
@@ -107,7 +107,7 @@
            <if test="areaId != null and (filterSelected == null or filterSelected != 1)">
                and ds.area_divide_ids is not null
                and ds.area_divide_ids != ''
                and find_in_set(#{areaId}, replace(ds.area_divide_ids, ' ', ''))
                and #{areaId} = ANY(string_to_array(replace(ds.area_divide_ids, ' ', ''), ',')::bigint[])
            </if>
        </where>
    </select>
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseZoneMapper.xml
@@ -91,11 +91,11 @@
            and dz.id = #{zoneId}
            and dz.defense_scene_ids is not null
            and dz.defense_scene_ids != ''
            and find_in_set(ds.id, replace(dz.defense_scene_ids, ' ', ''))
            and ds.id = ANY(string_to_array(replace(dz.defense_scene_ids, ' ', ''), ',')::bigint[])
        join ja_fw_area_divide ad on ad.is_deleted = 0
            and ds.area_divide_ids is not null
            and ds.area_divide_ids != ''
            and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', ''))
            and ad.id = ANY(string_to_array(replace(ds.area_divide_ids, ' ', ''), ',')::bigint[])
        left join ja_fw_police_station ps on ps.id = ad.police_station_id::VARCHAR and ps.is_deleted = 0
    </select>
drone-service/drone-fw/src/main/java/org/sxkj/fw/detection/mapper/FwEffectEvalMapper.xml
@@ -33,11 +33,11 @@
    <select id="selectFwEffectEvalPage" resultMap="fwEffectEvalResultMap">
        select
        ee.*,
        group_concat(distinct ad.area_name separator ',') as area_name,
        group_concat(distinct ds.scene_name separator ',') as scene_name
        string_agg(distinct ad.area_name, ',') as area_name,
        string_agg(distinct ds.scene_name, ',') as scene_name
        from ja_fw_effect_eval ee
        left join ja_fw_area_divide ad on find_in_set(ee.device_id, ad.device_ids) and ad.is_deleted = 0
        left join ja_fw_defense_scene ds on find_in_set(ad.id, ds.area_divide_ids) and ds.is_deleted = 0
        left join ja_fw_area_divide ad on ee.device_id = ANY(string_to_array(ad.device_ids, ',')::bigint[]) and ad.is_deleted = 0
        left join ja_fw_defense_scene ds on ad.id = ANY(string_to_array(ds.area_divide_ids, ',')::bigint[]) and ds.is_deleted = 0
        <where>
                ee.is_deleted = 0
            <if test="param2.deviceName != null and param2.deviceName != ''">
drone-service/drone-fw/src/main/java/org/sxkj/fw/detection/mapper/FwTaskScheduleMapper.xml
@@ -74,7 +74,7 @@
                ja_fw_defense_zone dz on dz.is_deleted = 0
            and dz.defense_scene_ids is not null
            and dz.defense_scene_ids != ''
            and find_in_set(dsm.id, replace(dz.defense_scene_ids, ' ', ''))
            and dsm.id = ANY(string_to_array(replace(dz.defense_scene_ids, ' ', ''), ',')::bigint[])
        <where>
            ts.is_deleted = 0
            <if test="param2.deviceName != null and param2.deviceName != ''">
drone-service/drone-system/src/main/java/org/sxkj/system/mapper/DeptMapper.xml
@@ -179,7 +179,7 @@
        left join sys_config sc on sc.dept_id = bd.id::VARCHAR and sc.is_deleted = 0
        where bd.is_deleted = 0
        and (
        bd.id = #{deptId}
        bd.id = #{deptId}::bigint
        or bd.ancestors like concat('%',#{deptId},'%')
        )
        and bd.dept_category = 1
drone-service/drone-system/src/main/java/org/sxkj/system/mapper/MenuMapper.xml
@@ -632,8 +632,8 @@
        select
        bm.*
        from manage_device_per_share mdps
        left join manage_device_per_menu mdpm on FIND_IN_SET(mdpm.id, mdps.device_per_menu_id)
        left join blade_menu bm on FIND_IN_SET(bm.id, mdpm.menu_id) and mdpm.is_deleted = 0
        left join manage_device_per_menu mdpm on mdpm.id = ANY(string_to_array(mdps.device_per_menu_id, ',')::bigint[])
        left join blade_menu bm on bm.id = ANY(string_to_array(mdpm.menu_id, ',')::bigint[]) and mdpm.is_deleted = 0
        where
        bm.is_deleted = 0
        AND category = 2
drone-service/drone-system/src/main/java/org/sxkj/system/mapper/RoleMapper.xml
@@ -65,27 +65,34 @@
    <!--角色查询-->
    <select id="getRoleList" resultType="org.sxkj.system.entity.Role">
        WITH RECURSIVE role_tree AS (
            SELECT id, parent_id, role_name, role_alias
            FROM blade_role
            WHERE id = #{roleParam.roleId} AND is_deleted = 0
            UNION ALL
            SELECT br.id, br.parent_id, br.role_name, br.role_alias
            FROM blade_role br
            INNER JOIN role_tree rt ON br.parent_id = rt.id
            WHERE br.is_deleted = 0 AND br.id != 1123598816738675201
        )
        SELECT br.* FROM blade_role br
        inner join (
        SELECT * FROM
        (
        SELECT t1.*,IF( find_in_set( parent_id, @pids ) > 0, @pids := concat( @pids, ',', id ), 0 ) AS ischild FROM
        ( SELECT id, parent_id,role_name,role_alias FROM blade_role t where is_deleted =0 ORDER BY parent_id, id ) t1,
        ( SELECT @pids := #{roleParam.roleId} ) t2
        ) t3
        WHERE id != 1123598816738675201
        INNER JOIN role_tree rt ON br.id = rt.id
        <if test="roleParam.roleName!=null and roleParam.roleName!=''">
            and role_name like concat('%',#{roleParam.roleName},'%')
            WHERE br.role_name like concat('%',#{roleParam.roleName},'%')
        </if>
        <if test="roleParam.roleAlias!=null and roleParam.roleAlias!=''">
            and role_alias like concat('%',#{roleParam.roleAlias},'%')
            <choose>
                <when test="roleParam.roleName!=null and roleParam.roleName!=''">
                    AND br.role_alias like concat('%',#{roleParam.roleAlias},'%')
                </when>
                <otherwise>
                    WHERE br.role_alias like concat('%',#{roleParam.roleAlias},'%')
                </otherwise>
            </choose>
        </if>
        ) t4 on br.id = t4.id::VARCHAR
        <if test="roleParam.isNowLevel==0">
            union all
            (
            SELECT * FROM blade_role where id = #{roleParam.roleId}
            )
            UNION ALL
            SELECT * FROM blade_role WHERE id = #{roleParam.roleId}
        </if>
    </select>
drone-service/drone-system/src/main/resources/application-dev.yml
@@ -5,6 +5,7 @@
#数据源配置
spring:
  datasource:
    driver-class-name: com.kingbase8.Driver
    url: ${blade.datasource.dev.url}
    username: ${blade.datasource.dev.username}
    password: ${blade.datasource.dev.password}
drone-task/drone-odm/src/main/java/org/sxkj/odm/mapper/OdmTaskInfoMapper.xml
@@ -195,7 +195,7 @@
        </if>
        <if test="lotInfoId != null and lotInfoId != ''">
            AND (
                FIND_IN_SET(#{lotInfoId}, wj.lot_info_id) > 0
                #{lotInfoId} = ANY(string_to_array(wj.lot_info_id, ',')::bigint[])
                OR wj.lot_info_id = #{lotInfoId}
            )
        </if>