后台服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 line
2.2 KiB

  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.iformall.mapper.WxCarJSOrderMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCarJSOrder">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
  8. <result column="car_number" jdbcType="VARCHAR" property="carNumber"/>
  9. <result column="order_id" jdbcType="VARCHAR" property="orderId"/>
  10. <result column="status" jdbcType="INTEGER" property="status"/>
  11. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  12. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  13. </resultMap>
  14. <sql id="allColumns">
  15. `id`,`car_number`,`tenant_id`,`parent_tenant_id`,`order_id`,`status`,`create_time`,`update_time`
  16. </sql>
  17. <sql id="dynamicWhereConditions">
  18. where 1 = 1
  19. <if test=" null != id ">
  20. and `id` = #{id}
  21. </if>
  22. <if test=" null != tenantId and '' != tenantId">
  23. and `tenant_id` = #{tenantId}
  24. </if>
  25. <if test=" null != parentTenantId and '' != parentTenantId">
  26. and `parent_tenant_id` = #{parentTenantId}
  27. </if>
  28. <if test=" null != carNumber and '' != carNumber">
  29. and `car_number` = #{carNumber}
  30. </if>
  31. <if test=" null != status and '' != status">
  32. and `status` = #{status}
  33. </if>
  34. </sql>
  35. <select id="getOneOrder" parameterType="com.iformall.domain.po.WxCarJSOrder" resultMap="BaseResultMap">
  36. select
  37. <include refid="allColumns"/>
  38. from wx_car_js_order
  39. <include refid="dynamicWhereConditions"/>
  40. order by create_time desc
  41. limit 0, 1
  42. </select>
  43. <update id="updateStatus" parameterType="com.iformall.domain.po.WxCarJSOrder">
  44. update wx_car_js_order set status = 2, update_time=now() where car_number = #{carNumber} and status = 1
  45. </update>
  46. </mapper>