SELECT
p.id AS id,
p.public_key_name AS publicKeyName,
p.upload_account AS uploadAccount,
h. NAME AS channelName,
p.upload_time AS uploadTime,
p.remark AS remark
FROM
public_key p
LEFT JOIN channel_publickey_relation c ON p.id = c.publickey_id
AND c.`status` = 1
LEFT JOIN channel h ON c.channel_id = h.id
AND h.del_status = 0
WHERE
p.upload_account LIKE concat(#{upload_account},'%')
AND p. STATUS = 1
联表查询, 限定条件要放在后面......否则会有null的信息