|
- <?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.WxOfflineActivityGrantItemMapper">
-
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxOfflineActivityGrantItem">
- <id property="id" column="id" jdbcType="BIGINT"/>
- <result property="tenantId" column="tenant_id" jdbcType="VARCHAR"/>
- <result property="parentTenantId" column="parent_tenant_id" jdbcType="VARCHAR"/>
- <result property="grantId" column="grant_id" jdbcType="BIGINT"/>
- <result property="activityId" column="activity_id" jdbcType="BIGINT"/>
- <result property="activityName" column="activity_name" jdbcType="VARCHAR"/>
- <result property="activityItemId" column="activity_item_id" jdbcType="BIGINT"/>
- <result property="activityItemName" column="activity_item_name" jdbcType="INTEGER"/>
- <result property="activityItemType" column="activity_item_type" jdbcType="SMALLINT"/>
- <result property="awardItamId" column="award_itam_id" jdbcType="BIGINT"/>
- <result property="awardName" column="award_name" jdbcType="VARCHAR"/>
- <result property="awardGrade" column="award_grade" jdbcType="INTEGER"/>
- <result property="awardMinAmount" column="award_min_amount" jdbcType="DECIMAL"/>
- <result property="awardMaxAmount" column="award_max_amount" jdbcType="DECIMAL"/>
- <result property="awardsItemRule" column="awards_item_rule" jdbcType="INTEGER"/>
- <result property="cashBackRatio" column="cash_back_ratio" jdbcType="DECIMAL"/>
- <result property="awardPrice" column="award_price" jdbcType="DECIMAL"/>
- <result property="awardCount" column="award_count" jdbcType="INTEGER"/>
- <result property="moneyRule" column="money_rule" jdbcType="SMALLINT"/>
- <result property="mallShareRate" column="mall_share_rate" jdbcType="DECIMAL"/>
- <result property="merchantShareRate" column="merchant_share_rate" jdbcType="DECIMAL"/>
- <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
- <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
- </resultMap>
-
- <sql id="allColumns">
- id,tenant_id,parent_tenant_id,
- grant_id,activity_id,activity_name,
- activity_item_id,activity_item_name,activity_item_type,
- award_itam_id,award_name,award_grade,
- award_min_amount,award_max_amount,awards_item_rule,cash_back_ratio,
- award_price,award_count,money_rule,
- mall_share_rate,merchant_share_rate,
- 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 != grantId">
- and `grant_id` = #{grantId}
- </if>
-
- <if test=" null != activityId">
- and `activity_id` = #{activityId}
- </if>
- <if test=" null != activityItemId">
- and `activity_item_id` = #{activityItemId}
- </if>
- <if test=" null != awardItamId">
- and `award_itam_id` = #{awardItamId}
- </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.WxOfflineActivityGrantItem" resultMap="BaseResultMap">
- select <include refid="allColumns" /> from wx_offline_activity_grant_item
- <include refid="dynamicWhereConditions" />
- </select>
-
- <insert id="insertList" parameterType="java.util.List">
- insert into wx_offline_activity_grant_item
- (id,tenant_id,parent_tenant_id,
- grant_id,activity_id,activity_name,
- activity_item_id,activity_item_name,activity_item_type,
- award_itam_id,award_name,award_grade,
- award_min_amount,award_max_amount,awards_item_rule,cash_back_ratio,
- award_price,award_count,money_rule,
- mall_share_rate,merchant_share_rate,
- create_date,update_date)
- values
- <foreach collection="grantItemList" item="item" index="index" separator=",">
- (#{item.id,jdbcType=BIGINT},#{item.tenantId,jdbcType=VARCHAR},#{item.parentTenantId,jdbcType=VARCHAR},
- #{item.grantId,jdbcType=BIGINT},#{item.activityId,jdbcType=BIGINT},#{item.activityName,jdbcType=VARCHAR},
- #{item.activityItemId,jdbcType=BIGINT},#{item.activityItemName,jdbcType=VARCHAR},#{item.activityItemType,jdbcType=INTEGER},
- #{item.awardItamId,jdbcType=BIGINT},#{item.awardName,jdbcType=VARCHAR},#{item.awardGrade,jdbcType=INTEGER},
- #{item.awardMinAmount,jdbcType=DECIMAL},#{item.awardMaxAmount,jdbcType=DECIMAL},#{item.awardsItemRule,jdbcType=INTEGER},#{item.cashBackRatio,jdbcType=DECIMAL},
- #{item.awardPrice,jdbcType=DECIMAL},#{item.awardCount,jdbcType=INTEGER},#{item.moneyRule,jdbcType=INTEGER},
- #{item.mallShareRate,jdbcType=DECIMAL},#{item.merchantShareRate,jdbcType=DECIMAL},
- #{item.createDate,jdbcType=TIMESTAMP},#{item.updateDate,jdbcType=TIMESTAMP})
- </foreach>
- </insert>
-
- <select id="getSumAwardCount" parameterType="com.iformall.domain.po.WxOfflineActivityGrantItem" resultType="Integer">
- SELECT COUNT(1) FROM wx_offline_activity_grant_item
- where 1 = 1
- <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 != activityId ">
- and activity_id = #{activityId}
- </if>
- </select>
-
- </mapper>
|