| | |
| | | select |
| | | obj.id, |
| | | obj.title, |
| | | obj.objection_type, |
| | | obj.objection_status, |
| | | obj.create_dept, |
| | | obj.catalog_resource_name, |
| | | obj.submitter, |
| | | obj.submitter_contact, |
| | | obj.handle_unit, |
| | | obj.objection_desc, |
| | | obj.objection_basis, |
| | | obj.other_objection_detail, |
| | | obj.review_opinion, |
| | | obj.area_code, |
| | | obj.apply_target_dept_id, |
| | | obj.create_user, |
| | | obj.create_dept, |
| | | obj.create_time, |
| | | /* 必须显式查询排序字段,否则某些情况下分页插件生成的 COUNT 会报错 */ |
| | | obj.update_user, |
| | | obj.update_time, |
| | | obj.status, |
| | | obj.is_deleted, |
| | | string_agg(da.attach_name::text, ',') as attach_names, |
| | | bd.dept_name as create_dept_name |
| | |
| | | </select> |
| | | |
| | | <select id="getDetail" resultType="org.sxkj.gd.orderdata.vo.GdDataObjectionVO"> |
| | | select |
| | | obj.*, |
| | | string_agg(da.attach_name SEPARATOR ',') as attach_names , |
| | | string_agg(da.attach_id SEPARATOR ',') as attach_ids |
| | | from |
| | | ja_gd_data_objection obj |
| | | left join |
| | | ja_gd_data_objection_attachment da on obj.id::VARCHAR = da.objection_id::VARCHAR |
| | | SELECT |
| | | obj.*, |
| | | string_agg(da.attach_name::text, ',') AS attach_names, |
| | | string_agg(da.attach_id::text, ',') AS attach_ids |
| | | FROM |
| | | ja_gd_data_objection obj |
| | | LEFT JOIN |
| | | ja_gd_data_objection_attachment da ON obj.id::text = da.objection_id::text |
| | | <where> |
| | | and da.is_deleted = 0 |
| | | <if test="id != null "> |
| | | and obj.id = #{id} |
| | | da.is_deleted = 0 |
| | | <if test="id != null"> |
| | | AND obj.id::text = #{id}::text |
| | | </if> |
| | | </where> |
| | | group by obj.id |
| | | GROUP BY |
| | | obj.id |
| | | </select> |
| | | |
| | | </mapper> |