SELECT mms_sample_datas.* from mms_sample_datas where mms_sample_datas.mms_id in (
SELECT
mms_sample_datas.mms_id
FROM
mms_sample_datas
INNER JOIN mms_text_datas ON mms_sample_datas.uuid = mms_text_datas.mms_uuid
AND mms_text_datas.is_repair_audit =
UNION
SELECT
mms_sample_datas.mms_id
FROM
mms_sample_datas
INNER JOIN mms_pic_datas ON mms_sample_datas.uuid = mms_pic_datas.mms_uuid
AND mms_pic_datas.is_repair_audit =
)