select count(1) from msg_web_push where status = 1
and receive_by = #{userId}
select b.*, a.push_id as msgId
from msg_web_push AS a
join msg_alarm AS b on a.alarm_id = b.alarm_id
where a.status = 1
and a.receive_by = #{userId}
select b.*, a.status, a.push_id as msgId
from msg_web_push AS a
join msg_alarm AS b on a.alarm_id = b.alarm_id
join base_camera_management AS c on b.camera_code = c.camera_code
and a.receive_by = #{userId}
and a.status = #{status}
and b.alarm_type = #{alarmType}
and b.alarm_time >= #{beginAlarmTime}
and b.alarm_time <= #{endAlarmTime}
and b.is_lock = #{isLock}
and c.railway_code = #{railwayCode}
and c.begin_mile >= #{beginMile}
and c.end_mile <= #{endMile}
select count(1) count, SUM(CASE status WHEN '1' THEN 1 ELSE 0 end) AS 'noCount' from msg_web_push
and receive_by = #{userId}
update msg_web_push
status = #{status}
and push_id = #{pushId}
and id = #{id}
update msg_web_push
status = 2
where receive_by = #{userId} and status = 1