TOrderExamineMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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.TOrderExamineMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderExamine">
  5. <id column="id" jdbcType="INTEGER" property="id" />
  6. <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
  7. <result column="aid" jdbcType="VARCHAR" property="aid" />
  8. <result column="status" jdbcType="INTEGER" property="status" />
  9. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  10. <result column="aname" jdbcType="VARCHAR" property="aname" />
  11. <result column="type" jdbcType="INTEGER" property="type" />
  12. <result column="tid" jdbcType="INTEGER" property="tid" />
  13. </resultMap>
  14. <sql id="Base_Column_List">
  15. id, order_no, aid, `status`, create_time, aname, `type`, tid
  16. </sql>
  17. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  18. select
  19. <include refid="Base_Column_List" />
  20. from t_order_examine
  21. where id = #{id,jdbcType=INTEGER}
  22. </select>
  23. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  24. delete from t_order_examine
  25. where id = #{id,jdbcType=INTEGER}
  26. </delete>
  27. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderExamine" useGeneratedKeys="true">
  28. insert into t_order_examine (order_no, aid, `status`,
  29. create_time, aname, `type`,
  30. tid)
  31. values (#{orderNo,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
  32. #{createTime,jdbcType=TIMESTAMP}, #{aname,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
  33. #{tid,jdbcType=INTEGER})
  34. </insert>
  35. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderExamine" useGeneratedKeys="true">
  36. insert into t_order_examine
  37. <trim prefix="(" suffix=")" suffixOverrides=",">
  38. <if test="orderNo != null">
  39. order_no,
  40. </if>
  41. <if test="aid != null">
  42. aid,
  43. </if>
  44. <if test="status != null">
  45. `status`,
  46. </if>
  47. <if test="createTime != null">
  48. create_time,
  49. </if>
  50. <if test="aname != null">
  51. aname,
  52. </if>
  53. <if test="type != null">
  54. `type`,
  55. </if>
  56. <if test="tid != null">
  57. tid,
  58. </if>
  59. </trim>
  60. <trim prefix="values (" suffix=")" suffixOverrides=",">
  61. <if test="orderNo != null">
  62. #{orderNo,jdbcType=VARCHAR},
  63. </if>
  64. <if test="aid != null">
  65. #{aid,jdbcType=VARCHAR},
  66. </if>
  67. <if test="status != null">
  68. #{status,jdbcType=INTEGER},
  69. </if>
  70. <if test="createTime != null">
  71. #{createTime,jdbcType=TIMESTAMP},
  72. </if>
  73. <if test="aname != null">
  74. #{aname,jdbcType=VARCHAR},
  75. </if>
  76. <if test="type != null">
  77. #{type,jdbcType=INTEGER},
  78. </if>
  79. <if test="tid != null">
  80. #{tid,jdbcType=INTEGER},
  81. </if>
  82. </trim>
  83. </insert>
  84. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderExamine">
  85. update t_order_examine
  86. <set>
  87. <if test="orderNo != null">
  88. order_no = #{orderNo,jdbcType=VARCHAR},
  89. </if>
  90. <if test="aid != null">
  91. aid = #{aid,jdbcType=VARCHAR},
  92. </if>
  93. <if test="status != null">
  94. `status` = #{status,jdbcType=INTEGER},
  95. </if>
  96. <if test="createTime != null">
  97. create_time = #{createTime,jdbcType=TIMESTAMP},
  98. </if>
  99. <if test="aname != null">
  100. aname = #{aname,jdbcType=VARCHAR},
  101. </if>
  102. <if test="type != null">
  103. `type` = #{type,jdbcType=INTEGER},
  104. </if>
  105. <if test="tid != null">
  106. tid = #{tid,jdbcType=INTEGER},
  107. </if>
  108. </set>
  109. where id = #{id,jdbcType=INTEGER}
  110. </update>
  111. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderExamine">
  112. update t_order_examine
  113. set order_no = #{orderNo,jdbcType=VARCHAR},
  114. aid = #{aid,jdbcType=VARCHAR},
  115. `status` = #{status,jdbcType=INTEGER},
  116. create_time = #{createTime,jdbcType=TIMESTAMP},
  117. aname = #{aname,jdbcType=VARCHAR},
  118. `type` = #{type,jdbcType=INTEGER},
  119. tid = #{tid,jdbcType=INTEGER}
  120. where id = #{id,jdbcType=INTEGER}
  121. </update>
  122. <select id="selectByOrderNo" resultMap="BaseResultMap">
  123. select
  124. <include refid="Base_Column_List" />
  125. from t_order_examine
  126. where order_no = #{orderNo,jdbcType=VARCHAR} and type = #{type,jdbcType=INTEGER}
  127. </select>
  128. <update id="updateStatusByOrderNo">
  129. update t_order_examine
  130. set status= #{status}
  131. where order_no = #{orderNo,jdbcType=VARCHAR}
  132. <if test="aid!=null">
  133. and aid = #{aid}
  134. </if>
  135. </update>
  136. <insert id="insertBatch">
  137. insert into t_order_examine (order_no, aid, `status`, aname,type,tid)
  138. values
  139. <foreach item="item" index="index" collection="list" separator=",">
  140. (#{item.orderNo,jdbcType=VARCHAR}, #{item.aid,jdbcType=VARCHAR}, #{item.status,jdbcType=INTEGER},
  141. #{item.aname,jdbcType=VARCHAR},#{item.type,jdbcType=INTEGER},#{item.tid,jdbcType=INTEGER})
  142. </foreach>
  143. </insert>
  144. <select id="selectByOrderNoAndAid" resultType="java.lang.Integer">
  145. select count(*)
  146. from t_order_examine where status=0
  147. and order_no = #{orderNo} and aid= #{aid}
  148. </select>
  149. <select id="selectByTid" resultMap="BaseResultMap">
  150. select
  151. <include refid="Base_Column_List" />
  152. from t_order_examine
  153. where tid = #{tid}
  154. </select>
  155. <delete id="deleteByOrderNo">
  156. delete from t_order_examine
  157. where order_no = #{orderNo}
  158. </delete>
  159. <delete id="deleteByTid">
  160. delete from t_order_examine
  161. where tid = #{tid}
  162. </delete>
  163. <select id="selectExamineBytidAndAid" resultMap="BaseResultMap">
  164. select
  165. <include refid="Base_Column_List" />
  166. from t_order_examine a
  167. where tid in
  168. <foreach item="item" index="index" collection="list" separator="," open="(" close=")">
  169. #{item}
  170. </foreach>
  171. and a.aid= #{aid}
  172. </select>
  173. </mapper>