From 8a57b3a0ee3fa70e8d43eb12865f1c27d0d385d8 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期三, 01 四月 2020 14:55:58 +0800
Subject: [PATCH] Merge branch 'div-1' into div

---
 fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml |   40 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 39 insertions(+), 1 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml
index 109850c..e3d12bb 100644
--- a/fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml
+++ b/fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml
@@ -28,6 +28,8 @@
 		<result column="createTime" property="createTime" jdbcType="BIGINT" />
 		<result column="updateTime" property="updateTime" jdbcType="BIGINT" />
 		<result column="expire" property="expire" jdbcType="INTEGER" />
+		<result column="stateSuper" property="stateSuper" jdbcType="BOOLEAN" />
+
 
 		<association property="boss" column="boss_id"
 			select="com.yeshi.fanli.dao.mybatis.UserInfoMapper.selectByPrimaryKey" />
@@ -163,7 +165,7 @@
 	</update>
 	
 	<update id="inviteSeparate">
-		update yeshi_ec_threeSale t set t.state = 0,t.expire = 1,
+		update yeshi_ec_threeSale t set t.state = 0,t.expire = 2,
 			t.updateTime = <![CDATA[UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) * 1000]]>
 		where t.worker_id=#{workerId} AND t.boss_id = #{bossId}
 	</update>
@@ -449,6 +451,42 @@
 			</if>
 		)A
 	</select>
+	
+	
+	<select id="listFirstTeamByUndeleted" resultMap="AllResultMap">
+		SELECT * FROM `yeshi_ec_threesale` ts
+		LEFT JOIN `yeshi_ec_threesale_extra_info` ff ON (ts.`boss_id` = ff.`tf_boss_id` AND ts.`worker_id`=ff.`tf_worker_id`)
+		WHERE ts.`boss_id` = #{uid} AND (ts.`expire` = 0 OR ts.`expire` = 2 OR ts.`expire` = 4)
+		ORDER BY ts.state DESC, ts.createTime DESC
+		LIMIT ${start},${count}
+	</select>
+
+	<select id="countFirstTeamByUndeleted" resultType="java.lang.Long">
+		SELECT IFNULL(count(ts.id),0) FROM `yeshi_ec_threesale` ts
+		WHERE ts.`boss_id` = #{uid} AND (ts.`expire` = 0 OR ts.`expire` = 2 OR ts.`expire` = 4)
+	</select>
+	
+	
+	<select id="listSecondTeamByUndeleted" resultMap="AllResultMap">
+		SELECT yet.*,stateSuper FROM (
+			SELECT DISTINCT(ts.`id`) AS id, tf.state AS stateSuper FROM `yeshi_ec_threesale` ts
+			LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id`
+			WHERE tf.`boss_id` = #{uid} AND (tf.`expire` = 0 OR tf.`expire` = 2))A
+		LEFT JOIN yeshi_ec_threesale yet ON yet.id = A.id
+		WHERE yet.`expire` = 0 OR yet.`expire` = 2 OR yet.`expire` = 3
+		ORDER BY yet.state DESC, yet.createTime DESC
+		LIMIT ${start},${count}
+	</select>
+
+	<select id="countSecondTeamByUndeleted" resultType="java.lang.Long">
+		SELECT COUNT(DISTINCT yet.id) FROM (SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts
+	           LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id`
+		   WHERE tf.`boss_id` = #{uid} AND (tf.`expire` = 0 OR tf.`expire` = 2))A
+		LEFT JOIN yeshi_ec_threesale yet ON yet.id = A.id
+		WHERE yet.`expire` = 0 OR yet.`expire` = 2 OR yet.`expire` = 3
+	</select>
+	
+	
 
 	<select id="getMyBoss" resultMap="AllResultMap">
 		select

--
Gitblit v1.8.0