| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?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.ytpm.dao.PromoterUserMapper">
- <insert id="insertPromoter">
- insert into yt_platform_user_promoter
- (relation_id, platform_user_id, promoter_user_id, ditch_id, app_id, share_rate, start_time, end_time,
- operator_id, operator_time)
- values (#{promoter.relationId},
- #{promoter.platformUserId},
- #{promoter.promoterUserId},
- #{promoter.ditchId},
- #{promoter.appId},
- #{promoter.shareRate},
- #{promoter.startTime},
- #{promoter.endTime},
- #{promoter.operatorId},
- #{promoter.operatorTime});
- </insert>
- <update id="updatePromoter">
- update yt_platform_user_promoter set
- <if test="promoter.platformUserId != null and promoter.platformUserId != ''">
- platform_user_id = #{promoter.platformUserId},
- </if>
- <if test="promoter.promoterUserId != null and promoter.promoterUserId != ''">
- promoter_user_id = #{promoter.promoterUserId},
- </if>
- <if test="promoter.ditchId != null">
- ditch_id = #{promoter.ditchId},
- </if>
- <if test="promoter.appId != null">
- app_id = #{promoter.appId},
- </if>
- <if test="promoter.shareRate != null and promoter.shareRate != ''">
- share_rate = #{promoter.shareRate},
- </if>
- <if test="promoter.endTime != null">
- end_time = #{promoter.endTime},
- </if>
- operator_time = #{promoter.operatorTime}
- where relation_id = #{promoter.relationId}
- </update>
- <select id="selectPromoterByAppId" resultType="com.ytpm.agent.model.YtPlatformUserPromoter">
- select relation_id,
- platform_user_id,
- promoter_user_id,
- ditch_id,
- app_id,
- share_rate,
- start_time,
- end_time,
- operator_id,
- operator_time
- from yt_platform_user_promoter
- where app_id = #{appId}
- and (end_time is null or end_time <![CDATA[ <= ]]> current_date())
- limit 1
- </select>
- <select id="selectPromoterByUserId" resultType="com.ytpm.agent.model.YtPlatformUserPromoter">
- select relation_id,
- platform_user_id,
- promoter_user_id,
- ditch_id,
- app_id,
- share_rate,
- start_time,
- end_time,
- operator_id,
- operator_time
- from yt_platform_user_promoter
- where promoter_user_id = #{userId}
- and (end_time is null or end_time <![CDATA[ <= ]]> current_date())
- order by start_time
- </select>
- </mapper>
|