| | |
| | | <?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.yeshi.fanli.dao.mybatis.redpack.RedPackWinInviteMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.redpack.RedPackWinInvite"> |
| | | <id column="rwr_id" property="id" jdbcType="BIGINT"/> |
| | |
| | | <result column="rwr_team_uid" property="teamUid" jdbcType="BIGINT"/> |
| | | <result column="rwr_money" property="money" jdbcType="DECIMAL"/> |
| | | <result column="rwr_source" property="source" jdbcType="INTEGER"/> |
| | | <result column="rwr_identify_code" property="identifyCode" jdbcType="VARCHAR"/> |
| | | <result column="rwr_order_no" property="orderNo" jdbcType="VARCHAR"/> |
| | | <result column="rwr_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="rwr_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | <result column="rwr_type" property="type" typeHandler="com.yeshi.fanli.util.mybatishandler.redpack.RedPackWinInviteTypeEnumHandler"/> |
| | | <result column="rwr_type" property="type" typeHandler="com.yeshi.fanli.util.mybatishandler.redpack.RedPackWinInviteTypeEnumHandler"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">rwr_id,rwr_uid,rwr_team_uid,rwr_money,rwr_type,rwr_source,rwr_order_no,rwr_create_time,rwr_update_time</sql> |
| | | <sql id="Base_Column_List">rwr_id,rwr_uid,rwr_team_uid,rwr_money,rwr_type,rwr_source,rwr_identify_code,rwr_order_no,rwr_create_time,rwr_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_red_pack_win_invite where rwr_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_red_pack_win_invite where rwr_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.redpack.RedPackWinInvite" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_red_pack_win_invite (rwr_id,rwr_uid,rwr_team_uid,rwr_money,rwr_type,rwr_source,rwr_order_no,rwr_create_time,rwr_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{teamUid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{type,jdbcType=VARCHAR},#{source,jdbcType=INTEGER},#{orderNo,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.redpack.RedPackWinInvite" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_red_pack_win_invite (rwr_id,rwr_uid,rwr_team_uid,rwr_money,rwr_type,rwr_source,rwr_identify_code,rwr_order_no,rwr_create_time,rwr_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{teamUid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{type,jdbcType=VARCHAR},#{source,jdbcType=INTEGER},#{identifyCode,jdbcType=VARCHAR},#{orderNo,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.redpack.RedPackWinInvite" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_red_pack_win_invite |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">rwr_id,</if> |
| | |
| | | <if test="money != null">rwr_money,</if> |
| | | <if test="type != null">rwr_type,</if> |
| | | <if test="source != null">rwr_source,</if> |
| | | <if test="identifyCode != null">rwr_identify_code,</if> |
| | | <if test="orderNo != null">rwr_order_no,</if> |
| | | <if test="createTime != null">rwr_create_time,</if> |
| | | <if test="updateTime != null">rwr_update_time,</if> |
| | |
| | | <if test="money != null">#{money,jdbcType=DECIMAL},</if> |
| | | <if test="type != null">#{type,jdbcType=VARCHAR},</if> |
| | | <if test="source != null">#{source,jdbcType=INTEGER},</if> |
| | | <if test="identifyCode != null">#{identifyCode,jdbcType=VARCHAR},</if> |
| | | <if test="orderNo != null">#{orderNo,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.redpack.RedPackWinInvite">update yeshi_ec_red_pack_win_invite set rwr_uid = #{uid,jdbcType=BIGINT},rwr_team_uid = #{teamUid,jdbcType=BIGINT},rwr_money = #{money,jdbcType=DECIMAL},rwr_type = #{type,jdbcType=VARCHAR},rwr_source = #{source,jdbcType=INTEGER},rwr_order_no = #{orderNo,jdbcType=VARCHAR},rwr_create_time = #{createTime,jdbcType=TIMESTAMP},rwr_update_time = #{updateTime,jdbcType=TIMESTAMP} where rwr_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.redpack.RedPackWinInvite">update yeshi_ec_red_pack_win_invite set rwr_uid = #{uid,jdbcType=BIGINT},rwr_team_uid = #{teamUid,jdbcType=BIGINT},rwr_money = #{money,jdbcType=DECIMAL},rwr_type = #{type,jdbcType=VARCHAR},rwr_source = #{source,jdbcType=INTEGER},rwr_identify_code = #{identifyCode,jdbcType=VARCHAR},rwr_order_no = #{orderNo,jdbcType=VARCHAR},rwr_create_time = #{createTime,jdbcType=TIMESTAMP},rwr_update_time = #{updateTime,jdbcType=TIMESTAMP} where rwr_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.redpack.RedPackWinInvite">update yeshi_ec_red_pack_win_invite |
| | | <set> |
| | | <if test="uid != null">rwr_uid=#{uid,jdbcType=BIGINT},</if> |
| | |
| | | <if test="money != null">rwr_money=#{money,jdbcType=DECIMAL},</if> |
| | | <if test="type != null">rwr_type=#{type,jdbcType=VARCHAR},</if> |
| | | <if test="source != null">rwr_source=#{source,jdbcType=INTEGER},</if> |
| | | <if test="identifyCode != null">rwr_identify_code=#{identifyCode,jdbcType=VARCHAR},</if> |
| | | <if test="orderNo != null">rwr_order_no=#{orderNo,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">rwr_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">rwr_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | |
| | | WHERE d.`rwr_uid` = #{uid} AND d.`rwr_type` = #{type} |
| | | </select> |
| | | |
| | | <select id="countByUidAndTeamUidAndType" resultType="Long"> |
| | | <select id="countByUidAndTeamUidAndType" resultType="Integer"> |
| | | SELECT IFNULL(COUNT(d.`rwr_id`),0) FROM yeshi_ec_red_pack_win_invite d |
| | | WHERE d.`rwr_uid` = #{uid} AND d.`rwr_team_uid` = #{teamUid} AND d.`rwr_type` = #{type} |
| | | </select> |
| | | |
| | | <select id="getByUidAndTeamUidAndType" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_red_pack_win_invite d |
| | | WHERE d.`rwr_uid` = #{uid} AND d.`rwr_team_uid` = #{teamUid} AND d.`rwr_type` = #{type} |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getByUidAndTeamUidAndTypeMonth" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_red_pack_win_invite d |
| | | WHERE d.`rwr_uid` = #{uid} AND d.`rwr_team_uid` = #{teamUid} AND d.`rwr_type` = #{type} |
| | | AND DATE_FORMAT(d.rwr_create_time,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m') |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="getRewardList" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_red_pack_win_invite d |
| | |
| | | WHERE d.`rwr_uid` = #{uid} |
| | | </select> |
| | | |
| | | <select id="getRewardMoney" resultType="BigDecimal"> |
| | | SELECT IFNULL(SUM(d.`rwr_money`),0) FROM yeshi_ec_red_pack_win_invite d |
| | | WHERE d.`rwr_uid` = #{uid} |
| | | </select> |
| | | |
| | | |
| | | <select id="getWinListByBossIdAndTeamUid" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_red_pack_win_invite d |
| | | WHERE d.`rwr_uid` = #{uid} AND d.`rwr_team_uid` = #{teamUid} |
| | | </select> |
| | | |
| | | <select id="getWinTopListByBossId" resultMap="BaseResultMap"> |
| | | SELECT SUM(d.`rwr_money`)AS rwr_money,d.`rwr_team_uid`,MIN(d.`rwr_id`) AS orderId FROM `yeshi_ec_red_pack_win_invite` d |
| | | WHERE d.`rwr_uid` = #{uid} AND d.`rwr_type` <![CDATA[<>]]> 'newUserReward' |
| | | GROUP BY d.`rwr_team_uid` |
| | | ORDER BY orderId |
| | | LIMIT #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="countWinTopListByBossId" resultType="Long"> |
| | | SELECT IFNULL(COUNT(DISTINCT d.`rwr_team_uid`),0) FROM `yeshi_ec_red_pack_win_invite` d |
| | | WHERE d.`rwr_uid` = #{uid} AND d.`rwr_type` <![CDATA[<>]]> 'newUserReward' |
| | | </select> |
| | | |
| | | <select id="countTeamNumByTid" resultType="Long"> |
| | | SELECT COUNT(dd.`rwr_id`) FROM yeshi_ec_red_pack_win_invite dd |
| | | WHERE dd.`rwr_uid` = #{uid} AND dd.`rwr_type` = 'zeroStageReward' |
| | | AND dd.`rwr_id` <![CDATA[<=]]> (SELECT d.`rwr_id` FROM `yeshi_ec_red_pack_win_invite` d |
| | | WHERE d.`rwr_uid` = #{uid} AND d.rwr_team_uid = #{teamUid} AND d.`rwr_type` = 'zeroStageReward') |
| | | </select> |
| | | |
| | | |
| | | <select id="query" resultMap="BaseResultMap"> |
| | | SELECT * FROM `yeshi_ec_red_pack_win_invite` d |
| | | WHERE 1=1 <if test="key != null and key != ''">AND d.`rwr_uid` = #{key}</if> |
| | | <if test="type != null">AND d.`rwr_type`= #{type}</if> |
| | | ORDER BY d.rwr_id DESC |
| | | LIMIT #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="Long"> |
| | | SELECT COUNT(DISTINCT d.`rwr_id`) FROM `yeshi_ec_red_pack_win_invite` d |
| | | WHERE 1=1 <if test="key != null and key != ''">AND d.`rwr_uid` = #{key}</if> |
| | | <if test="type != null">AND d.`rwr_type`= #{type}</if> |
| | | </select> |
| | | |
| | | </mapper> |