|
- <?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.WxCashBackActivityMerchantMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCashBackActivityMerchant">
- <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="activity_id" jdbcType="BIGINT" property="activityId" />
- <result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
- <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`,`activity_id`,`merchant_id`,`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 != activityId ">
- and `activity_id` = #{activityId}
- </if>
-
- <if test=" null != merchantId ">
- and `merchant_id` = #{merchantId}
- </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_cash_back_activity_merchant where id = #{id} and tenant_id=#{tenantId}
- </select>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxCashBackActivityMerchant" resultMap="BaseResultMap">
- select <include refid="allColumns" /> from wx_cash_back_activity_merchant
- <include refid="dynamicWhereConditions" />
- </select>
-
- <delete id="delete" parameterType="com.iformall.domain.po.WxCashBackActivityMerchant">
- delete from wx_cash_back_activity_merchant
- where `activity_id` = #{activityId}
- <if test=" null != merchantId ">
- and `merchant_id` = #{merchantId}
- </if>
- </delete>
-
- <select id="merchantCount" parameterType="com.iformall.domain.po.WxCashBackActivityMerchant" resultType="Integer">
- select count(1) from wx_cash_back_activity_merchant
- <include refid="dynamicWhereConditions" />
- </select>
-
- <select id="findActivityIdList" parameterType="java.util.HashMap" resultType="Long">
- select activity_id from wx_cash_back_activity_merchant where merchant_id = #{merchantId} and tenant_id=#{tenantId}
- </select>
-
- </mapper>
|