select msgtitle,
sum(decode(issend,0,nvl(num,0),0)) as notsend,
sum(decode(issend,1,nvl(num,0),0)) as success,
sum(decode(issend,2,nvl(num,0),0)) as failed
from
(
select st.msgtitle,sd.issend ,count(-1) as num
from sys_msg_send sd
inner join sys_msg_set st
on st.msgflag = sd.msgflag
where addtime between to_date('${bgtime} 00:00:00', 'yyyy-MM-dd HH24:mi:ss') and to_date('${endtime} 23:59:59', 'yyyy-MM-dd HH24:mi:ss')
<if test="msgtitle!=null and msgtitle!=''">
and msgtitle like '%${msgtitle}%'
<span style="white-space:pre"> </span></if>
group by st.msgtitle,sd.issend
)t group by t.msgtitle
Count按条件查询
最新推荐文章于 2023-07-10 14:44:49 发布