|
- <?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.WxBatchOrderMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBatchOrder">
- <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="c_user_id" jdbcType="BIGINT" property="cUserId"/>
- <result column="payment" jdbcType="INTEGER" property="payment"/>
- <result column="ext_param" jdbcType="VARCHAR" property="extParam"/>
- <result column="pay_vendor" jdbcType="INTEGER" property="payVendor"/>
- <result column="pay_version" jdbcType="INTEGER" property="payVersion"/>
- <result column="order_type" jdbcType="INTEGER" property="orderType"/>
- <result column="is_tt_poi_order" jdbcType="INTEGER" property="isTtPoiOrder"/>
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
- <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`c_user_id`,`payment`,`ext_param`,`pay_vendor`,`pay_version`,`order_type`,`is_tt_poi_order`,`create_date`,`update_date`
- </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 != cUserId ">
- and `c_user_id` = #{cUserId}
- </if>
-
- <if test=" null != payment ">
- and `payment` = #{payment}
- </if>
-
- <if test=" null != payVendor ">
- and `pay_vendor` = #{payVendor}
- </if>
- <if test=" null != payVersion ">
- and `pay_version` = #{payVersion}
- </if>
-
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns">order by ${sortColumns}</if>
- </sql>
-
- <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- select <include refid="allColumns"/> from wx_batch_order where id =#{id} and tenant_id=#{tenantId}
- </select>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxBatchOrder" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_batch_order
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="findCOrderList" parameterType="com.iformall.domain.po.WxBatchOrder" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_batch_order o
- where o.c_user_id = #{cUserId} and o.`tenant_id` = #{tenantId}
- <if test=" null != parentTenantId and '' != parentTenantId">
- and o.`parent_tenant_id` = #{parentTenantId}
- </if>
- <if test=" null != id ">
- and o.`id` = #{id}
- </if>
- <if test=" null != payVendor ">
- and o.pay_vendor = #{payVendor}
- </if>
- <if test=" null != payVersion ">
- and o.pay_version = #{payVersion}
- </if>
- <if test=" null != ids ">
- and o.id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- order by o.create_date desc
- </select>
-
- <select id="countList" parameterType="com.iformall.domain.po.WxBatchOrder" resultType="java.lang.Integer">
- select count(1) from wx_batch_order
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <update id="updateCUserId" parameterType="com.iformall.domain.po.WxBatchOrder">
- update wx_batch_order set `c_user_id` = #{cUserId} where id =#{id} and tenant_id=#{tenantId}
- </update>
-
- <update id="updatePayMent" parameterType="java.util.HashMap">
- update wx_batch_order set `payment` = #{payment} where id =#{id} and tenant_id=#{tenantId}
- </update>
-
- </mapper>
|