SopOrderLogMapper.xml 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.sop.mapper.SopOrderLogMapper">
  6. <resultMap type="SopOrderLog" id="SopOrderLogResult">
  7. <result property="id" column="id" />
  8. <result property="sopId" column="sop_id" />
  9. <result property="fsUserId" column="fs_user_id" />
  10. <result property="isBuy" column="is_buy" />
  11. <result property="orderSendType" column="order_send_type" />
  12. <result property="crateTime" column="crate_time" />
  13. <result property="updateTime" column="update_time" />
  14. <result property="sendTime" column="send_time" />
  15. </resultMap>
  16. <sql id="selectSopOrderLogVo">
  17. select id, sop_id, fs_user_id, is_buy, order_send_type, crate_time, update_time, send_time from sop_order_log
  18. </sql>
  19. <select id="selectSopOrderLogList" parameterType="SopOrderLog" resultMap="SopOrderLogResult">
  20. <include refid="selectSopOrderLogVo"/>
  21. <where>
  22. <if test="sopId != null and sopId != ''"> and sop_id = #{sopId}</if>
  23. <if test="fsUserId != null "> and fs_user_id = #{fsUserId}</if>
  24. <if test="isBuy != null "> and is_buy = #{isBuy}</if>
  25. <if test="orderSendType != null "> and order_send_type = #{orderSendType}</if>
  26. <if test="crateTime != null "> and crate_time = #{crateTime}</if>
  27. <if test="sendTime != null "> and send_time = #{sendTime}</if>
  28. </where>
  29. </select>
  30. <select id="selectSopOrderLogById" parameterType="Long" resultMap="SopOrderLogResult">
  31. <include refid="selectSopOrderLogVo"/>
  32. where id = #{id}
  33. </select>
  34. <insert id="insertSopOrderLog" parameterType="SopOrderLog" useGeneratedKeys="true" keyProperty="id">
  35. insert into sop_order_log
  36. <trim prefix="(" suffix=")" suffixOverrides=",">
  37. <if test="sopId != null">sop_id,</if>
  38. <if test="fsUserId != null">fs_user_id,</if>
  39. <if test="isBuy != null">is_buy,</if>
  40. <if test="orderSendType != null">order_send_type,</if>
  41. <if test="crateTime != null">crate_time,</if>
  42. <if test="updateTime != null">update_time,</if>
  43. <if test="sendTime != null">send_time,</if>
  44. </trim>
  45. <trim prefix="values (" suffix=")" suffixOverrides=",">
  46. <if test="sopId != null">#{sopId},</if>
  47. <if test="fsUserId != null">#{fsUserId},</if>
  48. <if test="isBuy != null">#{isBuy},</if>
  49. <if test="orderSendType != null">#{orderSendType},</if>
  50. <if test="crateTime != null">#{crateTime},</if>
  51. <if test="updateTime != null">#{updateTime},</if>
  52. <if test="sendTime != null">#{sendTime},</if>
  53. </trim>
  54. </insert>
  55. <update id="updateSopOrderLog" parameterType="SopOrderLog">
  56. update sop_order_log
  57. <trim prefix="SET" suffixOverrides=",">
  58. <if test="sopId != null">sop_id = #{sopId},</if>
  59. <if test="fsUserId != null">fs_user_id = #{fsUserId},</if>
  60. <if test="isBuy != null">is_buy = #{isBuy},</if>
  61. <if test="orderSendType != null">order_send_type = #{orderSendType},</if>
  62. <if test="crateTime != null">crate_time = #{crateTime},</if>
  63. <if test="updateTime != null">update_time = #{updateTime},</if>
  64. <if test="sendTime != null">send_time = #{sendTime},</if>
  65. </trim>
  66. where id = #{id}
  67. </update>
  68. <delete id="deleteSopOrderLogById" parameterType="Long">
  69. delete from sop_order_log where id = #{id}
  70. </delete>
  71. <delete id="deleteSopOrderLogByIds" parameterType="String">
  72. delete from sop_order_log where id in
  73. <foreach item="id" collection="array" open="(" separator="," close=")">
  74. #{id}
  75. </foreach>
  76. </delete>
  77. </mapper>