|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?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.WxOrderPressMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxOrderPress">
- <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="coupon_id" jdbcType="BIGINT" property="couponId" />
- <result column="order_id" jdbcType="BIGINT" property="orderId" />
- <result column="user_id" jdbcType="BIGINT" property="userId" />
- <result column="press_value" jdbcType="INTEGER" property="pressValue" />
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
- <result column="first" jdbcType="SMALLINT" property="first" />
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`order_id`,`user_id`,`press_value`,`create_date`,`first`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where `tenant_id` = #{tenantId}
- <if test=" null != id ">
- and `id` = #{id}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
- <if test=" null != orderId ">
- and `order_id` = #{orderId}
- </if>
- <if test=" null != userId ">
- and `user_id` = #{userId}
- </if>
- <if test=" null != pressValue ">
- and `press_value` = #{pressValue}
- </if>
- <if test=" null != createDate ">
- and `create_date` = #{createDate}
- </if>
- <if test=" null != couponIds ">
- and coupon_id in
- <foreach collection="couponIds" index="index" item="cIdItem" open="(" separator="," close=")">
- #{cIdItem}
- </foreach>
- </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_order_press where id = #{id} and tenant_id = #{tenantId}
- </select>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxOrderPress" resultMap="BaseResultMap">
- select <include refid="allColumns" /> from wx_order_press
- <include refid="dynamicWhereConditions" />
- </select>
-
- <select id="findPressList" parameterType="com.iformall.domain.vo.WxOrderPressVo" resultMap="BaseResultMap">
- select <include refid="allColumns" />
- from wx_order_press op
- where op.`order_id` = #{orderId} and op.tenant_id = #{tenantId}
- order by op.`create_date` desc
- </select>
-
- <select id="findCount" parameterType="com.iformall.domain.po.WxOrderPress" resultType="Integer">
- select count(1) from wx_order_press
- <include refid="dynamicWhereConditions" />
- </select>
- </mapper>
|