(select hygf_rectification_order.rectification_history from hygf_rectification_order
where hygf_rectification_order.peasant_househole_id = hygf_work_order_power_station.peasant_household_id
and hygf_rectification_order.rectification_status = '待整改' and hygf_rectification_order.rectification_source = hygf_work_order_power_station.work_order_power_station_node and hygf_rectification_order.rectification_source in ('area','engineering','design') ) as auditIdea,
...
...
@@ -101,10 +102,19 @@
on hygf_work_order.sequence_nbr=hygf_work_order_power_station.work_order_id
LEFT JOIN hygf_peasant_household on hygf_peasant_household.sequence_nbr=hygf_work_order_power_station.peasant_household_id
LEFT JOIN hygf_power_station_engineering_info on hygf_power_station_engineering_info.work_order_power_station_id=hygf_work_order_power_station.sequence_nbr
LEFT JOIN (
SELECT work_order_power_station_id, MIN( operation_time ) as firstConstructionDate FROM hygf_construction_records WHERE operation_content = '编辑施工资料' GROUP BY work_order_power_station_id
) newHcr ON newHcr.work_order_power_station_id = hygf_work_order_power_station.sequence_nbr
<where>
<iftest="dto.workOrderId!=null and dto.workOrderId!=''">
and hygf_work_order.sequence_nbr = #{dto.workOrderId}
</if>
<iftest="dto.startTime!=null and dto.startTime!=''">
and newHcr.firstConstructionDate >= #{dto.startTime}
</if>
<iftest="dto.endTime!=null and dto.endTime!=''">
and newHcr.firstConstructionDate <= #{dto.endTime}
</if>
<iftest=' dto.type!=null and dto.type == "1"'>
and hygf_work_order_power_station.power_station_construction_status in ('待登记','未通过','已完工','待审核')