<select id="queryPharmacyVisitIds" resultMap="queryProductAndPharmacyVisit">SELECT
tp.product_id,
tp.start_date,
tp.end_date,
tpv.pharmacy_visit_id
FROM
tb_promote_task_pharmacy AS tp
LEFTJOIN tb_promote_task_pharmacy_visit AS tpv ON tpv.promote_task_pharmacy_id = tp.id
WHERE
tp.task_item_id =#{taskItemId}</select>