中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

SQL 獲取數據

發布時間:2020-06-06 23:55:16 來源:網絡 閱讀:323 作者:TIANYUKAI 欄目:MySQL數據庫

SELECT

         COMPLAIN_CODE '投訴單號',

         ORDER_NO '訂單號',

         RESPONSIBILITY '責任單位名稱',

         CREATE_TIME '創建時間',

         COMPLAIN_TYPE '發起工單類型',

  DUTY_COMPLAIN_TYPE '定責投訴類型',

         COMPLAIN_SOUND_TYPE '聲音歸類',

         COMPLAIN_DATE '投訴日期',

         MEMO '情況說明',

  HANDLER1 "發起人工號",

  HANDLER2 "結束人工號",

  HANDLER_DATE1 "投訴開始時間",

  HANDLER_DATE2 "投訴結束時間",

         HANDLER_TYPE '處理類型',

         EOOR_SHIPPER_CONTACT '收貨方聯系人',

         EOOR_SHIPPER_CITY_NAME '發貨地址城市',

         EOOR_CONSIGNEE_CITY_NAME '收貨地址城市',

         EOOR_ORDER_TYPE '訂單類型',

         SEND_DATE '發貨時間',

         EOOR_SERVICE_MODE '服務類型',

         EOOS_SUPPLIER_FULL_NAME1'供應商全名',

         EOTS_LINK_TYPE '落地配'

FROM

 

         (

                   SELECT

                            t.COMPLAIN_CODE,

                            t.ORDER_NO,

                            t.RESPONSIBILITY,

                            t.CREATE_TIME,

                            CASE t.COMPLAIN_TYPE

                   WHEN 'SAFETY' THEN

                            '安全類'

                   WHEN 'CUSTOMER' THEN

                            '客戶類'

                   WHEN 'AGEING' THEN

                            '時效類'

                   WHEN 'ACTION' THEN

                            '客戶體驗類'

                   WHEN 'DELIVERY' THEN

                            '配送類'

                   ELSE

                            '貨代業務線上化'

                   END 'COMPLAIN_TYPE',

                   t.COMPLAIN_SOUND_TYPE,

                   t.COMPLAIN_DATE,

                   t.MEMO,

                   t.DUTY_COMPLAIN_TYPE,

                   b. HANDLER 'HANDLER1',

                   b.HANDLER_TYPE,

                   c.EOOR_SHIPPER_CONTACT,

                   c.EOOR_SHIPPER_CITY_NAME,

                   c.EOOR_CONSIGNEE_CITY_NAME,

                   c.EOOR_ORDER_TYPE,

                   c.SEND_DATE,

                   c.EOOR_SERVICE_MODE,

                   d.EOOS_SUPPLIER_FULL_NAME 'EOOS_SUPPLIER_FULL_NAME1',

    CASE e.EOTS_LINK_TYPE

    when '21' THEN '收貨'

                   when '22' THEN '配單'

                   when '23' THEN '發貨'

                   when '24' THEN '裝機'

                   when '51' THEN '提貨主單'

                   when '61' THEN '提貨訂單'

                   when '62' THEN '貨代簽收'

                   when '71' THEN '落地配交接'

                   when '72' THEN '落地配分配'

    ELSE

         '落地配簽收'

    END 'EOTS_LINK_TYPE',

                   min(b.HANDLER_DATE) 'HANDLER_DATE1'

         FROM

                   cs_complained_info t

         LEFT JOIN cs_complained_handle_record b ON b. CODE = t.COMPLAIN_CODE

         LEFT JOIN eo_order c ON c.EOOR_ORDER_NO = t.ORDER_NO

         LEFT JOIN eo_order_supplier d ON d.EOOS_ORDER_NO = t.ORDER_NO

         LEFT JOIN eo_order_task_status e ON e.EOOR_ORDER_NO = t.ORDER_NO

         WHERE

                   t.HANDLE_STATUS = "DONE"

         AND T.ORDER_NO != " "  

  AND t.CREATE_TIME > "2017-1-1"

         GROUP BY

                   t.COMPLAIN_CODE

         ) AS A

LEFT JOIN (

         SELECT

  t.COMPLAIN_CODE 'COMPLAIN_CODE2',

         b. HANDLER 'HANDLER2',

         max(b.HANDLER_DATE) 'HANDLER_DATE2'

FROM

         cs_complained_info t

LEFT JOIN cs_complained_handle_record b ON b. CODE = t.COMPLAIN_CODE

LEFT JOIN eo_order c ON c.EOOR_ORDER_NO = t.ORDER_NO

LEFT JOIN eo_order_supplier d ON d.EOOS_ORDER_NO = t.ORDER_NO

LEFT JOIN eo_order_task_status e ON e.EOOR_ORDER_NO = t.ORDER_NO

WHERE

         t.HANDLE_STATUS = "DONE"

AND b.HANDLER_RESULT = "FINISH"

AND T.ORDER_NO != " "

AND t.CREATE_TIME > "2017-1-1"

GROUP BY

         t.COMPLAIN_CODE

) AS B ON A.COMPLAIN_CODE = B.COMPLAIN_CODE2

ORDER BY COMPLAIN_CODE DESC


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

延川县| 宁强县| 阜新| 闵行区| 玛沁县| 车险| 依安县| 龙井市| 富顺县| 蕲春县| 许昌市| 东海县| 合水县| 临邑县| 都昌县| 昌都县| 临湘市| 杨浦区| 桑植县| 历史| 新建县| 安泽县| 嘉禾县| 策勒县| 南康市| 子长县| 肥乡县| 江西省| 竹山县| 汕头市| 屏山县| 六枝特区| 大洼县| 辽阳县| 东丰县| 营口市| 胶南市| 双城市| 家居| 云龙县| 东阳市|