id
,player_name,player_id,
sn,create_timestamp
insert into led (player_name, player_id, sn, create_timestamp)
values (#{playerName}, #{playerId}, #{sn}, #{createTimestamp})
SELECT
t1.*,
t2.pole_id,
t3.pole_name
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
1=1
AND t1.name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
OR t1.sn LIKE CONCAT(CONCAT('%', #{keyword}), '%')
OR t1.id LIKE CONCAT(CONCAT('%', #{keyword}), '%')
AND (t3.user_id = #{userId} OR t3.client_id = #{userId})
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
AND t1.name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
OR t1.player_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
OR t1.sn LIKE CONCAT(CONCAT('%', #{keyword}), '%')
OR t1.id LIKE CONCAT(CONCAT('%', #{keyword}), '%')
AND (t3.user_id = #{userid} OR t3.client_id = #{userid})
SELECT
t1.*
FROM
led t1
INNER JOIN led_nova_group_relation t2 ON t1.id = t2.nova_id
LEFT JOIN led_nova_group t3 ON t3.group_id = t2.nova_group_id
WHERE
t3.group_id=#{groupId}
AND (t2.user_id = #{clientId} OR t2.client_id = #{clientId})
SELECT
t1.*,
t2.pole_id,
t3.pole_name
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
LEFT JOIN led_nova_group_relation t4 ON t4.nova_id = t1.id
LEFT JOIN led_nova_group t5 ON t5.group_id = t4.nova_group_id
1=1
AND t5.group_id=#{groupId}
AND t1.name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
OR t1.sn LIKE CONCAT(CONCAT('%', #{keyword}), '%')
OR t1.id LIKE CONCAT(CONCAT('%', #{keyword}), '%')
AND (t3.user_id = #{userId} OR t3.client_id = #{userId})
GROUP BY t1.id