IntegralOrderMapper.xml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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="INTEGER" property="integralOrderNo" />
  8. <result column="wares_type" jdbcType="VARCHAR" property="waresType" />
  9. <result column="wares_name" jdbcType="VARCHAR" property="waresName" />
  10. <result column="union_id" jdbcType="VARCHAR" property="unionId" />
  11. <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
  12. <result column="exchange_num" jdbcType="INTEGER" property="exchangeNum" />
  13. <result column="exchange_time" jdbcType="DATE" property="exchangeTime" />
  14. <result column="status" jdbcType="VARCHAR" property="status" />
  15. <result column="integral" jdbcType="INTEGER" property="integral" />
  16. <result column="station_id" jdbcType="INTEGER" property="stationId" />
  17. </resultMap>
  18. <!--查询列-->
  19. <sql id="Base_Column_List">
  20. id, integral_order_no, wares_type, wares_name, wares_name, union_id, customer_name, exchange_num, exchange_time,
  21. status, integral, station_id
  22. </sql>
  23. <!--查询个人积分订单信息-->
  24. <select id="getUserIntegralOrderList" resultMap="BaseResultMap" parameterType="com.platform.yijia.pojo.IntegralOrder">
  25. SELECT
  26. <include refid="Base_Column_List" />
  27. FROM integral_order
  28. <where>
  29. <if test="unionId !=null and unionId !=''">
  30. union_id = #{unionId}
  31. </if>
  32. </where>
  33. </select>
  34. <!--新增积分订单-->
  35. <insert id="insertIntegralOrder" parameterType="com.platform.yijia.pojo.IntegralOrder">
  36. INSERT INTO integral_order
  37. <trim prefix="(" suffix=")" suffixOverrides=",">
  38. <if test="integralOrderNo !=null">
  39. integral_order_no,
  40. </if>
  41. <if test="waresType !=null">
  42. wares_type,
  43. </if>
  44. <if test="waresName !=null">
  45. wares_name,
  46. </if>
  47. <if test="unionId !=null">
  48. union_id,
  49. </if>
  50. <if test="customerName !=null">
  51. customer_name,
  52. </if>
  53. <if test="exchangeNum !=null">
  54. exchange_num,
  55. </if>
  56. <if test="exchangeTime !=null">
  57. exchange_time,
  58. </if>
  59. <if test="status !=null">
  60. status,
  61. </if>
  62. <if test="integral !=null">
  63. integral,
  64. </if>
  65. <if test="stationId !=null">
  66. station_id,
  67. </if>
  68. </trim>
  69. <trim prefix="values (" suffix=")" suffixOverrides=",">
  70. <if test="integralOrderNo !=null">
  71. #{integralOrderNo},
  72. </if>
  73. <if test="waresType !=null">
  74. #{waresType},
  75. </if>
  76. <if test="waresName !=null">
  77. #{waresName},
  78. </if>
  79. <if test="unionId !=null">
  80. #{unionId},
  81. </if>
  82. <if test="customerName !=null">
  83. #{customerName},
  84. </if>
  85. <if test="exchangeNum !=null">
  86. #{exchangeNum},
  87. </if>
  88. <if test="exchangeTime !=null">
  89. #{exchangeTime},
  90. </if>
  91. <if test="status !=null">
  92. #{status},
  93. </if>
  94. <if test="integral !=null">
  95. #{integral},
  96. </if>
  97. <if test="stationId !=null">
  98. #{stationId},
  99. </if>
  100. </trim>
  101. </insert>
  102. </mapper>