LiveOrderDfMapper.xml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.fs.live.mapper.LiveOrderDfMapper">
  6. <resultMap type="LiveOrderDf" id="LiveOrderDfResult">
  7. <result property="orderId" column="order_id" />
  8. <result property="orderCode" column="order_code" />
  9. <result property="appKey" column="app_key" />
  10. <result property="appSecret" column="app_secret" />
  11. <result property="loginAccount" column="login_account" />
  12. <result property="monthlyCard" column="monthly_card" />
  13. <result property="expressProductCode" column="express_product_code" />
  14. <result property="totalPrice" column="total_price" />
  15. <result property="platformPrice" column="platform_price" />
  16. <result property="status" column="status" />
  17. <result property="createTime" column="create_time" />
  18. <result property="updateTime" column="update_time" />
  19. <result property="failMsg" column="fail_msg" />
  20. <result property="parcelQuantity" column="parcel_quantity" />
  21. </resultMap>
  22. <sql id="selectLiveOrderDfVo">
  23. select order_id, order_code, app_key, app_secret, login_account, monthly_card, express_product_code,total_price,
  24. platform_price, status, create_time, update_time,fail_msg ,parcel_quantity from live_order_df
  25. </sql>
  26. <select id="selectLiveOrderDfList" parameterType="LiveOrderDf" resultMap="LiveOrderDfResult">
  27. <include refid="selectLiveOrderDfVo"/>
  28. <where>
  29. <if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
  30. <if test="appKey != null and appKey != ''"> and app_key = #{appKey}</if>
  31. <if test="appSecret != null and appSecret != ''"> and app_secret = #{appSecret}</if>
  32. <if test="loginAccount != null and loginAccount != ''"> and login_account = #{loginAccount}</if>
  33. <if test="monthlyCard != null and monthlyCard != ''"> and monthly_card = #{monthlyCard}</if>
  34. <if test="expressProductCode != null and expressProductCode != ''"> and express_product_code = #{expressProductCode}</if>
  35. <if test="totalPrice != null "> and total_price = #{totalPrice}</if>
  36. <if test="platformPrice != null "> and platform_price = #{platformPrice}</if>
  37. <if test="status != null "> and status = #{status}</if>
  38. <if test="failMsg != null and failMsg != ''"> and fail_msg like concat(#{failMsg},'%')</if>
  39. <if test="parcelQuantity != null"> and parcel_quantity = #{parcelQuantity}</if>
  40. </where>
  41. </select>
  42. <select id="selectLiveOrderDfByOrderId" parameterType="Long" resultMap="LiveOrderDfResult">
  43. <include refid="selectLiveOrderDfVo"/>
  44. where order_id = #{orderId}
  45. </select>
  46. <insert id="insertLiveOrderDf" parameterType="LiveOrderDf">
  47. insert into live_order_df
  48. <trim prefix="(" suffix=")" suffixOverrides=",">
  49. <if test="orderId != null">order_id,</if>
  50. <if test="orderCode != null and orderCode != ''">order_code,</if>
  51. <if test="appKey != null and appKey != ''">app_key,</if>
  52. <if test="appSecret != null and appSecret != ''">app_secret,</if>
  53. <if test="loginAccount != null and loginAccount != ''">login_account,</if>
  54. <if test="monthlyCard != null and monthlyCard != ''">monthly_card,</if>
  55. <if test="expressProductCode != null and expressProductCode != ''">express_product_code,</if>
  56. <if test="totalPrice != null">total_price,</if>
  57. <if test="platformPrice != null">platform_price,</if>
  58. <if test="status != null">status,</if>
  59. <if test="createTime != null">create_time,</if>
  60. <if test="updateTime != null">update_time,</if>
  61. <if test="failMsg != null">fail_msg,</if>
  62. <if test="parcelQuantity != null">parcel_quantity,</if>
  63. </trim>
  64. <trim prefix="values (" suffix=")" suffixOverrides=",">
  65. <if test="orderId != null">#{orderId},</if>
  66. <if test="orderCode != null and orderCode != ''">#{orderCode},</if>
  67. <if test="appKey != null and appKey != ''">#{appKey},</if>
  68. <if test="appSecret != null and appSecret != ''">#{appSecret},</if>
  69. <if test="loginAccount != null and loginAccount != ''">#{loginAccount},</if>
  70. <if test="monthlyCard != null and monthlyCard != ''">#{monthlyCard},</if>
  71. <if test="expressProductCode != null and expressProductCode != ''">#{expressProductCode},</if>
  72. <if test="totalPrice != null">#{totalPrice},</if>
  73. <if test="platformPrice != null">#{platformPrice},</if>
  74. <if test="status != null">#{status},</if>
  75. <if test="createTime != null">#{createTime},</if>
  76. <if test="updateTime != null">#{updateTime},</if>
  77. <if test="failMsg != null">#{failMsg},</if>
  78. <if test="parcelQuantity != null">#{parcelQuantity},</if>
  79. </trim>
  80. </insert>
  81. <update id="updateLiveOrderDf" parameterType="LiveOrderDf">
  82. update live_order_df
  83. <trim prefix="SET" suffixOverrides=",">
  84. <if test="orderCode != null and orderCode != ''">order_code = #{orderCode},</if>
  85. <if test="appKey != null and appKey != ''">app_key = #{appKey},</if>
  86. <if test="appSecret != null and appSecret != ''">app_secret = #{appSecret},</if>
  87. <if test="loginAccount != null and loginAccount != ''">login_account = #{loginAccount},</if>
  88. <if test="monthlyCard != null and monthlyCard != ''">monthly_card = #{monthlyCard},</if>
  89. <if test="expressProductCode != null and expressProductCode != ''">express_product_code = #{expressProductCode},</if>
  90. <if test="totalPrice != null">total_price = #{totalPrice},</if>
  91. <if test="platformPrice != null">platform_price = #{platformPrice},</if>
  92. <if test="status != null">status = #{status},</if>
  93. <if test="createTime != null">create_time = #{createTime},</if>
  94. <if test="updateTime != null">update_time = #{updateTime},</if>
  95. <if test="failMsg != null and failMsg != ''">fail_msg = #{failMsg},</if>
  96. <if test="parcelQuantity != null">parcel_quantity = #{parcelQuantity},</if>
  97. </trim>
  98. where order_id = #{orderId}
  99. </update>
  100. <delete id="deleteLiveOrderDfByOrderId" parameterType="Long">
  101. delete from live_order_df where order_id = #{orderId}
  102. </delete>
  103. <delete id="deleteLiveOrderDfByOrderIds" parameterType="String">
  104. delete from live_order_df where order_id in
  105. <foreach item="orderId" collection="array" open="(" separator="," close=")">
  106. #{orderId}
  107. </foreach>
  108. </delete>
  109. </mapper>