LiveOrderStatusMapper.xml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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.LiveOrderStatusMapper">
  6. <resultMap type="LiveOrderStatus" id="LiveOrderStatusResult">
  7. <result property="id" column="id" />
  8. <result property="orderId" column="order_id" />
  9. <result property="changeType" column="change_type" />
  10. <result property="changeMessage" column="change_message" />
  11. <result property="changeTime" column="change_time" />
  12. </resultMap>
  13. <sql id="selectLiveOrderStatusVo">
  14. select id, order_id, change_type, change_message, change_time from live_order_status
  15. </sql>
  16. <select id="selectLiveOrderStatusList" parameterType="LiveOrderStatus" resultMap="LiveOrderStatusResult">
  17. <include refid="selectLiveOrderStatusVo"/>
  18. <where>
  19. <if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
  20. <if test="changeType != null and changeType != ''"> and change_type = #{changeType}</if>
  21. <if test="changeMessage != null and changeMessage != ''"> and change_message = #{changeMessage}</if>
  22. <if test="changeTime != null "> and change_time = #{changeTime}</if>
  23. </where>
  24. </select>
  25. <select id="selectLiveOrderStatusById" parameterType="String" resultMap="LiveOrderStatusResult">
  26. <include refid="selectLiveOrderStatusVo"/>
  27. where id = #{id}
  28. </select>
  29. <insert id="insertLiveOrderStatus" parameterType="LiveOrderStatus" useGeneratedKeys="true" keyProperty="id">
  30. insert into live_order_status
  31. <trim prefix="(" suffix=")" suffixOverrides=",">
  32. <if test="orderId != null and orderId != ''">order_id,</if>
  33. <if test="changeType != null and changeType != ''">change_type,</if>
  34. <if test="changeMessage != null and changeMessage != ''">change_message,</if>
  35. <if test="changeTime != null">change_time,</if>
  36. </trim>
  37. <trim prefix="values (" suffix=")" suffixOverrides=",">
  38. <if test="orderId != null and orderId != ''">#{orderId},</if>
  39. <if test="changeType != null and changeType != ''">#{changeType},</if>
  40. <if test="changeMessage != null and changeMessage != ''">#{changeMessage},</if>
  41. <if test="changeTime != null">#{changeTime},</if>
  42. </trim>
  43. </insert>
  44. <update id="updateLiveOrderStatus" parameterType="LiveOrderStatus">
  45. update live_order_status
  46. <trim prefix="SET" suffixOverrides=",">
  47. <if test="orderId != null and orderId != ''">order_id = #{orderId},</if>
  48. <if test="changeType != null and changeType != ''">change_type = #{changeType},</if>
  49. <if test="changeMessage != null and changeMessage != ''">change_message = #{changeMessage},</if>
  50. <if test="changeTime != null">change_time = #{changeTime},</if>
  51. </trim>
  52. where id = #{id}
  53. </update>
  54. <delete id="deleteLiveOrderStatusById" parameterType="String">
  55. delete from live_order_status where id = #{id}
  56. </delete>
  57. <delete id="deleteLiveOrderStatusByIds" parameterType="String">
  58. delete from live_order_status where id in
  59. <foreach item="id" collection="array" open="(" separator="," close=")">
  60. #{id}
  61. </foreach>
  62. </delete>
  63. </mapper>