TDunLogMapper.xml 5.2 KB

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