GetOrderProductMapper.xml 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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.GetOrderProductMapper">
  4. <select id="getItfTblAssignMxUpload" parameterType="com.zfire.jiasm.syncdata.parameter.OrderPar" resultType="com.zfire.jiasm.syncdata.plus.entity.ItfTblAssignMxUpload">
  5. select a.out_id as fa_order_repair_product_id,a.pgmxid,'guangfo' as created_by,
  6. a.create_time as created_date,'guangfo' as last_modified_by,a.update_time as last_modified_date,
  7. a.pgid,c.ref_dict_code as spid,c.ref_dict_name as spmc,d.ref_dict_code as xlid,d.ref_dict_name as xlmc,
  8. (case when e.ref_dict_code > 99999 then 0 else e.ref_dict_code end) as xiid,IFNULL(e.ref_dict_name, '') as ximc,
  9. f.product_id as jxid,IFNULL(f.name,'') as jxmc,IFNULL(f.jxid,'') as jxno,a.buy_time as gmsj,a.create_time as czsj,
  10. '' as gzwz,a.fault_reason as gzxx, a.create_by as czren,a.sale_websit as xsdw,
  11. a.sale_websit_mobile as xsdwdh,a.service_websit_mobile as fwdwdh,
  12. a.remark as beiz,'' as qqlyxh,'' as pinpai,a.price as fee,0 as xxfee,
  13. '' as hsqk,a.num as shul,0 as wxcount,0 as yblength
  14. from order_product a
  15. left join sys_dict_ref c on c.dict_code=a.main_id and c.brand_id = #{request.brandId} and c.dict_type='MAIN_TYPE'
  16. left join sys_dict_ref d on d.dict_code=a.small_id and d.brand_id = #{request.brandId} and d.dict_type='SMALL_TYPE'
  17. left join sys_dict_ref e on e.dict_code=a.series_id and e.brand_id = #{request.brandId} and e.dict_type='SERIES'
  18. left join product f on f.product_id = a.product_id
  19. where a.id = #{request.id}
  20. </select>
  21. <select id="getItfTblAzAssignMxUpload" parameterType="com.zfire.jiasm.syncdata.parameter.OrderPar" resultType="com.zfire.jiasm.syncdata.plus.entity.ItfTblAzAssignMxUpload">
  22. select UNIX_TIMESTAMP(a.create_time) as fa_order_install_product_id,a.pgmxid,'guangfo' as created_by,a.pgguid,
  23. a.create_time as created_date,'guangfo' as last_modified_by,a.update_time as last_modified_date,
  24. c.ref_dict_code as spid,c.ref_dict_name as spmc,d.ref_dict_code as xlid,d.ref_dict_name as xlmc,
  25. (case when e.ref_dict_code > 99999 then 0 else e.ref_dict_code end) as xiid,IFNULL(e.ref_dict_name, '') as ximc,
  26. f.name as jxmc,f.jxid as jxno,a.create_time as czsj,a.price as jiage,
  27. a.num as shul,IFNULL(a.unit, '套') as danw,a.out_num as wjsl,a.inside_num as njsl,a.material_number as wldm
  28. from order_product a
  29. left join sys_dict_ref c on c.dict_code=a.main_id and c.brand_id = #{request.brandId} and c.dict_type='MAIN_TYPE'
  30. left join sys_dict_ref d on d.dict_code=a.small_id and d.brand_id = #{request.brandId} and d.dict_type='SMALL_TYPE'
  31. left join sys_dict_ref e on e.dict_code=a.series_id and e.brand_id = #{request.brandId} and e.dict_type='SERIES'
  32. left join product f on f.product_id = a.product_id
  33. where a.id = #{request.id}
  34. </select>
  35. <update id="upPgguid" parameterType="com.zfire.jiasm.syncdata.parameter.OrderPar">
  36. update order_product
  37. set pgguid = #{request.pgid}
  38. where order_base_id = #{request.orderNo} and (pgguid is null or pgguid = '' or pgguid = '0')
  39. </update>
  40. <update id="upPgmxid" parameterType="com.zfire.jiasm.syncdata.parameter.OrderPar">
  41. update order_product
  42. set pgmxid = #{request.pgid}
  43. where order_base_id = #{request.orderNo} and id = #{request.id} and (pgmxid is null or pgmxid = '')
  44. </update>
  45. <update id="upPgid" parameterType="com.zfire.jiasm.syncdata.parameter.OrderPar">
  46. update order_product
  47. set pgid = #{request.pgid}
  48. where order_base_id = #{request.orderNo} and (pgid is null or pgid = '')
  49. </update>
  50. </mapper>