TDunLogMapper.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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.goafanti.common.dao.TDunLogMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.TDunLog">
  5. <id column="id" jdbcType="VARCHAR" property="id" />
  6. <result column="dun_id" jdbcType="VARCHAR" property="dunId" />
  7. <result column="dum_by" jdbcType="VARCHAR" property="dumBy" />
  8. <result column="dum_time" jdbcType="DATE" property="dumTime" />
  9. <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  10. <result column="attachment_url" jdbcType="VARCHAR" property="attachmentUrl" />
  11. <result column="type" jdbcType="INTEGER" property="type" />
  12. <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
  13. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  14. </resultMap>
  15. <sql id="Base_Column_List">
  16. id, dun_id, dum_by, dum_time, remarks, attachment_url, `type`, order_no, create_time
  17. </sql>
  18. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  19. select
  20. <include refid="Base_Column_List" />
  21. from t_dun_log
  22. where id = #{id,jdbcType=VARCHAR}
  23. </select>
  24. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  25. delete from t_dun_log
  26. where id = #{id,jdbcType=VARCHAR}
  27. </delete>
  28. <insert id="insert" parameterType="com.goafanti.common.model.TDunLog">
  29. insert into t_dun_log (id, dun_id, dum_by,
  30. dum_time, remarks, attachment_url,
  31. `type`, order_no, create_time
  32. )
  33. values (#{id,jdbcType=VARCHAR}, #{dunId,jdbcType=VARCHAR}, #{dumBy,jdbcType=VARCHAR},
  34. #{dumTime,jdbcType=DATE}, #{remarks,jdbcType=VARCHAR}, #{attachmentUrl,jdbcType=VARCHAR},
  35. #{type,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
  36. )
  37. </insert>
  38. <insert id="insertSelective" parameterType="com.goafanti.common.model.TDunLog">
  39. insert into t_dun_log
  40. <trim prefix="(" suffix=")" suffixOverrides=",">
  41. <if test="id != null">
  42. id,
  43. </if>
  44. <if test="dunId != null">
  45. dun_id,
  46. </if>
  47. <if test="dumBy != null">
  48. dum_by,
  49. </if>
  50. <if test="dumTime != null">
  51. dum_time,
  52. </if>
  53. <if test="remarks != null">
  54. remarks,
  55. </if>
  56. <if test="attachmentUrl != null">
  57. attachment_url,
  58. </if>
  59. <if test="type != null">
  60. `type`,
  61. </if>
  62. <if test="orderNo != null">
  63. order_no,
  64. </if>
  65. <if test="createTime != null">
  66. create_time,
  67. </if>
  68. </trim>
  69. <trim prefix="values (" suffix=")" suffixOverrides=",">
  70. <if test="id != null">
  71. #{id,jdbcType=VARCHAR},
  72. </if>
  73. <if test="dunId != null">
  74. #{dunId,jdbcType=VARCHAR},
  75. </if>
  76. <if test="dumBy != null">
  77. #{dumBy,jdbcType=VARCHAR},
  78. </if>
  79. <if test="dumTime != null">
  80. #{dumTime,jdbcType=DATE},
  81. </if>
  82. <if test="remarks != null">
  83. #{remarks,jdbcType=VARCHAR},
  84. </if>
  85. <if test="attachmentUrl != null">
  86. #{attachmentUrl,jdbcType=VARCHAR},
  87. </if>
  88. <if test="type != null">
  89. #{type,jdbcType=INTEGER},
  90. </if>
  91. <if test="orderNo != null">
  92. #{orderNo,jdbcType=VARCHAR},
  93. </if>
  94. <if test="createTime != null">
  95. #{createTime,jdbcType=TIMESTAMP},
  96. </if>
  97. </trim>
  98. </insert>
  99. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TDunLog">
  100. update t_dun_log
  101. <set>
  102. <if test="dunId != null">
  103. dun_id = #{dunId,jdbcType=VARCHAR},
  104. </if>
  105. <if test="dumBy != null">
  106. dum_by = #{dumBy,jdbcType=VARCHAR},
  107. </if>
  108. <if test="dumTime != null">
  109. dum_time = #{dumTime,jdbcType=DATE},
  110. </if>
  111. <if test="remarks != null">
  112. remarks = #{remarks,jdbcType=VARCHAR},
  113. </if>
  114. <if test="attachmentUrl != null">
  115. attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
  116. </if>
  117. <if test="type != null">
  118. `type` = #{type,jdbcType=INTEGER},
  119. </if>
  120. <if test="orderNo != null">
  121. order_no = #{orderNo,jdbcType=VARCHAR},
  122. </if>
  123. <if test="createTime != null">
  124. create_time = #{createTime,jdbcType=TIMESTAMP},
  125. </if>
  126. </set>
  127. where id = #{id,jdbcType=VARCHAR}
  128. </update>
  129. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TDunLog">
  130. update t_dun_log
  131. set dun_id = #{dunId,jdbcType=VARCHAR},
  132. dum_by = #{dumBy,jdbcType=VARCHAR},
  133. dum_time = #{dumTime,jdbcType=DATE},
  134. remarks = #{remarks,jdbcType=VARCHAR},
  135. attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
  136. `type` = #{type,jdbcType=INTEGER},
  137. order_no = #{orderNo,jdbcType=VARCHAR},
  138. create_time = #{createTime,jdbcType=TIMESTAMP}
  139. where id = #{id,jdbcType=VARCHAR}
  140. </update>
  141. <select id="selectByDunId" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TDunLogListBo">
  142. select
  143. a.id, a.dun_id as dunId, b.name as dumBy, a.dum_time as dumTime, a.remarks
  144. from t_dun_log a left join admin b on a.dum_by=b.id
  145. where dun_id = #{dunId,jdbcType=VARCHAR}
  146. </select>
  147. <select id="selectByOrderNo" resultType="com.goafanti.order.bo.TDunLogListBo">
  148. select a.id, a.dun_id as dunId, b.name as dumBy, a.dum_time as dumTime, a.remarks,a.type,
  149. a.attachment_url attachmentUrl, c.order_no orderNo,c.buyer_name userName,a.create_time createTime
  150. from t_dun_log a left join admin b on a.dum_by=b.id left join t_order_mid c on a.order_no =c.order_no
  151. where c.order_no = #{orderNo} order by a.create_time desc
  152. </select>
  153. </mapper>