Administrator
2018-11-23 9666caad786d890ace2df4594e71cee47bb489b9
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml
@@ -129,9 +129,10 @@
   <update id="effectThreeSale" parameterType="java.lang.Long">
      update
      yeshi_ec_threeSale t
      set t.state=1 where t.state=0 and t.worker_id=#{0}  AND (t.expire = 0  OR  t.expire IS NULL)
      update    yeshi_ec_threeSale t set t.state=1,
      t.succeedTime = <![CDATA[UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) * 1000]]>,
      t.updateTime = <![CDATA[UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) * 1000]]>
      where t.state=0 and t.worker_id=#{0}  AND (t.expire = 0  OR  t.expire IS NULL)
   </update>
      <!-- 查询一度队员集合 -->
@@ -197,7 +198,7 @@
   <update id="updateExpire" parameterType="java.lang.Long">
      update
      yeshi_ec_threeSale t
      set t.expire = 1
      set t.expire = 1, t.updateTime = <![CDATA[UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) * 1000]]>
      where  t.`id` IN <foreach item="item" collection="list" open="(" separator=","
         close=")">#{item}</foreach>
   </update>
@@ -343,6 +344,7 @@
      ON ts.`boss_id` = ff.`tf_boss_id` AND ts.`worker_id` = ff.`tf_worker_id`
      WHERE ts.`boss_id` =  #{uid}
      ORDER BY ts.state DESC, ts.expire, ts.succeedTime DESC
      LIMIT ${start},${count}
   </select>
   
   <select id="countFirstTeam"  resultType="java.lang.Long">
@@ -382,4 +384,14 @@
      select <include refid="Base_Column_List" /> from yeshi_ec_threeSale where
      state = 1 and worker_id=#{uid}
   </select>
   <select id="listbyIdAndBossId" resultMap="BaseResultMap">
      SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_threeSale
      WHERE id = #{uid} AND boss_id=#{uid}
       <if test="expire != null and expire == 1">
           AND `expire` = 1  <!-- 失效 -->
       </if>
   </select>
</mapper>