|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.iformall.mapper.WxCarJSOrderMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCarJSOrder">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
- <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
- <result column="car_number" jdbcType="VARCHAR" property="carNumber"/>
- <result column="order_id" jdbcType="VARCHAR" property="orderId"/>
- <result column="status" jdbcType="INTEGER" property="status"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
- </resultMap>
-
- <sql id="allColumns">
- `id`,`car_number`,`tenant_id`,`parent_tenant_id`,`order_id`,`status`,`create_time`,`update_time`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1 = 1
-
- <if test=" null != id ">
- and `id` = #{id}
- </if>
-
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
-
- <if test=" null != carNumber and '' != carNumber">
- and `car_number` = #{carNumber}
- </if>
-
- <if test=" null != status and '' != status">
- and `status` = #{status}
- </if>
- </sql>
-
- <select id="getOneOrder" parameterType="com.iformall.domain.po.WxCarJSOrder" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_car_js_order
- <include refid="dynamicWhereConditions"/>
- order by create_time desc
- limit 0, 1
- </select>
-
- <update id="updateStatus" parameterType="com.iformall.domain.po.WxCarJSOrder">
- update wx_car_js_order set status = 2, update_time=now() where car_number = #{carNumber} and status = 1
- </update>
-
- </mapper>
|