add alarm sql query functions, use Deisgn repainter alarm widget