from hygf_work_order_power_station LEFT join hygf_work_order
on hygf_work_order.sequence_nbr=hygf_work_order_power_station.work_order_id
from
hygf_work_order_power_station
LEFT join hygf_work_order 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}
...
...
@@ -300,6 +310,12 @@
<iftest="dto.province != null and dto.province != ''">
and hygf_peasant_household.project_address like concat(concat('%',#{dto.province}),'%')
</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>
</where>
ORDER BY
hygf_work_order_power_station.sequence_nbr DESC
...
...
@@ -314,6 +330,9 @@
LEFT JOIN hygf_peasant_household hph ON hph.sequence_nbr = hbga.peasant_household_id
LEFT JOIN hygf_on_grid_and_acceptance hogaa ON hogaa.work_order_power_station_id = hbga.work_order_power_station_id
LEFT JOIN hygf_work_order ON hygf_work_order.sequence_nbr = hbga.work_order_id
left join
(select work_order_power_station_id, MIN( operation_time ) as firstSubmitDate from hygf_construction_gird_records hcgr where operation_content = '提交并网资料' GROUP BY work_order_power_station_id)
newHcgr on newHcgr.work_order_power_station_id = hbga.work_order_power_station_id
<where>
hbga.is_delete = 0
...
...
@@ -350,6 +369,12 @@
<iftest="map.province != null and map.province != ''">
AND hph.project_address like concat(concat('%',#{map.province}),'%')
</if>
<iftest="map.startTime!=null and map.startTime!=''">
and newHcgr.firstSubmitDate >= #{map.startTime}
</if>
<iftest="map.endTime!=null and map.endTime!=''">
and newHcgr.firstSubmitDate <= #{map.endTime}
</if>
</where>
ORDER BY hbga.sequence_nbr desc
</select>
...
...
@@ -363,9 +388,11 @@
LEFT JOIN hygf_peasant_household hph ON hph.sequence_nbr = hbga.peasant_household_id
LEFT JOIN hygf_on_grid_and_acceptance hogaa ON hogaa.work_order_power_station_id = hbga.work_order_power_station_id
LEFT JOIN hygf_work_order ON hygf_work_order.sequence_nbr = hbga.work_order_id
left join
(select work_order_power_station_id, MIN( operation_time ) as firstSubmitDate from hygf_construction_acceptance_records where operation_content = '提交验收审核' GROUP BY work_order_power_station_id)
newHcar on newHcar.work_order_power_station_id = hbga.work_order_power_station_id
<where>
hbga.is_delete = 0
<iftest="map.amosDealerId!=null and map.amosDealerId!=''">
and hygf_work_order.amos_dealer_id = #{map.amosDealerId}
</if>
...
...
@@ -402,6 +429,12 @@
<iftest="map.province != null and map.province != ''">
AND hph.project_address like concat(concat('%',#{map.province}),'%')
</if>
<iftest="map.startTime!=null and map.startTime!=''">
AND newHcar.firstSubmitDate >= #{map.startTime}