2021与蓝度共同重构项目,服务端
fix
zhanzhiqin
2022-05-27 33ecbd69aca2ccc58d47f467f3f7266b37fa9dfc
dao/src/main/resources/mapper/LightMapper.xml
@@ -70,4 +70,28 @@
            </if>
        </where>
    </select>
    <select id="listLightOnBinding" resultType="com.sandu.ximon.dao.bo.LightBo">
        SELECT
        t1.*,
        t2.id AS pole_id,
        t2.pole_code,
        t2.pole_name,
        t4.task_name
        FROM
        light t1
        LEFT JOIN pole t2 USING ( device_code )
        LEFT JOIN light_task_pole_relation t3 ON t3.pole_id = t2.id
        LEFT JOIN light_task t4 ON t3.task_id = t4.task_id
        <where>
            <if test="clientId != null">
                AND (t2.user_id = #{clientId} OR t2.client_id = #{clientId})
            </if>
            <if test="keyword != null and keyword != ''">
                AND (
                t1.device_code LIKE CONCAT('%', #{keyword},'%')
                OR t1.light_id LIKE CONCAT('%', #{keyword},'%')
                )
            </if>
        </where>
    </select>
</mapper>