If a N×N (N≥3) Hermitian matrix A meets the following conditions:
- A is positive semi-definite (not positive definite, i.e. A has at least M zero eigenvalue, where M is a given paremeter with 1≤M≤N-1).
- The sum of each off diagonal results in 0, and the main diagonal elements are non-negative, which is shown in the figure (set N=4 as example).
Then what the general solution of A is?
For example, a particular solution of A can be $$ \begin{matrix} I_{M'} & 0 &\\ 0 & 0 \\ \end{matrix} $$ where M≤N-M'≤N-1. It is just a particular solution, I wonder what is the general solution under these two conditions.

I claim that your matrices can never be decomposed in such a way.
First, note that a decomposition of the form $ A = BB^\dagger$ is possible in general if and only if your Hermitian matrix $A$ is positive semi-definite.
You seem to require that every element of the main diagonal be zero. We can in fact weaken this condition to requiring the matrices be trace-free. Since all the eigenvalues of a Hermitian matrix are real, it follows that there must be at least one positive eigenvalue and at least one negative eigenvalue for any trace-free matrix (or else all eigenvalues could be zero, in which we have the zero matrix).
It follows that every non-zero trace-free Hermitian matrix is necessarily indefinite, and by definition, all your matrices are trace-free and hence indefinite. Therefore a decomposition of the form $A=BB^\dagger$ is never possible for your class of matrices.
Edit: In case the OP didn't mean for the diagonal to be zero the situation is still quite bleak. More general, let $S$ denote the set of all matrices whose non-main diagonals sum to zero.
First, note that $S$ is closed under negation, i.e., $A \in S$ if and only if $-A\in S$. This already tells us there cannot exist a decomposition for every element of $S$, and more assumptions are required.
Another way to see this is that Sylvester's criterion requires that all of the main diagonal elements be non-negative for there to even be a chance for the matrix to be positive semi-definite. So if the main diagonal were unrestricted, any negative element on the diagonal would invalidate the existence of the required decomposition.
The general conclusion is that without further assumptions, no, such a decomposition need not exist.