IntegralOrderMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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.platform.yijia.dao.IntegralOrderMapper">
  4. <!--返回结果-->
  5. <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.IntegralOrder">
  6. <id column="id" jdbcType="INTEGER" property="id" />
  7. <result column="integral_order_no" jdbcType="VARCHAR" property="integralOrderNo" />
  8. <result column="wares_type" jdbcType="VARCHAR" property="waresType" />
  9. <result column="wares_name" jdbcType="VARCHAR" property="waresName" />
  10. <result column="wares_id" jdbcType="INTEGER" property="waresId" />
  11. <result column="wares_pic" jdbcType="VARCHAR" property="waresPic" />
  12. <result column="wares_detail" jdbcType="VARCHAR" property="waresDetail" />
  13. <result column="union_id" jdbcType="VARCHAR" property="unionId" />
  14. <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
  15. <result column="exchange_num" jdbcType="INTEGER" property="exchangeNum" />
  16. <result column="exchange_time" jdbcType="TIMESTAMP" property="exchangeTime" />
  17. <result column="status" jdbcType="VARCHAR" property="status" />
  18. <result column="integral" jdbcType="INTEGER" property="integral" />
  19. <result column="station_id" jdbcType="INTEGER" property="stationId" />
  20. </resultMap>
  21. <!--查询列-->
  22. <sql id="Base_Column_List">
  23. id, integral_order_no, wares_type, wares_name, wares_name, wares_id, wares_pic, wares_detail, union_id, customer_name, exchange_num, exchange_time,
  24. status, integral, station_id
  25. </sql>
  26. <!--查询个人积分订单信息-->
  27. <select id="getUserIntegralOrderList" resultMap="BaseResultMap" parameterType="com.platform.yijia.pojo.IntegralOrder">
  28. SELECT
  29. <include refid="Base_Column_List" />
  30. FROM integral_order
  31. <where>
  32. <if test="unionId !=null and unionId !=''">
  33. union_id = #{unionId}
  34. </if>
  35. <if test="stationId !=null and stationId !=''">
  36. AND station_id = #{stationId}
  37. </if>
  38. </where>
  39. ORDER BY exchange_time DESC
  40. </select>
  41. <!--新增积分订单-->
  42. <insert id="insertIntegralOrder" parameterType="com.platform.yijia.pojo.IntegralOrder">
  43. INSERT INTO integral_order
  44. <trim prefix="(" suffix=")" suffixOverrides=",">
  45. <if test="integralOrderNo !=null">
  46. integral_order_no,
  47. </if>
  48. <if test="waresType !=null">
  49. wares_type,
  50. </if>
  51. <if test="waresName !=null">
  52. wares_name,
  53. </if>
  54. <if test="waresId !=null">
  55. wares_id,
  56. </if>
  57. <if test="waresPic !=null">
  58. wares_pic,
  59. </if>
  60. <if test="waresDetail !=null">
  61. wares_detail,
  62. </if>
  63. <if test="unionId !=null">
  64. union_id,
  65. </if>
  66. <if test="customerName !=null">
  67. customer_name,
  68. </if>
  69. <if test="exchangeNum !=null">
  70. exchange_num,
  71. </if>
  72. <if test="exchangeTime !=null">
  73. exchange_time,
  74. </if>
  75. <if test="status !=null">
  76. status,
  77. </if>
  78. <if test="integral !=null">
  79. integral,
  80. </if>
  81. <if test="stationId !=null">
  82. station_id,
  83. </if>
  84. <if test="stationName !=null">
  85. station_name,
  86. </if>
  87. </trim>
  88. <trim prefix="values (" suffix=")" suffixOverrides=",">
  89. <if test="integralOrderNo !=null">
  90. #{integralOrderNo},
  91. </if>
  92. <if test="waresType !=null">
  93. #{waresType},
  94. </if>
  95. <if test="waresName !=null">
  96. #{waresName},
  97. </if>
  98. <if test="waresId !=null">
  99. #{waresId},
  100. </if>
  101. <if test="waresPic !=null">
  102. #{waresPic},
  103. </if>
  104. <if test="waresDetail !=null">
  105. #{waresDetail},
  106. </if>
  107. <if test="unionId !=null">
  108. #{unionId},
  109. </if>
  110. <if test="customerName !=null">
  111. #{customerName},
  112. </if>
  113. <if test="exchangeNum !=null">
  114. #{exchangeNum},
  115. </if>
  116. <if test="exchangeTime !=null">
  117. #{exchangeTime},
  118. </if>
  119. <if test="status !=null">
  120. #{status},
  121. </if>
  122. <if test="integral !=null">
  123. #{integral},
  124. </if>
  125. <if test="stationId !=null">
  126. #{stationId},
  127. </if>
  128. <if test="stationName !=null">
  129. #{stationName},
  130. </if>
  131. </trim>
  132. </insert>
  133. </mapper>