|
- <?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.OrderSnapshotMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.OrderSnapshot">
- <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="order_id" jdbcType="BIGINT" property="orderId" />
- <result column="compose_order_id" jdbcType="BIGINT" property="composeOrderId" />
- <result column="type" jdbcType="INTEGER" property="type"/>
- <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
- <result column="cover_picture" jdbcType="VARCHAR" property="coverPicture"/>
- <result column="detail_picture" jdbcType="VARCHAR" property="detailPicture"/>
- <result column="title" jdbcType="VARCHAR" property="title"/>
- <result column="sub_title" jdbcType="VARCHAR" property="subTitle"/>
- <result column="item_group" jdbcType="VARCHAR" property="itemGroup"/>
- <result column="sale_price" jdbcType="INTEGER" property="salePrice"/>
- <result column="freight_price" jdbcType="INTEGER" property="freightPrice"/>
- <result column="use_price" jdbcType="INTEGER" property="usePrice"/>
- <result column="use_limit_rule" jdbcType="INTEGER" property="useLimitRule"/>
- <result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity"/>
- <result column="send_type" jdbcType="INTEGER" property="sendType"/>
- <result column="valid_type" jdbcType="INTEGER" property="validType"/>
- <result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate"/>
- <result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate"/>
- <result column="pick_start_date" jdbcType="TIMESTAMP" property="pickStartDate"/>
- <result column="pick_end_date" jdbcType="TIMESTAMP" property="pickEndDate"/>
- <result column="valid_days" jdbcType="INTEGER" property="validDays"/>
- <result column="detail" jdbcType="VARCHAR" property="detail"/>
- <result column="price" jdbcType="INTEGER" property="price"/>
- <result column="tail_price" jdbcType="INTEGER" property="tailPrice"/>
- <result column="orig_price" jdbcType="INTEGER" property="origPrice"/>
- <result column="unit" jdbcType="INTEGER" property="unit"/>
- <result column="remark" jdbcType="VARCHAR" property="remark"/>
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
- <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
- <result column="business" jdbcType="INTEGER" property="business"/>
- <result column="sub_business" jdbcType="INTEGER" property="subBusiness"/>
- <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/>
- <result column="subsidy_type" jdbcType="INTEGER" property="subsidyType"/>
- <result column="subsidy_num" jdbcType="INTEGER" property="subsidyNum"/>
- <result column="press_limit_num" jdbcType="INTEGER" property="pressLimitNum"/>
- <result column="press_limit_hours" jdbcType="INTEGER" property="pressLimitHours"/>
- <result column="auto_refund" jdbcType="INTEGER" property="autoRefund"/>
- <result column="credit_price" jdbcType="INTEGER" property="creditPrice"/>
- <result column="credit_refund" jdbcType="INTEGER" property="creditRefund"/>
- <result column="conditions" jdbcType="VARCHAR" property="conditions"/>
- <result column="password_support" property="passwordSupport"/>
- <result column="content_type" property="contentType"/>
- <result column="html" property="html"/>
- <result column="source_type" jdbcType="INTEGER" property="sourceType"/>
-
- <result column="gift_list" jdbcType="VARCHAR" property="giftList"></result>
- <result column="merchant_list" jdbcType="VARCHAR" property="merchantList"></result>
-
- <result column="product_type" jdbcType="INTEGER" property="productType"/>
- <result column="category_id" jdbcType="INTEGER" property="categoryId"/>
- <result column="product_attrs" jdbcType="VARCHAR" property="productAttrs"/>
- <result column="sku_attrs" jdbcType="VARCHAR" property="skuAttrs"/>
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`order_id`,`compose_order_id`,`type`,`cover_img`,`cover_picture`,`detail_picture`,
- `title`,`sub_title`,`item_group`,`sale_price`,`freight_price`,`use_price`,`use_limit_rule`,`use_limit_quantity`,`send_type`,
- `valid_type`,`valid_start_date`,`valid_end_date`,pick_start_date,pick_end_date,`valid_days`,`detail`,`price`,tail_price,orig_price,`unit`,
- `remark`,`create_date`,`update_date`,`business`,`sub_business`,`support_transfer`,`subsidy_num`,`subsidy_type`,
- `press_limit_num`, `press_limit_hours`, `auto_refund`,`credit_price`,`credit_refund`,
- `conditions`,content_type,source_type,password_support,gift_list,merchant_list,
- product_type,category_id,product_attrs,sku_attrs
- </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 != orderId ">
- and `order_id` = #{orderId}
- </if>
-
- <if test=" null != composeOrderId ">
- and `compose_order_id` = #{composeOrderId}
- </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="findList" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from order_snapshot
- <include refid="dynamicWhereConditions"/>
- </select>
-
-
- </mapper>
|