From 0e0eb2b6645d02c0a0a15cb83fc2717875ab12b4 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 24 三月 2020 15:19:39 +0800
Subject: [PATCH] APP更新整改,团队补贴与团队奖励修改

---
 fanli/src/main/java/com/yeshi/fanli/mapping/order/OrderTeamRewardMapper.xml |   71 +++++++++++++----------------------
 1 files changed, 27 insertions(+), 44 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/order/OrderTeamRewardMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/order/OrderTeamRewardMapper.xml
index d218a2d..b6fcf61 100644
--- a/fanli/src/main/java/com/yeshi/fanli/mapping/order/OrderTeamRewardMapper.xml
+++ b/fanli/src/main/java/com/yeshi/fanli/mapping/order/OrderTeamRewardMapper.xml
@@ -20,13 +20,16 @@
 			jdbcType="TIMESTAMP" />
 		<result column="otr_get_time" property="getTime" jdbcType="TIMESTAMP" />
 		<result column="otr_level" property="level" jdbcType="INTEGER" />
+		<result column="otr_valid_time" property="validTime" jdbcType="TIMESTAMP" />
+		<result column="otr_invalid_time" property="inValidTime"
+			jdbcType="TIMESTAMP" />
 		<association property="subsidy"
 			javaType="com.yeshi.fanli.entity.order.InviteOrderSubsidy" column="otr_subsidy_id">
 			<id column="otr_subsidy_id" property="id" />
 		</association>
 
 	</resultMap>
-	<sql id="Base_Column_List">otr_id,otr_uid,otr_money,otr_order_no,otr_source_type,otr_state,otr_create_time,otr_update_time,otr_original_money,otr_subsidy_id,otr_pre_get_time,otr_get_time,otr_level
+	<sql id="Base_Column_List">otr_id,otr_uid,otr_money,otr_order_no,otr_source_type,otr_state,otr_create_time,otr_update_time,otr_original_money,otr_subsidy_id,otr_pre_get_time,otr_get_time,otr_level,otr_valid_time,otr_invalid_time
 	</sql>
 	<select id="selectByPrimaryKey" resultMap="BaseResultMap"
 		parameterType="java.lang.Long">
@@ -46,9 +49,9 @@
 	<insert id="insert" parameterType="com.yeshi.fanli.entity.order.OrderTeamReward"
 		useGeneratedKeys="true" keyProperty="id">insert into
 		yeshi_ec_order_team_reward
-		(otr_id,otr_uid,otr_money,otr_order_no,otr_source_type,otr_state,otr_create_time,otr_update_time,otr_original_money,otr_subsidy_id,otr_pre_get_time,otr_get_time,otr_level)
+		(otr_id,otr_uid,otr_money,otr_order_no,otr_source_type,otr_state,otr_create_time,otr_update_time,otr_original_money,otr_subsidy_id,otr_pre_get_time,otr_get_time,otr_level,otr_valid_time,otr_invalid_time)
 		values
-		(#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{orderNo,jdbcType=VARCHAR},#{sourceType,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{originalMoney,jdbcType=DECIMAL},#{subsidy.id,jdbcType=BIGINT},#{preGetTime,jdbcType=TIMESTAMP},#{getTime,jdbcType=TIMESTAMP},#{level,jdbcType=INTEGER})
+		(#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{orderNo,jdbcType=VARCHAR},#{sourceType,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{originalMoney,jdbcType=DECIMAL},#{subsidy.id,jdbcType=BIGINT},#{preGetTime,jdbcType=TIMESTAMP},#{getTime,jdbcType=TIMESTAMP},#{level,jdbcType=INTEGER},#{validTime,jdbcType=TIMESTAMP},#{inValidTime,jdbcType=TIMESTAMP})
 	</insert>
 	<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.OrderTeamReward"
 		useGeneratedKeys="true" keyProperty="id">
@@ -67,6 +70,8 @@
 			<if test="preGetTime != null">otr_pre_get_time,</if>
 			<if test="getTime != null">otr_get_time,</if>
 			<if test="level != null">otr_level,</if>
+			<if test="validTime != null">otr_valid_time,</if>
+			<if test="inValidTime != null">otr_invalid_time,</if>
 		</trim>
 		values
 		<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -83,6 +88,8 @@
 			<if test="preGetTime != null">#{preGetTime,jdbcType=TIMESTAMP},</if>
 			<if test="getTime != null">#{getTime,jdbcType=TIMESTAMP},</if>
 			<if test="level != null">#{level,jdbcType=INTEGER},</if>
+			<if test="validTime != null">#{validTime,jdbcType=TIMESTAMP},</if>
+			<if test="inValidTime != null">#{inValidTime,jdbcType=TIMESTAMP}</if>
 		</trim>
 	</insert>
 	<update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.OrderTeamReward">update
@@ -98,8 +105,9 @@
 		=#{subsidy.id,jdbcType=BIGINT} ,otr_pre_get_time
 		=#{preGetTime,jdbcType=TIMESTAMP} ,otr_get_time
 		=#{getTime,jdbcType=TIMESTAMP} ,otr_level =#{level,jdbcType=INTEGER}
-		where otr_id = #{id,jdbcType=BIGINT}
-	</update>
+		,otr_valid_time =#{validTime,jdbcType=TIMESTAMP} ,otr_invalid_time
+		=#{inValidTime,jdbcType=TIMESTAMP} where otr_id =
+		#{id,jdbcType=BIGINT}</update>
 	<update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.OrderTeamReward">
 		update yeshi_ec_order_team_reward
 		<set>
@@ -115,65 +123,40 @@
 			<if test="subsidy !=null">otr_subsidy_id =#{subsidy.id,jdbcType=BIGINT},</if>
 			<if test="preGetTime !=null">otr_pre_get_time =#{preGetTime,jdbcType=TIMESTAMP},</if>
 			<if test="getTime !=null">otr_get_time =#{getTime,jdbcType=TIMESTAMP},</if>
-			<if test="id !=null">otr_id =#{id,jdbcType=BIGINT},</if>
 			<if test="level !=null">otr_level =#{level,jdbcType=INTEGER},</if>
+			<if test="validTime !=null">otr_valid_time =#{validTime,jdbcType=TIMESTAMP},</if>
+			<if test="inValidTime !=null">otr_invalid_time =#{inValidTime,jdbcType=TIMESTAMP},</if>
 		</set>
 		where otr_id = #{id,jdbcType=BIGINT}
 	</update>
 	<select id="getByOrderNoAndType" resultMap="BaseResultMap">SELECT * FROM
 		yeshi_ec_order_team_reward WHERE otr_uid = #{uid} AND otr_order_no =
-		#{orderNo} AND otr_source_type = #{type} LIMIT 1
-	</select>
+		#{orderNo} AND otr_source_type = #{type} LIMIT 1</select>
 	<select id="getByOrderNoAndTypeForUpdate" resultMap="BaseResultMap">SELECT *
 		FROM yeshi_ec_order_team_reward WHERE otr_uid = #{uid} AND
 		otr_order_no = #{orderNo} AND otr_source_type = #{type} for update
 	</select>
 	<select id="countByOrderNoAndType" resultType="java.lang.Long">SELECT count(*)
 		FROM yeshi_ec_order_team_reward WHERE otr_order_no = #{orderNo} AND
-		otr_source_type = #{type}
-	</select>
+		otr_source_type = #{type}</select>
 	<select id="selectBySubsidyIdAndUidForUpdate" resultMap="BaseResultMap">SELECT *
 		FROM yeshi_ec_order_team_reward WHERE otr_subsidy_id = #{subsidyId}
-		AND otr_uid = #{uid} for update
-	</select>
+		AND otr_uid = #{uid} for update</select>
 	<select id="listBySubsidyId" resultMap="BaseResultMap"
 		parameterType="java.lang.Long">SELECT * FROM yeshi_ec_order_team_reward WHERE
-		otr_subsidy_id = #{0}
-	</select>
-
+		otr_subsidy_id = #{0}</select>
 	<select id="listCanSettleByUid" resultMap="BaseResultMap">SELECT * FROM
-		yeshi_ec_order_team_reward WHERE
-		otr_uid
-		=#{uid} AND otr_state=1 AND
-		NOW()>otr_pre_get_time
-		limit
-		#{start},#{count}
-	</select>
-
+		yeshi_ec_order_team_reward WHERE otr_uid =#{uid} AND otr_state=1 AND
+		NOW()&gt;otr_pre_get_time limit #{start},#{count}</select>
 	<select id="countCanSettle" resultType="java.lang.Long"
-		parameterType="java.lang.Long">SELECT count(*) FROM yeshi_ec_order_team_reward
-		WHERE
-		otr_uid =#{uid} AND otr_state=1 AND NOW()>otr_pre_get_time
-	</select>
-
-
-	<select id="listCanSettleUid" resultType="java.lang.Long">
-		SELECT t.`otr_uid` FROM
-		yeshi_ec_order_team_reward t WHERE t.`otr_state`=1
-		AND #{time} >
+		parameterType="java.lang.Long">SELECT count(*) FROM yeshi_ec_order_team_reward WHERE
+		otr_uid =#{uid} AND otr_state=1 AND NOW()&gt;otr_pre_get_time</select>
+	<select id="listCanSettleUid" resultType="java.lang.Long">SELECT t.`otr_uid` FROM
+		yeshi_ec_order_team_reward t WHERE t.`otr_state`=1 AND #{time} &gt;
 		t.`otr_pre_get_time` GROUP BY t.`otr_uid` LIMIT #{start},#{count}
 	</select>
-
-
 	<select id="countCanSettleUid" resultType="java.lang.Long"
-		parameterType="java.util.Date">
-		SELECT COUNT(*) FROM
-		(
-		SELECT t.otr_uid FROM
+		parameterType="java.util.Date">SELECT COUNT(*) FROM ( SELECT t.otr_uid FROM
 		yeshi_ec_order_team_reward t WHERE t.otr_state=1 AND
-		#{0}>t.otr_pre_get_time GROUP BY t.otr_uid) a
-	</select>
-
-
-
+		#{0}&gt;t.otr_pre_get_time GROUP BY t.otr_uid) a</select>
 </mapper>

--
Gitblit v1.8.0