I have created two tables as,

Dashboard_T is master table which will have all the dashboard with all roles which are allowed to this dashboard.

DashboardSettings_T which will have dashboard allocated to the user with his responsible offices, certifying offices & modules assigned to the user.

How i will generate dynamic query to find the count(for no. of records) & no of records for user who is logged in & belongs to the items he is assigned in Dashboard_T & DasboardSettings_T tables using parameters.