<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.WorkOrderPowerStationMapper">

    <select id="selectPeasantHousehold" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold">

    SELECT
        hygf_peasant_household.*,
        hygf_peasant_household.sequence_nbr stationId
    FROM
        hygf_work_order_power_station
        LEFT JOIN hygf_peasant_household ON hygf_work_order_power_station.peasant_household_id = hygf_peasant_household.sequence_nbr
    WHERE
        hygf_work_order_power_station.work_order_id=#{sequenceNbr}
        <if test="ownersName!=null and ownersName!=''">
            and hygf_peasant_household.owners_name like concat(concat('%',#{ownersName}),'%')
        </if>

    </select>



</mapper>
