<?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.njcn.device.pms.mapper.majornetwork.PowerGenerationUserMapper">



    <select id="getPowerGenerationUserSelect" resultType="com.njcn.device.pms.pojo.vo.PowerGenerationUserVO">
        select
        pms_power_generation_user.id,
        pms_power_generation_user.name,
        pms_power_generation_user.org_name,
        pms_power_generation_user.org_id,
        pms_power_distributionarea.id platformId,
        pms_power_distributionarea.name platformName

        from pms_power_generation_user pms_power_generation_user
        left join pms_power_distributionarea pms_power_distributionarea on pms_power_generation_user.Platform_Id =
        pms_power_distributionarea.id
        where pms_power_generation_user.status = 1
        and pms_power_distributionarea.status = 1
        <if test="orgIds!=null and orgIds.size!=0">
            and pms_power_generation_user.org_id in
            <foreach collection="orgIds" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="id !=null and id!='' ">
          and  pms_power_generation_user.id like CONCAT(CONCAT('%', #{id}), '%')
        </if>
    </select>
</mapper>
