Commit cdb0f6be authored by 朱晨阳's avatar 朱晨阳

施工电站列表数据重复问题修改

parent fbef9421
...@@ -23,10 +23,8 @@ ...@@ -23,10 +23,8 @@
ps.work_order_id = hygf_work_order.sequence_nbr ps.work_order_id = hygf_work_order.sequence_nbr
) as ownersName ) as ownersName
FROM hygf_work_order, hygf_work_order_power_station, hygf_peasant_household FROM hygf_work_order
WHERE hygf_work_order.is_delete=0 WHERE hygf_work_order.is_delete=0
and hygf_work_order_power_station.work_order_id = hygf_work_order.sequence_nbr
and hygf_peasant_household.sequence_nbr = hygf_work_order_power_station.peasant_household_id
<if test="dto.workOrderNum!=null and dto.workOrderNum!=''"> <if test="dto.workOrderNum!=null and dto.workOrderNum!=''">
and hygf_work_order.work_order_num like concat(concat('%',#{dto.workOrderNum}),'%') and hygf_work_order.work_order_num like concat(concat('%',#{dto.workOrderNum}),'%')
</if> </if>
...@@ -43,7 +41,15 @@ ...@@ -43,7 +41,15 @@
and hygf_work_order.region_company_id =#{dto.regionCompanyId} and hygf_work_order.region_company_id =#{dto.regionCompanyId}
</if> </if>
<if test="dto.ownersName!=null and dto.ownersName!=''"> <if test="dto.ownersName!=null and dto.ownersName!=''">
and hygf_peasant_household.owners_name like concat ('%',#{dto.ownersName},'%') and (
SELECT
GROUP_CONCAT( owners_name ORDER BY owners_name ASC SEPARATOR ', ' ) AS ownersName
FROM
hygf_work_order_power_station ps
LEFT JOIN hygf_peasant_household ph ON ps.peasant_household_id = ph.sequence_nbr
WHERE
ps.work_order_id = hygf_work_order.sequence_nbr
) like concat ('%',#{dto.ownersName},'%')
</if> </if>
ORDER BY ORDER BY
hygf_work_order.rec_date DESC, hygf_work_order.rec_date DESC,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment