OrderExceptionRecordDao.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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.kmall.admin.dao.OrderExceptionRecordDao">
  4. <resultMap type="com.kmall.admin.entity.OrderExceptionRecordEntity" id="orderExceptionRecordMap">
  5. <result property="id" column="id"/>
  6. <result property="orderSn" column="order_sn"/>
  7. <result property="userId" column="user_id"/>
  8. <result property="exceptionContent" column="exception_content"/>
  9. <result property="exceptionStatus" column="exception_status"/>
  10. <result property="createrSn" column="creater_sn"/>
  11. <result property="createTime" column="create_time"/>
  12. <result property="moderSn" column="moder_sn"/>
  13. <result property="modTime" column="mod_time"/>
  14. <result property="tstm" column="tstm"/>
  15. </resultMap>
  16. <select id="queryObject" resultType="com.kmall.admin.entity.OrderExceptionRecordEntity">
  17. select
  18. `id`,
  19. `order_sn`,
  20. `user_id`,
  21. `exception_content`,
  22. `exception_status`,
  23. `creater_sn`,
  24. `create_time`,
  25. `moder_sn`,
  26. `mod_time`,
  27. `tstm`
  28. from mall_order_exception_record
  29. where id = #{id}
  30. </select>
  31. <select id="queryList" resultType="com.kmall.admin.entity.OrderExceptionRecordEntity">
  32. select
  33. `id`,
  34. `order_sn`,
  35. `user_id`,
  36. `exception_content`,
  37. `exception_status`,
  38. `creater_sn`,
  39. `create_time`,
  40. `moder_sn`,
  41. `mod_time`,
  42. `tstm`
  43. from mall_order_exception_record
  44. WHERE 1=1
  45. <if test="name != null and name.trim() != ''">
  46. AND name LIKE concat('%',#{name},'%')
  47. </if>
  48. <choose>
  49. <when test="sidx != null and sidx.trim() != ''">
  50. order by ${sidx} ${order}
  51. </when>
  52. <otherwise>
  53. order by id desc
  54. </otherwise>
  55. </choose>
  56. <if test="offset != null and limit != null">
  57. limit #{offset}, #{limit}
  58. </if>
  59. </select>
  60. <select id="queryTotal" resultType="int">
  61. select count(*) from mall_order_exception_record
  62. WHERE 1=1
  63. <if test="name != null and name.trim() != ''">
  64. AND name LIKE concat('%',#{name},'%')
  65. </if>
  66. </select>
  67. <insert id="save" parameterType="com.kmall.admin.entity.OrderExceptionRecordEntity" useGeneratedKeys="true" keyProperty="id">
  68. insert into mall_order_exception_record(
  69. `order_sn`,
  70. `user_id`,
  71. `exception_content`,
  72. `exception_status`,
  73. `creater_sn`,
  74. `create_time`,
  75. `moder_sn`,
  76. `mod_time`,
  77. `tstm`)
  78. values(
  79. #{orderSn},
  80. #{userId},
  81. #{exceptionContent},
  82. #{exceptionStatus},
  83. #{createrSn},
  84. #{createTime},
  85. #{moderSn},
  86. #{modTime},
  87. #{tstm})
  88. </insert>
  89. <update id="update" parameterType="com.kmall.admin.entity.OrderExceptionRecordEntity">
  90. update mall_order_exception_record
  91. <set>
  92. <if test="orderSn != null">`order_sn` = #{orderSn}, </if>
  93. <if test="userId != null">`user_id` = #{userId}, </if>
  94. <if test="exceptionContent != null">`exception_content` = #{exceptionContent}, </if>
  95. <if test="exceptionStatus != null">`exception_status` = #{exceptionStatus}, </if>
  96. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  97. <if test="createTime != null">`create_time` = #{createTime}, </if>
  98. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  99. <if test="modTime != null">`mod_time` = #{modTime}, </if>
  100. <if test="tstm != null">`tstm` = #{tstm}</if>
  101. </set>
  102. where id = #{id}
  103. </update>
  104. <delete id="delete">
  105. delete from mall_order_exception_record where id = #{value}
  106. </delete>
  107. <delete id="deleteBatch">
  108. delete from mall_order_exception_record where id in
  109. <foreach item="id" collection="array" open="(" separator="," close=")">
  110. #{id}
  111. </foreach>
  112. </delete>
  113. </mapper>