标签:
SELECT T1.REPAIRNO, T1.UNDERTAKER10, T3.FULLNAME AS RECEIVERNAME, T1.WALKDISTANCE, T1.STATUSCODEDATE10 AS RECEIVETIME, t8.REPAIRTYPE, T5.DELIVEREDDATE, CASE WHEN T2.REPAIRNO IS NULL THEN ‘否‘ ELSE ‘是‘ END ISINSURANCE, T2.FIXEDDATE, T4.FULLNAME AS CLAIMSNNAME, T2.TotalFee FROM RT_REPAIR T1 LEFT JOIN RT_INSURANCECLAIMS T2 ON T1.REPAIRNO = T2.REPAIRNO AND T1.FRAMENO = T2.FRAMENO LEFT JOIN CM_STAFF T3 ON T1.UNDERTAKER10 = T3.STAFFPKID LEFT JOIN CM_STAFF T4 ON T2.ClaimsID = T4.STAFFPKID LEFT JOIN RT_REPAIRPROCESS T5 ON T1.REPAIRNO = T5.REPAIRNO LEFT JOIN RT_CUSTOMERWISH T6 ON T1.REPAIRNO = T6.REPAIRNO LEFT JOIN RT_WORKCONTENT T7 ON T6.REPAIRNO = T7.REPAIRNO AND T6.WISHID = T7.WISHID LEFT JOIN RM_RepairType t8 ON t7.RepairTypeCode = t8.repairtypecode WHERE T1.FRAMENO = ‘LHGRB186982000004‘ AND STATUSCODE = ‘99‘ ORDER BY REPAIRNO DESC
标签:
原文地址:http://www.cnblogs.com/ShaYeBlog/p/4211813.html