dao/src/main/resources/mapper/LightMapper.xml
@@ -46,4 +46,16 @@ </if> </where> </select> <select id="listCode" resultType="java.lang.String"> SELECT t1.device_code FROM light t1 LEFT JOIN pole t2 USING ( device_code ) <where> <if test="clientId != null"> AND (t2.user_id = #{clientId} OR t2.client_id = #{clientId}) </if> </where> </select> </mapper>