" left join (select danger_id ,GROUP_CONCAT(inspect_name SEPARATOR '@') 'inspect_content' from danger_inspect_info group by danger_id)aaa on aaa.danger_id = t.id "+
" left join (select danger_id, count(id) 'inspection_num' from danger_inspection_record group by danger_id)bbb on bbb.danger_id = t.id "+
" left join (select danger_id, count(id) 'rectification_num' from ajh_rectification_info group by danger_id)ccc on ccc.danger_id = t.id ${ew.customSqlSegment}")
select ifnull(aaa.inspect_content,'') inspect_content, ifnull(bbb.inspection_num,0) inspection_num, ifnull(ccc.rectification_num,0) 'rectification_num', t.* from danger_level_manage t
left join (select danger_id ,GROUP_CONCAT(inspect_name SEPARATOR '@') 'inspect_content' from danger_inspect_info group by danger_id)aaa on aaa.danger_id = t.id
left join (select danger_id, count(id) 'inspection_num' from danger_inspection_record group by danger_id)bbb on bbb.danger_id = t.id
left join (select danger_id, count(id) 'rectification_num' from ajh_rectification_info group by danger_id)ccc on ccc.danger_id = t.id
<where>
<iftest="param.departId != null and param.departId != ''"> and t.depart_id = #{param.departId}</if>
<iftest="param.dangerType != null and param.dangerType != ''"> and t.danger_type = #{param.dangerType}</if>
<iftest="param.dangerName != null and param.dangerName != ''"> and t.danger_name like concat('%', #{param.dangerName}, '%')</if>
<iftest="param.dangerContent != null and param.dangerContent != ''"> and t.danger_content = #{param.dangerContent}</if>
<iftest="param.dangerStandard != null and param.dangerStandard != ''"> and t.danger_standard = #{param.dangerStandard}</if>
<iftest="param.dangerLevel != null and param.dangerLevel != ''"> and t.danger_level = #{param.dangerLevel}</if>
<iftest="param.dangerResult != null and param.dangerResult != ''"> and t.danger_result = #{param.dangerResult}</if>
<iftest="param.dangerWay != null and param.dangerWay != ''"> and t.danger_way = #{param.dangerWay}</if>
<iftest="param.dangerRank != null and param.dangerRank != ''"> and t.danger_rank = #{param.dangerRank}</if>
<iftest="param.dangerDept != null and param.dangerDept != ''"> and t.danger_dept = #{param.dangerDept}</if>
<iftest="param.dangerUser != null and param.dangerUser != ''"> and t.danger_user = #{param.dangerUser}</if>
<iftest="param.dangerFour != null and param.dangerFour != ''"> and t.danger_four = #{param.dangerFour}</if>
<iftest="param.dangerPlace != null and param.dangerPlace != ''"> and t.danger_place = #{param.dangerPlace}</if>
<iftest="param.equipInfoId != null and param.equipInfoId != ''"> and t.equip_info_id = #{param.equipInfoId}</if>
<iftest="param.share != null and param.share != ''"> and share = #{param.share}</if>
<iftest="param.frequency != null and param.frequency != ''"> and frequency = #{param.frequency}</if>