2021与蓝度共同重构项目,服务端
zhanzhiqin
2022-04-18 f2dfd5e6fbbb9c4e96e91c86be0bb6f7a44d87c3
dao/src/main/resources/mapper/LedPlayerEntityMapper.xml
@@ -22,4 +22,25 @@
        insert into led (player_name, player_id, sn, create_timestamp)
        values (#{playerName}, #{playerId}, #{sn}, #{createTimestamp})
    </insert>
    <select id="ledPlayerEntityList" resultType="com.sandu.ximon.dao.domain.LedPlayerEntity">
        SELECT
        t1.*, t2.pole_id,
        t3.pole_name, t3.id
        FROM
        led t1
        LEFT JOIN pole_binding t2 ON t1.sn = t2.device_code
        AND t2.device_type = 1
        LEFT JOIN pole t3 ON t3.id = t2.pole_id
        <where>
            <if test="keyword != null and keyword != ''">
                AND t1.name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
                OR t1.sn LIKE CONCAT(CONCAT('%', #{keyword}), '%')
                OR t1.id LIKE CONCAT(CONCAT('%', #{keyword}), '%')
            </if>
            <if test="userid != null">
                AND (t3.user_id = #{userid} OR t3.client_id = #{userid})
            </if>
        </where>
    </select>
</mapper>