OrderParentMapper.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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.ruoyi.system.mapper.OrderParentMapper">
  6. <resultMap type="OrderParent" id="OrderParentResult">
  7. <result property="id" column="id" />
  8. <result property="userId" column="user_id" />
  9. <result property="orderStatus" column="order_status" />
  10. <result property="totalAmount" column="total_amount" />
  11. <result property="totalDiscount" column="total_discount" />
  12. <result property="actualPayAmount" column="actual_pay_amount" />
  13. <result property="paymentMethod" column="payment_method" />
  14. <result property="paymentTime" column="payment_time" />
  15. <result property="createTime" column="create_time" />
  16. <result property="updateTime" column="update_time" />
  17. <result property="ddId" column="dd_id" />
  18. <result property="tableNum" column="table_num" />
  19. <result property="shdzId" column="shdz_id" />
  20. <result property="shAddress" column="sh_address" />
  21. </resultMap>
  22. <sql id="selectOrderParentVo">
  23. select id, user_id, order_status, total_amount, total_discount, actual_pay_amount, payment_method, payment_time, create_time, update_time, dd_id, table_num, shdz_id, sh_address from order_parent
  24. </sql>
  25. <select id="selectOrderParentList" parameterType="OrderParent" resultMap="OrderParentResult">
  26. <include refid="selectOrderParentVo"/>
  27. <where>
  28. <if test="userId != null "> and user_id = #{userId}</if>
  29. <if test="orderStatus != null "> and order_status = #{orderStatus}</if>
  30. <if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
  31. <if test="totalDiscount != null "> and total_discount = #{totalDiscount}</if>
  32. <if test="actualPayAmount != null "> and actual_pay_amount = #{actualPayAmount}</if>
  33. <if test="paymentMethod != null and paymentMethod != ''"> and payment_method = #{paymentMethod}</if>
  34. <if test="paymentTime != null "> and payment_time = #{paymentTime}</if>
  35. <if test="ddId != null and ddId != ''"> and dd_id = #{ddId}</if>
  36. <if test="tableNum != null and tableNum != ''"> and table_num = #{tableNum}</if>
  37. <if test="shdzId != null"> and shdz_id = #{shdzId}</if>
  38. <if test="shAddress != null and shAddress != ''"> and sh_address = #{shAddress}</if>
  39. </where>
  40. </select>
  41. <select id="selectOrderParentById" parameterType="Long" resultMap="OrderParentResult">
  42. <include refid="selectOrderParentVo"/>
  43. where id = #{id}
  44. </select>
  45. <insert id="insertOrderParent" parameterType="OrderParent">
  46. insert into order_parent
  47. <trim prefix="(" suffix=")" suffixOverrides=",">
  48. <if test="id != null">id,</if>
  49. <if test="userId != null">user_id,</if>
  50. <if test="orderStatus != null">order_status,</if>
  51. <if test="totalAmount != null">total_amount,</if>
  52. <if test="totalDiscount != null">total_discount,</if>
  53. <if test="actualPayAmount != null">actual_pay_amount,</if>
  54. <if test="paymentMethod != null">payment_method,</if>
  55. <if test="paymentTime != null">payment_time,</if>
  56. <if test="createTime != null">create_time,</if>
  57. <if test="updateTime != null">update_time,</if>
  58. <if test="ddId != null">dd_id,</if>
  59. <if test="tableNum != null and tableNum != ''">table_num,</if>
  60. <if test="shdzId != null">shdz_id,</if>
  61. <if test="shAddress != null and shAddress != ''">sh_address,</if>
  62. </trim>
  63. <trim prefix="values (" suffix=")" suffixOverrides=",">
  64. <if test="id != null">#{id},</if>
  65. <if test="userId != null">#{userId},</if>
  66. <if test="orderStatus != null">#{orderStatus},</if>
  67. <if test="totalAmount != null">#{totalAmount},</if>
  68. <if test="totalDiscount != null">#{totalDiscount},</if>
  69. <if test="actualPayAmount != null">#{actualPayAmount},</if>
  70. <if test="paymentMethod != null">#{paymentMethod},</if>
  71. <if test="paymentTime != null">#{paymentTime},</if>
  72. <if test="createTime != null">#{createTime},</if>
  73. <if test="updateTime != null">#{updateTime},</if>
  74. <if test="ddId != null">#{ddId},</if>
  75. <if test="tableNum != null and tableNum != ''">#{tableNum},</if>
  76. <if test="shdzId != null">#{shdzId},</if>
  77. <if test="shAddress != null and shAddress != ''">#{shAddress},</if>
  78. </trim>
  79. </insert>
  80. <update id="updateOrderParent" parameterType="OrderParent">
  81. update order_parent
  82. <trim prefix="SET" suffixOverrides=",">
  83. <if test="userId != null">user_id = #{userId},</if>
  84. <if test="orderStatus != null">order_status = #{orderStatus},</if>
  85. <if test="totalAmount != null">total_amount = #{totalAmount},</if>
  86. <if test="totalDiscount != null">total_discount = #{totalDiscount},</if>
  87. <if test="actualPayAmount != null">actual_pay_amount = #{actualPayAmount},</if>
  88. <if test="paymentMethod != null">payment_method = #{paymentMethod},</if>
  89. <if test="paymentTime != null">payment_time = #{paymentTime},</if>
  90. <if test="createTime != null">create_time = #{createTime},</if>
  91. <if test="updateTime != null">update_time = #{updateTime},</if>
  92. <if test="ddId != null">dd_id = #{ddId},</if>
  93. <if test="tableNum != null and tableNum != ''">table_num = #{tableNum},</if>
  94. <if test="shdzId != null">shdz_id = #{shdzId},</if>
  95. <if test="shAddress != null and shAddress != ''">sh_address = #{shAddress},</if>
  96. </trim>
  97. where id = #{id}
  98. </update>
  99. <delete id="deleteOrderParentById" parameterType="Long">
  100. delete from order_parent where id = #{id}
  101. </delete>
  102. <delete id="deleteOrderParentByIds" parameterType="String">
  103. delete from order_parent where id in
  104. <foreach item="id" collection="array" open="(" separator="," close=")">
  105. #{id}
  106. </foreach>
  107. </delete>
  108. </mapper>