Commit 5590cbcb authored by licc's avatar licc

框架搭建

parent 21e72d4e
Pipeline #361 canceled with stages
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.AccountInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @author 86187
*/
public interface AccountMapper extends BaseMapper<AccountInfo> {
/**
* 添加
*
* @param accountInfo 账户信息
* @return 1
*/
int add(AccountInfo accountInfo);
/**
* 编辑
*
* @param accountInfo 账户信息
* @return 1
*/
int edit(AccountInfo accountInfo);
/**
* 删除
*
* @param id 主键id
* @return 1
*/
int delById(@Param("id") Integer id);
/**
* 通过userId获取账户信息
*
* @param userId 用户id
* @return 账户信息
*/
AccountInfo getByUserId(@Param("userId") String userId);
/**
* 通过userId 和 yearMonth获取账户信息
*
* @param userId 用户id
* @param yearMonth 年月
* @return 账户信息
*/
AccountInfo getByUserIdAndTime(@Param("userId") String userId, @Param("yearMonth") String yearMonth);
/**
* 修改用户的当月收益个累计收益
* @param accountInfo
* @return
*/
int updateEarningsMonthAndEarningsTotalByid(AccountInfo accountInfo);
/**
* 统计
* @return 数量
*/
int count();
/**
* 获取账户列表
* @param map 条件
* @return 账户列表
*/
List<AccountInfo> getList(Map<String,Object> map);
/**
* 更新账户表时间为当前月,月收益为0
* @param yearMonth 时间
* @return >1
*/
int updateMoneyAndEarningsMonth(@Param("yearMonth") String yearMonth);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.AntiFake;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @author 86187
*/
public interface AntiFakeMapper extends BaseMapper<AntiFake> {
/**
* 添加 二维码数据
*
* @param antiFake 二维码
* @return 1
*/
int add(AntiFake antiFake);
/**
* 编辑 二维码数据
*
* @param antiFake 二维码
* @return 1
*/
int edit(AntiFake antiFake);
/**
* 获取最大批次号
*
* @return 最大批次号
*/
String getByBestBigNumber();
/**
* 批量创建防伪二维码
*
* @param list 入参list
* @return list.size()
*/
int creates(List<AntiFake> list);
/**
* 通过产品编号 获取二维码信息
*
* @param productNo 产品编号
* @return 二维码信息
*/
AntiFake getByProductNo(@Param("productNo") String productNo);
/**
* 通过防伪码 获取二维码信息
*
* @param shaValue 防伪码
* @return 二维码信息
*/
AntiFake getByShaValue(@Param("shaValue") String shaValue);
/**
* 根据条件获取二维码数量
*
* @param map 条件参数
* @return 数量
*/
int count(Map<String, Object> map);
/**
* 获取二维码列表
*
* @param map 条件参数
* @return 二维码列表
*/
List<AntiFake> getList(Map<String, Object> map);
/**
* 根据主键id,获取生产码
*
* @param list 主键ids
* @return ProductNos
*/
List<AntiFake> getProductNos(List<Long> list);
/**
* 根据主键id,获取二维码集合
*
* @param batchNumber 批次号
* @return ProductNos
*/
List<AntiFake> getBatchNumber(@Param("batchNumber") String batchNumber);
/**
* 修改二维码使用状态
*
* @param batchNumber 批次号
* @return size
*/
int updateUseStatus(@Param("batchNumber") String batchNumber);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.BankInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
* @author 86187
*/
public interface BankInfoMapper extends BaseMapper<BankInfo> {
/**
* 添加银行卡信息
*
* @param bankInfo 银行卡信息
* @return 1
*/
int add(BankInfo bankInfo);
/**
* 编辑银行卡信息
*
* @param bankInfo 银行卡信息
* @return 1
*/
int edit(BankInfo bankInfo);
/**
* 删除银行卡信息
*
* @param id 银行卡id
* @return 1
*/
int delById(@Param("id") Integer id);
/**
* 通过用户id,获取用户银行卡信息
*
* @param userId 用户id
* @return 1
*/
BankInfo getByUserId(@Param("userId") String userId);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.CultivatingPrizeInfo;
import cn.wisenergy.model.vo.CultivatingPrizeInfoVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
/**
* 培育奖详情记录
* @author zw
*/
public interface CultivatingPrizeInfoMapper extends BaseMapper<CultivatingPrizeInfo> {
CultivatingPrizeInfo getOneByUserId(String userId);
int add(CultivatingPrizeInfo cultivatingPrizeInfo);
/**
* 分页查询所有信息
* @param map
* @return
*/
List<CultivatingPrizeInfoVo> getCultivatingPrizeInfoList(Map<String, Object> map);
/**
* 统计总记录数
*
* @param map 入参
* @return 结果
*/
int count( Map<String, Object> map);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.CultivatingPrize;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/**
* 培育奖金额对应表
*
* @author zw
*/
public interface CultivatingPrizeMapper extends BaseMapper<CultivatingPrize> {
/**
* 根据用户等级获取培育奖对应金额
*
* @return
*/
CultivatingPrize getcultivatingPrizeByUserLevel(int userLevel);
/**
* 查询所有信息
*
* @return
*/
List<CultivatingPrize> getCultivatingPrizeList();
/**
* 编辑培育奖信息
*
* @param cultivatingPrize 信息
* @return 1
*/
int edit(CultivatingPrize cultivatingPrize);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.CustomerService;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
* 专属客服对应表
* @author zw
*/
public interface CustomerServiceMapper extends BaseMapper<CustomerService> {
/**
* 随机获得一条专属客服记录
* @return
*/
CustomerService randService();
/**
* 根据wechatId查询专属客服
* @param customerServiceId
* @return
*/
CustomerService selectbyWeChatId(@Param("customerServiceId") String customerServiceId);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.LastMonthAccount;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
* @author 86187
*/
public interface LastAccountMapper extends BaseMapper<LastMonthAccount> {
/**
* 通过userId 和 yearMonth获取账户信息
*
* @param userId 用户id
* @param yearMonth 年月
* @return 账户信息
*/
LastMonthAccount getByUserIdAndTime(@Param("userId") String userId, @Param("yearMonth") String yearMonth);
/**
* 把 A 表的结构数据 复制给 B表
*
* @param oldTable A
* @param newTable B
*/
void copyTable(@Param("oldTable") String oldTable, @Param("newTable") String newTable);
/**
* 删除表
*
* @param tableName 表名
*/
void deleteTable(@Param("tableName") String tableName);
/**
* 更新表名
*
* @param oldTableName 旧表名
* @param newTableName 新表名
*/
void updateTableName(@Param("oldTableName") String oldTableName, @Param("newTableName") String newTableName);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.CultivatingPrize;
import cn.wisenergy.model.app.CultivatingPrizeInfo;
import cn.wisenergy.model.app.LastMonthCultivatingPrizeInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface LastMonthCultivatingPrizeInfoMapper extends BaseMapper<LastMonthCultivatingPrizeInfo> {
LastMonthCultivatingPrizeInfo getOneByUserId(String userId);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.LastMonthRecommendUser;
import cn.wisenergy.model.app.RecommendUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface LastMonthRecommendUserMapper extends BaseMapper<LastMonthRecommendUser> {
/**
* 获取用户直推信息
* @param userId 用户Id
* @return 用户直推信息
*/
LastMonthRecommendUser getByUserId(String userId);
//根据用户推荐人的userid,查询数据库用户直推表,看推荐人用户是否存在
Integer zcByUserId(String userid);
/**
* 获取用户的直推用户总人数
* @param userId 用户Id
* @return 直推用户总人数
*/
Integer getRecommendUserCountByUserId(String userId);
/**
* 新增用户直推信息
* @param recommendUser
* @return
*/
int add(LastMonthRecommendUser recommendUser);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.LastMonthTeamUserInfo;
import cn.wisenergy.model.app.TeamUserInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface LastMonthTeamUserInfoMapper extends BaseMapper<LastMonthTeamUserInfo> {
/**
* 获取用户的团队信息
* @param userId 用户Id
* @return 用户的团队信息
*/
LastMonthTeamUserInfo getByUserId(String userId);
/**
* 获取用户的团队总人数
* @param userId 用户Id
* @return 团队总人数
*/
Integer getTeamUserCount(String userId);
int add(LastMonthTeamUserInfo teamUserInfo);
int edit(LastMonthTeamUserInfo lastMonthTeamUserInfo);
}
package cn.wisenergy.mapper;
import cn.hutool.system.UserInfo;
import cn.wisenergy.model.app.LastMonthUserInfo;
import cn.wisenergy.model.app.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface LastMonthUserInfoMapper extends BaseMapper<LastMonthUserInfo> {
/**
* 添加
*
* @param user 用户信息
* @return 用户信息
*/
int add(LastMonthUserInfo user);
/**
* 编辑
*
* @param user 用户信息
* @return 修改是否成功
*/
int edit(LastMonthUserInfo user);
/**
* 删除
*
* @param id 用户id
* @return 删除是否成功
*/
int delById(@Param("id") Integer id);
List<User> getList(Map<String, Object> map);
/**
* 获取所有的非普通用户列表
*
* @return 非普通用户列表
*/
List<LastMonthUserInfo> findAllNotZeroUser();
LastMonthUserInfo findByName(String name);
String findPswByName(String UserName);
void save(LastMonthUserInfo user);
/**
* 获取用户信息
*
* @return 用户信息
*/
LastMonthUserInfo getUserById(@Param("id") Long id);
/**
* 获取用户信息
*
* @param userId 用户id
* @return 用户信息
*/
LastMonthUserInfo getByUserId(@Param("userId") String userId);
/**
* 获取用户信息
*
* @param userId 用户id
* @return 用户信息
*/
Integer ByUserId(@Param("userId") String userId);
/**
* 获取用户信息
*
* @param
* @return 用户信息
*/
Integer beInvitedCode1(@Param("beInvitedCode") String beInvitedCode);
/**
* 获取用户信息
*
* @param beInvitedCode 用户被邀请码
* @return 用户信息
*/
LastMonthUserInfo getByBeInvitedCode(@Param("beInvitedCode") String beInvitedCode);
/**
* 获取黄金树以上会员用户
*
* @return
*/
List<LastMonthUserInfo> getAllGoldUser();
/**
* 查询用户
*
* @param param
* @return
*/
public List<LastMonthUserInfo> getUsersListByMap(Map<String, Object> param);
//根据手机号查询用户Integer
LastMonthUserInfo queryUsersByPhone(@Param("userId") String userId);
//根据用户的推荐人邀请码比对推荐人的本人邀请码,查询推荐人的用户ID
Integer inviteCodeBeInvitedCode(@Param("beInvitedCode") Integer beInvitedCode);
/**
* 用户注册
*
* @param userId
* @param inviteCode
* @param beInvitedCode
* @param userLevel
*/
Integer insertbyint(@Param("userId") String userId, @Param("inviteCode") String inviteCode, @Param("beInvitedCode") String beInvitedCode, @Param("userLevel") Integer userLevel, @Param("headImage") String headImage,@Param("frozen") Integer frozen);
Integer save(@Param("userId") String userId, @Param("beInvitedCode") String beInvitedCode);
LastMonthUserInfo edit1(int userLevel, String intiveCode, String userId);
Integer getuserIdById(@Param("userId") String userId);
Integer getById(@Param("userId") String userId);
String BYQMById(@Param("userId") String userId);
/**
* 根据userid获取获取所有的直接推荐人
*
* @param inviteCode 用户本人的邀请码
* @return 所有填写此人的邀请码的用户
*/
List<LastMonthUserInfo> getByInviteCode(@Param("inviteCode") String inviteCode, @Param("userLevel") int userLevel);
/**
* 通过邀请码,获取用户信息
*
* @param inviteCode 邀请码
* @return 用户信息
*/
LastMonthUserInfo queryByInviteCode(@Param("inviteCode") String inviteCode);
/**
* 通过用户等级,获取该等级用户列表
*
* @param userLevel 用户等级
* @return 等级用户列表
*/
List<LastMonthUserInfo> getByLevel(@Param("userLevel") Integer userLevel);
/**
* @param
* @return
*/
LastMonthUserInfo biInvitedCode1(@Param("inviteCode") String inviteCode);
/**
* 用户邀请码查询用户数据
*
* @param inviteCode
* @return
*/
LastMonthUserInfo InvitedCode2(@Param("inviteCode") String inviteCode);
/**
* 根据用户的推荐人邀请码 查询上级用户的id
*
* @param beInvitedCode
* @return
*/
String getUserByIntiveCode(String beInvitedCode);
String getUserIdByIntiveCode(String outerUserId);
/**
* 获取所有的空投用户
* 且注册时间为一月之前
*
* @return
*/
List<LastMonthUserInfo> getAerialDeliveryUserBeforOneMonth(@Param("before") String before,
@Param("now") String now);
/**
* 随机获取一条小于当前id的用户 即: 比当前用户早注册的用户
*
* @param id
* @return
*/
LastMonthUserInfo randOneGetUserByUserId(Integer id);
/**
* 根据邀请码获取所有的下级用户
* @param userId
* @return
*/
List<LastMonthUserInfo> getListByIntvitedCode(String userId);
/**
* 根据当前用户的推荐人邀请码获取推荐人的用户信息(上级用户信息)
* @param beInvitedCode
* @return
*/
LastMonthUserInfo getuserByBeInvitedCode(String beInvitedCode);
/**
* 获取在团队中处于同一位置的用户集合
* @param beInvitedCode
* @return
*/
List<LastMonthUserInfo> getListUserByBeInvitedCode(String beInvitedCode);
/**
* 通过邀请码获取用户信息
* @param inviteCode
* @return
*/
LastMonthUserInfo getUserByInviteCode(String inviteCode);
/**
* 根据用户的userid查询用户对象
* @param userId
* @return
*/
LastMonthUserInfo getUserByUserId(String userId);
List<LastMonthUserInfo> getAll();
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.MemberPercent;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @author 86187
*/
public interface MemberPercentMapper extends BaseMapper<MemberPercent> {
/**
* 保存
* @param memberPercent 入参
* @return 1
*/
int add(MemberPercent memberPercent);
/**
* 编辑
*
* @param memberPercent 入参
* @return 1
*/
int edit(MemberPercent memberPercent);
/**
* 删除
*
* @param id 主键id
* @return 1
*/
int delById(@Param("id") Integer id);
/**
* 获取等级 某个类型的比列
* @param userLevel 会员等级
* @param type 类型
* @return 返佣比例
*/
MemberPercent getByLevelAndType(@Param("userLevel") Integer userLevel, @Param("type") Integer type);
/**
* 统计条数
* @return 条数
*/
int count();
/**
* 获取会员优惠比列
* @param map 参数条件
* @return 列表
*/
List<MemberPercent> getList(Map<String,Object> map);
/**
* 获取黄金等级及以上月度肥料比例之和
* @return
*/
Double getGoldUpSum();
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.MonthAward;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author 86187
*/
public interface MonthAwardMapper extends BaseMapper<MonthAward> {
/**
* 添加
*
* @param monthAward 奖励信息
* @return 1
*/
int add(MonthAward monthAward);
/**
* 编辑
*
* @param monthAward 奖励信息
* @return 1
*/
int edit(MonthAward monthAward);
/**
* 删除
*
* @param id 主键id
* @return 1
*/
int delById(Integer id);
/**
* 获取本月 月度奖金
* @param yearMonth 年月
* @return 月度奖金
*/
MonthAward getByTime(@Param("yearMonth") String yearMonth);
/**
* 统计数据条数
* @param map 条件
* @return 条数
*/
int count(Map<String,Object> map);
/**
* 获取列表
* @param map 条件
* @return 列表
*/
List<MonthAward> getList(Map<String,Object> map);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.MonthManure;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
* @author 86187
*/
public interface MonthManureMapper extends BaseMapper<MonthManure> {
/**
* 添加月度肥料
*
* @param monthManure 月度肥料信息
* @return 1
*/
int add(MonthManure monthManure);
/**
* 编辑月度肥料
*
* @param monthManure 月度肥料信息
* @return 1
*/
int edit(MonthManure monthManure);
/**
* 通过年月获取月度肥料剩余奖金信息
*
* @param yearMonth 年月
* @return 月度肥料剩余奖金信息
*/
MonthManure queryByTime(@Param("yearMonth") String yearMonth);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.OrderInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
* @author 86187
*/
public interface OrderMapper extends BaseMapper<OrderInfo> {
/**
* 根据返佣状态获取 订单列表
*
* @param rebateStatus 0 未返佣 1 返佣
* @return 订单列表
*/
List<OrderInfo> getByRebateStatus(@Param("rebateStatus") Integer rebateStatus);
/**
* 有赞订单数据插入
*/
void insertYouZanOrders(OrderInfo orderInfo);
/**
* 根据tid获取订单数据
*
* @param tid 有赞生成的订单id
* @return 一条订单数据
*/
OrderInfo getByTid(@Param("tid") String tid);
/**
* 获取当前用户的业绩
*
* @param userId
* @return
*/
BigDecimal getPerformanceByUserid(String userId);
/**
* 获取订单完成时间不为空,且订单完成时间小于当前时间
*
* @param successTime 订单完成时间
* @return 订单列表
*/
List<OrderInfo> getListBySuccessTime(@Param("successTime") Date successTime);
/**
* 更据创建订单时间获取订单列表
* @param created 创建订单时间
* @return 订单列表
*/
List<OrderInfo> getByCreateTime(@Param("created") Date created);
/**
* 根据升级状态获取订单数据
* @param levelStatus
* @return
*/
List<OrderInfo> getByLevelStatus(int levelStatus);
/**
* 根据月度任务状态获取订单数据
* @param monthOrderStatus
* @return
*/
List<OrderInfo> getByMonthOrderStatus(int monthOrderStatus);
/**
* 总条数
* @return
*/
int count();
/**
* 分页查询订单信息
* @param map
*/
List<OrderInfo> findByPage(HashMap<String, Object> map);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.ProductInfo;
import org.apache.ibatis.annotations.Param;
/**
* @author 86187
*/
public interface ProductMapper {
/**
* 添加产品认证信息
*
* @param productInfo 产品认证信息
* @return 1
*/
int add(ProductInfo productInfo);
/**
* 编辑产品认证信息
*
* @param productInfo 产品认证信息
* @return 1
*/
int edit(ProductInfo productInfo);
/**
* 根据批次号获取产品认证信息
* @param batchNumber 批次号
* @return 产品认证信息
*/
ProductInfo getByBatchNumber(@Param("batchNumber") String batchNumber);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.ProgressPrize;
import cn.wisenergy.model.vo.ProgressPrizeVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @author 86187
*/
public interface ProgressPrizeMapper extends BaseMapper<ProgressPrize> {
int add(ProgressPrize progressPrize);
int edit(ProgressPrize progressPrize);
int delById(@Param("id") Integer id);
/**
* 根据 年月 获取月的最大进步奖用户列表
*
* @param yearMonth 年月
* @return 最大进步奖用户列表
*/
List<ProgressPrize> getByYearMonth(@Param("yearMonth") String yearMonth);
/**
* 获取本月月的最大进步奖用户列表 倒序 增长率相等的,按注册时间倒序
*
* @param yearMonth 年月
* @return 最大进步奖用户列表
*/
List<ProgressPrizeVo> getByTime(@Param("yearMonth") String yearMonth);
/**
* 根据 userId 年月 获取月的最大进步奖用户
* @param userId 用户id
* @param yearMonth 年月
* @return 最大进步奖用户列表
*/
ProgressPrize getByUserIdYearMonth(@Param("userId") String userId,@Param("yearMonth") String yearMonth);
/**
* 统计最大进步奖总记录数
*
* @param map 入参
* @return 结果
*/
int count( Map<String, Object> map);
/**
* 获取最大进步奖列表
* @param map 入参
* @return 结果集
*/
List<ProgressPrize> getList(Map<String, Object> map);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.RecommendUser;
import cn.wisenergy.model.vo.RecommendUserVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
/**
* @author zw
*/
public interface RecommendUserMapper extends BaseMapper<RecommendUser> {
/**
* 获取用户直推信息
* @param userId 用户Id
* @return 用户直推信息
*/
RecommendUser getByUserId(String userId);
//根据用户推荐人的userid,查询数据库用户直推表,看推荐人用户是否存在
Integer zcByUserId(String userid);
/**
* 获取用户的直推用户总人数
* @param userId 用户Id
* @return 直推用户总人数
*/
Integer getRecommendUserCountByUserId(String userId);
/**
* 新增用户直推信息
* @param recommendUser
* @return
*/
int add(RecommendUser recommendUser);
/**
* 分页查询所有用户信息
* @param map
* @return
*/
List<RecommendUserVo> getRecommendUserList(Map<String, Object> map);
/**
* 统计总记录数
* @param map 入参
* @return 结果
*/
int count( Map<String, Object> map);
/**
* 获取所有的用户
* @return
*/
List<RecommendUser> getAll();
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.ShopVersion;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author 86187
*/
public interface ShopVersionMapper extends BaseMapper<ShopVersion> {
/**
* 添加
*
* @param shopVersion 版本信息
* @return 1
*/
int add(ShopVersion shopVersion);
/**
* 编辑
*
* @param shopVersion 版本信息
* @return 1
*/
int edit(ShopVersion shopVersion);
/**
* 根据类型获取版本信息
*
* @param type 1:ios 2:安卓
* @return
*/
ShopVersion getByType(@Param("type") Integer type);
List<ShopVersion> getList();
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.shopZx;
import cn.wisenergy.model.dto.ZxUserDto;
import cn.wisenergy.model.vo.ShopZxUserVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* Created by m1991 on 2021/2/24 14:50
*/
@Mapper
public interface ShopZxMapper extends BaseMapper<shopZx> {
/**
* 添加方法 zxUrl userId zxName zxField imgUrl
* @param
* @return 1
*/
int zxadd(@Param("zxUrl") String zxUrl,@Param("zxField") String zxField,@Param("inviteCode") String inviteCode,@Param("zxDate") Long zxDate);
/**
* 用户头像上传并更新
* @param
* @return
*/
int zxadd1(@Param("headImage") String headImage,@Param("userId") String userId);
/**
* 倒叙查询资讯与用户发布数据
*/
List<ZxUserDto> selectPage(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
//
// /**
// * 用于查询资讯单表全部信息
// * @param pageNum
// * @param pageSize
// * @return
// */
// List<zxUserVo> selectAll(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
/**
* 点赞接口专用
*/
shopZx selectByzxid(@Param("zxid") Integer zxid);
int updateByzxid(@Param("zxid")Integer zxid,@Param("zxLikes") Integer zxLikes);
/**
* 资讯审核
* @param zxid
* @param ZxToExamine
* @return
*/
int updateZxToExaminezxid(@Param("zxid")Integer zxid,@Param("ZxToExamine") Integer ZxToExamine);
/**
* 分页查询所有用户信息
* @param map
* @return
*/
List<ShopZxUserVo> getShopZxList(Map<String, Object> map);
/**
* 统计总记录数
* @param map 入参
* @return 结果
*/
int count( Map<String, Object> map);
}
//package cn.wisenergy.mapper;
//
//
//import cn.wisenergy.model.app.SmsLog;
//import org.apache.ibatis.annotations.Param;
//
//import java.util.List;
//import java.util.Map;
//
//public interface SmsLogMapper {
//
// public SmsLog getSmsLogById(@Param(value = "id") Long id);
//
// public List<SmsLog> getSmsLogListByMap(Map<String, Object> param);
//
// public Integer getSmsLogCountByMap(Map<String, Object> param);
//
// public Integer insertSmsLog(SmsLog smsLog);
//
// public Integer updateSmsLog(SmsLog smsLog);
//
// public Integer deleteSmsLogById(@Param(value = "id") Long id);
//
// public Integer batchDeleteSmsLog(Map<String, List<String>> params);
//
//}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.SysUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
* @author 86187
*/
public interface SysUserMapper extends BaseMapper<SysUser> {
/**
* 获取后台账户信息
*
* @param id 用户主键id
* @return 后台账户信息
*/
SysUser getById(@Param("id") Integer id);
/**
* 更据账户,获取后台用户信息
*
* @param account 账户
* @return 后台用户信息
*/
SysUser getByAccount(@Param("account") String account);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.TeamPerformance;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @author 86187
*/
public interface TeamPerformanceMapper extends BaseMapper<TeamPerformance> {
int add(TeamPerformance teamPerformance);
/**
* 编辑
* @param teamPerformance 团队业绩
* @return 1
*/
int edit(TeamPerformance teamPerformance);
/**
* 删除
* @param id 主键ID
* @return 1
*/
int delById(@Param("id") Integer id);
/**
* 用户id和时间获取用户月业绩
*
* @param userId 用户id
* @param yearMonth 时间
* @return 用户月业绩
*/
TeamPerformance getByUserIdAndTime(@Param("userId") String userId, @Param("yearMonth") String yearMonth);
/**
* 统计 等级月业绩和
*
* @param userLevel 等级
* @param yearMonth 年月
* @return 等级总金额
*/
Double countTeamMoney(@Param("userLevel") Integer userLevel, @Param("yearMonth") String yearMonth);
/**
* 获取时间前的 月业绩列表
*
* @param yearMonth 时间
* @return 月业绩列表
*/
List<TeamPerformance> getByBeforeTime(@Param("yearMonth") String yearMonth);
/**
* 根据时间统计 所有用户业绩和
*
* @param yearMonth 时间
* @return 所有用户业绩和
*/
Double countByTime(@Param("yearMonth") String yearMonth);
/**
* 月业绩排名前20人 业绩和
* @param yearMonth 时间
* @return 业绩和
*/
Double countTwenty(@Param("yearMonth") String yearMonth);
List<TeamPerformance> userTwenty(@Param("yearMonth") String yearMonth);
/**
* 当前用户的团队总业绩
* @param userId 当前用户id
* @return 当前用户的团队累计总业绩金额
*/
Double countUserTeamByUserId(@Param("userId") String userId);
/**
* 当前用户本月团队新增业绩
* @param userId 用户Id
* @return 当前用户本月团队新增业绩
*/
Double monthUserTeamByuserId(@Param("userid") String userId,@Param("yearMonth") String yearMonth);
/**
* 统计团队业绩总记录数
*
* @param map 入参
* @return 结果
*/
int count( Map<String, Object> map);
/**
* 获取团队业绩流水列表
* @param map 入参
* @return 结果集
*/
List<TeamPerformance> getList(Map<String, Object> map);
/**
*
* @param userId
* @return
*/
TeamPerformance getByUserId(String userId);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.TeamUserInfo;
import cn.wisenergy.model.vo.TeamUserInfoVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
/**
* 团队Mapper
* @author zw
*/
public interface TeamUserInfoMapper extends BaseMapper<TeamUserInfo> {
// TeamUserInfo getByUserId(String userid);
//根据userId查询用户是否存在
Integer czByUserId(String userId);
/**
* 获取用户的团队信息
* @param userId 用户Id
* @return 用户的团队信息
*/
TeamUserInfo getByUserId(String userId);
/**
* 获取用户的团队总人数
* @param userId 用户Id
* @return 团队总人数
*/
Integer getTeamUserCount(String userId);
int add(TeamUserInfo teamUserInfo);
int edit(TeamUserInfo teamUserInfo);
/**
* 分页查询所有信息
* @param map
* @return
*/
List<TeamUserInfoVo> getTeamUserInfoList(Map<String, Object> map);
/**
* 统计总记录数
*
* @param map 入参
* @return 结果
*/
int count( Map<String, Object> map);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.TradeRecord;
import cn.wisenergy.model.vo.AccumulatedIncomeVo;
import cn.wisenergy.model.vo.WithdrawalRecordVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author 86187
*/
public interface TradeRecordMapper extends BaseMapper<TradeRecord> {
/**
* 添加交易记录
*
* @param tradeRecord 记录信息
* @return 1
*/
int add(TradeRecord tradeRecord);
/**
* 编辑交易记录
*
* @param tradeRecord 记录信息
* @return 1
*/
int edit(TradeRecord tradeRecord);
/**
* 删除
*
* @param id 主键
* @return 1
*/
int delById(@Param("id") Integer id);
/**
* 根据用户id,获取用户交易列表
*
* @param userId 用户id
* @return 用户交易列表
*/
List<TradeRecord> getByUserId(@Param("userId") String userId);
/**
* 获取不包括本月的六个月的累计收益
*
* @param userId 用户id
* @return 累计收益
*/
List<AccumulatedIncomeVo> getSixMonthIncome(@Param("userId") String userId);
/**
* 根据用户id 或 年月 ,获取用户本月交易提现列表
*
* @param userId 用户id
* @param yearMonth 年月
* @return 交易列表
*/
List<WithdrawalRecordVo> getWithdrawalRecord(@Param("userId") String userId, @Param("yearMonth") Date yearMonth);
/**
* 获取用户本月累计奖金
*
* @param userId 用户id
* @param yearMonth 年月
* @return
*/
Double queryMonthAward(@Param("userId") String userId, @Param("yearMonth") Date yearMonth);
/**
* 获取本月新增奖金(月度肥料)
*
* @param yearMonth 时间
* @return 本月新增奖金
*/
Double queryMonthGrow(@Param("yearMonth") Date yearMonth);
/**
* 获取历史累计奖金 -时间小于yearMonth (月度肥料)
*
* @param yearMonth 时间
* @return 本月新增奖金
*/
Double queryAllAward(@Param("yearMonth") Date yearMonth);
/**
* 获取用户等级 月奖金---时间小于yearMonth (月度肥料)
*
* @param userLevel 用户等级
* @param yearMonth 时间
* @return 用户等级 月奖金
*/
Double queryByUserLevel(@Param("userLevel") Integer userLevel, @Param("yearMonth") Date yearMonth);
/**
* 统计交易流水总记录数
*
* @param map 入参
* @return 结果
*/
int count(Map<String, Object> map);
/**
* 获取交易流水列表
*
* @param map 入参
* @return 结果集
*/
List<TradeRecord> getList(Map<String, Object> map);
/**
* 根据类型和用户id,获取用户本月该类型最新数据
*
* @param userId 用户id
* @param tradeType 类型
* @param yearMonth 时间
* @return 交易记录
*/
TradeRecord getByUserIdAndType(@Param("userId") String userId, @Param("tradeType") Integer tradeType,
@Param("yearMonth") Date yearMonth);
/**
* 获取本月返佣列表
*
* @param userId 用户id
* @param yearMonth 时间
* @return 返佣交易记录列表
*/
List<TradeRecord> getRebateList(@Param("userId") String userId, @Param("yearMonth") Date yearMonth);
/**
* 根据类型和用户id,获取用户本月该类型最新数据
*
* @param userId 用户id
* @param tradeType 类型
* @param yearMonth 时间
* @return 交易记录
*/
TradeRecord getByUserIdAndTypeAndStatus(@Param("userId") String userId, @Param("tradeType") Integer tradeType,
@Param("yearMonth") Date yearMonth,@Param("status") Integer status);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.UserDataInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
public interface UserDataInfoMapper extends BaseMapper<UserDataInfo> {
int add(UserDataInfo userDataInfo);
List<UserDataInfo> getALl();
List<UserDataInfo> getListByLevelStatus(int levelStatus);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.Variable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
* @author 86187
* @ Description: 变量表mapper
* @ Author : 86187
* @ Date : 2021/3/15 15:09
*/
public interface VariableMapper extends BaseMapper<Variable> {
/**
* 新增
*
* @param variable 变量信息
* @return 1
*/
int add(Variable variable);
/**
* 编辑
*
* @param variable 变量信息
* @return 1
*/
int edit(Variable variable);
/**
* 删除
*
* @param id 主键id
* @return 1
*/
int delById(@Param("id") Integer id);
/**
* 根据key,获取变量信息
* @param variableKey 变量唯一标识
* @return 变量信息
*/
Variable getByKey(@Param("variableKey") String variableKey);
}
package cn.wisenergy.mapper;
import cn.wisenergy.model.app.userLikes;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 用户点赞记录表
* Created by m1991 on 2021/3/15 12:54
*/
@Mapper
public interface userLikesMapper extends BaseMapper<userLikes> {
/**
* userId查询用户点赞记录
* @param userLikeId
* @return
*/
userLikes selectlikes(@Param("userLikeId") String userLikeId, @Param("likedId") int likedId);
/**
* 添加点赞记录
* @return
*/
int addlikes(@Param("userLikeId") String userLikeId,@Param("likedId")int likedId,@Param("likedStaus")int likedStaus,@Param("likedType")int likedType);
}
<?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="cn.wisenergy.mapper.AccountMapper">
<resultMap id="AccountMap" type="cn.wisenergy.model.app.AccountInfo">
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="user_level" property="userLevel"/>
<result column="year_month" property="yearMonth"/>
<result column="extract_money" property="extractMoney"/>
<result column="earnings_month" property="earningsMonth"/>
<result column="frozen_money" property="frozenMoney"/>
<result column="earnings_total" property="earningsTotal"/>
<result column="frozen_status" property="frozenStatus"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
account_info
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_id,user_level,`year_month`,extract_money,earnings_month,frozen_money,earnings_total,frozen_status,
create_time,update_time
</sql>
<sql id="vals">
#{userId},#{userLevel},#{yearMonth},#{extractMoney},#{earningsMonth},#{frozenMoney},
#{earningsTotal},#{frozenStatus},now(),now()
</sql>
<sql id="updateCondition">
<if test="userId != null">user_id = #{userId},</if>
<if test="userLevel != null">user_level = #{userLevel},</if>
<if test="yearMonth != null">`year_month` =#{yearMonth},</if>
<if test="extractMoney != null">extract_money =#{extractMoney},</if>
<if test="earningsMonth != null">earnings_month =#{earningsMonth},</if>
<if test="frozenMoney != null">frozen_money =#{frozenMoney},</if>
<if test="earningsTotal != null">earnings_total =#{earningsTotal},</if>
<if test="frozenStatus != null">frozen_status =#{frozenStatus},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="userId != null">and user_id = #{userId}</if>
<if test="userLevel != null">and user_level = #{userLevel}</if>
<if test="yearMonth != null">and `year_month` =#{yearMonth}</if>
<if test="extractMoney != null">and extract_money =#{extractMoney}</if>
<if test="earningsMonth != null">and earnings_month =#{earningsMonth}</if>
<if test="frozenMoney != null">and frozen_money =#{frozenMoney}</if>
<if test="earningsTotal != null">and earnings_total =#{earningsTotal}</if>
<if test="frozenStatus != null">and frozen_status =#{frozenStatus}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<insert id="add" parameterType="cn.wisenergy.model.app.AccountInfo" keyProperty="id" useGeneratedKeys="true">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value(
<include refid="vals"/>
)
</insert>
<update id="edit" parameterType="cn.wisenergy.model.app.AccountInfo">
UPDATE
<include refid="table"/>
<set>
<include refid="updateCondition"/>
</set>
<where>
id = #{id}
</where>
</update>
<delete id="delById" parameterType="java.lang.Integer">
delete from
<include refid="table"/>
where id = #{id}
</delete>
<select id="getByUserId" resultType="cn.wisenergy.model.app.AccountInfo">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
user_id=#{userId}
</where>
</select>
<select id="getByUserIdAndTime" resultType="cn.wisenergy.model.app.AccountInfo">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
user_id=#{userId}
and `year_month`=#{yearMonth}
</where>
</select>
<select id="count" resultType="java.lang.Integer">
select count(1)
from
<include refid="table"/>
</select>
<select id="getList" resultType="cn.wisenergy.model.app.AccountInfo">
select
<include refid="cols_all"/>
from
<include refid="table"/>
order by create_time desc
limit #{startNum},#{endNum}
</select>
<update id="updateEarningsMonthAndEarningsTotalByid" parameterType="cn.wisenergy.model.app.AccountInfo">
UPDATE
<include refid="table"/>
<set>
<include refid="updateCondition"/>
</set>
<where>
id = #{id}
</where>
</update>
<update id="updateMoneyAndEarningsMonth">
update <include refid="table"/>
set earnings_month=0,`year_month`=#{yearMonth}
</update>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.AntiFakeMapper">
<resultMap id="antiMap" type="cn.wisenergy.model.app.AntiFake">
<id column="id" property="id"/>
<result column="product_no" property="productNo"/>
<result column="security_code" property="securityCode"/>
<result column="batch_number" property="batchNumber"/>
<result column="sha_value" property="shaValue"/>
<result column="produce_time" property="produceTime"/>
<result column="scan_time" property="scanTime"/>
<result column="status" property="status"/>
<result column="use_status" property="useStatus"/>
<result column="scan_number" property="scanNumber"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
anti_fake
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
product_no,security_code,batch_number,sha_value,produce_time,scan_time,status,use_status,scan_number,create_time,update_time
</sql>
<sql id="vals">
#{productNo},#{securityCode},#{batchNumber},#{shaValue},#{produceTime},#{scanTime},#{status},#{useStatus},#{scanNumber},now(),now()
</sql>
<sql id="createsVal">
#{i.productNo},#{i.securityCode},#{i.batchNumber},#{i.shaValue},#{i.produceTime},#{i.scanTime},#{i.status},#{i.useStatus},
#{i.scanNumber},now(),now()
</sql>
<sql id="updateCondition">
<if test="productNo != null">product_no = #{productNo},</if>
<if test="securityCode != null">security_code = #{securityCode},</if>
<if test="batchNumber != null">batch_number = #{batchNumber},</if>
<if test="shaValue != null">sha_value = #{shaValue},</if>
<if test="produceTime != null">produce_time = #{produceTime},</if>
<if test="scanTime != null">scan_time = #{scanTime},</if>
<if test="status != null">status = #{status},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>
<if test="scanNumber != null">scan_number = #{scanNumber},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="productNo != null">and product_no = #{productNo}</if>
<if test="securityCode != null">and security_code = #{securityCode}</if>
<if test="batchNumber != null">and batch_number = #{batchNumber}</if>
<if test="shaValue != null">and sha_value = #{shaValue}</if>
<if test="produceTime != null">and produce_time = #{produceTime}</if>
<if test="scanTime != null">and scan_time = #{scanTime}</if>
<if test="status != null">and status = #{status}</if>
<if test="useStatus != null">and use_status = #{useStatus}</if>
<if test="scaNumber != null">and sca_number = #{scaNumber}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<insert id="add" parameterType="cn.wisenergy.model.app.AntiFake" keyProperty="id" useGeneratedKeys="true">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value(
<include refid="vals"/>
)
</insert>
<update id="edit" parameterType="cn.wisenergy.model.app.AntiFake">
UPDATE
<include refid="table"/>
<set>
<include refid="updateCondition"/>
</set>
<where>
id = #{id}
</where>
</update>
<update id="updateUseStatus">
UPDATE
<include refid="table"/>
<set>
use_status=1
</set>
<where>
use_status=1
and batch_number=#{batchNumber}
</where>
</update>
<select id="getByBestBigNumber" resultType="java.lang.String">
select MAX(batch_number)
from
<include refid="table"/>
</select>
<!-- 批量创建接口 -->
<insert id="creates" parameterType="list">
INSERT INTO
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
VALUES
<foreach collection="list" item="i" index="index" separator=",">
(<include refid="createsVal"/>)
</foreach>
</insert>
<select id="getByProductNo" resultMap="antiMap">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
product_no=#{productNo}
</where>
</select>
<select id="count" resultType="java.lang.Integer">
select count(1)
from
<include refid="table"/>
<where>
1=1
<if test="useStatus != null">
and use_status=#{useStatus}
</if>
</where>
</select>
<select id="getList" resultMap="antiMap">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
1=1
<if test="useStatus != null">
and use_status=#{useStatus}
</if>
order by create_time desc
limit #{startNum},#{endNum}
</where>
</select>
<select id="getProductNos" resultMap="antiMap">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
use_status=0
and id IN
<foreach collection="list" index="index" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</where>
</select>
<select id="getByShaValue" resultMap="antiMap">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
sha_value=#{shaValue}
</where>
</select>
<select id="getBatchNumber" resultMap="antiMap">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
use_status=0
and batch_number=#{batchNumber}
</where>
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.BankInfoMapper">
<resultMap id="bankMap" type="cn.wisenergy.model.app.BankInfo">
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="name" property="name"/>
<result column="id_card_no" property="idCardNo"/>
<result column="bank_name" property="bankName"/>
<result column="card_number" property="cardNumber"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
bank_info
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_id,name,id_card_no,bank_name,card_number,create_time,update_time
</sql>
<sql id="vals">
#{userId},#{name},#{idCardNo},#{bankName},#{cardNumber},now(),now()
</sql>
<sql id="updateCondition">
<if test="userId != null">user_id = #{userId},</if>
<if test="name != null">name = #{name},</if>
<if test="idCardNo != null">id_card_no = #{idCardNo},</if>
<if test="bankName != null">bank_name =#{bankName},</if>
<if test="cardNumber != null">card_number =#{cardNumber},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="userId != null">and user_id = #{userId}</if>
<if test="name != null">and name = #{name}</if>
<if test="idCardNo != null">and id_card_no = #{idCardNo}</if>
<if test="bankName != null">and bank_name =#{bankName}</if>
<if test="cardNumber != null">and card_number =#{cardNumber}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<insert id="add" parameterType="cn.wisenergy.model.app.BankInfo" keyProperty="id" useGeneratedKeys="true">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value(
<include refid="vals"/>
)
</insert>
<update id="edit" parameterType="cn.wisenergy.model.app.BankInfo">
UPDATE
<include refid="table"/>
<set>
<include refid="updateCondition"/>
</set>
<where>
id = #{id}
</where>
</update>
<delete id="delById" parameterType="java.lang.Integer">
delete from
<include refid="table"/>
where id = #{id}
</delete>
<select id="getByUserId" resultType="cn.wisenergy.model.app.BankInfo">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
user_id=#{userId}
</where>
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.CultivatingPrizeInfoMapper">
<resultMap id="bankMap" type="cn.wisenergy.model.app.CultivatingPrizeInfo">
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="seedling" property="seedling"/>
<result column="bronze_tree" property="bronzeTree"/>
<result column="silver_tree" property="silverTree"/>
<result column="gold_tree" property="goldTree"/>
<result column="farmer" property="farmer"/>
<result column="forest_start" property="forestStart"/>
<result column="partner" property="partner"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
cultivating_prize_info
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_id,seedling,bronze_tree,silver_tree,gold_tree,farmer,forest_start,partner,create_time,update_time
</sql>
<sql id="vals">
#{userId},#{seedling},#{bronzeTree},#{silverTree},#{goldTree},#{farmer},#{forestStart},#{partner},now(),now()
</sql>
<sql id="updateCondition">
<if test="userId != null">user_id = #{userId},</if>
<if test="seedling != null">seedling = #{seedling},</if>
<if test="bronzeTree != null">bronze_tree = #{bronzeTree},</if>
<if test="silverTree != null">silver_tree = #{silverTree},</if>
<if test="goldTree != null">gold_tree = #{goldTree},</if>
<if test="farmer != null">farmer = #{farmer},</if>
<if test="forestStart != null">forest_start = #{forestStart},</if>
<if test="partner != null">partner = #{partner},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="userId != null">and user_id = #{userId}</if>
<if test="seedling != null">and seedling = #{seedling}</if>
<if test="bronzeTree != null">and bronze_tree = #{bronzeTree}</if>
<if test="silverTree != null">and silver_tree = #{silverTree}</if>
<if test="goldTree != null">and gold_tree = #{goldTree}</if>
<if test="farmer != null">and farmer = #{farmer}</if>
<if test="forestStart != null">and forest_start = #{forestStart}</if>
<if test="partner != null">and partner = #{partner}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<select id="getOneByUserId" resultType="cn.wisenergy.model.app.CultivatingPrizeInfo">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
user_id = #{userId}
</where>
</select>
<insert id="add" parameterType="cn.wisenergy.model.app.CultivatingPrizeInfo">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value
(<include refid="vals"/>)
</insert>
<select id="getCultivatingPrizeInfoList" resultType="cn.wisenergy.model.vo.CultivatingPrizeInfoVo">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
1=1
<if test="userId != null and userId != ''">
and user_id = #{userId}
</if>
<if test="queryTime != null and queryTime != ''">
and (YEAR(create_time) = YEAR(#{queryTime})
AND MONTH(create_time) =MONTH(#{queryTime})
AND DAY(create_time)=DAY(#{queryTime}))
</if>
</where>
order by create_time desc
limit #{startNum},#{endNum}
</select>
<select id="count" resultType="java.lang.Integer">
select count(1)
from
<include refid="table"/>
<where>
<if test="userId != null and userId != ''">
user_id=#{userId}
</if>
<if test="queryTime != null and queryTime != ''">
and `create_time` = #{queryTime}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.CultivatingPrizeMapper">
<resultMap id="bankMap" type="cn.wisenergy.model.app.CultivatingPrize">
<id column="id" property="id"/>
<result column="user_level" property="userLevel"/>
<result column="cultivating_prize" property="cultivatingPrize"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
cultivating_prize
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_level,cultivating_prize,create_time,update_time
</sql>
<sql id="vals">
#{userLevel},#{cultivatingPrize},now(),now()
</sql>
<sql id="updateCondition">
<if test="userLevel != null">user_level = #{userLevel},</if>
<if test="cultivatingPrize != null">cultivating_prize = #{cultivatingPrize},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="userLevel != null">and user_level = #{userLevel}</if>
<if test="cultivatingPrize != null">and cultivating_prize = #{cultivatingPrize}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<update id="edit" parameterType="cn.wisenergy.model.app.CultivatingPrize">
UPDATE
<include refid="table"/>
<set>
<include refid="updateCondition"/>
</set>
<where>
id = #{id}
</where>
</update>
<select id="getcultivatingPrizeByUserLevel" resultType="cn.wisenergy.model.app.CultivatingPrize">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
user_level = #{userLevel}
</where>
</select>
<select id="getCultivatingPrizeList" resultType="cn.wisenergy.model.app.CultivatingPrize">
select
<include refid="cols_all"/>
from
<include refid="table"/>
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.CustomerServiceMapper">
<resultMap id="bankMap" type="cn.wisenergy.model.app.CustomerService">
<id column="id" property="id"/>
<result column="wechat_id" property="wechatId"/>
<result column="wechat_img_url" property="wechatImgUrl"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
customer_service
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
wechat_id,wechat_img_url,create_time,update_time
</sql>
<sql id="vals">
#{wechatId},#{wechatImgUrl},now(),now()
</sql>
<sql id="updateCondition">
<if test="wechatId != null">service_id = #{wechatId},</if>
<if test="wechatImgUrl != null">wechat_img_url = #{wechatImgUrl},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="wechatId != null">and service_id = #{wechatId}</if>
<if test="wechatImgUrl != null">and wechat_img_url = #{wechatImgUrl}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<select id="randService" resultType="cn.wisenergy.model.app.CustomerService">
select
<include refid="cols_all"/>
from
<include refid="table"/>
order by rand() limit 1
</select>
<select id="selectbyWeChatId" parameterType="string" resultType="cn.wisenergy.model.app.CustomerService">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
wechat_id = #{customerServiceId}
</where>
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.LastAccountMapper">
<resultMap id="AccountMap" type="cn.wisenergy.model.app.LastMonthAccount">
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="user_level" property="userLevel"/>
<result column="year_month" property="yearMonth"/>
<result column="extract_money" property="extractMoney"/>
<result column="earnings_month" property="earningsMonth"/>
<result column="frozen_money" property="frozenMoney"/>
<result column="earnings_total" property="earningsTotal"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
last_month_account
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_id,user_level,`year_month`,extract_money,earnings_month,frozen_money,earnings_total,create_time,update_time
</sql>
<sql id="vals">
#{userId},#{userLevel},#{yearMonth},#{extractMoney},#{earningsMonth},#{frozenMoney},
#{earningsTotal},now(),now()
</sql>
<sql id="updateCondition">
<if test="userId != null">user_id = #{userId},</if>
<if test="userLevel != null">user_level = #{userLevel},</if>
<if test="yearMonth != null">`year_month` =#{yearMonth},</if>
<if test="extractMoney != null">extract_money =#{extractMoney},</if>
<if test="earningsMonth != null">earnings_month =#{earningsMonth},</if>
<if test="frozenMoney != null">frozen_money =#{frozenMoney},</if>
<if test="earningsTotal != null">earnings_total =#{earningsTotal},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="userId != null">and user_id = #{userId}</if>
<if test="userLevel != null">and user_level = #{userLevel}</if>
<if test="yearMonth != null">and `year_month` =#{yearMonth}</if>
<if test="extractMoney != null">and extract_money =#{extractMoney}</if>
<if test="earningsMonth != null">and earnings_month =#{earningsMonth}</if>
<if test="frozenMoney != null">and frozen_money =#{frozenMoney}</if>
<if test="earningsTotal != null">and earnings_total =#{earningsTotal}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<delete id="deleteTable">
drop table ${tableName}
</delete>
<select id="getByUserIdAndTime" resultType="cn.wisenergy.model.app.LastMonthAccount">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
user_id=#{userId}
and `year_month`=#{yearMonth}
</where>
</select>
<update id="copyTable">
CREATE TABLE ${newTable} SELECT * FROM ${oldTable};
</update>
<update id="updateTableName">
rename table ${oldTableName} to ${newTableName};
</update>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.LastMonthCultivatingPrizeInfoMapper">
<resultMap id="LastMonthCultivatingPrizeInfoMap" type="cn.wisenergy.model.app.LastMonthCultivatingPrizeInfo">
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="seedling" property="seedling"/>
<result column="bronze_tree" property="bronzeTree"/>
<result column="silver_tree" property="silverTree"/>
<result column="gold_tree" property="goldTree"/>
<result column="farmer" property="farmer"/>
<result column="forest_start" property="forestStart"/>
<result column="partner" property="partner"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
lastmonth_cultivating_prize_info
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_id,seedling,bronze_tree,silver_tree,gold_tree,farmer,forest_start,partner,create_time,update_time
</sql>
<sql id="vals">
#{userId},#{seedling},#{bronzeTree},#{silverTree},#{goldTree},#{farmer},#{forestStart},#{partner},now(),now()
</sql>
<sql id="updateCondition">
<if test="userId != null">user_id = #{userId},</if>
<if test="seedling != null">seedling = #{seedling},</if>
<if test="bronzeTree != null">bronze_tree = #{bronzeTree},</if>
<if test="silverTree != null">silver_tree = #{silverTree},</if>
<if test="goldTree != null">gold_tree = #{goldTree},</if>
<if test="farmer != null">farmer = #{farmer},</if>
<if test="forestStart != null">forest_start = #{forestStart},</if>
<if test="partner != null">partner = #{partner},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="userId != null">and user_id = #{userId}</if>
<if test="seedling != null">and seedling = #{seedling}</if>
<if test="bronzeTree != null">and bronze_tree = #{bronzeTree}</if>
<if test="silverTree != null">and silver_tree = #{silverTree}</if>
<if test="goldTree != null">and gold_tree = #{goldTree}</if>
<if test="farmer != null">and farmer = #{farmer}</if>
<if test="forestStart != null">and forest_start = #{forestStart}</if>
<if test="partner != null">and partner = #{partner}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<select id="getOneByUserId" resultType="cn.wisenergy.model.app.LastMonthCultivatingPrizeInfo">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
user_id = #{userId}
</where>
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.LastMonthRecommendUserMapper">
<resultMap id="userMap" type="cn.wisenergy.model.app.LastMonthRecommendUser">
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="normal_user_num" property="normalUserNum"/>
<result column="seedling_num" property="seedlingNum"/>
<result column="bronze_tree_num" property="bronzeTreeNum"/>
<result column="silver_tree_num" property="silverTreeNum"/>
<result column="gold_tree_num" property="goldTreeNum"/>
<result column="farmer_num" property="farmerNum"/>
<result column="forest_start_num" property="forestStartNum"/>
<result column="partner_num" property="partnerNum"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="monthy_count" property="monthyCount"/>
<result column="history_count" property="historyCount"/>
</resultMap>
<sql id="table">
lastmonth_recommend_user
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_id,normal_user_num,seedling_num,bronze_tree_num,silver_tree_num,
gold_tree_num,farmer_num,forest_start_num,partner_num,create_time,update_time,monthy_count,history_count
</sql>
<sql id="vals">
#{userId},#{normalUserNum},#{seedlingNum},#{bronzeTreeNum},#{silverTreeNum},
#{goldTreeNum},#{farmerNum},#{forestStartNum},#{partnerNum},now(),now(),#{monthyCount},#{historyCount}
</sql>
<sql id="updateCondition">
<if test="normalUserNum != null">normal_user_num =#{normalUserNum},</if>
<if test="seedlingNum != null">seedling_num =#{seedlingNum},</if>
<if test="bronzeTreeNum != null">bronze_tree_num =#{bronzeTreeNum},</if>
<if test="silverTreeNum != null">silver_tree_num =#{silverTreeNum},</if>
<if test="goldTreeNum != null">gold_tree_num =#{goldTreeNum},</if>
<if test="farmerNum != null">farmer_num =#{farmerNum},</if>
<if test="forestStartNum != null">forest_start_num =#{forestStartNum},</if>
<if test="partnerNum != null">partner_num =#{partnerNum},</if>
<if test="monthyCount != null">monthy_count =#{monthyCount},</if>
<if test="historyCount != null">history_count =#{historyCount},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="normalUserNum != null">and normal_user_num =#{normalUserNum},</if>
<if test="seedlingNum != null">and seedling_num =#{seedlingNum},</if>
<if test="bronzeTreeNum != null">and bronze_tree_num =#{bronzeTreeNum},</if>
<if test="silverTreeNum != null">and silver_tree_num =#{silverTreeNum},</if>
<if test="goldTreeNum != null">and gold_tree_num =#{goldTreeNum},</if>
<if test="farmerNum != null">and farmer_num =#{farmerNum},</if>
<if test="forestStartNum != null">and forest_start_num =#{forestStartNum},</if>
<if test="partnerNum != null">and partner_num =#{partnerNum},</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
<if test="monthyCount != null">and #{monthyCount} &gt;= monthyCount</if>
<if test="historyCount != null">and #{historyCount} &gt;= historyCount</if>
</sql>
<select id="getByUserId" resultType="cn.wisenergy.model.app.LastMonthRecommendUser">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
user_id=#{userId}
</where>
</select>
<!--根据用户邀请码更新直推表-->
<select id="zcByUserId" resultType="integer">
select
id
from
<include refid="table"/>
<where>
user_id=#{userid}
</where>
</select>
<!--用户信息插入用户直推表-->
<select id="getRecommendUserCountByUserId" resultType="java.lang.Integer">
select
(normal_user_num+seedling_num+bronze_tree_num+silver_tree_num+
gold_tree_num+farmer_num+forest_start_num+partner_num) AS RecommendUserCount
from
<include refid="table"/>
<where>
user_id=#{userId}
</where>
</select>
<insert id="add" parameterType="cn.wisenergy.model.app.LastMonthRecommendUser" keyProperty="id" useGeneratedKeys="true">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value
(<include refid="vals"/>)
</insert>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.LastMonthTeamUserInfoMapper">
<resultMap id="userMap" type="cn.wisenergy.model.app.LastMonthTeamUserInfo">
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="normal_user_num" property="normalUserNum"/>
<result column="seedling_num" property="seedlingNum"/>
<result column="bronze_tree_num" property="bronzeTreeNum"/>
<result column="silver_tree_num" property="silverTreeNum"/>
<result column="gold_tree_num" property="goldTreeNum"/>
<result column="farmer_num" property="farmerNum"/>
<result column="forest_start_num" property="forestStartNum"/>
<result column="partner_num" property="partnerNum"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
lastmonth_team_user_info
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_id,normal_user_num,seedling_num,bronze_tree_num,silver_tree_num,
gold_tree_num,farmer_num,forest_start_num,partner_num,create_time,update_time
</sql>
<sql id="vals">
#{userId},#{normalUserNum},#{seedlingNum},#{bronzeTreeNum},#{silverTreeNum},
#{goldTreeNum},#{farmerNum},#{forestStartNum},#{partnerNum},now(),now()
</sql>
<sql id="updateCondition">
<if test="normalUserNum != null">normal_user_num =#{normalUserNum},</if>
<if test="seedlingNum != null">seedling_num =#{seedlingNum},</if>
<if test="bronzeTreeNum != null">bronze_tree_num =#{bronzeTreeNum},</if>
<if test="silverTreeNum != null">silver_tree_num =#{silverTreeNum},</if>
<if test="goldTreeNum != null">gold_tree_num =#{goldTreeNum},</if>
<if test="farmerNum != null">farmer_num =#{farmerNum},</if>
<if test="forestStartNum != null">forest_start_num =#{forestStartNum},</if>
<if test="partnerNum != null">partner_num =#{partnerNum},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="normalUserNum != null">and normal_user_num =#{normalUserNum},</if>
<if test="seedlingNum != null">and seedling_num =#{seedlingNum},</if>
<if test="bronzeTreeNum != null">and bronze_tree_num =#{bronzeTreeNum},</if>
<if test="silverTreeNum != null">and silver_tree_num =#{silverTreeNum},</if>
<if test="goldTreeNum != null">and gold_tree_num =#{goldTreeNum},</if>
<if test="farmerNum != null">and farmer_num =#{farmerNum},</if>
<if test="forestStartNum != null">and forest_start_num =#{forestStartNum},</if>
<if test="partnerNum != null">and partner_num =#{partnerNum},</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<update id="edit">
UPDATE
<include refid="table"/>
<set>
<include refid="updateCondition"/>
</set>
<where>
id = #{id}
</where>
</update>
<select id="getByUserId" resultType="cn.wisenergy.model.app.LastMonthTeamUserInfo">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
user_id=#{userId}
</where>
</select>
<!--根据userid查询用户是否存在-->
<select id="czByUserId" resultType="cn.wisenergy.model.app.LastMonthTeamUserInfo">
select
id
from
<include refid="table"/>
<where>
user_id=#{userid}
</where>
</select>
<select id="getTeamUserCount" resultType="java.lang.Integer" >
select
(normal_user_num+seedling_num+bronze_tree_num+silver_tree_num+
gold_tree_num+farmer_num+forest_start_num+partner_num) AS teamUserCount
from
<include refid="table"/>
<where>
user_id=#{userId}
</where>
</select>
<insert id="add" parameterType="cn.wisenergy.model.app.LastMonthTeamUserInfo" keyProperty="id" useGeneratedKeys="true">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value
(<include refid="vals"/>)
</insert>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.MemberPercentMapper">
<resultMap id="userMap" type="cn.wisenergy.model.app.MemberPercent">
<id column="id" property="id"/>
<result column="user_level" property="userLevel"/>
<result column="type" property="type"/>
<result column="percent" property="percent"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
member_percent
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_level,type,percent,create_time,update_time
</sql>
<sql id="vals">
#{userLevel},#{type},#{percent},now(),now()
</sql>
<sql id="updateCondition">
<if test="userLevel != null">user_level = #{userLevel},</if>
<if test="type != null">type = #{type},</if>
<if test="percent != null">percent =#{percent},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="userLevel != null">and user_level = #{userLevel}</if>
<if test="type != null">and type = #{type}</if>
<if test="percent != null">and percent =#{percent}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<insert id="add" parameterType="cn.wisenergy.model.app.MemberPercent" keyProperty="id" useGeneratedKeys="true">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value(
<include refid="vals"/>
)
</insert>
<update id="edit" parameterType="cn.wisenergy.model.app.MemberPercent">
UPDATE
<include refid="table"/>
<set>
<include refid="updateCondition"/>
</set>
<where>
id = #{id}
</where>
</update>
<delete id="delById" parameterType="java.lang.Integer">
delete from
<include refid="table"/>
where id = #{id}
</delete>
<select id="getByLevelAndType" resultType="cn.wisenergy.model.app.MemberPercent">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
user_level=#{userLevel}
and type=#{type}
</where>
</select>
<select id="count" resultType="java.lang.Integer">
select count(1)
from
<include refid="table"/>
</select>
<select id="getList" resultType="cn.wisenergy.model.app.MemberPercent">
select
<include refid="cols_all"/>
from
<include refid="table"/>
order by user_level
limit #{startNum},#{endNum}
</select>
<select id="getGoldUpSum" resultType="java.lang.Double">
select sum(percent)
from
<include refid="table"/>
<where>
type=2
and user_level>3
</where>
</select>
</mapper>
<?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="cn.wisenergy.mapper.MonthAwardMapper">
<resultMap id="monthMap" type="cn.wisenergy.model.app.MonthAward">
<id column="id" property="id"/>
<result column="growth_award" property="growthAward"/>
<result column="award_total" property="awardTotal"/>
<result column="month_award_total" property="monthAwardTotal"/>
<result column="month_increased" property="monthIncreased"/>
<result column="gold_award" property="goldAward"/>
<result column="farmer_award" property="farmerAward"/>
<result column="forest_start_award" property="forestStartAward"/>
<result column="partner_award" property="partnerAward"/>
<result column="year_month" property="yearMonth"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
month_award
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
growth_award,award_total,month_award_total,month_increased,gold_award,farmer_award, forest_start_award,
partner_award,`year_month`,create_time,update_time
</sql>
<sql id="vals">
#{growthAward},#{awardTotal},#{monthAwardTotal},#{monthIncreased},#{goldAward},#{farmerAward},
#{forestStartAward}, #{partnerAward},#{yearMonth},now(),now()
</sql>
<sql id="updateCondition">
<if test="growthAward != null">growth_award =#{growthAward},</if>
<if test="awardTotal != null">award_total = #{awardTotal},</if>
<if test="monthAwardTotal != null">month_award_total = #{monthAwardTotal},</if>
<if test="monthIncreased != null">month_increased =#{monthIncreased},</if>
<if test="goldAward != null">gold_award =#{goldAward},</if>
<if test="farmerAward != null">farmer_award =#{farmerAward},</if>
<if test="forestStartAward != null">forest_start_award =#{forestStartAward},</if>
<if test="partnerAward != null">partner_award =#{partnerAward},</if>
<if test="yearMonth != null">`year_month` =#{yearMonth},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="growthAward != null">and growth_award =#{growthAward}</if>
<if test="awardTotal != null">and award_total = #{awardTotal}</if>
<if test="monthAwardTotal != null">and month_award_total = #{monthAwardTotal}</if>
<if test="monthIncreased != null">and month_increased =#{monthIncreased}</if>
<if test="goldAward != null">and gold_award =#{goldAward}</if>
<if test="farmerAward != null">and farmer_award =#{farmerAward}</if>
<if test="forestStartAward != null">and forest_start_award =#{forestStartAward}</if>
<if test="partnerAward != null">and partner_award =#{partnerAward}</if>
<if test="yearMonth != null">and `year_month` =#{yearMonth}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<insert id="add" parameterType="cn.wisenergy.model.app.MonthAward" keyProperty="id" useGeneratedKeys="true">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value(
<include refid="vals"/>
)
</insert>
<update id="edit" parameterType="cn.wisenergy.model.app.MonthAward">
UPDATE
<include refid="table"/>
<set>
<include refid="updateCondition"/>
</set>
<where>
id = #{id}
</where>
</update>
<delete id="delById" parameterType="java.lang.Integer">
delete from
<include refid="table"/>
where id = #{id}
</delete>
<select id="getByTime" resultType="cn.wisenergy.model.app.MonthAward">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
<if test="yearMonth != null">
`year_month`=#{yearMonth}
</if>
</where>
order by create_time desc
limit 1
</select>
<select id="count" resultType="java.lang.Integer">
select count(1)
from
<include refid="table"/>
<where>
<if test="queryTime != null and queryTime != ''">
`year_month` = #{queryTime}
</if>
</where>
</select>
<select id="getList" resultType="cn.wisenergy.model.app.MonthAward">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
<if test="queryTime != null and queryTime != ''">
`year_month` = #{queryTime}
</if>
</where>
order by create_time desc
limit #{startNum},#{endNum}
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.MonthManureMapper">
<resultMap id="monthMap" type="cn.wisenergy.model.app.MonthManure">
<id column="id" property="id"/>
<result column="year_month" property="yearMonth"/>
<result column="manure_award" property="manureAward"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
month_manure
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
`year_month`,manure_award,create_time,update_time
</sql>
<sql id="vals">
#{yearMonth},#{manureAward},now(),now()
</sql>
<sql id="updateCondition">
<if test="yearMonth != null">`year_month` =#{yearMonth},</if>
<if test="manureAward != null">manure_award = #{manureAward},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="yearMonth != null">and `year_month` =#{yearMonth}</if>
<if test="manureAward != null">and manure_award = #{manureAward}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<insert id="add" parameterType="cn.wisenergy.model.app.MonthManure" keyProperty="id" useGeneratedKeys="true">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value(
<include refid="vals"/>
)
</insert>
<update id="edit" parameterType="cn.wisenergy.model.app.MonthManure">
UPDATE
<include refid="table"/>
<set>
<include refid="updateCondition"/>
</set>
<where>
id = #{id}
</where>
</update>
<select id="queryByTime" resultType="cn.wisenergy.model.app.MonthManure">
SELECT
<include refid="cols_all"/>
FROM
<include refid="table"/>
<where>
<if test="yearMonth != null and yearMonth != ''">
`year_month`=#{yearMonth}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.OrderMapper">
<resultMap id="OrderMap" type="cn.wisenergy.model.app.OrderInfo">
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="item_id" property="itemId"/>
<result column="pay_type" property="payType"/>
<result column="youzan_update_time" property="youzanUpdateTime"/>
<result column="tid" property="tid"/>
<result column="created" property="created"/>
<result column="team_type" property="teamType"/>
<result column="pay_time" property="payTime"/>
<result column="pay_type_str" property="payTypeStr"/>
<result column="close_type" property="closeType"/>
<result column="refund_state" property="refundState"/>
<result column="success_time" property="successTime"/>
<result column="payment" property="payment"/>
<result column="rebate_status" property="rebateStatus"/>
<result column="level_status" property="levelStatus"/>
<result column="month_order_status" property="monthOrderStatus"/>
<result column="monthly_task_status" property="monthlyTaskStatus"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
order_info
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_id,item_id,pay_type,youzan_update_time,tid,created,team_type,pay_time,pay_type_str,close_type,refund_state,
success_time,payment,rebate_status,level_status,month_order_status,monthly_task_status,create_time,update_time
</sql>
<sql id="vals">
#{userId},#{itemId},#{payType},#{youzanUpdateTime}, #{tid},#{created},#{teamType},#{payTime},#{payTypeStr},
#{closeType},#{refundState},#{successTime},#{payment},
#{rebateStatus},#{levelStatus},#{monthOrderStatus},#{monthlyTaskStatus},now(),now()
</sql>
<sql id="updateCondition">
<if test="userId != null">user_id = #{userId},</if>
<if test="itemId != null">item_id =#{itemId},</if>
<if test="payType != null">pay_type =#{payType},</if>
<if test="youzanUpdateTime != null">youzan_update_time =#{youzanUpdateTime},</if>
<if test="tid != null">tid =#{tid},</if>
<if test="created != null">created =#{created},</if>
<if test="teamType != null">team_type =#{teamType},</if>
<if test="payTime != null">pay_time =#{payTime},</if>
<if test="payTypeStr != null">pay_type_str =#{payTypeStr},</if>
<if test="closeType != null">close_type =#{closeType},</if>
<if test="refundState != null">refund_state =#{refundState},</if>
<if test="successTime != null">success_time =#{successTime},</if>
<if test="payment != null">payment =#{payment},</if>
<if test="rebateStatus != null">rebate_status =#{rebateStatus},</if>
<if test="levelStatus != null">level_status =#{levelStatus},</if>
<if test="monthOrderStatus != null">month_order_status =#{monthOrderStatus},</if>
<if test="monthlyTaskStatus != null">monthly_task_status =#{monthlyTaskStatus},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="userId != null">and user_id = #{userId}</if>
<if test="itemId != null">and item_id =#{itemId}</if>
<if test="payType != null">and pay_type =#{payType}</if>
<if test="youzanUpdateTime != null">youzan_update_time =#{youzanUpdateTime}</if>
<if test="tid != null">and tid =#{tid}</if>
<if test="created != null">and created =#{created}</if>
<if test="teamType != null">and team_type =#{teamType}</if>
<if test="payTime != null">and pay_time =#{payTime}</if>
<if test="payTypeStr != null">and pay_type_str =#{payTypeStr}</if>
<if test="closeType != null">and close_type =#{closeType}</if>
<if test="refundState != null">and refund_state =#{refundState}</if>
<if test="successTime != null">and success_time =#{successTime}</if>
<if test="payment != null">and payment =#{payment}</if>
<if test="rebateStatus != null">and rebate_status =#{rebateStatus}</if>
<if test="levelStatus != null">and level_status =#{levelStatus}</if>
<if test="monthOrderStatus != null">and month_order_status =#{monthOrderStatus}</if>
<if test="monthlyTaskStatus != null">and monthly_task_status =#{monthlyTaskStatus}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<select id="getByRebateStatus" resultType="cn.wisenergy.model.app.OrderInfo">
SELECT
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
rebateStatus=#{rebateStatus}
</where>
</select>
<insert id="insertYouZanOrders" parameterType="cn.wisenergy.model.app.OrderInfo" keyProperty="id"
useGeneratedKeys="true">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value
(<include refid="vals"/>)
</insert>
<select id="getByTid" resultType="cn.wisenergy.model.app.OrderInfo">
SELECT
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
tid=#{tid}
</where>
</select>
<select id="getPerformanceByUserid" resultType="java.math.BigDecimal">
select
sum(payment)
from
<include refid="table"/>
<where>
user_id=#{userid}
and pay_type <![CDATA[ <> ]]> 0
</where>
</select>
<select id="getListBySuccessTime" resultType="cn.wisenergy.model.app.OrderInfo">
SELECT
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
rebate_status=0
and pay_type !=0
<if test="successTime != null ">
AND(
YEAR(success_time) = YEAR(#{successTime})
AND MONTH(success_time) = MONTH(#{successTime}))
</if>
</where>
</select>
<select id="getByCreateTime" resultType="cn.wisenergy.model.app.OrderInfo">
SELECT
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
pay_type != 0
and user_id !=''
<if test="created != null ">
and (YEAR(created) = YEAR(#{created})
AND MONTH(created) = MONTH(#{created})
)
</if>
</where>
</select>
<select id="getByLevelStatus" resultType="cn.wisenergy.model.app.OrderInfo">
SELECT
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
level_status=#{levelStatus}
</where>
</select>
<select id="getByMonthOrderStatus" resultType="cn.wisenergy.model.app.OrderInfo">
select
<include refid="cols_all"/>
from
<include refid="table"/>
where
month_order_status = #{monthOrderStatus}
and
success_time is not null
</select>
<select id="findByPage" resultType="cn.wisenergy.model.app.OrderInfo">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
<if test="userId != null and userId != ''">
user_id=#{userId}
</if>
</where>
order by create_time desc
limit #{startNum},#{endNum}
</select>
<select id="count" resultType="java.lang.Integer">
select count(1)
from
<include refid="table"/>
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.ProductMapper">
<resultMap id="productMap" type="cn.wisenergy.model.app.ProductInfo">
<id column="id" property="id"/>
<result column="batch_number" property="batchNumber"/>
<result column="brand" property="brand"/>
<result column="specification" property="specification"/>
<result column="brand_name" property="brandName"/>
<result column="product_country" property="productCountry"/>
<result column="valid_time" property="validTime"/>
<result column="company_name" property="companyName"/>
<result column="company_address" property="companyAddress"/>
<result column="company_url" property="companyUrl"/>
<result column="tracking_number" property="trackingNumber"/>
<result column="logistics_url" property="logisticsUrl"/>
<result column="record_number" property="recordNumber"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
product_info
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
batch_number,brand,specification,brand_name,product_country, valid_time, company_name,company_address,
company_url,tracking_number, logistics_url,record_number, create_time,update_time
</sql>
<sql id="vals">
#{batchNumber},#{brand}, #{specification},#{brandName},#{productCountry}, #{validTime},#{companyName},
#{companyAddress},#{companyUrl},#{trackingNumber},#{logisticsUrl}, #{recordNumber},now(),now()
</sql>
<sql id="createsVal">
#{i.batchNumber},#{i.brand},#{i.specification},#{i.brandName},#{i.productCountry},
#{i.validTime},#{i.companyName},
#{i.companyAddress}, #{i.companyUrl},#{i.trackingNumber},#{i.logisticsUrl}, #{i.recordNumber},now(),now()
</sql>
<sql id="updateCondition">
<if test="batchNumber != null">batch_number = #{batchNumber},</if>
<if test="brand != null">brand = #{brand},</if>
<if test="specification != null">specification = #{specification},</if>
<if test="brandName != null">brand_name = #{brandName},</if>
<if test="productCountry != null">product_country = #{productCountry},</if>
<if test="validTime != null">valid_time = #{validTime},</if>
<if test="companyName != null">company_name = #{companyName},</if>
<if test="companyAddress != null">company_address = #{companyAddress},</if>
<if test="companyUrl != null">company_url = #{companyUrl},</if>
<if test="trackingNumber != null">tracking_number = #{trackingNumber},</if>
<if test="logisticsUrl != null">logistics_url = #{logisticsUrl},</if>
<if test="recordNumber != null">record_number = #{recordNumber},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="batchNumber != null">and batch_number = #{batchNumber}</if>
<if test="brand != null">and brand = #{brand}</if>
<if test="specification != null">and specification = #{specification}</if>
<if test="brandName != null">and brand_name = #{brandName}</if>
<if test="productCountry != null">and product_country = #{productCountry}</if>
<if test="validTime != null">and valid_time = #{validTime}</if>
<if test="companyName != null">and company_name = #{companyName}</if>
<if test="companyAddress != null">and company_address = #{companyAddress}</if>
<if test="companyUrl != null">and company_url = #{companyUrl}</if>
<if test="trackingNumber != null">and tracking_number = #{trackingNumber}</if>
<if test="logisticsUrl != null">and logistics_url = #{logisticsUrl}</if>
<if test="recordNumber != null">and record_number = #{recordNumber}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<insert id="add" parameterType="cn.wisenergy.model.app.ProductInfo" keyProperty="id" useGeneratedKeys="true">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value(
<include refid="vals"/>
)
</insert>
<update id="edit" parameterType="cn.wisenergy.model.app.ProductInfo">
UPDATE
<include refid="table"/>
<set>
<include refid="updateCondition"/>
</set>
<where>
id = #{id}
</where>
</update>
<select id="getByBatchNumber" resultMap="productMap">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
batch_number=#{batchNumber}
</where>
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.ProgressPrizeMapper">
<resultMap id="monthMap" type="cn.wisenergy.model.app.ProgressPrize">
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="year_month" property="yearMonth"/>
<result column="growth_rate" property="growthRate"/>
<result column="award_money" property="awardMoney"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
progress_prize
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_id,`year_month`,`growth_rate`,award_money,create_time,update_time
</sql>
<sql id="vals">
#{userId},#{yearMonth},#{growthRate},#{awardMoney},now(),now()
</sql>
<sql id="updateCondition">
<if test="userId != null">user_id = #{userId},</if>
<if test="yearMonth != null">`year_month` = #{yearMonth},</if>
<if test="growthRate != null">`growth_rate` =#{growthRate},</if>
<if test="awardMoney != null">award_money =#{awardMoney},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="userId != null">and user_id = #{userId}</if>
<if test="yearMonth != null">and `year_month` = #{yearMonth}</if>
<if test="growthRate != null">and `growth_rate` =#{growthRate}</if>
<if test="awardMoney != null">and award_money =#{awardMoney}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<insert id="add" parameterType="cn.wisenergy.model.app.ProgressPrize" keyProperty="id" useGeneratedKeys="true">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value(
<include refid="vals"/>
)
</insert>
<update id="edit" parameterType="cn.wisenergy.model.app.ProgressPrize">
UPDATE
<include refid="table"/>
<set>
<include refid="updateCondition"/>
</set>
<where>
id = #{id}
</where>
</update>
<delete id="delById" parameterType="java.lang.Integer">
delete from
<include refid="table"/>
where id = #{id}
</delete>
<select id="getByYearMonth" resultType="cn.wisenergy.model.app.ProgressPrize">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
<if test="yearMonth != null">
`year_month` = #{yearMonth}
</if>
</where>
</select>
<select id="getByTime" resultType="cn.wisenergy.model.vo.ProgressPrizeVo">
select p.user_id as userId,u.head_image as headImage,p.`growth_rate` as growthRate, p.award_money as awardMoney
from
progress_prize p ,user_info u
where
p.user_id=u.user_id
and p.`year_month` = #{yearMonth}
and p.award_money>0
order by p.`growth_rate` desc,p.award_money desc,u.create_time desc
</select>
<select id="getByUserIdYearMonth" resultType="cn.wisenergy.model.app.ProgressPrize">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
<if test="userId != null and userId != ''">
user_id=#{userId}
</if>
<if test="yearMonth != null">
and `year_month`= #{yearMonth}
</if>
</where>
</select>
<select id="count" resultType="java.lang.Integer">
select count(1)
from
<include refid="table"/>
<where>
<if test="queryTime != null and queryTime != ''">
`year_month` = #{queryTime}
</if>
</where>
</select>
<select id="getList" resultType="cn.wisenergy.model.app.ProgressPrize">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
<if test="queryTime != null and queryTime != ''">
`year_month` = #{queryTime}
</if>
</where>
order by create_time desc
limit #{startNum},#{endNum}
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.RecommendUserMapper">
<resultMap id="userMap" type="cn.wisenergy.model.app.RecommendUser">
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="normal_user_num" property="normalUserNum"/>
<result column="seedling_num" property="seedlingNum"/>
<result column="bronze_tree_num" property="bronzeTreeNum"/>
<result column="silver_tree_num" property="silverTreeNum"/>
<result column="gold_tree_num" property="goldTreeNum"/>
<result column="farmer_num" property="farmerNum"/>
<result column="forest_start_num" property="forestStartNum"/>
<result column="partner_num" property="partnerNum"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="monthy_count" property="monthyCount"/>
<result column="history_count" property="historyCount"/>
</resultMap>
<sql id="table">
recommend_user
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_id,normal_user_num,seedling_num,bronze_tree_num,silver_tree_num,
gold_tree_num,farmer_num,forest_start_num,partner_num,create_time,update_time,monthy_count,history_count
</sql>
<sql id="vals">
#{userId},#{normalUserNum},#{seedlingNum},#{bronzeTreeNum},#{silverTreeNum},
#{goldTreeNum},#{farmerNum},#{forestStartNum},#{partnerNum},now(),now(),#{monthyCount},#{historyCount}
</sql>
<sql id="updateCondition">
<if test="normalUserNum != null">normal_user_num =#{normalUserNum},</if>
<if test="seedlingNum != null">seedling_num =#{seedlingNum},</if>
<if test="bronzeTreeNum != null">bronze_tree_num =#{bronzeTreeNum},</if>
<if test="silverTreeNum != null">silver_tree_num =#{silverTreeNum},</if>
<if test="goldTreeNum != null">gold_tree_num =#{goldTreeNum},</if>
<if test="farmerNum != null">farmer_num =#{farmerNum},</if>
<if test="forestStartNum != null">forest_start_num =#{forestStartNum},</if>
<if test="partnerNum != null">partner_num =#{partnerNum},</if>
<if test="monthyCount != null">monthy_count =#{monthyCount},</if>
<if test="historyCount != null">history_count =#{historyCount},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="normalUserNum != null">and normal_user_num =#{normalUserNum},</if>
<if test="seedlingNum != null">and seedling_num =#{seedlingNum},</if>
<if test="bronzeTreeNum != null">and bronze_tree_num =#{bronzeTreeNum},</if>
<if test="silverTreeNum != null">and silver_tree_num =#{silverTreeNum},</if>
<if test="goldTreeNum != null">and gold_tree_num =#{goldTreeNum},</if>
<if test="farmerNum != null">and farmer_num =#{farmerNum},</if>
<if test="forestStartNum != null">and forest_start_num =#{forestStartNum},</if>
<if test="partnerNum != null">and partner_num =#{partnerNum},</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
<if test="monthyCount != null">and #{monthyCount} &gt;= monthyCount</if>
<if test="historyCount != null">and #{historyCount} &gt;= historyCount</if>
</sql>
<select id="getByUserId" resultType="cn.wisenergy.model.app.RecommendUser">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
user_id=#{userId}
</where>
</select>
<!--根据用户邀请码更新直推表-->
<select id="zcByUserId" resultType="integer">
select
id
from
<include refid="table"/>
<where>
user_id=#{userid}
</where>
</select>
<!--用户信息插入用户直推表-->
<select id="getRecommendUserCountByUserId" resultType="java.lang.Integer">
select
(normal_user_num+seedling_num+bronze_tree_num+silver_tree_num+
gold_tree_num+farmer_num+forest_start_num+partner_num) AS RecommendUserCount
from
<include refid="table"/>
<where>
user_id=#{userId}
</where>
</select>
<insert id="add" parameterType="cn.wisenergy.model.app.RecommendUser" keyProperty="id" useGeneratedKeys="true">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value
(<include refid="vals"/>)
</insert>
<select id="getRecommendUserList" resultType="cn.wisenergy.model.app.RecommendUser">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
1=1
<if test="userId != null and userId != ''">
and user_id = #{userId}
</if>
<if test="queryTime != null and queryTime != ''">
and (YEAR(create_time) = YEAR(#{queryTime})
AND MONTH(create_time) =MONTH(#{queryTime})
AND DAY(create_time)=DAY(#{queryTime}))
</if>
</where>
order by create_time desc
limit #{startNum},#{endNum}
</select>
<select id="count" resultType="java.lang.Integer">
select count(1)
from
<include refid="table"/>
<where>
<if test="userId != null and userId != ''">
user_id=#{userId}
</if>
<if test="queryTime != null and queryTime != ''">
and `create_time` = #{queryTime}
</if>
</where>
</select>
<select id="getAll" resultType="cn.wisenergy.model.app.RecommendUser">
select
<include refid="cols_all"/>
from
<include refid="table"/>
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.ShopVersionMapper">
<resultMap id="versionMap" type="cn.wisenergy.model.app.ShopVersion">
<id column="id" property="id"/>
<result column="name" property="name"/>
<result column="type" property="type"/>
<result column="url" property="url"/>
<result column="version" property="version"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
shop_version
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
name,type,url,version,create_time,update_time
</sql>
<sql id="vals">
#{name},#{type},#{url},#{version},now(),now()
</sql>
<sql id="updateCondition">
<if test="name != null">name = #{name},</if>
<if test="type != null">type = #{type},</if>
<if test="url != null">url =#{url},</if>
<if test="version != null">version =#{version},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="name != null">and name = #{name}</if>
<if test="type != null">and type = #{type}</if>
<if test="url != null">and url =#{url}</if>
<if test="version != null">and version =#{version}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<insert id="add" parameterType="cn.wisenergy.model.app.ShopVersion" keyProperty="id" useGeneratedKeys="true">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value(
<include refid="vals"/>
)
</insert>
<update id="edit" parameterType="cn.wisenergy.model.app.ShopVersion">
UPDATE
<include refid="table"/>
<set>
<include refid="updateCondition"/>
</set>
<where>
id = #{id}
</where>
</update>
<select id="getByType" resultType="cn.wisenergy.model.app.ShopVersion">
select
<include refid="cols_all"/>
from
<include refid="table"/>
where type=#{type}
</select>
<select id="getList" resultType="cn.wisenergy.model.app.ShopVersion">
select
<include refid="cols_all"/>
from
<include refid="table"/>
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.ShopZxMapper">
<resultMap id="zxMap" type="cn.wisenergy.model.app.shopZx">
<id column="zx_id" property="zxid"/>
<result column="zx_url" property="zxUrl"/>
<result column="zx_likes" property="zxLikes"/>
<result column="invite_code" property="inviteCode"/>
<result column="zx_to_examine" property="zxToExamine"/>
<result column="zx_field" property="zxField"/>
<result column="zx_date" property="zxDate"/>
</resultMap>
<sql id="table">
shop_zx
</sql>
<sql id="cols_all">
zx_id as zxid,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
zx_url,zx_field,invite_code,zx_date
</sql>
<sql id="vals">
#{zxUrl},#{zxField},#{inviteCode},#{zxDate}
</sql>
<sql id="updateCondition">
<if test="zxLikes != null">zx_likes = #{zxLikes},</if>
</sql>
<!--资讯内容插入-->
<insert id="zxadd" parameterType="cn.wisenergy.model.app.shopZx">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value(
<include refid="vals"/>
)
</insert>
<!--用户头像插入-->
<update id="zxadd1" parameterType="cn.wisenergy.model.app.User">
UPDATE
user_info
<set>
head_image=#{headImage}
</set>
<where>
user_id=#{userId}
</where>
</update>
<!--资讯内容倒叙查询-->
<!--资讯内容倒叙查询-->
<select id="selectPage" parameterType="java.lang.Integer" resultType="cn.wisenergy.model.dto.ZxUserDto">
select
b.zx_id as zxid,
b.zx_url as zxUrl,
b.zx_likes as zxLikes,
b.zx_field as zxField,
b.zx_date as zxDate,
b.invite_code as inviteCode,
a.user_id as userId,
a.head_image as headImage
from shop_zx b left join user_info a ON a.invite_code=b.invite_code
WHERE zx_to_examine = 1
AND a.user_id !=0
order by zxid desc limit #{pageNum},#{pageSize}
</select>
<!--资讯点赞专用sql-->
<select id="selectByzxid" parameterType="java.lang.Integer" resultType="cn.wisenergy.model.app.shopZx">
select * from shop_zx where zx_id=#{zxid}
</select>
<update id="updateByzxid">
UPDATE
<include refid="table"/>
<set>
zx_likes = #{zxLikes}
</set>
<where>
zx_id = #{zxid}
</where>
</update>
<!--资讯审核-->
<update id="updateZxToExaminezxid">
UPDATE
<include refid="table"/>
<set>
zx_to_examine = #{ZxToExamine}
</set>
<where>
zx_id = #{zxid}
</where>
</update>
<!--资讯内容与用户内容倒叙查询-->
<select id="getShopZxList" resultType="cn.wisenergy.model.vo.ShopZxUserVo">
select
b.zx_id as zxid,
b.zx_url as zxUrl,
b.zx_likes as zxLikes,
b.zx_to_examine as auditStatus,
b.zx_field as zxField,
b.zx_date as zxDate,
b.invite_code as inviteCode,
a.user_id as userId,
b.zx_to_examine as ZxToExamine
from shop_zx b left join user_info a ON a.invite_code=b.invite_code
<where>
1=1
<if test="userId != null and userId != ''">
and user_id = #{userId}
</if>
</where>
order by zx_id desc
limit #{startNum},#{endNum}
</select>
<select id="count" resultType="java.lang.Integer">
select count(1)
from
<include refid="table"/>
<where>
<if test="userId != null and userId != ''">
zx_id = #{zxId}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.SmsLogMapper">
<select id="getSmsLogById" resultType="cn.wisenergy.model.app.SmsLog">
select
id as id,
codeType as codeType,
phone as phone,
message as message,
failInfo as failInfo,
status as status,
createdUserId as createdUserId,
updatedUserId as updatedUserId,
creatdTime as creatdTime,
updatedTime as updatedTime,
isDelete as isDelete
from sms_log
<trim prefix="where" prefixOverrides="and | or">
<if test="id != null">
and id=#{id}
</if>
</trim>
</select>
<select id="getSmsLogListByMap" resultType="cn.wisenergy.model.app.SmsLog" parameterType="java.util.Map">
select
id as id,
codeType as codeType,
phone as phone,
message as message,
failInfo as failInfo,
status as status,
createdUserId as createdUserId,
updatedUserId as updatedUserId,
creatdTime as creatdTime,
updatedTime as updatedTime,
isDelete as isDelete
from sms_log
<trim prefix="where" prefixOverrides="and | or">
<if test="id != null">
and id=#{id}
</if>
<if test="codeType != null">
and codeType=#{codeType}
</if>
<if test="phone != null and phone!=''">
and phone=#{phone}
</if>
<if test="message != null and message!=''">
and message=#{message}
</if>
<if test="failInfo != null and failInfo!=''">
and failInfo=#{failInfo}
</if>
<if test="status != null">
and status=#{status}
</if>
<if test="createdUserId != null">
and createdUserId=#{createdUserId}
</if>
<if test="updatedUserId != null">
and updatedUserId=#{updatedUserId}
</if>
<if test="null!=creatdTime">
and creatdTime=#{creatdTime}
</if>
<if test="null!=updatedTime">
and updatedTime=#{updatedTime}
</if>
<if test="isDelete != null">
and isDelete=#{isDelete}
</if>
</trim>
<if test="beginPos != null and pageSize != null ">
limit #{beginPos},#{pageSize}
</if>
</select>
<select id="getSmsLogCountByMap" resultType="Integer" parameterType="java.util.Map">
select count(*) from sms_log
<trim prefix="where" prefixOverrides="and | or">
<if test="id != null">
and id=#{id}
</if>
<if test="codeType != null">
and codeType=#{codeType}
</if>
<if test="phone != null and phone!=''">
and phone=#{phone}
</if>
<if test="message != null and message!=''">
and message=#{message}
</if>
<if test="failInfo != null and failInfo!=''">
and failInfo=#{failInfo}
</if>
<if test="status != null">
and status=#{status}
</if>
<if test="createdUserId != null">
and createdUserId=#{createdUserId}
</if>
<if test="updatedUserId != null">
and updatedUserId=#{updatedUserId}
</if>
<if test="null!=creatdTime">
and creatdTime=#{creatdTime}
</if>
<if test="null!=updatedTime">
and updatedTime=#{updatedTime}
</if>
<if test="isDelete != null">
and isDelete=#{isDelete}
</if>
</trim>
</select>
<insert id="insertSmsLog" parameterType="cn.wisenergy.model.app.SmsLog">
insert into sms_log(
codeType,
phone,
message,
failInfo,
status,
createdUserId,
updatedUserId,
creatdTime,
updatedTime,
isDelete)
values(
#{codeType},
#{phone},
#{message},
#{failInfo},
#{status},
#{createdUserId},
#{updatedUserId},
#{creatdTime},
#{updatedTime},
#{isDelete})
</insert>
<update id="updateSmsLog" parameterType="cn.wisenergy.model.app.SmsLog">
update sms_log
<trim prefix="set" suffixOverrides="," suffix="where id=#{id}">
<if test="codeType != null">
codeType=#{codeType},
</if>
<if test="phone != null and phone!=''">
phone=#{phone},
</if>
<if test="message != null and message!=''">
message=#{message},
</if>
<if test="failInfo != null and failInfo!=''">
failInfo=#{failInfo},
</if>
<if test="status != null">
status=#{status},
</if>
<if test="createdUserId != null">
createdUserId=#{createdUserId},
</if>
<if test="updatedUserId != null">
updatedUserId=#{updatedUserId},
</if>
<if test="creatdTime != null">
creatdTime=#{creatdTime},
</if>
<if test="updatedTime != null">
updatedTime=#{updatedTime},
</if>
<if test="isDelete != null">
isDelete=#{isDelete}
</if>
</trim>
</update>
<delete id="deleteSmsLogById" parameterType="String">
delete from sms_log where id = #{id}
</delete>
<delete id="batchDeleteSmsLog" parameterType="java.util.Map">
delete from sms_log where id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</delete>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.SysUserMapper">
<resultMap id="sysMap" type="cn.wisenergy.model.app.SysUser">
<id column="id" property="id"/>
<result column="account" property="account"/>
<result column="password" property="password"/>
<result column="user_name" property="userName"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
sys_user
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
account,password,user_name,create_time,update_time
</sql>
<sql id="vals">
#{account},#{password},#{userName},now(),now()
</sql>
<sql id="updateCondition">
<if test="account != null">account = #{account},</if>
<if test="password != null">password = #{password},</if>
<if test="userName != null">user_name = #{userName},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="account != null">and account = #{account}</if>
<if test="password != null">and password = #{password}</if>
<if test="userName != null">and user_name = #{userName}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<select id="getById" resultType="cn.wisenergy.model.app.SysUser">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
id=#{id}
</where>
</select>
<select id="getByAccount" resultType="cn.wisenergy.model.app.SysUser">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
account=#{account}
</where>
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.TeamPerformanceMapper">
<resultMap id="monthMap" type="cn.wisenergy.model.app.TeamPerformance">
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="user_level" property="userLevel"/>
<result column="year_month" property="yearMonth"/>
<result column="month_team_performance" property="monthTeamPerformance"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
team_performance
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_id,user_level,`year_month`,month_team_performance,create_time,update_time
</sql>
<sql id="vals">
#{userId},#{userLevel},#{yearMonth},#{monthTeamPerformance},now(),now()
</sql>
<sql id="updateCondition">
<if test="userId != null">user_id = #{userId},</if>
<if test="userLevel != null">user_level = #{userLevel},</if>
<if test="yearMonth != null">`year_month` =#{yearMonth},</if>
<if test="monthTeamPerformance != null">month_team_performance =#{monthTeamPerformance},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="userId != null">and user_id = #{userId}</if>
<if test="userLevel != null">and user_level = #{userLevel}</if>
<if test="yearMonth != null">and `year_month` =#{yearMonth}</if>
<if test="monthTeamPerformance != null">and month_team_performance =#{monthTeamPerformance}</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<insert id="add" parameterType="cn.wisenergy.model.app.TeamPerformance" keyProperty="id" useGeneratedKeys="true">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value(
<include refid="vals"/>
)
</insert>
<update id="edit" parameterType="cn.wisenergy.model.app.TeamPerformance">
UPDATE
<include refid="table"/>
<set>
<include refid="updateCondition"/>
</set>
<where>
id = #{id}
</where>
</update>
<delete id="delById" parameterType="java.lang.Integer">
delete from
<include refid="table"/>
where id = #{id}
</delete>
<select id="getByUserIdAndTime" resultType="cn.wisenergy.model.app.TeamPerformance">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
1=1
<if test="userId != null">
and user_id = #{userId}
</if>
<if test="yearMonth != null">
and `year_month`=#{yearMonth}
</if>
</where>
</select>
<select id="countTeamMoney" resultType="java.lang.Double">
select
sum(month_team_performance)
from
<include refid="table"/>
<where>
<if test="userLevel != null">
user_level = #{userLevel}
</if>
<if test="yearMonth != null">
and `year_month` = #{yearMonth}
</if>
</where>
</select>
<select id="getByBeforeTime" resultType="cn.wisenergy.model.app.TeamPerformance">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
<if test="yearMonth != null">
`year_month` &lt; #{yearMonth}
</if>
</where>
</select>
<select id="countByTime" resultType="java.lang.Double">
select
sum(month_team_performance)
from
<include refid="table"/>
<where>
user_level>0
<if test="yearMonth != null">
and `year_month` = #{yearMonth}
</if>
</where>
</select>
<select id="countTwenty" resultType="java.lang.Double">
select
sum(month_team_performance)
from
<include refid="table"/>
<where>
<if test="yearMonth != null">
`year_month` = #{yearMonth}
</if>
order by month_team_performance desc
limit 20
</where>
</select>
<select id="userTwenty" resultType="cn.wisenergy.model.app.TeamPerformance">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
user_level != 0
<if test="yearMonth != null">
and `year_month` = #{yearMonth}
</if>
order by month_team_performance desc
limit 20
</where>
</select>
<select id="countUserTeamByUserId" resultType="double">
select sum(month_team_performance)
from
<include refid="table"/>
<where>
user_id=#{userId}
</where>
</select>
<select id="monthUserTeamByuserId" resultType="double">
select month_team_performance
from
<include refid="table"/>
<where>
user_id=#{userid}
and `year_month` = #{yearMonth}
</where>
</select>
<select id="count" resultType="java.lang.Integer">
select count(1)
from
<include refid="table"/>
<where>
<if test="userId != null and userId != ''">
user_id=#{userId}
</if>
<if test="queryTime != null and queryTime != ''">
and `year_month` = #{queryTime}
</if>
</where>
</select>
<select id="getList" resultType="cn.wisenergy.model.app.TeamPerformance">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
<if test="userId != null and userId != ''">
user_id=#{userId}
</if>
<if test="queryTime != null and queryTime != ''">
and `year_month` = #{queryTime}
</if>
</where>
order by create_time desc
limit #{startNum},#{endNum}
</select>
<select id="getByUserId" resultType="cn.wisenergy.model.app.TeamPerformance">
select
<include refid="cols_all"/>
from
<include refid="table"/>
where
user_id = #{userId}
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.TeamUserInfoMapper">
<resultMap id="userMap" type="cn.wisenergy.model.app.TeamUserInfo">
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="normal_user_num" property="normalUserNum"/>
<result column="seedling_num" property="seedlingNum"/>
<result column="bronze_tree_num" property="bronzeTreeNum"/>
<result column="silver_tree_num" property="silverTreeNum"/>
<result column="gold_tree_num" property="goldTreeNum"/>
<result column="farmer_num" property="farmerNum"/>
<result column="forest_start_num" property="forestStartNum"/>
<result column="partner_num" property="partnerNum"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="table">
team_user_info
</sql>
<sql id="cols_all">
id,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_id,normal_user_num,seedling_num,bronze_tree_num,silver_tree_num,
gold_tree_num,farmer_num,forest_start_num,partner_num,create_time,update_time
</sql>
<sql id="vals">
#{userId},#{normalUserNum},#{seedlingNum},#{bronzeTreeNum},#{silverTreeNum},
#{goldTreeNum},#{farmerNum},#{forestStartNum},#{partnerNum},now(),now()
</sql>
<sql id="updateCondition">
<if test="normalUserNum != null">normal_user_num =#{normalUserNum},</if>
<if test="seedlingNum != null">seedling_num =#{seedlingNum},</if>
<if test="bronzeTreeNum != null">bronze_tree_num =#{bronzeTreeNum},</if>
<if test="silverTreeNum != null">silver_tree_num =#{silverTreeNum},</if>
<if test="goldTreeNum != null">gold_tree_num =#{goldTreeNum},</if>
<if test="farmerNum != null">farmer_num =#{farmerNum},</if>
<if test="forestStartNum != null">forest_start_num =#{forestStartNum},</if>
<if test="partnerNum != null">partner_num =#{partnerNum},</if>
update_time =now()
</sql>
<sql id="criteria">
<if test="id != null">id = #{id}</if>
<if test="normalUserNum != null">and normal_user_num =#{normalUserNum},</if>
<if test="seedlingNum != null">and seedling_num =#{seedlingNum},</if>
<if test="bronzeTreeNum != null">and bronze_tree_num =#{bronzeTreeNum},</if>
<if test="silverTreeNum != null">and silver_tree_num =#{silverTreeNum},</if>
<if test="goldTreeNum != null">and gold_tree_num =#{goldTreeNum},</if>
<if test="farmerNum != null">and farmer_num =#{farmerNum},</if>
<if test="forestStartNum != null">and forest_start_num =#{forestStartNum},</if>
<if test="partnerNum != null">and partner_num =#{partnerNum},</if>
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
</sql>
<update id="edit">
UPDATE
<include refid="table"/>
<set>
<include refid="updateCondition"/>
</set>
<where>
id = #{id}
</where>
</update>
<select id="getByUserId" resultType="cn.wisenergy.model.app.TeamUserInfo">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
user_id=#{userId}
</where>
</select>
<!--根据userid查询用户是否存在-->
<select id="czByUserId" resultType="cn.wisenergy.model.app.TeamUserInfo">
select
id
from
<include refid="table"/>
<where>
user_id=#{userid}
</where>
</select>
<select id="getTeamUserCount" resultType="java.lang.Integer" >
select
(normal_user_num+seedling_num+bronze_tree_num+silver_tree_num+
gold_tree_num+farmer_num+forest_start_num+partner_num) AS teamUserCount
from
<include refid="table"/>
<where>
user_id=#{userId}
</where>
</select>
<insert id="add" parameterType="cn.wisenergy.model.app.TeamUserInfo" keyProperty="id" useGeneratedKeys="true">
insert into
<include refid="table"/>
(<include refid="cols_exclude_id"/>)
value
(<include refid="vals"/>)
</insert>
<select id="getTeamUserInfoList" resultType="cn.wisenergy.model.app.TeamUserInfo">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
1=1
<if test="userId != null and userId != ''">
and user_id = #{userId}
</if>
<if test="queryTime != null and queryTime != ''">
and (YEAR(create_time) = YEAR(#{queryTime})
AND MONTH(create_time) =MONTH(#{queryTime})
AND DAY(create_time)=DAY(#{queryTime}))
</if>
</where>
order by create_time desc
limit #{startNum},#{endNum}
</select>
<select id="count" resultType="java.lang.Integer">
select count(1)
from
<include refid="table"/>
<where>
<if test="userId != null and userId != ''">
user_id=#{userId}
</if>
<if test="queryTime != null and queryTime != ''">
and `create_time` = #{queryTime}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
<?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="cn.wisenergy.mapper.userLikesMapper">
<resultMap id="zxMap" type="cn.wisenergy.model.app.userLikes">
<id column="like_id" property="likeId"/>
<result column="user_like_id" property="userLikeId"/>
<result column="liked_id" property="likedId"/>
<result column="liked_status" property="likedStatus"/>
<result column="liked_type" property="likedType"/>
<result column="liked_time" property="likedTime"/>
</resultMap>
<sql id="table">
user_likes
</sql>
<sql id="cols_all">
like_id as likeId,
<include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
user_like_id as userLikeId,
liked_id as likedId,
liked_status as likedStaus,
liked_type as likedType
</sql>
<sql id="vals">
#{userLikeId},#{likedId},#{likedStaus},#{likedType}
</sql>
<!--查询点赞记录-->
<select id="selectlikes" parameterType="cn.wisenergy.model.app.userLikes" resultType="cn.wisenergy.model.app.userLikes" >
select * from user_likes WHERE user_like_id=#{userLikeId} and liked_id=#{likedId}
</select>
<!--点赞内容插入-->
<insert id="addlikes" parameterType="cn.wisenergy.model.app.userLikes">
insert into user_likes
(user_like_id,
liked_id ,
liked_status,
liked_type)
value(
#{userLikeId},#{likedId},#{likedStaus},#{likedType}
)
</insert>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment