shiyue hai 1 ano
pai
achega
a362cf3c53

+ 13 - 2
energy-manage-service/src/main/resources/mybatis/windrelation/WindRelationMapper.xml

@@ -55,8 +55,19 @@
         and wc.company_name like CONCAT("%", #{companyName} ,"%")
         </if>
         and wc.del_state = 0
-        and wc.company_code in (select code_number from sys_organization_auth where role_id =#{roleId} and code_type = 'company')
-        and wc.create_by = #{userId}
+        <if test="state!=null or companyName!=null">
+            and
+            wc.company_code in (select code_number from sys_organization_auth where role_id =#{roleId} and code_type = 'company')
+            and
+            wc.create_by = #{userId}
+        </if>
+        <if test="state==null and companyName==null">
+            and
+            wc.create_by = #{userId}
+            or
+            wc.company_code in (select code_number from sys_organization_auth where role_id =#{roleId} and code_type = 'company')
+
+        </if>
     </select>
 
     <select id="selectByCodeNumber" parameterType="java.lang.String" resultType="com.energy.manage.common.po.windrelation.WindRelationPO">