( SELECT IF ( COUNT( 1 )> 0, 1, 0 ) FROM t_dsa_analysis_batch_unit_device_transfinite WHERE analysis_batch_unit_device_id = t1.id AND is_work = 1 ) AS is_work,
( SELECT IF ( COUNT( 1 )> 0, 1, 0 ) FROM t_dsa_analysis_batch_unit_device_transfinite WHERE analysis_batch_unit_device_id = t1.id ) AS is_transfinite,
( SELECT IF ( COUNT( 1 )> 0, 1, 0 ) FROM t_mw_work_batch_detail WHERE analysis_batch_unit_device_id = t1.id LIMIT 1 ) AS work_status
FROM
t_dsa_analysis_batch_unit_device t1
WHERE
t1.analysis_batch_id = #{analysisBatchCode}
) analysis
LEFT JOIN t_dsa_analysis_batch_unit_device_transfinite t2 ON t2.analysis_batch_unit_device_id = analysis.id