吉安感知网项目-后端
linwei
2026-02-05 08d4bb2bf4bfadc9ab5fcf6b0a2bfb543d22b2a0
drone-service/drone-gd/src/main/java/org/sxkj/gd/orderdata/mapper/GdDataObjectionMapper.xml
@@ -3,7 +3,7 @@
<mapper namespace="org.sxkj.gd.orderdata.mapper.GdDataObjectionMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="gdDataObjectionResultMap" type="org.sxkj.gd.orderdata.entity.GdDataObjectionEntity">
    <resultMap id="gdDataObjectionResultMap" type="org.sxkj.gd.orderdata.vo.GdDataObjectionVO">
        <result column="id" property="id"/>
        <result column="title" property="title"/>
        <result column="objection_type" property="objectionType"/>
@@ -17,6 +17,7 @@
        <result column="other_objection_detail" property="otherObjectionDetail"/>
        <result column="review_opinion" property="reviewOpinion"/>
        <result column="area_code" property="areaCode"/>
        <result column="attach_names" property="attachNames"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
@@ -28,7 +29,40 @@
    <select id="selectGdDataObjectionPage" resultMap="gdDataObjectionResultMap">
        select * from ja_gd_data_objection where is_deleted = 0
        select
            do.*,
            GROUP_CONCAT(da.attach_name SEPARATOR ',') as attach_names,
            bd.dept_name as create_dept_name
        from
            ja_gd_data_objection do
        left join
                ja_gd_data_objection_attachment da
                on do.id = da.objection_id and da.is_deleted = 0
        left join
                blade_dept bd on bd.id = do.create_dept
        <where>
                do.is_deleted = 0
                and da.is_deleted = 0
            <if test="param2.title != null and param2.title != ''">
                and do.title like concat('%',#{param2.title},'%')
            </if>
            <if test="param2.objectionStatus != null and param2.objectionStatus != ''">
                and do.objection_status = #{param2.objectionStatus}
            </if>
            <if test="param2.deptList != null and param2.deptList.size > 0">
                and (
                do.create_dept in
                <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")">
                    #{deptId}
                </foreach>
                )
                or do.apply_target_dept_id in
                <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")">
                    #{deptId}
                </foreach>
            </if>
        </where>
        group by do.id
    </select>
@@ -36,4 +70,22 @@
        SELECT * FROM ja_gd_data_objection ${ew.customSqlSegment}
    </select>
    <select id="getDetail" resultType="org.sxkj.gd.orderdata.vo.GdDataObjectionVO">
        select
            do.*,
            GROUP_CONCAT(da.attach_name SEPARATOR ',') as attach_names ,
            GROUP_CONCAT(da.attach_id SEPARATOR ',') as attach_ids
        from
            ja_gd_data_objection do
        left join
                ja_gd_data_objection_attachment da on do.id = da.objection_id
        <where>
                and da.is_deleted = 0
            <if test="id != null ">
                and do.id = #{id}
            </if>
        </where>
        group by do.id
    </select>
</mapper>