DELETE FROM CellTemplateConfig a WHERE a.ID in(SELECT b.ID FROM CellTemplateConfig b INNER JOIN CellTemplate c on b.CellTemplateID=c.ID WHERE c.ReportTemplateID=#{templateDbID,jdbcType=VARCHAR})
DELETE FROM KeyValueReference a WHERE a.ID in(SELECT b.ID FROM KeyValueReference b INNER JOIN CellTemplate c on b.CellTemplateID=c.ID WHERE c.ReportTemplateID=#{templateDbID,jdbcType=VARCHAR})
SELECT q.Name FROM OrganizationServiceTemplateGroup p LEFT JOIN Organization q on p.OrganizationID=q.ID WHERE p.TemplateGroupID=#{templateGroupDtoID,jdbcType:VARCHAR} AND q.IsActive=1