| | |
| | | t1.device_code |
| | | FROM |
| | | light t1 |
| | | LEFT JOIN pole t2 USING ( device_code ) |
| | | LEFT JOIN pole t2 ON t1.device_code = t2.device_code |
| | | <where> |
| | | <if test="clientId != null"> |
| | | AND (t2.user_id = #{clientId} OR t2.client_id = #{clientId}) |
| | | <if test="userId != null"> |
| | | AND (t2.user_id = #{userId} OR t2.client_id = #{userId}) |
| | | </if> |
| | | <if test="keyword != null and keyword != ''"> |
| | | AND ( |
| | |
| | | OR t2.pole_name LIKE CONCAT('%', #{keyword},'%') |
| | | ) |
| | | </if> |
| | | <if test="deviceCode != null"> |
| | | <if test="deviceCode != null and deviceCode!= ''"> |
| | | AND t2.device_code = #{deviceCode} |
| | | </if> |
| | | </where> |