|
- <?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.WxRaffleActivityItemMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxRaffleActivityItem">
- <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="name" jdbcType="VARCHAR" property="name" />
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
- <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
- <result column="activity_id" jdbcType="BIGINT" property="activityId" />
- <result column="money_rule" jdbcType="INTEGER" property="moneyRule" />
- <result column="total_money" jdbcType="DECIMAL" property="totalMoney" />
- <result column="mall_back_rate" jdbcType="DECIMAL" property="mallBackRate" />
- <result column="merchant_back_rate" jdbcType="DECIMAL" property="merchantBackRate" />
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`name`,`create_date`,`update_date`,`activity_id`,`money_rule`,
- `total_money`,`mall_back_rate`,`merchant_back_rate`
- </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 != createDateBegin">
- and `create_date` >= #{createDateBegin}
- </if>
-
- <if test=" null != createDateEnd">
- and `create_date` <= #{createDateEnd}
- </if>
-
- <if test=" null != name ">
- and `name` like concat('%', #{name},'%')
- </if>
-
- <if test=" null != activityId ">
- and `activity_id` = #{activityId}
- </if>
-
- <if test=" null != activityIdList ">
- and activity_id in
- <foreach collection="activityIdList" index="index" item="aidItem" open="(" separator="," close=")">
- #{aidItem}
- </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_raffle_activity_item where id = #{id} and tenant_id=#{tenantId}
- </select>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxRaffleActivityItem" resultMap="BaseResultMap">
- select <include refid="allColumns" /> from wx_raffle_activity_item
- <include refid="dynamicWhereConditions" />
- </select>
-
- <select id="itemCount" parameterType="com.iformall.domain.po.WxRaffleActivityItem" resultType="Integer">
- select count(1) from wx_raffle_activity_item where `activity_id` = #{activityId} and tenant_id=#{tenantId}
- </select>
-
- <delete id="delete" parameterType="com.iformall.domain.po.WxRaffleActivityItem">
- delete from wx_raffle_activity_item
- <include refid="dynamicWhereConditions" />
- </delete>
-
- </mapper>
|