Get Post By post_name

$post_name = 'my-post';

$querystr = 'SELECT * FROM "wp_posts" WHERE "post_name" = "' $post_name . '"';

$results = $wpdb->get_results($querystr, OBJECT);


if(!empty($results)) {
	foreach ($results as $result) {
		// do your magic
		break;
	}
} else {
	echo 'post '. $post_name . ' was not found.';
}

// see: https://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query

Add Template File to a Post Using Shortcode

// read file
function include_template_file ($template_path=null) {
	if($template_path == null)
		return '';
	ob_start();
    load_template( get_template_directory() .'/'. $template_path );
	$content = ob_get_contents();
	ob_end_clean();
	return $content;
}

// shortcode code
function include_template_shortcode($atts, $content=''){
	 extract( shortcode_atts( array(
	      'path' => null
     ), $atts ) );
	return include_template_file($path);
}

add_shortcode( 'include_template', 'include_template_shortcode' );

// Example:
// [include_template path='assets/my-file.php']