OrderExamineMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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.OrderExamineMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrderExamine">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Thu Sep 26 16:21:54 CST 2019.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
  12. <result column="type" jdbcType="INTEGER" property="type" />
  13. <result column="aid" jdbcType="VARCHAR" property="aid" />
  14. <result column="status" jdbcType="INTEGER" property="status" />
  15. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  16. </resultMap>
  17. <sql id="Example_Where_Clause">
  18. <!--
  19. WARNING - @mbg.generated
  20. This element is automatically generated by MyBatis Generator, do not modify.
  21. This element was generated on Thu Sep 26 16:21:54 CST 2019.
  22. -->
  23. <where>
  24. <foreach collection="oredCriteria" item="criteria" separator="or">
  25. <if test="criteria.valid">
  26. <trim prefix="(" prefixOverrides="and" suffix=")">
  27. <foreach collection="criteria.criteria" item="criterion">
  28. <choose>
  29. <when test="criterion.noValue">
  30. and ${criterion.condition}
  31. </when>
  32. <when test="criterion.singleValue">
  33. and ${criterion.condition} #{criterion.value}
  34. </when>
  35. <when test="criterion.betweenValue">
  36. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  37. </when>
  38. <when test="criterion.listValue">
  39. and ${criterion.condition}
  40. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  41. #{listItem}
  42. </foreach>
  43. </when>
  44. </choose>
  45. </foreach>
  46. </trim>
  47. </if>
  48. </foreach>
  49. </where>
  50. </sql>
  51. <sql id="Update_By_Example_Where_Clause">
  52. <!--
  53. WARNING - @mbg.generated
  54. This element is automatically generated by MyBatis Generator, do not modify.
  55. This element was generated on Thu Sep 26 16:21:54 CST 2019.
  56. -->
  57. <where>
  58. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  59. <if test="criteria.valid">
  60. <trim prefix="(" prefixOverrides="and" suffix=")">
  61. <foreach collection="criteria.criteria" item="criterion">
  62. <choose>
  63. <when test="criterion.noValue">
  64. and ${criterion.condition}
  65. </when>
  66. <when test="criterion.singleValue">
  67. and ${criterion.condition} #{criterion.value}
  68. </when>
  69. <when test="criterion.betweenValue">
  70. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  71. </when>
  72. <when test="criterion.listValue">
  73. and ${criterion.condition}
  74. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  75. #{listItem}
  76. </foreach>
  77. </when>
  78. </choose>
  79. </foreach>
  80. </trim>
  81. </if>
  82. </foreach>
  83. </where>
  84. </sql>
  85. <sql id="Base_Column_List">
  86. <!--
  87. WARNING - @mbg.generated
  88. This element is automatically generated by MyBatis Generator, do not modify.
  89. This element was generated on Thu Sep 26 16:21:54 CST 2019.
  90. -->
  91. id, order_no, type, aid, status, create_time
  92. </sql>
  93. <select id="selectByExample" parameterType="com.goafanti.common.model.OrderExamineExample" resultMap="BaseResultMap">
  94. <!--
  95. WARNING - @mbg.generated
  96. This element is automatically generated by MyBatis Generator, do not modify.
  97. This element was generated on Thu Sep 26 16:21:54 CST 2019.
  98. -->
  99. select
  100. <if test="distinct">
  101. distinct
  102. </if>
  103. <include refid="Base_Column_List" />
  104. from order_examine
  105. <if test="_parameter != null">
  106. <include refid="Example_Where_Clause" />
  107. </if>
  108. <if test="orderByClause != null">
  109. order by ${orderByClause}
  110. </if>
  111. </select>
  112. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  113. <!--
  114. WARNING - @mbg.generated
  115. This element is automatically generated by MyBatis Generator, do not modify.
  116. This element was generated on Thu Sep 26 16:21:54 CST 2019.
  117. -->
  118. select
  119. <include refid="Base_Column_List" />
  120. from order_examine
  121. where id = #{id,jdbcType=INTEGER}
  122. </select>
  123. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  124. <!--
  125. WARNING - @mbg.generated
  126. This element is automatically generated by MyBatis Generator, do not modify.
  127. This element was generated on Thu Sep 26 16:21:54 CST 2019.
  128. -->
  129. delete from order_examine
  130. where id = #{id,jdbcType=INTEGER}
  131. </delete>
  132. <delete id="deleteByExample" parameterType="com.goafanti.common.model.OrderExamineExample">
  133. <!--
  134. WARNING - @mbg.generated
  135. This element is automatically generated by MyBatis Generator, do not modify.
  136. This element was generated on Thu Sep 26 16:21:54 CST 2019.
  137. -->
  138. delete from order_examine
  139. <if test="_parameter != null">
  140. <include refid="Example_Where_Clause" />
  141. </if>
  142. </delete>
  143. <insert id="insert" parameterType="com.goafanti.common.model.OrderExamine">
  144. <!--
  145. WARNING - @mbg.generated
  146. This element is automatically generated by MyBatis Generator, do not modify.
  147. This element was generated on Thu Sep 26 16:21:54 CST 2019.
  148. -->
  149. insert into order_examine (id, order_no, type,
  150. aid, status, create_time
  151. )
  152. values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
  153. #{aid,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}
  154. )
  155. </insert>
  156. <insert id="insertSelective" parameterType="com.goafanti.common.model.OrderExamine">
  157. <!--
  158. WARNING - @mbg.generated
  159. This element is automatically generated by MyBatis Generator, do not modify.
  160. This element was generated on Thu Sep 26 16:21:54 CST 2019.
  161. -->
  162. insert into order_examine
  163. <trim prefix="(" suffix=")" suffixOverrides=",">
  164. <if test="id != null">
  165. id,
  166. </if>
  167. <if test="orderNo != null">
  168. order_no,
  169. </if>
  170. <if test="type != null">
  171. type,
  172. </if>
  173. <if test="aid != null">
  174. aid,
  175. </if>
  176. <if test="status != null">
  177. status,
  178. </if>
  179. <if test="createTime != null">
  180. create_time,
  181. </if>
  182. </trim>
  183. <trim prefix="values (" suffix=")" suffixOverrides=",">
  184. <if test="id != null">
  185. #{id,jdbcType=INTEGER},
  186. </if>
  187. <if test="orderNo != null">
  188. #{orderNo,jdbcType=VARCHAR},
  189. </if>
  190. <if test="type != null">
  191. #{type,jdbcType=INTEGER},
  192. </if>
  193. <if test="aid != null">
  194. #{aid,jdbcType=VARCHAR},
  195. </if>
  196. <if test="status != null">
  197. #{status,jdbcType=INTEGER},
  198. </if>
  199. <if test="createTime != null">
  200. #{createTime,jdbcType=TIMESTAMP},
  201. </if>
  202. </trim>
  203. </insert>
  204. <select id="countByExample" parameterType="com.goafanti.common.model.OrderExamineExample" resultType="java.lang.Long">
  205. <!--
  206. WARNING - @mbg.generated
  207. This element is automatically generated by MyBatis Generator, do not modify.
  208. This element was generated on Thu Sep 26 16:21:54 CST 2019.
  209. -->
  210. select count(*) from order_examine
  211. <if test="_parameter != null">
  212. <include refid="Example_Where_Clause" />
  213. </if>
  214. </select>
  215. <update id="updateByExampleSelective" parameterType="map">
  216. <!--
  217. WARNING - @mbg.generated
  218. This element is automatically generated by MyBatis Generator, do not modify.
  219. This element was generated on Thu Sep 26 16:21:54 CST 2019.
  220. -->
  221. update order_examine
  222. <set>
  223. <if test="record.id != null">
  224. id = #{record.id,jdbcType=INTEGER},
  225. </if>
  226. <if test="record.orderNo != null">
  227. order_no = #{record.orderNo,jdbcType=VARCHAR},
  228. </if>
  229. <if test="record.type != null">
  230. type = #{record.type,jdbcType=INTEGER},
  231. </if>
  232. <if test="record.aid != null">
  233. aid = #{record.aid,jdbcType=VARCHAR},
  234. </if>
  235. <if test="record.status != null">
  236. status = #{record.status,jdbcType=INTEGER},
  237. </if>
  238. <if test="record.createTime != null">
  239. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  240. </if>
  241. </set>
  242. <if test="_parameter != null">
  243. <include refid="Update_By_Example_Where_Clause" />
  244. </if>
  245. </update>
  246. <update id="updateByExample" parameterType="map">
  247. <!--
  248. WARNING - @mbg.generated
  249. This element is automatically generated by MyBatis Generator, do not modify.
  250. This element was generated on Thu Sep 26 16:21:54 CST 2019.
  251. -->
  252. update order_examine
  253. set id = #{record.id,jdbcType=INTEGER},
  254. order_no = #{record.orderNo,jdbcType=VARCHAR},
  255. type = #{record.type,jdbcType=INTEGER},
  256. aid = #{record.aid,jdbcType=VARCHAR},
  257. status = #{record.status,jdbcType=INTEGER},
  258. create_time = #{record.createTime,jdbcType=TIMESTAMP}
  259. <if test="_parameter != null">
  260. <include refid="Update_By_Example_Where_Clause" />
  261. </if>
  262. </update>
  263. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrderExamine">
  264. <!--
  265. WARNING - @mbg.generated
  266. This element is automatically generated by MyBatis Generator, do not modify.
  267. This element was generated on Thu Sep 26 16:21:54 CST 2019.
  268. -->
  269. update order_examine
  270. <set>
  271. <if test="orderNo != null">
  272. order_no = #{orderNo,jdbcType=VARCHAR},
  273. </if>
  274. <if test="type != null">
  275. type = #{type,jdbcType=INTEGER},
  276. </if>
  277. <if test="aid != null">
  278. aid = #{aid,jdbcType=VARCHAR},
  279. </if>
  280. <if test="status != null">
  281. status = #{status,jdbcType=INTEGER},
  282. </if>
  283. <if test="createTime != null">
  284. create_time = #{createTime,jdbcType=TIMESTAMP},
  285. </if>
  286. </set>
  287. where id = #{id,jdbcType=INTEGER}
  288. </update>
  289. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OrderExamine">
  290. <!--
  291. WARNING - @mbg.generated
  292. This element is automatically generated by MyBatis Generator, do not modify.
  293. This element was generated on Thu Sep 26 16:21:54 CST 2019.
  294. -->
  295. update order_examine
  296. set order_no = #{orderNo,jdbcType=VARCHAR},
  297. type = #{type,jdbcType=INTEGER},
  298. aid = #{aid,jdbcType=VARCHAR},
  299. status = #{status,jdbcType=INTEGER},
  300. create_time = #{createTime,jdbcType=TIMESTAMP}
  301. where id = #{id,jdbcType=INTEGER}
  302. </update>
  303. <update id="updateByOrderNoAndAid">
  304. update order_examine set status=1 where aid= #{aid} and order_no= #{orderNo} and type= #{type}
  305. </update>
  306. <select id="checkCountStatus" resultType="java.lang.Integer">
  307. select count(*) from order_examine where order_no = #{orderNo}
  308. <if test="status !=null">
  309. and status=#{status}
  310. </if>
  311. <if test="type !=null">
  312. and `type`= #{type}
  313. </if>
  314. </select>
  315. <select id="selectByOrderNo" resultType="com.goafanti.common.bo.OrderExamineBo">
  316. select a.id,b.name,a.type,a.status
  317. from order_examine a left join admin b on a.aid=b.id
  318. where a.order_no= #{orderNo} and a.type= #{type}
  319. </select>
  320. <select id="selectByOrderNoAndAid" resultType="java.lang.Integer">
  321. select ifnull(min(status),2) from order_examine
  322. where order_no= #{orderNo} and aid= #{aid}
  323. </select>
  324. <update id="updateByOrderNo">
  325. update order_examine set status=0
  326. where order_no=#{orderNo}
  327. <if test="status != null">
  328. and status=#{status}
  329. </if>
  330. </update>
  331. </mapper>