| | |
| | | package com.yeshi.fanli.dao.mybatis; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale; |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | | |
| | | public interface ThreeSaleMapper { |
| | | |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(ThreeSale record); |
| | | |
| | | int insertSelective(ThreeSale record); |
| | | |
| | | ThreeSale selectByPrimaryKey(Long id); |
| | | |
| | | UserInfo selectBoss(Long uid); |
| | | |
| | | List<ThreeSale> selectByUid(Long uid); |
| | | |
| | | int updateByPrimaryKeySelective(ThreeSale record); |
| | | |
| | | int updateByPrimaryKey(ThreeSale record); |
| | | |
| | | int effectThreeSale(Long workerUid); |
| | | |
| | | /** |
| | | * 查询一度队员集合 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<ThreeSale> queryMyFirstTeamList(@Param("start") int start, @Param("count") int count, |
| | | @Param("key") String key,@Param("bossId") Long bossId); |
| | | |
| | | long queryCountMyFirstTeamList(@Param("key") String key,@Param("bossId") Long bossId); |
| | | |
| | | |
| | | /** |
| | | * 查询二度队员集合 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<ThreeSale> queryMySecondTeamList(@Param("start") int start, @Param("count") int count, |
| | | @Param("key") String key,@Param("bossId") Long bossId); |
| | | |
| | | long queryCountMySecondTeamList(@Param("key") String key,@Param("bossId") Long bossId); |
| | | |
| | | |
| | | /** |
| | | * 长时间未邀请成功用户 |
| | | * @param daysNum |
| | | * @return |
| | | */ |
| | | List<Long> queryLongTimeFailed(@Param("daysNum") int daysNum); |
| | | |
| | | |
| | | /** |
| | | * 长时间 邀请成功用户 |
| | | * @param daysNum |
| | | * @return |
| | | */ |
| | | List<ThreeSale> queryLongTimeSuccess(@Param("daysNum") int daysNum); |
| | | |
| | | |
| | | /** |
| | | * 设置对应邀请过期 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | int updateExpire(List<Long> list); |
| | | |
| | | /** |
| | | * 一级查询 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<ThreeSale> listFirstTeamQuery(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid, |
| | | @Param("state")Integer state, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | long countFirstTeamQuery(@Param("uid") Long uid, @Param("state")Integer state, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime); |
| | | |
| | | |
| | | /** |
| | | * 二级查询 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<ThreeSale> listSecondTeamQuery(@Param("start")long start, @Param("count")int count, @Param("uid")Long uid, |
| | | @Param("state")Integer state, @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | |
| | | long countSecondTeamQuery(@Param("uid")Long uid, @Param("state")Integer state, @Param("startTime")String startTime, |
| | | @Param("endTime") String endTime); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 上级查询 |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<ThreeSale> listSuperiorQuery(@Param("start") long start, @Param("count") int count, |
| | | @Param("state")Integer state, @Param("uid") Long uid); |
| | | |
| | | long countSuperiorQuery(@Param("state")Integer state, @Param("uid") Long uid); |
| | | |
| | | |
| | | /** |
| | | * 查询一级队员 |
| | | * @param paramLong |
| | | * @param paramInt |
| | | * @param paramLong1 |
| | | * @return |
| | | */ |
| | | List<ThreeSale> listFirstTeam(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 统计一级队员 |
| | | * @param uid |
| | | * @param state |
| | | * @return |
| | | */ |
| | | long countFirstTeam(@Param("uid") Long uid, @Param("state") Integer state); |
| | | |
| | | /** |
| | | * 查询二级队员 |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<ThreeSale> listSecondTeam(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 统计二级队员 |
| | | * @param uid |
| | | * @param state |
| | | * @return |
| | | */ |
| | | long countSecondTeam(@Param("uid") Long uid, @Param("state") Integer state); |
| | | |
| | | /** |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | ThreeSale getMyBoss(@Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 根据id、uid查询 |
| | | * @param id |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<ThreeSale> listbyIdAndBossId(@Param("id")Long id, @Param("uid") Long uid, @Param("expire") Integer expire); |
| | | |
| | | package com.yeshi.fanli.dao.mybatis;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
|
| | | public interface ThreeSaleMapper {
|
| | |
|
| | | int deleteByPrimaryKey(Long id);
|
| | |
|
| | | int insert(ThreeSale record);
|
| | |
|
| | | int insertSelective(ThreeSale record);
|
| | |
|
| | | ThreeSale selectByPrimaryKey(Long id);
|
| | |
|
| | | UserInfo selectBoss(Long uid);
|
| | |
|
| | | List<ThreeSale> selectByUid(Long uid);
|
| | |
|
| | | int updateByPrimaryKeySelective(ThreeSale record);
|
| | |
|
| | | int updateByPrimaryKey(ThreeSale record);
|
| | |
|
| | | int effectThreeSale(Long workerUid);
|
| | | |
| | | /**
|
| | | * 删除失效
|
| | | * @param bossId
|
| | | * @param workerId
|
| | | * @return
|
| | | */
|
| | | int deleteExpireRecord(@Param("bossId")Long bossId, @Param("workerId")Long workerId);
|
| | | |
| | | /**
|
| | | * 失效
|
| | | * @param bossId
|
| | | * @param workerId
|
| | | * @return
|
| | | */
|
| | | List<ThreeSale> getExpireRecord(@Param("bossId")Long bossId, @Param("workerId")Long workerId);
|
| | | |
| | |
|
| | | /**
|
| | | * 查询一度队员集合
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | List<ThreeSale> queryMyFirstTeamList(@Param("start") int start, @Param("count") int count, @Param("key") String key,
|
| | | @Param("bossId") Long bossId);
|
| | |
|
| | | long queryCountMyFirstTeamList(@Param("key") String key, @Param("bossId") Long bossId);
|
| | |
|
| | | /**
|
| | | * 查询二度队员集合
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | List<ThreeSale> queryMySecondTeamList(@Param("start") int start, @Param("count") int count,
|
| | | @Param("key") String key, @Param("bossId") Long bossId);
|
| | |
|
| | | long queryCountMySecondTeamList(@Param("key") String key, @Param("bossId") Long bossId);
|
| | |
|
| | | /**
|
| | | * 长时间未邀请成功用户
|
| | | * |
| | | * @param daysNum
|
| | | * @return
|
| | | */
|
| | | List<Long> queryLongTimeFailed(@Param("daysNum") int daysNum);
|
| | |
|
| | | /**
|
| | | * 长时间 邀请成功用户
|
| | | * |
| | | * @param daysNum
|
| | | * @return
|
| | | */
|
| | | List<ThreeSale> queryLongTimeSuccess(@Param("daysNum") int daysNum);
|
| | |
|
| | | /**
|
| | | * 设置对应邀请过期
|
| | | * |
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | int updateExpire(List<Long> list);
|
| | |
|
| | | /**
|
| | | * 一级查询
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<ThreeSale> listFirstTeamQuery(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid,
|
| | | @Param("state") Integer state, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | long countFirstTeamQuery(@Param("uid") Long uid, @Param("state") Integer state,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | /**
|
| | | * 二级查询
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<ThreeSale> listSecondTeamQuery(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid,
|
| | | @Param("state") Integer state, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | long countSecondTeamQuery(@Param("uid") Long uid, @Param("state") Integer state,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | /**
|
| | | * 上级查询
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | List<ThreeSale> listSuperiorQuery(@Param("start") long start, @Param("count") int count,
|
| | | @Param("state") Integer state, @Param("uid") Long uid);
|
| | |
|
| | | long countSuperiorQuery(@Param("state") Integer state, @Param("uid") Long uid);
|
| | |
|
| | | /**
|
| | | * 查询一级队员
|
| | | * |
| | | * @param paramLong
|
| | | * @param paramInt
|
| | | * @param paramLong1
|
| | | * @return
|
| | | */
|
| | | List<ThreeSale> listFirstTeam(@Param("start") long start, @Param("count") int count, |
| | | @Param("uid") Long uid, @Param("state") Integer state);
|
| | |
|
| | | /**
|
| | | * 统计一级队员
|
| | | * |
| | | * @param uid
|
| | | * @param state
|
| | | * @return
|
| | | */
|
| | | long countFirstTeam(@Param("uid") Long uid, @Param("state") Integer state);
|
| | |
|
| | | /**
|
| | | * 查询二级队员
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | List<ThreeSale> listSecondTeam(@Param("start") long start, @Param("count") int count,
|
| | | @Param("uid") Long uid,@Param("state") Integer state);
|
| | |
|
| | | /**
|
| | | * 统计二级队员
|
| | | * |
| | | * @param uid
|
| | | * @param state
|
| | | * @return
|
| | | */
|
| | | long countSecondTeam(@Param("uid") Long uid, @Param("state") Integer state);
|
| | |
|
| | | /**
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | ThreeSale getMyBoss(@Param("uid") Long uid);
|
| | |
|
| | | /**
|
| | | * 根据id、uid查询
|
| | | * |
| | | * @param id
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | List<ThreeSale> listbyIdAndBossId(@Param("id") Long id, @Param("uid") Long uid, @Param("expire") Integer expire);
|
| | |
|
| | | /**
|
| | | * 根据邀请者ID查询关系
|
| | | * |
| | | * @param workerId
|
| | | * @return
|
| | | */
|
| | | List<ThreeSale> listByWorkerId(Long workerId);
|
| | | |
| | | |
| | | /**
|
| | | * 获取成功邀请关系数量
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | int getSuccessRelationshipNum(@Param("uid") Long uid);
|
| | | |
| | | |
| | | /**
|
| | | * 根据邀请者ID、bossID查询 有效关系
|
| | | * |
| | | * @param workerId
|
| | | * @return
|
| | | */
|
| | | ThreeSale getRelationshipByBossIdAndWorkerId(@Param("bossId") Long bossId, @Param("workerId") Long workerId);
|
| | | |
| | | |
| | | /**
|
| | | * 最后一次关系记录 -无论
|
| | | * @param bossId
|
| | | * @param workerId
|
| | | * @return
|
| | | */
|
| | | ThreeSale getNearRelationByBossIdAndWorkerId(@Param("bossId") Long bossId, @Param("workerId") Long workerId);
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 根据下级查询成功的邀请关系
|
| | | * @param workerId
|
| | | * @return
|
| | | */
|
| | | ThreeSale selectSuccessByWorkerId(Long workerId);
|
| | | |
| | |
|
| | | /**
|
| | | * 根据邀请者ID查询未失效关系
|
| | | * |
| | | * @param workerId
|
| | | * @return
|
| | | */
|
| | | ThreeSale getByWorkerId(Long workerId);
|
| | | |
| | | |
| | | /**
|
| | | * 查询时间段邀请成功人信息
|
| | | * @param bossId
|
| | | * @param minTime
|
| | | * @param maxTime
|
| | | * @return
|
| | | */
|
| | | List<ThreeSale> getSuccessByDate(@Param("bossId")Long bossId,@Param("minTime")Long minTime, @Param("maxTime")Long maxTime);
|
| | | |
| | | /**
|
| | | * 查询最近的信息(根据下级ID与状态)
|
| | | * @param workerId
|
| | | * @param state
|
| | | * @return
|
| | | */
|
| | | ThreeSale selectLatestByWorkerIdAndState(@Param("workerId") Long workerId,@Param("state") int state);
|
| | | |
| | | /**
|
| | | * 根据时间查询邀请关系
|
| | | * @param uid
|
| | | * @param time
|
| | | * @return
|
| | | */
|
| | | ThreeSale getByWorkerIdAndTime(@Param("workerId") Long workerId, @Param("time") long time);
|
| | | |
| | | /**
|
| | | * 邀请关系脱离
|
| | | * @param bossId
|
| | | * @param workerId
|
| | | */
|
| | | void inviteSeparate(@Param("workerId") Long workerId, @Param("bossId")Long bossId);
|
| | | |
| | | /**
|
| | | * 队员在该boss 下第几个队员序号
|
| | | * @param workerId
|
| | | * @return
|
| | | */
|
| | | long getTeamOrderNumByWorkerId(@Param("workerId") Long workerId);
|
| | | } |