From a in mm_xxzx
Where. cjrid = 1 & (. djlx = 0 |. djlx = 1 |. djlx = 5 |. djlx = 6 |. djlx = 7)
Orderby A. djlx
Select New
{
Xxlxmc = A. djlx = 0? "Repair Plan": (A. djlx = 1? "Repair task list": (A. djlx = 2? "Spare parts warehouse receiving ticket": (A. djlx = 3? "Spare parts warehouse picking ticket": "Spare Parts Plan "))),
Bm = A. bm,
MS = A. ms,
Ztmc =
(A. zt = 0 & A. djlx = 0? "New": (A. zt = 1 & A. djlx = 0? "Workshop approval": (A. zt = 2 & A. djlx = 0? "Factory approval": (A. zt = 3 & A. djlx = 0? "Complete ":
(A. zt = 0 & A. djlx = 1? "New": (A. zt = 1 & A. djlx = 1? "To be accepted": (A. zt = 2 & A. djlx = 1? "Accepted": (A. zt = 3 & A. djlx = 1? "Waiting for Repair ":
(A. zt = 0 & A. djlx = 5? "New": (A. zt = 1 & A. djlx = 5? "Custodian approval": (A. zt = 2 & A. djlx = 5? "Completed": "expired "))))))))))),
Jsrxm = A. jsrxm
}
the SQL stored procedure is converted to a LINQ statement. Because case when is too long, an error is returned: "sqlexception: The Case expression can only be nested into 10 layers ." No good solution yet!