(SELECT count(*) from hygf_work_order_power_station where hygf_work_order_power_station.work_order_id = hygf_work_order.sequence_nbr ) peasantHouseholdNum,
(SELECT count(*) from hygf_work_order_power_station where hygf_work_order_power_station.work_order_id = hygf_work_order.sequence_nbr
and hygf_work_order_power_station.power_station_construction_status in ("待登记","未通过","已完工","待审核")
) peasantHouseholdSgNum
FROM hygf_work_order WHERE hygf_work_order.is_delete=0
<iftest="dto.workOrderNum!=null and dto.workOrderNum!=''">
and hygf_work_order.work_order_num like concat(concat("%",#{dto.workOrderNum}),"%")
</if>
<iftest="dto.projectRegionManager!=null and dto.projectRegionManager!=''">
and hygf_work_order.project_region_manager like concat(concat("%",#{dto.projectRegionManager}),"%")
</if>
<iftest="dto.workOrderStatus!=null and dto.workOrderStatus!=''">
and hygf_work_order.work_order_status=#{dto.workOrderStatus}
</if>
<iftest="dto.amosDealerId!=null and dto.amosDealerId!=''">
and hygf_work_order.amos_dealer_id = #{dto.amosDealerId}
</if>
<iftest="dto.regionCompanyId!=null and dto.regionCompanyId!=''">
and hygf_work_order.region_company_id =#{dto.regionCompanyId}