RepairDownloadMapper.xml 6.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.zfire.jiasm.syncdata.dao.mapper.RepairDownloadMapper">
  4. <select id="getOrderBase" parameterType="com.zfire.jiasm.syncdata.parameter.OrderPar" resultType="com.zfire.jiasm.syncdata.plus.entity.OrderBase">
  5. select a.pgid,a.pgguid,'REPAIR' as order_type,c.order_state as order_status,d.order_state as last_order_status,
  6. a.dqjdsj as order_status_time,IFNULL(a.yxji,'1') as priority,a.xjwdsj as dispatch_time,
  7. a.xjwdsj as dispatch_websit_time,a.yhmc as user_name,a.yddh as user_mobile,
  8. a.yddh2 as user_mobile2,a.yhsx as user_attr,a.quhao as area_code,a.dhhm as tel_phone,
  9. a.fjhm as gree_virtualnumber,a.email,a.vip,
  10. a.sfen as province,a.cshi as city,a.xian as area,a.xzhen as street,
  11. a.sfenid as province_id,a.cshiid as city_id,a.xianid as area_id,a.xzhenid as street_id,
  12. a.dizi as address,IFNULL(a.gpsdzxx,'') as gps_address,
  13. a.xxlb as info_type,a.beiz as remark,a.gdhao as file_no,e.dict_code as main_id,e.dict_value as main_name,
  14. f.dict_code as service_category_id,f.dict_value as service_category_name,
  15. if((a.wxwdno='' or wxwdno is null),IFNULL(a.xjwdno,''),a.wxwdno) as websit_id,a.wxwdmc as websit_name,
  16. a.xjwdno as rece_websit_id,a.xjwdmc as rece_websit_name,
  17. a.cjwdno as create_websit_id,'' as create_websit_name,
  18. a.xswdno as sale_websit_id,a.xswdmc as sale_websit_name,
  19. a.zjczwd as last_operator_websit,a.zjczwdxtbh as sys_websit_number,
  20. a.xxqdid as info_channel_id,ifnull(a.xxqd,'') as info_channel,a.xxlyid as info_source_id,ifnull(a.xxly,'') as info_source,
  21. a.ssqy as region,a.zxhao as seat_no,a.xsdh as external_pk,
  22. a.bjustat as bjy_check_status,a.yhqwsmsj as expect_start_time,a.qwsmjssj as expect_end_time,a.cjwdno as create_sys,
  23. a.last_modified_by as last_operator_by,IFNULL(a.zjczsj,a.last_modified_date) as last_operator_time,
  24. a.yhqwsmsj as appointment_time,a.azsl as total_num,a.wwsl as undone_num,a.xsdh as sale_no,
  25. a.xsorsh as data_push_attr,
  26. a.jindu as lng,a.weidu as lat,a.wcsj as over_time,a.cjdt as create_time,a.cjren as create_by,a.cjrmc as create_name,
  27. IFNULL(a.last_modified_date,a.zjczsj) as update_time,a.last_modified_by as update_by,a.wxrenid as dispatch_flag,1 as upload_flag,
  28. a.xjwdsj as rece_time,a.xjwdsj as worker_rece_time,a.xxlbid as info_type_id,
  29. a.yhsxid as user_attr_id,a.qqlymc as external_name2,a.qqlyxh as external_no,a.wxcount as out_wxcount,
  30. case a.tsdengji when '一级投诉' then 'FIRST'
  31. when '二级投诉' then 'SECOND'
  32. when '三级投诉' then 'THIRD'
  33. when '特级投诉' then 'SUPER' else 'NO' end as complaint,
  34. case when a.spid=102 then '商用' when a.spid=109 then '商用' else '家用' end as service_flag
  35. from itf_tbl_assign_download a
  36. left join order_state_contrast c on c.brand_order_state=a.stat and c.state_type=60 and c.brand_id = #{request.brandId}
  37. left join order_state_contrast d on d.brand_order_state=a.qystat and d.state_type=60 and d.brand_id = #{request.brandId}
  38. left join sys_dict_ref e on e.ref_dict_code=a.spid and e.brand_id = #{request.brandId} and e.dict_type='MAIN_TYPE'
  39. left join sys_dict f on f.dict_type='SERVICE_CATEGORY' and f.dict_value='家电售后'
  40. where a.syn_req_id = #{request.synReqId}
  41. </select>
  42. <select id="getUpOrderBase" parameterType="com.zfire.jiasm.syncdata.parameter.OrderPar" resultType="com.zfire.jiasm.syncdata.plus.entity.OrderBase">
  43. select a.yhmc as user_name,a.quhao as area_code,a.yddh as user_mobile,a.dhhm as tel_phone,
  44. a.email,a.yddh2 as user_mobile2,a.vip,
  45. a.sfen as province,a.cshi as city,a.xian as area,a.xzhen as street,
  46. a.sfenid as province_id,a.cshiid as city_id,a.xianid as area_id,a.xzhenid as street_id,
  47. a.dizi as address,a.beiz as remark,IFNULL(a.last_modified_date,a.zjczsj) as update_time,
  48. case when a.spid=102 then '商用' when a.spid=109 then '商用' else '家用' end as service_flag,
  49. a.last_modified_by as update_by,IFNULL(a.yxji,'1') as priority,a.gpsdzxx as gps_address,
  50. case a.tsdengji when '一级投诉' then 'FIRST'
  51. when '二级投诉' then 'SECOND'
  52. when '三级投诉' then 'THIRD'
  53. when '特级投诉' then 'SUPER' else 'NO' end as complaint,
  54. a.xswdno as sale_websit_id,
  55. a.xxqdid as info_channel_id,ifnull(a.xxqd,'') as info_channel,a.xxlyid as info_source_id,ifnull(a.xxly,'') as info_source,
  56. a.wcsj as over_time,IFNULL(a.zjczsj,a.last_modified_date) as last_operator_time,
  57. IFNULL(a.last_modified_date,a.zjczsj) as update_time,a.yhsx as user_attr,a.yhsxid as user_attr_id,
  58. a.fjhm as gree_virtualnumber,
  59. a.gdhao as file_no,a.zxhao as seat_no,a.xjwdsj as rece_time,a.xjwdsj as worker_rece_time,
  60. a.yhqwsmsj as appointment_time,
  61. a.yhqwsmsj as expect_start_time,a.qwsmjssj as expect_end_time,
  62. a.wxcount as out_wxcount,a.ssqy as region,a.xsdh as external_pk
  63. from itf_tbl_assign_download a
  64. where a.syn_req_id = #{request.synReqId}
  65. </select>
  66. <select id="getOrderBaseStatus" parameterType="com.zfire.jiasm.syncdata.parameter.OrderPar" resultType="com.zfire.jiasm.syncdata.plus.entity.OrderBase">
  67. select c.order_state as order_status,d.order_state as last_order_status
  68. from itf_tbl_assign_download a
  69. left join order_state_contrast c on c.brand_order_state=a.stat and c.state_type=60 and c.brand_id = #{request.brandId}
  70. left join order_state_contrast d on d.brand_order_state=a.qystat and d.state_type=60 and d.brand_id = #{request.brandId}
  71. where a.syn_req_id = #{request.synReqId}
  72. </select>
  73. </mapper>