DoumuProductInfoMapper.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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.DoumuProductInfoMapper">
  6. <resultMap type="DoumuProductInfo" id="DoumuProductInfoResult">
  7. <result property="productId" column="product_id" />
  8. <result property="productId" column="product_id" />
  9. <result property="openid" column="openid" />
  10. <result property="orderNumber" column="order_number" />
  11. <result property="name" column="name" />
  12. <result property="deliveryType" column="delivery_type" />
  13. <result property="phonenumber" column="phonenumber" />
  14. <result property="quantity" column="quantity" />
  15. <result property="provinceId" column="province_id" />
  16. <result property="province" column="province" />
  17. <result property="cityId" column="city_id" />
  18. <result property="city" column="city" />
  19. <result property="countyId" column="county_id" />
  20. <result property="county" column="county" />
  21. <result property="address" column="address" />
  22. <result property="lon" column="lon" />
  23. <result property="lat" column="lat" />
  24. <result property="flowType" column="flow_type" />
  25. <result property="status" column="status" />
  26. <result property="goodsName" column="goods_name" />
  27. <result property="totalPrice" column="total_price" />
  28. <result property="mailNo" column="mail_no" />
  29. <result property="createBy" column="create_by" />
  30. <result property="createTime" column="create_time" />
  31. <result property="updateBy" column="update_by" />
  32. <result property="updateTime" column="update_time" />
  33. <result property="remark" column="remark" />
  34. <result property="beginTime" column="beginTime" />
  35. <result property="endTime" column="endTime" />
  36. </resultMap>
  37. <sql id="selectDoumuProductInfoVo">
  38. select product_id,openid,order_number, name, delivery_type, phonenumber,quantity,province_id,province,city_id,city,county_id,county,lon,lat,status, address,
  39. flow_type,goods_name,total_price, mail_no, create_by, create_time, update_by, update_time, remark from doumu_product_info
  40. </sql>
  41. <select id="selectDoumuProductInfoList" parameterType="DoumuProductInfo" resultMap="DoumuProductInfoResult">
  42. <include refid="selectDoumuProductInfoVo"/>
  43. <where>
  44. <if test="orderNumber != null and orderNumber != ''"> and order_number = #{orderNumber}</if>
  45. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  46. <if test="deliveryType != null and deliveryType != ''"> and delivery_type = #{deliveryType}</if>
  47. <if test="phonenumber != null and phonenumber != ''"> and phonenumber = #{phonenumber}</if>
  48. <if test="address != null and address != ''"> and address = #{address}</if>
  49. <if test="flowType != null and flowType != ''"> and flow_type = #{flowType}</if>
  50. <if test="status != null and status != ''"> and status = #{status}</if>
  51. <if test="mailNo != null and mailNo != ''"> and mailNo = #{mailNo}</if>
  52. <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
  53. AND date_format(create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
  54. </if>
  55. <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
  56. AND date_format(create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
  57. </if>
  58. </where>
  59. order by create_time desc
  60. </select>
  61. <select id="selectDoumuProductInfoByProductId" parameterType="Long" resultMap="DoumuProductInfoResult">
  62. <include refid="selectDoumuProductInfoVo"/>
  63. where product_id = #{productId}
  64. </select>
  65. <insert id="insertDoumuProductInfo" parameterType="DoumuProductInfo" useGeneratedKeys="true" keyProperty="productId">
  66. insert into doumu_product_info
  67. <trim prefix="(" suffix=")" suffixOverrides=",">
  68. <if test="openid != null "> openid,</if>
  69. <if test="orderNumber != null "> order_number,</if>
  70. <if test="name != null and name != ''">name,</if>
  71. <if test="deliveryType != null">delivery_type,</if>
  72. <if test="phonenumber != null">phonenumber,</if>
  73. <if test="quantity != null">quantity,</if>
  74. <if test="provinceId != null">province_id,</if>
  75. <if test="province != null">province,</if>
  76. <if test="cityId != null">city_id,</if>
  77. <if test="city != null">city,</if>
  78. <if test="countyId != null">county_id,</if>
  79. <if test="county != null">county,</if>
  80. <if test="address != null">address,</if>
  81. <if test="lon != null">lon,</if>
  82. <if test="lat != null">lat,</if>
  83. <if test="flowType != null">flow_type,</if>
  84. <if test="status != null">status,</if>
  85. <if test="goodsName != null">goods_name,</if>
  86. <if test="totalPrice != null and totalPrice != 0">total_price,</if>
  87. <if test="mailNo != null">mailNo,</if>
  88. <if test="createBy != null">create_by,</if>
  89. <if test="createTime != null">create_time,</if>
  90. <if test="updateBy != null">update_by,</if>
  91. <if test="updateTime != null">update_time,</if>
  92. <if test="remark != null">remark,</if>
  93. </trim>
  94. <trim prefix="values (" suffix=")" suffixOverrides=",">
  95. <if test="openid != null "> #{openid},</if>
  96. <if test="orderNumber != null ">#{orderNumber},</if>
  97. <if test="name != null and name != ''">#{name},</if>
  98. <if test="deliveryType != null">#{deliveryType},</if>
  99. <if test="phonenumber != null">#{phonenumber},</if>
  100. <if test="quantity != null">#{quantity},</if>
  101. <if test="provinceId != null">#{provinceId},</if>
  102. <if test="province != null">#{province},</if>
  103. <if test="cityId != null">#{cityId},</if>
  104. <if test="city != null">#{city},</if>
  105. <if test="countyId != null">#{countyId},</if>
  106. <if test="county != null">#{county},</if>
  107. <if test="address != null">#{address},</if>
  108. <if test="lon != null">#{lon},</if>
  109. <if test="lat != null">#{lat},</if>
  110. <if test="flowType != null">#{flowType},</if>
  111. <if test="status != null">#{status},</if>
  112. <if test="goodsName != null">#{goodsName},</if>
  113. <if test="totalPrice != null and totalPrice != 0">#{totalPrice},</if>
  114. <if test="mailNo != null">#{mailNo},</if>
  115. <if test="createBy != null">#{createBy},</if>
  116. <if test="createTime != null">#{createTime},</if>
  117. <if test="updateBy != null">#{updateBy},</if>
  118. <if test="updateTime != null">#{updateTime},</if>
  119. <if test="remark != null">#{remark},</if>
  120. </trim>
  121. </insert>
  122. <update id="updateDoumuProductInfo" parameterType="DoumuProductInfo">
  123. update doumu_product_info
  124. <trim prefix="SET" suffixOverrides=",">
  125. <if test="openid != null "> openid = #{openid},</if>
  126. <if test="orderNumber != null and orderNumber != ''"> order_number = #{orderNumber},</if>
  127. <if test="name != null and name != ''">name = #{name},</if>
  128. <if test="deliveryType != null">delivery_type = #{deliveryType},</if>
  129. <if test="phonenumber != null">phonenumber = #{phonenumber},</if>
  130. <if test="quantity != null">quantity = #{quantity},</if>
  131. <if test="provinceId != null">province_id = #{provinceId},</if>
  132. <if test="province != null">province = #{province},</if>
  133. <if test="cityId != null">city_id = #{cityId},</if>
  134. <if test="city != null">city = #{city},</if>
  135. <if test="countyId != null">county_id = #{countyId},</if>
  136. <if test="county != null">county = #{county},</if>
  137. <if test="address != null">address = #{address},</if>
  138. <if test="lon != null">lon = #{lon},</if>
  139. <if test="lat != null">lat = #{lat},</if>
  140. <if test="flowType != null">flow_type = #{flowType},</if>
  141. <if test="status != null">status = #{status},</if>
  142. <if test="goodsName != null">goods_name = #{goodsName},</if>
  143. <if test="totalPrice != null and totalPrice != 0">total_price = #{totalPrice},</if>
  144. <if test="mailNo != null">mailNo = #{mailNo},</if>
  145. <if test="createBy != null">create_by = #{createBy},</if>
  146. <if test="createTime != null">create_time = #{createTime},</if>
  147. <if test="updateBy != null">update_by = #{updateBy},</if>
  148. <if test="updateTime != null">update_time = #{updateTime},</if>
  149. <if test="remark != null">remark = #{remark},</if>
  150. </trim>
  151. where product_id = #{productId}
  152. </update>
  153. <update id="updateDoumuProductInfoFlowList">
  154. update doumu_product_info set flow_type = #{flowType} where product_id in
  155. <foreach collection="productIdList" index="index" item="productId" open="(" separator="," close=")">
  156. #{productId}
  157. </foreach>
  158. </update>
  159. <delete id="deleteDoumuProductInfoByProductId" parameterType="Long">
  160. delete from doumu_product_info where product_id = #{productId}
  161. </delete>
  162. <delete id="deleteDoumuProductInfoByProductIds" parameterType="String">
  163. delete from doumu_product_info where product_id in
  164. <foreach item="productId" collection="array" open="(" separator="," close=")">
  165. #{productId}
  166. </foreach>
  167. </delete>
  168. </mapper>