left join sys_user u on u.user_name=a.create_by left join sys_dept d on u.dept_id = d.dept_id left join bid q on q.bid_id = a.bid_id left join (select t.* from ( select a.*, row_number() over(partition by bid_id order by create_time desc) rw from bid_jsqr a ) t where t.rw = 1) j on j.bid_id = q.bid_id select a.bid_hj_id, a.bid_hj_code, a.bid_hj_pricing_type, a.bid_hj_pricing_date, a.bid_hj_remark, a.create_by, a.create_time, a.update_by, a.update_time, u.nick_name create_name, a.bid_hj_approval_status,q.bid_id,q.bid_code,q.bid_salesman_name, q.bid_tendering_unit,q.bid_project, q.bid_jsxz_confirm_id,j.bid_jsxz_group_values, j.bid_jsqr_tl_approval_status,j.bid_jsqr_tl_remark, j.bid_jsqr_dy_approval_status,j.bid_jsqr_dy_remark, j.bid_jsqr_zy_approval_status,j.bid_jsqr_zy_remark, j.bid_jsqr_qt_approval_status,j.bid_jsqr_qt_remark from bid_hj a insert into bid_hj bid_hj_id, bid_hj_code, bid_hj_approval_status, bid_hj_pricing_type, bid_hj_pricing_date, bid_hj_remark, create_by, create_time, update_by, update_time, bid_id, #{bidHjId}, #{bidHjCode}, #{bidHjApprovalStatus}, #{bidHjPricingType}, #{bidHjPricingDate}, #{bidHjRemark}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{bidId}, update bid_hj bid_hj_code = #{bidHjCode}, bid_hj_approval_status = #{bidHjApprovalStatus}, bid_hj_pricing_type = #{bidHjPricingType}, bid_hj_pricing_date = #{bidHjPricingDate}, bid_hj_remark = #{bidHjRemark}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, where bid_hj_id = #{bidHjId} delete from bid_hj where bid_hj_id = #{bidHjId} delete from bid_hj where bid_hj_id in #{bidHjId}