select
,count( DISTINCT l.data_id) as total ,sum(if(l.abnormal & 1 = 1, 1, 0)) abnormal, sum(if(l.abnormal & 1=0, 1, 0)) success,
COUNT(DISTINCT CASE WHEN l.org_code LIKE 'H%' THEN l.org_code END) AS medical_institution_count,
COUNT(DISTINCT CASE WHEN l.org_code LIKE 'P%' THEN l.org_code END) AS retail_pharmacy_count,
COUNT(DISTINCT l.org_code) AS total_institutions,
sum(ifnull(l.gb_node_num, 0) + ifnull(l.js_node_num, 0) + ifnull(l.qt_node_num, 0)+ifnull(l.bl_node_num, 0)+ifnull(l.zs_node_num,0)) AS total_node_count,
sum(ifnull(l.call_error_tc,0)) AS total_error_count
, SUBSTR(#{condition.startTime}, 1, 10) as start_time
, SUBSTR(#{condition.endTime}, 1, 10) as end_time
FROM
interface_call_log l
where l.outside = 0
AND l.data_source & 1 = 1
AND (l.abnormal & 1 IN(0, 1))
and l.division_code like #{condition.divisionCode}
and (
l.division_code like '${item}'
)
and l.interface_code in
#{item}
AND l.rev_admdv_code LIKE CONCAT( SUBSTR(#{condition.divisionCode}, 1, 2 ), '%' )
and l.date_time = ]]> #{condition.startTimeStr}
and l.date_time #{condition.endTimeStr}
and l.system_id = #{condition.systemId}
and l.org_code like #{condition.orgType}
group by
报错信息:Caused by: java.sql.SQLException: errCode = 2, detailMessage = Unexpected exception: Implicit casts should never throw analysis exception. 不是每次报错 时间范围查询多点数据会报。感觉和优化器有关系。