|
- <?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.WxOfflineActivityItemMapper">
-
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxOfflineActivityItem">
- <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="activityId" column="activity_id" jdbcType="BIGINT"/>
- <result property="type" column="type" jdbcType="SMALLINT"/>
- <result property="name" column="name" jdbcType="VARCHAR"/>
- <result property="limitMoney" column="limit_money" jdbcType="DECIMAL"/>
- <result property="awardsItemPrice" column="awards_item_price" jdbcType="DECIMAL"/>
- <result property="awardsItemLimit" column="awards_item_limit" jdbcType="INTEGER"/>
- <result property="awardsItemCount" column="awards_item_count" jdbcType="INTEGER"/>
- <result property="awardsItemRule" column="awards_item_rule" jdbcType="SMALLINT"/>
- <result property="calculationMode" column="calculation_mode" jdbcType="SMALLINT"/>
- <result property="maxAmount" column="max_amount" jdbcType="DECIMAL"/>
- <result property="startingTaxPoint" column="starting_tax_point" jdbcType="DECIMAL"/>
- <result property="taxPoints" column="tax_points" 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,
- activity_id,`type`,`name`,
- limit_money,awards_item_price,awards_item_limit,awards_item_count,
- awards_item_rule,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 != name and name != '' ">
- and `name` like concat('%', #{name},'%')
- </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_offline_activity_item where id = #{id} and tenant_id=#{tenantId}
- </select>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxOfflineActivityItem" resultMap="BaseResultMap">
- select <include refid="allColumns" /> from wx_offline_activity_item
- <include refid="dynamicWhereConditions" />
- </select>
-
- <select id="findIds" parameterType="com.iformall.domain.po.WxOfflineActivityItem" resultType="Long">
- select id from wx_offline_activity_item
- <include refid="dynamicWhereConditions" />
- </select>
-
- <delete id="delete" parameterType="com.iformall.domain.po.WxOfflineActivityItem">
- delete from wx_offline_activity_item
- <include refid="dynamicWhereConditions" />
- </delete>
-
- </mapper>
|