How to assemble statements in exec sp_executesql

I successfully run the following sql statement to find the ideal data

exec sp_executesql N"Select * FROM FC_Repair WHERE  
        F_RepairDepartmentId in 
        (  
            ""ace7f0e7-f158-4587-920d-e76546885198"",""bf421a22-786b-40fd-8afc-c3e5e2364901"" 
        )  "
After

is changed to parametric type, no data can be found. If you modify the following sql statement, please.
this is a sql statement generated after querying with dapper DynamicParameters dynamic parameters, so how about finding a better solution without changing the original sql format?

exec sp_executesql N"Select * FROM FC_Repair WHERE  
        F_RepairDepartmentId in 
        (  
            @F_RepairDepartmentId0 
        )  ", 
N"@F_RepairDepartmentId0 nvarchar(4000)",
@F_RepairDepartmentId0=
N"""ace7f0e7-f158-4587-920d-e76546885198"",""bf421a22-786b-40fd-8afc-c3e5e2364901"" "

The statement in

IN really can't be written like you do. In any case, @ F_RepairDepartmentId0 is interpreted as a single string.
for IN, you need to change it to string concatenation sql, as follows:

DECLARE @sql NVARCHAR(4000);
DECLARE @F_RepairDepartmentId0 NVARCHAR(3000);
SET @F_RepairDepartmentId0 = N'''ace7f0e7-f158-4587-920 D -e76546885198'', ''bf421a22-786b-40fd-8afc-c3e5e2364901''';
SET @sql = N'SELECT *
                       FROM FC_Repair
                       WHERE
                         F_RepairDepartmentId IN
                         (' + @F_RepairDepartmentId0 + ')';

EXEC sp_executesql @sql
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e7d5d6-46715.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e7d5d6-46715.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?