2021与蓝度共同重构项目,服务端
liuhaonan
2022-11-18 385b687cc1a0a8f6de2320af6b6e0d654cd658ed
dao/src/main/resources/mapper/NewNovaLedMapper.xml
@@ -29,15 +29,34 @@
        LEFT JOIN pole_binding t2 ON t1.sn = t2.device_code
        AND t2.device_type = 12
        LEFT JOIN pole t3 ON t2.pole_id = t3.id
        LEFT JOIN new_nova_group_relation t4 ON t4.nova_id = t1.id
        LEFT JOIN new_nova_group t5 ON t5.group_id = t4.nova_group_id
        <where>
            1=1
            <if test="groupId != null">
                AND t5.group_id=#{groupId}
            </if>
            <if test="keyword != null and keyword != ''">
                AND t1.name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
                OR t1.sn LIKE CONCAT(CONCAT('%', #{keyword}), '%')
                AND (t1.name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
                OR t1.sn LIKE CONCAT(CONCAT('%', #{keyword}), '%'))
            </if>
            <if test="userId != null">
                AND (t3.user_id = #{userId} OR t3.client_id = #{userId})
            </if>
        </where>
        GROUP BY t1.id
    </select>
    <select id="getListByGroupId" resultType="com.sandu.ximon.dao.bo.NewNovaGroupListBo">
        SELECT
        t1.*
        FROM
        new_nova_led t1
        INNER JOIN new_nova_group_relation t2 ON t1.id = t2.nova_id
        LEFT JOIN new_nova_group t3 ON t3.group_id = t2.nova_group_id
        WHERE
        t3.group_id=#{groupId}
        <if test="clientId != null">
            AND (t3.user_id = #{clientId} OR t3.client_id = #{clientId})
        </if>
    </select>
</mapper>