|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <?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.TtCouponChannelPoiMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.TtCouponChannelPoi">
- <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="coupon_channel_id" jdbcType="BIGINT" property="couponChannelId"/>
- <result column="spu_id" jdbcType="VARCHAR" property="spuId"/>
- <result column="status" jdbcType="INTEGER" property="status"/>
- <result column="status_desc" jdbcType="VARCHAR" property="statusDesc"/>
-
- <result column="last_status" jdbcType="INTEGER" property="lastStatus"/>
- <result column="last_status_desc" jdbcType="VARCHAR" property="lastStatusDesc"/>
-
- <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`,`coupon_channel_id`,`spu_id`,
- `status`,`status_desc`,`last_status`,`last_status_desc`,
- `create_date`,`update_date`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where is_del = 0
-
- <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 != couponChannelId ">
- and `coupon_channel_id` = #{couponChannelId}
- </if>
-
- <if test=" null != spuId and '' != spuId">
- and `spu_id` = #{spuId}
- </if>
-
- <if test=" null != status">
- and `status` = #{status}
- </if>
-
- <if test=" null != lastStatus">
- and `last_status` = #{lastStatus}
- </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.TtCouponChannelPoi" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from tt_coupon_channel_poi
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="selectById" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from tt_coupon_channel_poi
- where `id` = #{id}
- </select>
-
- <select id="selectByChannelId" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from tt_coupon_channel_poi
- where `coupon_channel_id` = #{couponChannelId}
- </select>
-
- <select id="findIdList" parameterType="com.iformall.domain.po.TtCouponChannelPoi" resultType="Long">
- select id
- from tt_coupon_channel_poi
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <update id="deleteByUpdate" parameterType="Long">
- update tt_coupon_channel_poi set is_del = 1
- where id = #{id}
- </update>
-
-
- <select id="getPoiPutOnCount" resultType="Integer">
- select count(1)
- from tt_coupon_channel_poi
- where is_del = 0
- and `tenant_id` = #{tenantId}
- and `status` = 1
- and `id` in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </select>
-
-
- <update id="updateBySpuId" parameterType="com.iformall.domain.po.TtCouponChannelPoi">
- update tt_coupon_channel_poi set update_date = now()
- <if test=" null != status ">,`status` = #{status}</if>
- <if test=" null != statusDesc ">,`last_status` = #{statusDesc}</if>
- <if test=" null != lastStatus ">,`last_status` = #{lastStatus}</if>
- <if test=" null != lastStatusDesc ">,`last_status_desc` = #{lastStatusDesc}</if>
- where `spu_id` = #{spuId}
- </update>
-
- </mapper>
|